in reply to sorting objects
sort is placing the values in $something_else::a and $something_else::b since it was called from package something_else. The workaround is to tell sort to pass the values as parameters by using the ($$) prototype:
sub fetSort($$) { # Prototype necessary. my $ftA = $_[0]->{"fet"}; my $ftB = $_[1]->{"fet"}; $fetType->{$ftA} <=> $fetType->{$ftB} } package something_else; sort netFetObj::fetSort @{ $OBJ->{"fets"} }
This negatively affects performance, according to the docs.
In the future, please use <c>...</c> around your code rather than (an unclosed) <pre>...</pre>, as per the Monestary Guidelines. A janitor will have to fix it for you.
|
|---|