Why type more than you need to?This philosophy is one I don't agree with, especially when developing code you are going to have to go back and tweak later.
You're right. And I asked the wrong question; or at least an incomplete one. What I meant to ask was: why type more when you're not gaining anything? Your code is more complex, it's partially duplicated, and it's not very readable. I consider myself a strong Perl programmer (and I realize that assumption can be a dangerous one to start with :-), and I had to sit for a minute before I could figure out what it was that you'd done.
Every time I've done a quick shift in the middle of a block of code, I've had to go back and change it later. With @args, I might want to later replace that @args with ($gorp,$slug,@args) = shift() for instance. It leaves a place in the code to do that, and I only have to edit one line to make that change.
Are you sure you don't mean my (@args) = @_;
only ever returns one element, so using it in list context is pointless: ($gorp,$slug,@args) = shift()
doesn't do anything to $slug
I don't mean to grill you. I just want to understand and give some (hopefully friendly) advice.
my 200th node! :-)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||