Today around 11:01am, Jonathan Scott Duff hammered out this masterpiece:
: On Tue, Aug 15, 2000 at 09:14:20AM -0400, Casey R. Tweten wrote:
: > This, by the way (even as a test) was agravating to me because in order to
: > get decent output I really had to do this:
: >
: > cat /etc/passwd | perl -nfe '$\="\n";print((split/:/)[0])'
:
: cat /etc/passwd | perl -lnfe 'print((split/:/)[0])'
Yes, I know.
: > So perhaps we should allow all the 'special' variables, namely the
: > scalars, to be assigned to on the command line via thier English
: > representations. Observe:
: >
: > perl -OUTPUT_AUTOFLUSH=1 -OUTPUT_RECORD_SEPARATOR="\n" -ne 'print((split/:/)[0])'
:
: If you're going to be that verbose, might as well put that in the
: program itself.
:
: perl -lne 'BEGIN { $|=1; $/="\n"; } print ((split/:/)[0])'
Frankly, they're both ugly. I personally like the *idea*, I'm not
advocating my solution. It would be wonderful if we could assign values
to Perl's special variables when we're doing a one line quick
hack. Often, I will modify default values in programs in order to be
more lazy. That isn't easily available for a command line hack ( and 80 -
120 characters on the line ( give or take ) ). Why not make it more
available?
And, sure, perhaps the idea bytes, so scratch it. However, I love the
idea of `-f` or something like it, to turn off output buffering.
: > Or something to that effect. However, I suppose the same could be done
: > with thier punctuation defaults:
: >
: > cat /etc/passwd | perl '-$|=1' '-$\="\n"' -ne 'print((split/:/)[0])'
:
: Ick.
Just an alternative, I don't like it either, frankly.
--
print(join(' ', qw(Casey R. Tweten)));my $sig={mail=>'[EMAIL PROTECTED]',site=>
'http://home.kiski.net/~crt'};print "\n",'.'x(length($sig->{site})+6),"\n";
print map{$_.': '.$sig->{$_}."\n"}sort{$sig->{$a}cmp$sig->{$b}}keys%{$sig};
my $VERSION = '0.01'; #'patched' by Jerrad Pierce <belg4mit at MIT dot EDU>