Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: Data Structures

by YYCseismic (Beadle)
on May 02, 2008 at 19:42 UTC ( [id://684243]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Data Structures
in thread Data Structures

I'm not sure I understand the difference with your correction. Why is it supposed to be
my( $x, $y, $z ) = @{ $line[000301038][1261] };
rather than without the @{...} around the $line[...][...]?

Replies are listed 'Best First'.
Re^5: Data Structures
by BrowserUk (Patriarch) on May 02, 2008 at 21:07 UTC

    Without @{ .. } to derefernce the anonymous array reference, $x would be set to that array reference and $y & $z would be undef.

    $line[ 1 ][ 2 ] = [ 3,4,5 ];; my( $x, $y, $z ) = $line[ 1 ][ 2 ];; print for $x, $y, $z;; ARRAY(0x194a9f8) Use of uninitialized value in print at ... Use of uninitialized value in print at ...

    With the dereference:

    my( $x, $y, $z ) = @{ $line[ 1 ][ 2 ] };; print for $x, $y, $z;; 3 4 5

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-19 00:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found