Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Miscellaneous.pm?

by markjugg (Curate)
on Mar 03, 2006 at 00:14 UTC ( #534095=note: print w/ replies, xml ) Need Help??


in reply to Re: Miscellaneous.pm?
in thread Miscellaneous.pm?

Are you aware of List::MoreUtils? It contains a "uniq" function much like this.

BTW, there seems to be bug in your routine. I think you meant something like !$seen{$_}++.

That illustrates the value of having even a "simple" routine in a re-usable module!


Comment on Re^2: Miscellaneous.pm?
Download Code
Replies are listed 'Best First'.
Re^3: Miscellaneous.pm?
by diotalevi (Canon) on Mar 03, 2006 at 00:35 UTC

    That module is on my to-avoid list. It's poisoned with prototypes and is chock full of functions of dubious utility and quality. Thanks for the note about the bug in my response. I don't make the same mistake when I'm typing at source code.

    In general, I'd prefer to inline these sorts of tasks anyway. It's only while experimenting that I use these as broken out functions.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

      Thanks for the note about the bug in my response. I don't make the same mistake when I'm typing at source code.
      LOL! Yeah, right. You've shown a perfect example why people ought to put such often used code in a module, instead of typing it in, again and again.

        Well I've never made it /before/...

        ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

      [List::MoreUtils]... is chock full of functions of dubious utility and quality.
      Could you elaborate a bit about the quality? Just curious, could be an interesting source for guidelines and best practices (and probably a meditation by its own).

      Flavio
      perl -ple'$_=reverse' <<<ti.xittelop@oivalf

      Don't fool yourself.

        I objected most to the use of prototypes everywhere. I might have found one thing I disliked but I was sure I'd get things wrong if I used it because it's a bag of functions and it'd force some particular syntax on me.

        I kind of sort of wish that if the author really believed in those functions that they'd be added to List::Utils directly.

        ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (18)
As of 2015-07-07 17:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls