Do you know where your variables are? | |
PerlMonks |
Re^2: \ as a binary operatorby dk (Chaplain) |
on Jul 01, 2009 at 23:11 UTC ( [id://776586]=note: print w/replies, xml ) | Need Help?? |
You're right. Not only that $_[0] is an alias, and the original implementation is redundant because of it, but also that it could be implemented much more concisely, f.ex.
sub head($) { $_[0] =~ s/^(\S+)\s+// and $1 }
However, with these changes, the very point of the post would be missed. There was a reason that I put it in "obfuscation" - because "head $msg" is trivial and "head \ $msg" is fun :)
In Section
Obfuscated Code
|
|