In article <m3r8q673y0._s_@cs839290-a.mtth.phub.net.cable.rogers.com>, Rick Delaney <rick.delaney@rogers.com> writes: > "Keith C. Ivey" <kcivey@cpcug.org> writes: > >> I'm surprised no one submitted anything with 0 x10, but I >> guess those always end up too long. > > I tried a bit but the best I came up with was > > #!/usr/bin/perl -pl > ($c|=0 x10)++}{$_=$c > > for 24 (instead of 21). > or: #!/usr/bin/perl -p ($\|=0 x10)++}{ (18) but it misses the final \n and anyways, this technique fails in general for the empty file. What you really want is code to execute before the first loop of -p or -n, e.g. something like #!/usr/bin/perl -pM0;$\=$[x10 $\++}{ but unfortunately -M doesn't work from the #! line and it still misses the final \n (it does work without the final \n if used from the commandline though)Thread Previous | Thread Next