Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Re: Re: Array in Array

by CombatSquirrel (Hermit)
on Oct 06, 2003 at 14:40 UTC ( #296958=note: print w/replies, xml ) Need Help??

in reply to Re: Re: Array in Array
in thread Array in Array

Your $rec variable is actually a reference to an array. You should dereference it, for example by writing my @rray = @$rec;, or, TIMTOWTDI:
#!/usr/bin/perl use strict; use warnings; my @accounts = ("A x1 B y1 C z1 D v1 E w1 F", "A x2 B y2 C zzz2 D v2 E w2 F", "A x3 B y3 C z3 D v3 E w3 F", "A x4 B y4 C z4 D v4 E wwww4 F", "A x5 B y5 C z5 D v5 E w5 F", "A x6 B y6 C z6 D v6 E F"); my @fields = ("A", "B", "C", "D", "E"); sub tweezers_sub { my @accounts_2 = map { [@{{/([A-Z])\s+([a-z]+\d|\s)/g}}{@fields} ] +} @accounts; for my $rec (@accounts_2) { print "'" . join("' - '", @$rec) . "'\n"; } } tweezers_sub;
This uses a RegEx instead of a split, but you can still see how $rec is dereferenced by writing @$rec.
Hope this helped.
Update: Mixed up referencing and dereferencing. Fixed.
Entropy is the tendency of everything going to hell.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://296958]
[LanX]: strangely you can't disable the XP nodelet
[LanX]: But you can use CSS to hide it
[LanX]: and disoplay the data permanently in your peronal nodelet
[marinersk]: I saw that you could post it on the Personal Nodelet, but you have to provide the content also. No way to auto-populate it. Not that this would solve my distraction problem...
[LanX]: there are template variables to "Auto-populate" it
[marinersk]: Yeah, someday I might become interested enough to poke around PerlMonks more internally. Most of the fancy stuff is way down on my to do list.
[LanX]: Yeah ...
[LanX]: no variable for votes_left

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2017-05-29 14:25 GMT
Find Nodes?
    Voting Booth?