RE: Newbie Help please.

2002-03-31 Thread Timothy Johnson
ent: 3/31/02 5:04 AM Subject: Re: Newbie Help please. Sa wrote: > #!/usr/bin/perl -w > $map{"red"} = "apple"; > $map{"green"} = "grass"; > $map{"blue"} = "ocean"; > print "A string please: "; chomp ($some_string = ); &g

Re: Newbie Help please.

2002-03-31 Thread Ahmed Moustafa
Sa wrote: > #!/usr/bin/perl -w > $map{"red"} = "apple"; > $map{"green"} = "grass"; > $map{"blue"} = "ocean"; > print "A string please: "; chomp ($some_string = ); > print "The value for $some_string is $map($some_string)\n"; > > When I run it though I get the following complaint from perl: > > A

Re: Newbie Help please.

2002-03-31 Thread Billie
Hi The term $map($some_string) actually means 2 scalar variables, one is $map and the other is $some_string. You get warning of uninitialized variable because $map is never declared before. The correct way to refer to a value in hash is $map{$some_string}. I think there is a typo in the book Ho