Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Re: Re: Dereference an array reference

by danger (Priest)
on Apr 19, 2001 at 11:42 UTC ( [id://73771]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Dereference an array reference
in thread Dereference an array reference

That's all well and good to say -- but it might help to give a little context (Oh my, what pun!) to ponder:

#!/usr/bin/perl -w use strict; my $scalar; my @list; sub foo { return (42, 24, 10); } sub bar { my @array = (42, 24, 10); return @array; } $scalar = foo(); # same as: $scalar = (42,24,10); @list = foo(); # same as: @list = (42,24,10); print "$scalar:@list\n"; # prints: 10:42 24 10 $scalar = bar(); # same as: $scalar = @array; @list = bar(); # same as: @list = @array; print "$scalar:@list\n"; # prints: 3:42 24 10 __END__

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://73771]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found