Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: 1 loop too many in array iteration

by Athanasius (Chancellor)
on Feb 13, 2013 at 08:23 UTC ( #1018501=note: print w/replies, xml ) Need Help??


in reply to 1 loop too many in array iteration

Square brackets [] return a reference to an array — i.e., a single scalar value. So the line:

my @done = ["$time[5]-$time[4]-$time[3]", $type, $amount];

assigns an array reference to the first element only ($done[0]) of @done. I think you wanted:

my @done = ("$time[5]-$time[4]-$time[3]", $type, $amount);

which populates the array @done with three scalar values.

Hope that helps,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018501]
help
Chatterbox?
[erix]: my "Jeschwätz von jestern" = "Geschwätz von gestern" = "my babbling of yesterday"
[marto]: thanks erix

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (10)
As of 2018-01-19 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (218 votes). Check out past polls.

    Notices?