use GD;$i=new GD::Image(113,350);$_="JUST ANOTHER PERL HACKER,";$i->fill
(0,0,$i->colorAllocate(255,255,255));s#.{5}#$d=5;@a=($q=0,map{$d+=$f++%2
?3*$_:$_;$_;}map{split//}unpack C5,$&);push@a,10-$d%10;@g=(3,5,23,join(
"",@a)=~/(.{6})/,63,$');$b=$i->colorAllocate(0,0,0);$t=9;map{$h=$q++%7?
50:60;$i->line(++$t,$y+9,$t,$y+$h,$_?$b:$w)for split//,/1/?$_.$i->string
(gdTinyFont,shift@g,53+$y,shift@g,$b):do{$l=$z=unpack B7,pack v,unpack(x
.$_.C,"5A;eKYWc_3")-40<<1;$z=~s/./1^$&/eg;$m=reverse$z;${qw.l m m l l m.
[$c++%12]||z}}}101,splice(@a,0,5,"01010"),@a,101;$y+=70#eg;print$i->png
The output should be piped into a png file thusly:perl ean-13.pl > out.pngenjoy.
Update: oops. I totally ignored the ${qw.l m m l l m.} part.
perlmonks.org content © perlmonks.org and japhy, teamster_jr
prlmnks.org © 2006 edmund von der burg (eccles & toad)
v 0.03