Front page | perl.perl5.porters |
Postings from July 2008
Re: Fun with open() on a string
Thread Previous
|
Thread Next
From:
H.Merijn Brand
Date:
July 31, 2008 05:13
Subject:
Re: Fun with open() on a string
Message ID:
20080731141247.52308656@pc09.procura.nl
On Thu, 31 Jul 2008 02:26:38 -0700, Peter Scott <Peter@PSDT.com> wrote:
> On Thu, 31 Jul 2008 07:11:21 +0200, Bram wrote:
> > Citeren Peter Scott <Peter@PSDT.com>:
> >
> >> On Thu, 31 Jul 2008 06:40:52 +0200, Aristotle Pagaltzis wrote:
> >>> $ perl -lan -0777 -e 'BEGIN{close STDIN; require CGI; } print
> >>> "@F[6158,12205,17280,16572],"'
> >>> you passed sub protections,
> >>
> >> That's not what I posted. You have -e instead of -E. Size matters :-)
> >
> > perl-5.10.0 -lan -0777 -E 'BEGIN{close STDIN; require CGI; } print
> > "@F[6158,12205,17280,16572],"'
> > Just another Perl hacker,
> >
> > perl-5.10.0 -lan -0777 -e 'BEGIN{close STDIN; require CGI; } print
> > "@F[6158,12205,17280,16572],"'
> > Just another Perl hacker,
> >
> > perl-5.10.0 -MCGI -wle 'print $CGI::VERSION;'
> > 3.29
>
> Sigh. Yes. The -E was my cute way of saying require 5.010, which makes
> it more likely that CGI will be version 3.29, which is in the 5.10 core.
> Aristotle's version of CGI is 3.15, which is core for 5.8.8.
Real fun indeed :)
For CGI 3.38, the shortest version would be
perl -lap -0e'BEGIN{close STDIN;require CGI}$_="@F[424,1010,96,16674]"'
CGI has the longest pod from the core .pm's, so getting a success is
relatively easy. It also happens to be the *only* CORE .pm that contains
these four words. I found no other modules (even none-CORE) that enable
this short version.
Close come:
POE (1.003)
perl -lap -0e'BEGIN{close STDIN;require POE}$F[2821]=substr$F[2821],-12,6;$_="@F[610,865,2455,2821]"'
XML::Twig 3.32
perl -lap -0e'BEGIN{close STDIN;require XML::Twig}chop($_="\L@F[653,11676,5,19071]")'
Or with a bit extra obfuscation
Text::CSV_XS 0.52
perl -lap -0e'BEGIN{close STDIN;require Text::CSV_XS}$F[$#F/6-$=]=~s/=b/h/;$_="@F[257,679,435,791]er"'
Now I need to do some serious work ...
--
H.Merijn Brand Amsterdam Perl Mongers http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Thread Previous
|
Thread Next