Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Push function

by GrandFather (Saint)
on Apr 06, 2009 at 20:51 UTC ( [id://755849]=note: print w/replies, xml ) Need Help??


in reply to Push function

Note that you don't need to 'make space'. Consider:

use strict; use warnings; use Data::Dump::Streamer; my @arr = ([11, 22, [[]]], [333, 444, []], [6666, 7777, []]); push @{$arr[0][2][0]}, 3; Dump \@arr; @arr = ([11, 22], [333, 444], [6666, 7777]); push @{$arr[0][2][0]}, 3; Dump \@arr;

Prints:

$ARRAY1 = [ [ 11, 22, [ [ 3 ] ] ], [ 333, 444, [] ], [ 6666, 7777, [] ] ]; $ARRAY1 = [ [ 11, 22, [ [ 3 ] ] ], [ 333, 444 ], [ 6666, 7777 ] ];

True laziness is hard work

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2024-04-26 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found