in reply to Re: uninitialized value in phonebook program
in thread uninitialized value in phonebook program
you get the correct output, and it shows $1 and $2 are initialized, but you still get the uninitialized error. Here is the output when you pass it School&0 and one number:foreach $name (keys %book) { #write the data print "$name \n"; $name =~ /(.+)&(.+)/; print "$1, $2 \n"; if ($2 =~ /^0$/) { print BOOK "$1,::"; } else { print BOOK"$1,$2::"; } for ( 0 .. $#{ $book{$name} } ) { print BOOK $def[$_+2] . ":" . $book{$name}[$_] . "::" unless +$book{$name}[$_] =~ /^0$/; } print BOOK "\n"; }
school&0 school, 0 # Use of uninitialized value, <> chunk 7. File 'untitled:Desktop Folder:Will's Stuff:Applications:MacPerl ƒ:phonebook'; Line 57so that isnt the problem. Loop lables are a good idea, though, thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: uninitialized value in phonebook program
by chipmunk (Parson) on Feb 25, 2002 at 05:09 UTC |