Uri Guttman wrote:
[EMAIL PROTECTED] writes:
Why does it work that way?
people wanted access the the actual values of a hash when doing
foreach ( values %hash )
so they can mung them.
Yes; but the question isn't really "why", it's "how".
Apparently chop() is specialized internally
"JP" == John Porter [EMAIL PROTECTED] writes:
JP Yes; but the question isn't really "why", it's "how".
JP Apparently chop() is specialized internally to detect the
JP hashness of its argument, in a way that can't be expressed
JP by a prototype.
well, according to this
perl5.6.0 -le
On Mon, Jan 29, 2001 at 10:39:42AM -0500, John Porter wrote:
Uri Guttman wrote:
[EMAIL PROTECTED] writes:
Why does it work that way?
people wanted access the the actual values of a hash when doing
foreach ( values %hash )
so they can mung them.
Yes; but the question isn't
On Mon, 29 Jan 2001 11:47:47 -0500, Uri Guttman wrote:
well, according to this
perl5.6.0 -le '%h = qw( a b c d ); $_ .= 1 for %h ; print values %h ; chop %h ; print
values %h'
b1d1
bd
it doesn't appear to be a chop specific thing. unraveling a hash always
seems to use aliases for the values.
On Mon, Jan 29, 2001 at 10:39:42AM -0500, John Porter wrote:
Yes; but the question isn't really "why", it's "how".
Apparently chop() is specialized internally to detect the
hashness of its argument, in a way that can't be expressed
by a prototype.
That's what I thought, but no. The hash
On Sun, Jan 28, 2001 at 04:28:08PM +0100, [EMAIL PROTECTED] wrote:
Aliasing again. They keys are copies, the values aliases.
How bizarre? Why does it work that way?
--
Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/
"None of our men are "experts."... because no one
"MGS" == Michael G Schwern [EMAIL PROTECTED] writes:
MGS On Sun, Jan 28, 2001 at 04:28:08PM +0100, [EMAIL PROTECTED] wrote:
Aliasing again. They keys are copies, the values aliases.
MGS How bizarre? Why does it work that way?
well, my take is that it works for the same reason that
On Sun, Jan 28, 2001 at 12:59:53PM -0500, Michael G Schwern wrote:
On Sun, Jan 28, 2001 at 04:28:08PM +0100, [EMAIL PROTECTED] wrote:
Aliasing again. They keys are copies, the values aliases.
How bizarre? Why does it work that way?
keys HASH returns copies of the keys, while values HASH
On Sat, 27 Jan 2001 15:42:43 -0700, root wrote:
I read RFC195 suggesting to drop 'chop' and go with 'chomp'.
What does 'chop' have anything to do with 'chomp'?
I'm totally oppose to that. Consider:
my $s;
map { /\S/ $s .= "$_ " } split(/\s+/,@_);
chop($s);
return $s;
Excuse me, but you're
Today around 10:19pm, Bart Lateur hammered out this masterpiece:
: I, too, once used chop() to get the last character of a string, in my
: case to calculate a barcode check digit.
:
: while(my $digit = chop($barcode)) {
: ...
: }
:
: The while loop should have continued
Hi,
I read RFC195 suggesting to drop 'chop' and go with 'chomp'.
What does 'chop' have anything to do with 'chomp'?
I'm totally oppose to that. Consider:
my $s;
map { /\S/ $s .= "$_ " } split(/\s+/,@_);
chop($s);
return $s;
Thanks,
Marc K.
On Sat, Jan 27, 2001 at 03:42:43PM -0700, root wrote:
I read RFC195 suggesting to drop 'chop' and go with 'chomp'.
What does 'chop' have anything to do with 'chomp'?
chop() and chomp() are very often confused due to their similar names,
similar functionality and the fact that chop() did
On Sat, Jan 27, 2001 at 05:13:23PM -0500, Michael G Schwern wrote:
On Sat, Jan 27, 2001 at 03:42:43PM -0700, root wrote:
I read RFC195 suggesting to drop 'chop' and go with 'chomp'.
What does 'chop' have anything to do with 'chomp'?
chop() and chomp() are very often confused due to their
On Sun, Jan 28, 2001 at 01:26:09AM +0100, [EMAIL PROTECTED] wrote:
On Sat, Jan 27, 2001 at 05:13:23PM -0500, Michael G Schwern wrote:
This one not only modifies its arguments (or $_ when called without),
it also has the right prototype and works on lists:
sub chop (@) {
my $__;
14 matches
Mail list logo