Hi,
I have a Utils module, it exports two hash sort routines
When I use it in my script as follows....
I get an undefined sort routine error
If I use it like this...
It works fine?
All other routines I export don't require the package namespace prefix to work, so why does the bespoke sort routine?
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads
I have a Utils module, it exports two hash sort routines
Code:
sub hashValueAsc {
$sortHash{$a} <=> $sortHash{$b};
}
sub hashValueDesc {
$sortHash{$b} <=> $sortHash{$a};
}
When I use it in my script as follows....
Code:
foreach my $key (sort hashValueDesc (keys(%sortHash)))
I get an undefined sort routine error
If I use it like this...
Code:
foreach my $key (sort [b]Utils::[/b]hashValueDesc (keys(%sortHash)))
It works fine?
All other routines I export don't require the package namespace prefix to work, so why does the bespoke sort routine?
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads