XP is just a number | |
PerlMonks |
Re: ASCII Pattern - Golfby davido (Cardinal) |
on Sep 19, 2003 at 01:02 UTC ( [id://292549]=note: print w/replies, xml ) | Need Help?? |
How about this (untested):
Basically all I did was eliminate the redundant use of 'abs', and shortened the name of ARGV. Oh, and used $/ instead of "\n" to save two keystrokes. It's about 15 keystrokes shorter, I believe. UPDATE: Many apologies for bungling my untested attempt. As you pointed out, the abs wasn't exactly redundant. I just read precidence wrong. Actually, it was redundant, but its parameters weren't. In the spirit of "do it once and once only" I broke the common functionality out into a subroutine. And as before, I used $/ instead of "\n". The following IS tested, works, and saves you ten keystrokes (for 98 total, plus the shebang line).
Dave "If I had my life to do over again, I'd be a plumber." -- Albert Einstein
In Section
Seekers of Perl Wisdom
|
|