Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^4: Deleting duplicate lines from file

by Win (Novice)
on Feb 17, 2006 at 09:48 UTC ( [id://530958]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re^3: Deleting duplicate lines from file
in thread Deleting duplicate lines from file

The question is.

Why use
my (@lines, %line_md5);
when you can use
my @lines; my %line_md5:
I don't really see that there is any point in grouping them together like that. I am thinking of putting a moto on my messages: Keep it simple when possible. Go complex when required.

Replies are listed 'Best First'.
Re^5: Deleting duplicate lines from file
by Anonymous Monk on Feb 17, 2006 at 10:23 UTC
    Both are simple. Concentrate on your problem
Re^5: Deleting duplicate lines from file
by blazar (Canon) on Feb 17, 2006 at 10:48 UTC
    [slightly edited and fixed a typo: Perl 5 doesn't make that much use of the colon!] The question is my (@lines, %line_md5); when you can use  my @lines; my %line_md5;

    Because it's simpler, cleaner, easier to type and to read, and groups together correlated variables maybe?

    I don't really see that there is any point in grouping them together like that. I am thinking of putting a moto on my messages: Keep it simple when possible. Go complex when required.

    Indeed! Just be aware that the World's concept of "complex" is not bound to match Win's authoritative one...

    PS: here's a motto: "don't put motos on your messages". Oh, or... was it all about Moto? This would explain a lot of things... but no: PM is definitely about Perl.

      Because it's simpler

      Sorry neither are simple. Simplest would be:

      my @lines; my %line_md5;

      Here is clearly readable. There are no troubling lists to have to scan. Each one is on their own line. Simple and readble that is what people's code should be. Of course I wouldn't expect many on PM to understand that, given how much they love the Obfuscation section and how many ++ they give obfuscated code.

      (and yes I'm posting as anon to avoid the -- that you morons will give this post).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://530958]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.