fritz1968 has asked for the wisdom of the Perl Monks concerning the following question:
where $user->getSomething() is defined elsewhere. The above push statement may be called more than one time. But for now, let's just assume that it is only called once. When I print out the above array, I get the following (which is what I am expecting):push(@userData, $user->getID(), ";",$user->getExternalID(), ";", $user +->getExternalParentID(), ";", $user->getSid(), ";", $user->getDomain( +), ";", $user->getLockedTimes() );
I was expecting the loop to run once, printing the following:foreach (@currentData) { my ($recordNum, $externalID, $externalParent, $ssid1, $domain1 +, $timesLocked) = split(/;/, $_); print @currentData; print "\nin the foreach loop for $recordNum\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: arrays and foreach
by chromatic (Archbishop) on Aug 16, 2012 at 17:14 UTC | |
|
Re: arrays and foreach
by Anonymous Monk on Aug 16, 2012 at 17:15 UTC | |
by fritz1968 (Sexton) on Aug 16, 2012 at 17:29 UTC | |
by MidLifeXis (Monsignor) on Aug 16, 2012 at 18:04 UTC |