Sa wrote: > #!/usr/bin/perl -w > $map{"red"} = "apple"; > $map{"green"} = "grass"; > $map{"blue"} = "ocean"; > print "A string please: "; chomp ($some_string = <STDIN>); > print "The value for $some_string is $map($some_string)\n"; > > When I run it though I get the following complaint from perl: > > A string please: blue > Use of uninitialized value in concatenation (.) at ./key3.pl line 6, <STDIN> > line 1. > The value for blue is (blue)
In line 6, it's $map{$some_string} not $map($some_string). Regards, -- Ahmed Moustafa http://pobox.com/~amoustafa -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]