one more question on reference,

if say you have sub as below

my @arrayref;

sub do_something {
       my $something = @_;
       open FILE, "$something", or die;
       while (<FILE>) {
            my @array = map (split /,/)[1,2,3,5];
            push @arrayref, [EMAIL PROTECTED];
       }
      close FILE;
}

my @arrayref_copy = do_something($something);



Let's for a moment forget about my inefficient style and just look at the last step. If I wanted to use @arrayref_copy and pass it into another subroutine,should I reference them again?(if file itself was pretty big?)

another_sub([EMAIL PROTECTED]); <-- is this the right thing to do? or is this redundant since array is already collection of reference?

sub another_sub {

}


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


Reply via email to