Hello!
When i try access to hash with $name i get error:
Use of uninitialized value within %p in concatenation (.) or string at ./7.plx line 15, <STDIN> line 1.
#!/usr/bin/perl use warnings; use strict; use 5.010; my %p = ( "Word1" => "WordWord1", "Word2" => "WordWord2", "Word3" => "WordWord3", ); while(<STDIN>) { my $name = $_; print "$p{$name}\n"; }
What is wrong with my code?
In reply to Wrong hash accessing? by Firsov
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |