I'm trying to brush up on my Perl by learning object
oriented Perl!  This may not be the best way to brush
up on this subject, but I am sure that I will learn a
lot!  Here is a script:

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

my @array = [1, 2, ['a','b','c','d']];

my $arrayref = [EMAIL PROTECTED];

my $arraySize = scalar $arrayref->@array;

print $arraySize."\n";

I received the following error message:
Array found where operator expected at ./anonymousData
line 8, at end of line
        (Missing operator before ?)
syntax error at ./anonymousData line 8, near
"->@array"
Execution of ./anonymousData aborted due to
compilation errors.

What am I doing wrong?  Out of curiousity, if the
array was anonymous, then how can I find it's size.  

$arrayref = [1, 2, ['a', 'b', 'c', 'd']];
How can I find the size of this array with dereferencing?

-- 
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