"NT" == Nathan Torkington [EMAIL PROTECTED] writes:
NT Casey R. Tweten writes:
Wow. Now that, that, is lame. You're saying that keys() expects
it's first argument to begin with a %? Why should it care what it's
argumen begins with?
NT The keys function changes its arguments' data
I assure you that the number of people who get compile-time caught
for writing keys or each $x[$i][$j] or pop or push $x[$i][$j] is
*very* large. This is by far the most prevalent error that happens
with data structures in apprentice and perhaps even journeymen perl
programmers. Having the
Casey R. Tweten wrote:
sub func {
return qw/KeyOne Value1 KeyTwo Value2/;
}
print "$_\n" foreach keys func();
Please. There are ways -- well, just one way -- to do this, even in perl5.
print "$_\n" foreach keys %{{ func() }};
--
John Porter
We're building the
In reply to your message from the not too distant future: next Monday AD
Reply-to: [EMAIL PROTECTED]
Return-receipt-to: [EMAIL PROTECTED]
Organization: a) Discordia b) none c) what's that?
Content-Typo: gibberish, charset=ascii-art
Date: Tue, 22 Aug 2000 10:15:48 EDT
From: Jerrad Pierce belg4mit
Today around 10:11am, John Porter hammered out this masterpiece:
: Casey R. Tweten wrote:
:
: sub func {
:return qw/KeyOne Value1 KeyTwo Value2/;
: }
:
: print "$_\n" foreach keys func();
:
: Please. There are ways -- well, just one way -- to do this, even in perl5.
:
: print
Other than the issue of semantics (array is not list), I still have not
seen:
a) why this is the Wrong Thing
Why what is the wrong thing? Why treating an immutable list
as a mutable array is wrong? Because you can't change the length
of a list -- it doesn't have an AV to update. If you want
Today around 3:34pm, Tom Christiansen hammered out this masterpiece:
: Today around 11:48am, Tom Christiansen hammered out this masterpiece:
:
: : So basically, it would be nice if each, keys, values, etc. could all deal
: : with being handed a hash from a code block or subroutine...
: :
: :
: No. keys() expects something that starts with a %, not
: something that starts with a .
Wow. Now that, that, is lame. You're saying that keys() expects it's first
argument to begin with a %? Why should it care what it's argumen begins with?
You're just now figuring this out? Really?
All
Casey R. Tweten writes:
Wow. Now that, that, is lame. You're saying that keys() expects
it's first argument to begin with a %? Why should it care what it's
argumen begins with?
The keys function changes its arguments' data structure. keys resets
the each iterator (see the documentation
On Mon, Aug 21, 2000 at 09:00:26PM -0400, Casey R. Tweten wrote:
Today around 3:34pm, Tom Christiansen hammered out this masterpiece:
: No. keys() expects something that starts with a %, not
: something that starts with a .
Wow. Now that, that, is lame. You're saying that keys() expects
Today around 11:48am, Tom Christiansen hammered out this masterpiece:
: So basically, it would be nice if each, keys, values, etc. could all deal
: with being handed a hash from a code block or subroutine...
:
: In the current Perl World, a function can only return as output to
: its caller a
Today around 11:48am, Tom Christiansen hammered out this masterpiece:
: So basically, it would be nice if each, keys, values, etc. could all deal
: with being handed a hash from a code block or subroutine...
:
: In the current Perl World, a function can only return as output to
: its caller a
12 matches
Mail list logo