Balaji thoguluva wrote:

> For clarity, I have something like this structure
>  
> my $rhash = {
>                         $rarray => [  ],
>                     };
>  
> I would like to know the length of the anonymous array containing some
> elements.

the usual trick use be used:

#!/usr/bin/perl -w
use strict;

my $h = {array => [1,3,5,7]};

print  @{$h->{array}} . "\n";
print $#{$h->{array}} . "\n";

__END__

prints:

4
3

david
-- 
sub'_{print"@_ ";* \ = * __ ,\ & \}
sub'__{print"@_ ";* \ = * ___ ,\ & \}
sub'___{print"@_ ";* \ = * ____ ,\ & \}
sub'____{print"@_,\n"}&{_+Just}(another)->(Perl)->(Hacker)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to