JAaronAnderson.com wrote:
=pod
Hey fellow GoogleGroup Brothers & Sisters,

I hate to disappoint you but this is not a "GoogleGroup", this is a mailing list controlled by perl.org.

I am hoping to ask you all a quick Perl intermediate logic question…
I have called an obj command which returns what I think is a multi-
dimensional array like so
=cut
my @userlist = $obj->command_ok(qw/user list/, "","","");
# it then returns this info I think
# “emailHandle”, “User FullName”
# because it shows Array elements in memory
# foreach of them but not the mapped qw word list hmmmmm

# When I try to map the results to a single non-associated @array,
# I understand Perl’s “map” is ONLY a one-to-one flat array mapping…

No, it is not:

$ perl -le'
my @original = 1 .. 5;
my @larger   = map { $_, $_ * 2 } @original;
my @smaller  = map { $_ % 2 ? $_ : () } @original;
print "[EMAIL PROTECTED] = @[EMAIL PROTECTED] = @[EMAIL PROTECTED] = @smaller";
'
@original = 1 2 3 4 5
@larger = 1 2 2 4 3 6 4 8 5 10
@smaller = 1 3 5


# So I understand this map
{ $_ = $$_[0] } @userlist;
#returns me the “emailHandle”  or if I try
{ $_ = $$_[1] } @userlist;
# it of course returns me the “User FullName”

There is no "map" in those examples. What is in @_? Why are you assigning to $_?

# Is there a way I can combine/join both and return them
asynchronously ?
# Thanks so much …

Please post some actual code that will compile and run.



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to