Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: Re: reusable hash value sort

by jdavidboyd (Friar)
on Jul 13, 2002 at 13:31 UTC ( #181482=note: print w/replies, xml ) Need Help??

in reply to Re: reusable hash value sort
in thread reusable hash value sort

Being a Perl newbie, I must ask,
why is this "not good to use in programs"?

Replies are listed 'Best First'.
Re: Re: Re: reusable hash value sort
by Courage (Parson) on Jul 14, 2002 at 15:46 UTC
    I beleive it's better to create "independent" subroutines, in that sence of a word that they will not depend on a state of some external global variable. When you'll return to this subroutine after many years and will reuse it, then you have a chance to use it incorrectly.

    As a second point, you may accidentially break that external variable somehow and after that something bad will happen, including coredumps (AFAIK some versions of perl will coredump on sort routines when criteria subroutine does not behave well)

    Courage, the Cowardly Dog

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://181482]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2022-05-25 03:34 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (84 votes). Check out past polls.