But strangely, the code below which shifts the first parameter magically DWIMmed by getting the right object.
I don't believe you.
perl -e' use strict; use warnings; use Data::Dumper qw( Dumper ); sub _DBsort4create { my $obj = shift; print(Dumper($obj)); 0 } my $csvQ = { x => 123, y => 456 }; for my $csvq ( sort _DBsort4create keys %$csvQ ) { } ' $VAR1 = undef;
If it does happen to return the right object, you are modifying a stack you shouldn't be modifying, which should lead to dire repercussions.
In reply to Re: Sort mechanics problems with objects and potentially contradicting comparisons (would cause infinite loop)
by ikegami
in thread Sort mechanics problems with objects and potentially contradicting comparisons (would cause infinite loop)
by anonymized user 468275
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |