Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^8: Writing an array inside an array

by talha099 (Initiate)
on Nov 18, 2010 at 16:13 UTC ( [id://872291]=note: print w/replies, xml ) Need Help??


in reply to Re^7: Writing an array inside an array
in thread Writing an array inside an array

Thank you very much again for your help.
Actually, I was trying to store the array in the form:
my $graph = [ 1, 2, 14 , 2, 3, 18 ];
I wanted to pass $graph to another function which expects the input in that form. Would you recommend me using $graph or @graph?
Thanks again.

Replies are listed 'Best First'.
Re^9: Writing an array inside an array
by moritz (Cardinal) on Nov 19, 2010 at 08:45 UTC
    Would you recommend me using $graph or @graph?

    Use the @ sigil. It gives you several advantages: it behaves sensibly in scalar context, and the syntax for working with it less convoluted than reference syntax.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://872291]
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 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found