Re: hash access

2006-09-14 Thread Xavier Mas i Ramón
A Dijous 14 Setembre 2006 11:38, Mumia W. va escriure: > On 09/14/2006 01:18 AM, Xavier Mas i Ramón wrote: > > Hi all!, > > > > 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

Re: hash access

2006-09-14 Thread Xavier Mas i Ramón
A Dijous 14 Setembre 2006 08:31, John W. Krahn va escriure: > Xavier Mas i Ramón wrote: > > Hi all!, > > Hello, > > > 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 bu

Re: hash access

2006-09-14 Thread Mumia W.
On 09/14/2006 07:17 AM, John W. Krahn wrote: Mumia W. wrote: 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 Oops, thanks :-) -- To unsubscribe, e-mail: [EMAIL

Re: hash access

2006-09-14 Thread John W. Krahn
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

Re: hash access

2006-09-14 Thread Mumia W.
On 09/14/2006 01:18 AM, Xavier Mas i Ramón wrote: Hi all!, 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

Re: hash access

2006-09-13 Thread John W. Krahn
Xavier Mas i Ramón wrote: > Hi all!, Hello, > 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.

Re: Hash Access Query

2002-12-03 Thread Todd W
"Ben Crane" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi, > > right, my first attempt at a hash of arrays appears to > have some success...but I have a query: > > sub HoA > { > foreach $arb (@uniqueroadname) > { > foreach $doublearb (@contents) > { > if ($

RE: Hash Access Query

2002-12-03 Thread Beau E. Cox
Hi Ben - I have three general suggestions: use strict; use strict; use strict; 'strict' forces you to pre-define your variables; it makes the code more readable, AND will save you many times over from misspelling errors (when this happens, perl merrily creates a new varia

RE: hash access issue

2001-10-18 Thread Brian Arnold
You could probably do something like sub checkanything { my $var2 = shift; foreach (keys %HoH) { return $HoH{$_}{$var2} if $HoH{$_}{$var2}; } } Then in your main body of code, just say something like if ($var1 eq "anything") { $return = &checkanything($var2); } I think that should do