Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: extracting a list from a lists of lists

by tadman (Prior)
on Jan 02, 2003 at 01:08 UTC ( #223659=note: print w/replies, xml ) Need Help??


in reply to extracting a list from a lists of lists

As gjb mentioned, you can copy with a dereference. Sometimes it's not necessary to copy, though, so you can always just use the reference as is. Here's some examples:
my $ref = $LoL[$n]; my @ary = @{$LoL[$n]}; $ref->[0] = "Foo"; # Modifies @LoL directly $ary[0] = "Foo"; # Only modifies @ary copy foreach (@$ref) { ... } foreach (@ary) { ... }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2022-09-28 02:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (124 votes). Check out past polls.

    Notices?