[HoustonTx.pm] Golf (was Re:Perl/Unix)
houston at mail.pm.org
houston at mail.pm.org
Thu Aug 7 22:25:02 CDT 2003
Unfortunately, it never completes (at least under 5.6.1).
It does actually run if you add one more character.
perl -0ne'0'
Better yet, it can be made into a useful program by changing one
character.
perl -0pe'0'
Of course, on a relatively standard Unix-type system I can write
this in only 3 characters (4 on MSWin).<grin/>
G. Wade
On Thu, 7 Aug 2003 18:25:09 -0500
houston at mail.pm.org wrote:
> > perl -0e'$_=<>'
>
> Very nice! (shaved one off there, eh!)
>
> I completely forgot about -0 (where's perldoc, oh YEAH - there's
> perldoc =)
>
> Oh, wait, wait, this leads us to... here we go:
>
> perl -0ne''
>
> (spoiler: it _does_ meet the rules of the challenge, as it does assign
> the entire contents of a file to a variable =)
>
> !chris
>
> ===================================
> Discreet Packaging: www.dronecolony.com
> C. Church
> ===================================
>
>
> _______________________________________________
> Houston mailing list
> Houston at mail.pm.org
> http://mail.pm.org/mailman/listinfo/houston
--
"Zathras have very sad life. Probably also have sad death. But at
least there is symmetry." -- Zathras
More information about the Houston
mailing list