Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: convert rows to columns

by ack (Deacon)
on Nov 26, 2012 at 20:35 UTC ( [id://1005758]=note: print w/replies, xml ) Need Help??


in reply to Re: convert rows to columns
in thread convert rows to columns

I saw that, to. Also, you can't push to a sigle element of an array that I'm aware of. You have to push to an array. So the line push $arr[$cnt], $xox[$i]."".$xox[1+$i] I believe won't work. You need something like push @arr, $xox[$i]."".$xox[1+$i].

ack Albuquerque, NM

Replies are listed 'Best First'.
Re^3: convert rows to columns
by choroba (Cardinal) on Nov 27, 2012 at 10:31 UTC
    In recent Perl (since 5.14), you can push to an array reference. It is not autovivified, though; therefore,
    perl -e '$x[0] = []; push $x[0], 1'
    works, but
    perl -e 'push $x[0], 1'
    does not.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-03-19 02:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found