mr_dont has asked for the wisdom of the Perl Monks concerning the following question:
Hi PerlMonks!
Last night I was writing a script and I was stumped by its behaviour... Basically, it contains a data object which is a hash containing a multidimensional array (a 2n one)...
So I might have data like this: @{$self->{_mydata}[2][3]} = "John";
In one of my methods, when I print this out,
it gives my the correct answer:
print "My name is @{$self->{_mydata}[2][3]}\n";
Output: My name is John
However, when I try to evaluate it, It doesn't work:
if ((@{$self->{_mydata}[2][3]}) eq "John") { print "My name is @{$self->{_mydata}[2][3]}\n"; }
The above code won't print anything... Why isn't this working? Anyone know what I am doing wrong?
Thanks Fellow Monks..!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Evaluating Multidimensional Arrays and References
by c-era (Curate) on Aug 10, 2001 at 19:46 UTC | |
Re: Evaluating Multidimensional Arrays and References
by bikeNomad (Priest) on Aug 10, 2001 at 19:48 UTC |