Ahh, certainly this is
cheating BrowserUk {grin}.
The version of emulated DOS on your Win32 system always places new command prompt on a separate line by itself. So, even if your perl script prints just '13' without a terminating '\n', DOS would do the job for you.
However, for a Unix system I can't see how one could go shorter than just:
#12345678901234
print-s pop,$/
Which is 14 characters.
Surely, had
japhy considered writing his golf for DOS, then the ',$/' part would be dropped thereby reducing the golf even further by 3 characters as you've pointed out ;-)
Update: To clarify, the word 'cheating' should be considered a sarcasm ;^). I didn't mean to sound offending. I very much respect
BrowserUk's comment and have nothing against him pointing out the intimate features of perl running on various non *nix systems. I simply felt it would be worthwhile to also direct your attention to the minor difference in running the golf piece on Win32 and Unix systems.
_____________________
# Under Construction
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:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.