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.