Perl

WWW::Mechanize

WWW::Mechanizeは、LWP::UserAgent + HTML::TokeParser 相当の働きをしてくれるモジュール。(LWP::UserAgentのsubclass) 簡易ブラウザのシミュレートっぽいことが出来るので、WebTestUnit代わりに使える。WWW::Mechanizeのインストールでは、 make testの為…

Y-combinator みたいなもの

# fact(5) print &{$_ = sub{ ($_[0] ($_[0]-1) }}(5);

for my $i (0..$#ARGV) { printf("%d %s\n", $i, $ARGV[$i]); }

brainf*ck to Ook! translater

#!/usr/bin/env perl # usage: ./bf2ook.pl < hello.bf > hello.ook while (readline(*STDIN)){ s/\>/Ook. Ook?/g; s/\

#!/usr/bin/perl print "Hello world\n";