* Etienne Grossmann <[EMAIL PROTECTED]> [2004-04-11 03:19]:
> On Sat, Apr 10, 2004 at 08:56:26PM -0400, [EMAIL PROTECTED] wrote:
> > last|perl -pe '$_ x=/(..:..)...(.*)/&&"'$1'"ge$1&&"'$1'"lt$2'
> > That's gonna be tough for Randal to beat... :-)
> > -- Larry Wall in <[EMAIL PROTECTED]>
>
> The other conditions in the rhs I don't grok.
Remember that it's shell code at the first iteration here, and as
there's single-quotes in the middle of the Perl code, only the
following bits are seen verbatim by Perl:
perl -pe '$_ x=/(..:..)...(.*)/&&"'$1'"ge$1&&"'$1'"lt$2'
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^ ^^^^^
The rest is interpreted by the shell -- particularly, the $1 and
$2 not protected by anything are interpolated before Perl is even
called.
With a little spacing, the code reads like this:
$_ x= /(..:..)...(.*)/ && 'foo' ge $1 && 'bar' lt $2;
where I'm assuming that the shell's $1 was "foo" and its $2 was
'bar'.
--
Regards,
Aristotle
"If you can't laugh at yourself, you don't take life seriously enough."