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
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
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
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
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
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.
"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 ($
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
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