XP is just a number | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I needed to determine the length of the longest line in a file today.
After overcoming the surprise that I can't recall ever needing to do such a
thing before, I banged out this Perl script:
Running the code on the following file would print 7. The trailing newline is included in the length of a line.
Reflecting on the code over lunch, it occurred to me that that was way too many characters. Here is my 38:
<Reveal this spoiler or all in this thread>
Please show me how to slim this down. In reply to Golf: Length of longest line in a file by toolic
|
|