APM: creating a hash

Goldilox Goldilox at teachnet.edb.utexas.edu
Fri Apr 4 17:49:19 CST 2003


I'm having trouble getting a hash to see everything like I want it too.
I need some hash values to have single quotes around them, for example

'RA'

And then other elements that have spaces

Stage and Flow

thus:

%stypes={''RA''=>'Rainfall',
''ST''=>'Stage'
};

Error: Bad name after RA'

so I try this:

%stypes={"'RA'"=>"Rainfall",
"'ST'"=>"Stage and Flow"
};

Error: Reference found where even-sized list expected

I've created a reference?

I'd like to do this:

%stypes=qw{
'RA' Rainfall 
'ST' Stage and Flow
};

but I'd have to change the input separator to take 

Stage and Flow 

as one element

I've been able to find the special variable for the array output separator (
i.e. $" )
but not one for an input separator, nor one specifically for hashes either
(input or output)

any help?

Rhett





More information about the Austin mailing list