Mumia W. wrote: > On 09/14/2006 01:18 AM, Xavier Mas i Ramón wrote: >> >> I'm trying to create a sorted (ASCII) hash file but get all time a >> syntax error in line "my $abreviatures{$clau} = 1;" at >> "$abreviatures{ <--". Sure is an stupid mistake but I'm not able to >> see it even checking with my "Learning Perl" book. >> >> Pls, can someone tell me where is the syntax error? >> >> ... >> while (<ABREVIATURES>) { >> chomp; >> my $clau = $_; >> my $abreviatures{$clau} = 1; >> } >> close ABREVIATURES; > > The "my" command doesn't work that way. You have to "my" the entire hash > like so: > > ... > my $abreviatures;
That is not a hash, that is a scalar. ITYM: my %abreviatures; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>