in reply to Sort mechanics problems with objects and potentially contradicting comparisons (would cause infinite loop)
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sort mechanics problems with objects and potentially contradicting comparisons (would cause infinite loop)
by anonymized user 468275 (Curate) on Jun 02, 2016 at 07:47 UTC | |
by ikegami (Patriarch) on Jun 02, 2016 at 15:03 UTC | |
by anonymized user 468275 (Curate) on Jun 06, 2016 at 15:54 UTC | |
by ikegami (Patriarch) on Jun 08, 2016 at 15:12 UTC | |
|
Re^2: Sort mechanics problems with objects and potentially contradicting comparisons (would cause infinite loop)
by Anonymous Monk on Jun 02, 2016 at 16:31 UTC |