给 perl hacker 们看的[19]

[入库:2005年8月28日] [更新:2007年3月25日]

本文简介:选择自 eternalee 的 Blog

21\000\004",0,25)'; eval
%%
Date:         19 Apr 90 17:18:27 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
print ('Just ','anoth','er Pe','rl ha','cker,')[0..4]
%%
Date:         2 May 90 16:44:45 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
$_ = "Jvtu bopuifs Pfsm ibdlfs,"; y/a-z/za-y/; print
%%
Date:         15 May 90 16:02:24 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
open(P,"|perl");print P"format=\nJust another Perl hacker,\n.\nwrite"
%%
Date:         22 May 90 21:41:18 GMT
From:         flee@shire.cs.psu.edu (Felix Lee)
@a=split(//,$]);@b=split(//,"k ple th\nhroeaarcn.");$k=$#a=$#b;@a=sort grep($_.=$k++,@a);print@b[substr(pop(@a),1,2)-$#b]while(@a);
%%
Date:         25 May 90 15:29:25 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
$_=pack("c25",65..90);y/A-Y/Just another Perl hacker,/;print
%%
Date:         26 May 90 00:00:37 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
sub isplit { # &isplit(word,string) => array
 local($word,$_) = @_;
 local(@ind,@result,$start,$end);
 @ind = (0);
 s#$word#push(ind,length($`),length($`.$&)),$&#ieg;
 push(ind,length);
 # @ind now has pairs of indicies (0-origin) into $_
 # that bound the non-$word items; convert into result:
 while (@ind) {
  $start = shift(ind);
  $end = shift(ind);
  push(result,substr($_,$start+$[,$end-$start));
 }
 @result;
}
print &isplit("z","JzuZsztZ zaZnzoZtzhZezrZ zPZezrZlz ZhzaZczkZezrZ,");
%%
Date:         5 Jun 90 19:07:58 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
$,=" "; print +("hacker,","Just","Perl","another")[1,3,2,0];
%%
Date:         14 Jun 90 06:38:52 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
open(o,"|cat");print o "Just another Perl hacker,"
%%
Date:         15 Jun 90 01:37:14 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
print `perl -e 'print STDERR "Just another Perl hacker,"' 2>&1`
%%
Date:         15 Jun 90 16:15:31 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
$_ = <<'-- '; s/../printf "%c",hex($&)/ge;
4a75737420616e6f74686572205065726c206861636b65722c
--
%%
Date:         15 Jun 90 22:06:24 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
printf "%s %s %s %s%c", 'Just', 'another', 'Perl', 'hacker', 44
%%
Date:         16 Jun 90 19:22:20 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
print <;echo Just another perl hacker,>
%%
Date:         18 Jun 90 07:49:28 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
$_ = "Just another Perl hacker,"; { redo if s/./(print $&),""/e; }
%%
Date:         18 Jun 90 15:53:11 GMT
From:         merlyn@iwarp.intel.com (Randal Schwartz)
print "Just another Perl hacker," if "you can't think of anything better..."
%%
Date:         20 Jun 90 17:51:58 GMT

本文关键:perl
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top