in reply to Learning perlisms leads to experience, wisdom and discoveries that whitespace & idioms are lazy

I hope that no one reads your node and gets the idea that hash slices are somehow exotic. They aren't. Substituting in a loop is baby perl and while there there are places where that is appropriate and good, there are plenty of places choosing slower but simpler for newbies isn't the right decision. Personally, I'd never consider the looped version "correct" unless there was a really good reason to use the other version.

Also, did you mean to link to anything in particular with each of your [linked] nodes? Maybe you meant to make them [google://Google.com links]?

  • Comment on Re: Learning perlisms leads to experience, wisdom and discoveries that whitespace & idioms are lazy

Replies are listed 'Best First'.
Re^2: Learning perlisms leads to experience, wisdom and discoveries that whitespace & idioms are lazy
by kappa (Chaplain) on Dec 23, 2004 at 13:06 UTC
    By the way, do you know why the hash slice method is faster than looping? I measured and looks like it really is and by a significant amount of up to 25%. Seems strange.
    --kap

      Hash slicing does the assignment loop in C; explicitly looping does it in Perl.

Re^2: Learning perlisms leads to experience, wisdom and discoveries that whitespace & idioms are lazy
by castaway (Parson) on Dec 23, 2004 at 09:39 UTC
    I second dios question, what are all those internal links for? (It's distracting me from actually reading the content)

    C.

      Maybe he just meant to underline certain keywords? Putting brackets around something is easier than adding <u></u> or <b></b>, but the links are very distracting. I kept hovering my mouse over them to see what they link to, but almost all of the links are just the word itself, which leads me to the preceding conclusion.