dankogai's Journal http://use.perl.org/~dankogai/journal/ dankogai's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:32:09+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 dankogai's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~dankogai/journal/ If you can patent the script tag hack, what about JAPH? http://use.perl.org/~dankogai/journal/31499?from=rss <a href="http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&amp;Sect2=HITOFF&amp;d=PALL&amp;p=1&amp;u=%2Fnetahtml%2FPTO%2Fsrchnum.htm&amp;r=1&amp;f=G&amp;l=50&amp;s1=6,941,562.PN.&amp;OS=PN/6,941,562&amp;RS=PN/6,941,562">United States Patent: 6941562</a><blockquote><div><p>The present invention permits a JavaScript-based Remote Procedure Call (RPC) to be executed from a Web page displayed in a Web browser window, without utilizing browser plug-in, Java Applet, or ActiveX technology. Traditionally, clunky downloads and Web browser plug-ins has been required to enable Web page interactivity, which greatly compromises the performance and reach of the Web page. Based purely on HTML and JavaScript, the present invention utilizes the HTML &lt;script&gt; element to pass data to the server and execute a remote procedure, receiving the resulting output to the same displayed Web page. The present invention can be used to build a lightweight Web page that offers real-time data and interactivity.</p></div></blockquote><p>The Script Tag Hack is a great hack and my hats are off they found the hack in 2001. But a patent? Now it's my jaw's turn to drop. That's a hack. No more, no less. Neither invension nor innovation that deserves a patent.</p><p>If any given creative use of un(known|documented) features can be patented, why not JAPH?</p><p>Dan the Just Another Patent Violator(?)</p> dankogai 2006-11-03T16:56:35+00:00 journal PerlIO Benchmark http://use.perl.org/~dankogai/journal/29525?from=rss <p>I had a chance to benchmark various PerlIO layers. The result was striking.</p><p> Benchmarking code:</p><blockquote><div><p> <tt>use strict;<br>use warnings;<br>use Benchmark qw(timethese cmpthese);<br>our $test_file = 'test.txt';<br># 64 chars including LF;<br>my $test_line = join '', ( '0'<nobr> <wbr></nobr>.. '9', 'A'<nobr> <wbr></nobr>.. 'Z', 'a'<nobr> <wbr></nobr>.. 'z', '_', "\n" );<br>sub make_test_file {<br>&nbsp; &nbsp; my $kb&nbsp; &nbsp; = shift;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # size in KB<br>&nbsp; &nbsp; my $block = $test_line x 16;&nbsp; &nbsp; # 1024 bytes;<br>&nbsp; &nbsp; my $fh;<br>&nbsp; &nbsp; open $fh, "&gt;:raw", $test_file or die "$test_file:$!";<br>&nbsp; &nbsp; print {$fh} $block for ( 1<nobr> <wbr></nobr>.. $kb );<br>&nbsp; &nbsp; close $fh;<br>&nbsp; &nbsp; # slurp once to make sure the file buffer is in effect;<br>&nbsp; &nbsp; open $fh, "&lt;:raw", $test_file or die "$test_file:$!";<br>&nbsp; &nbsp; my $content = do { local $/; &lt;$fh&gt; };<br>&nbsp; &nbsp; close $fh;<br>}<br>sub make_tester {<br>&nbsp; &nbsp; my $layer = shift;<br>&nbsp; &nbsp; my $openarg = $layer ? "&lt;:$layer" : "&lt;";<br>&nbsp; &nbsp; sub {<br>&nbsp; &nbsp; &nbsp; &nbsp; open my $fh, $openarg, $test_file or die "$test_file:$!";<br>&nbsp; &nbsp; &nbsp; &nbsp; $_ ne $test_line and die while (&lt;$fh&gt;);<br>&nbsp; &nbsp; &nbsp; &nbsp; close $fh;<br>&nbsp; &nbsp; &nbsp; }<br>}<br>my %these = map { $_ =&gt; make_tester($_) } qw( raw perlio mmap );<br>$these{nolayer} = make_tester(q());<br> <br>for my $filesize ( map { 4**$_ } ( 0<nobr> <wbr></nobr>.. 4 ) ) {<br>&nbsp; &nbsp; make_test_file($filesize);<br>&nbsp; &nbsp; print "#### Testing for $filesize KB Read\n";<br>&nbsp; &nbsp; cmpthese( timethese( 0, \%these ) );<br>}<br>delete $these{raw};&nbsp; &nbsp; # because this guy is too slow on large files!<br>for my $filesize ( map { 4**$_ } ( 5<nobr> <wbr></nobr>.. 8 ) ) {<br>&nbsp; &nbsp; make_test_file($filesize);<br>&nbsp; &nbsp; print "#### Testing for $filesize KB Read\n";<br>&nbsp; &nbsp; cmpthese( timethese( 0, \%these ) );<br>}<br>__END__</tt></p></div> </blockquote><p>The result on my MacBook Pro:</p><blockquote><div><p> <tt>#### Testing for 1 KB Read<br>Benchmark: running mmap, nolayer, perlio, raw for at least 3 CPU seconds...<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Rate&nbsp; &nbsp; &nbsp;raw&nbsp; &nbsp; mmap&nbsp; perlio nolayer<br>raw&nbsp; &nbsp; &nbsp; &nbsp;213/s&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; -95%&nbsp; &nbsp; -98%&nbsp; &nbsp; -98%<br>mmap&nbsp; &nbsp; &nbsp;4492/s&nbsp; &nbsp;2007%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; -55%&nbsp; &nbsp; -64%<br>perlio&nbsp; 10088/s&nbsp; &nbsp;4632%&nbsp; &nbsp; 125%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; -19%<br>nolayer 12488/s&nbsp; &nbsp;5758%&nbsp; &nbsp; 178%&nbsp; &nbsp; &nbsp;24%&nbsp; &nbsp; &nbsp; --<br>#### Testing for 4 KB Read<br>Benchmark: running mmap, nolayer, perlio, raw for at least 3 CPU seconds...<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rate&nbsp; &nbsp; &nbsp;raw&nbsp; &nbsp; mmap&nbsp; perlio nolayer<br>raw&nbsp; &nbsp; &nbsp;55.7/s&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; -99%&nbsp; &nbsp; -99%&nbsp; &nbsp; -99%<br>mmap&nbsp; &nbsp; 3722/s&nbsp; &nbsp;6578%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; -42%&nbsp; &nbsp; -49%<br>perlio&nbsp; 6375/s&nbsp; 11338%&nbsp; &nbsp; &nbsp;71%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; -13%<br>nolayer 7305/s&nbsp; 13008%&nbsp; &nbsp; &nbsp;96%&nbsp; &nbsp; &nbsp;15%&nbsp; &nbsp; &nbsp; --<br>#### Testing for 16 KB Read<br>Benchmark: running mmap, nolayer, perlio, raw for at least 3 CPU seconds...<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rate&nbsp; &nbsp; &nbsp;raw&nbsp; &nbsp; mmap&nbsp; perlio nolayer<br>raw&nbsp; &nbsp; &nbsp;13.5/s&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; -99%&nbsp; &nbsp; -99%&nbsp; &nbsp; -99%<br>mmap&nbsp; &nbsp; 1849/s&nbsp; 13550%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; -25%&nbsp; &nbsp; -30%<br>perlio&nbsp; 2469/s&nbsp; 18123%&nbsp; &nbsp; &nbsp;34%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; &nbsp;-7%<br>nolayer 2649/s&nbsp; 19455%&nbsp; &nbsp; &nbsp;43%&nbsp; &nbsp; &nbsp; 7%&nbsp; &nbsp; &nbsp; --<br>#### Testing for 64 KB Read<br>Benchmark: running mmap, nolayer, perlio, raw for at least 3 CPU seconds...<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rate&nbsp; &nbsp; &nbsp;raw&nbsp; &nbsp; mmap&nbsp; perlio nolayer<br>raw&nbsp; &nbsp; &nbsp;3.53/s&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; -99%&nbsp; &nbsp;-100%&nbsp; &nbsp;-100%<br>mmap&nbsp; &nbsp; &nbsp;693/s&nbsp; 19567%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; -10%&nbsp; &nbsp; -14%<br>perlio&nbsp; &nbsp;767/s&nbsp; 21651%&nbsp; &nbsp; &nbsp;11%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; &nbsp;-5%<br>nolayer&nbsp; 810/s&nbsp; 22872%&nbsp; &nbsp; &nbsp;17%&nbsp; &nbsp; &nbsp; 6%&nbsp; &nbsp; &nbsp; --<br>#### Testing for 256 KB Read<br>Benchmark: running mmap, nolayer, perlio, raw for at least 3 CPU seconds...<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Rate&nbsp; &nbsp; &nbsp;raw&nbsp; perlio nolayer&nbsp; &nbsp; mmap<br>raw&nbsp; &nbsp; &nbsp;0.937/s&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; -99%&nbsp; &nbsp;-100%&nbsp; &nbsp;-100%<br>perlio&nbsp; &nbsp; 187/s&nbsp; 19804%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; &nbsp;-4%&nbsp; &nbsp; &nbsp;-6%<br>nolayer&nbsp; &nbsp;194/s&nbsp; 20582%&nbsp; &nbsp; &nbsp; 4%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; &nbsp;-2%<br>mmap&nbsp; &nbsp; &nbsp; 198/s&nbsp; 21062%&nbsp; &nbsp; &nbsp; 6%&nbsp; &nbsp; &nbsp; 2%&nbsp; &nbsp; &nbsp; --<br>#### Testing for 1024 KB Read<br>Benchmark: running mmap, nolayer, perlio for at least 3 CPU seconds...<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rate&nbsp; perlio nolayer&nbsp; &nbsp; mmap<br>perlio&nbsp; 46.8/s&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; &nbsp;-5%&nbsp; &nbsp; -11%<br>nolayer 49.2/s&nbsp; &nbsp; &nbsp; 5%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; &nbsp;-7%<br>mmap&nbsp; &nbsp; 52.8/s&nbsp; &nbsp; &nbsp;13%&nbsp; &nbsp; &nbsp; 7%&nbsp; &nbsp; &nbsp; --<br>#### Testing for 4096 KB Read<br>Benchmark: running mmap, nolayer, perlio for at least 3 CPU seconds...<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rate&nbsp; perlio nolayer&nbsp; &nbsp; mmap<br>perlio&nbsp; 12.4/s&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; &nbsp;-4%&nbsp; &nbsp; &nbsp;-4%<br>nolayer 12.9/s&nbsp; &nbsp; &nbsp; 4%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; &nbsp;-1%<br>mmap&nbsp; &nbsp; 13.0/s&nbsp; &nbsp; &nbsp; 4%&nbsp; &nbsp; &nbsp; 1%&nbsp; &nbsp; &nbsp; --<br>#### Testing for 16384 KB Read<br>Benchmark: running mmap, nolayer, perlio for at least 3 CPU seconds...<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Rate&nbsp; perlio nolayer&nbsp; &nbsp; mmap<br>perlio&nbsp; 2.96/s&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; &nbsp;-5%&nbsp; &nbsp; &nbsp;-6%<br>nolayer 3.11/s&nbsp; &nbsp; &nbsp; 5%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; &nbsp;-1%<br>mmap&nbsp; &nbsp; 3.14/s&nbsp; &nbsp; &nbsp; 6%&nbsp; &nbsp; &nbsp; 1%&nbsp; &nbsp; &nbsp; --<br>#### Testing for 65536 KB Read<br>Benchmark: running mmap, nolayer, perlio for at least 3 CPU seconds...<br>&nbsp; &nbsp; &nbsp; &nbsp; s/iter&nbsp; perlio&nbsp; &nbsp; mmap nolayer<br>perlio&nbsp; &nbsp; 1.35&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; &nbsp;-8%&nbsp; &nbsp; &nbsp;-8%<br>mmap&nbsp; &nbsp; &nbsp; 1.25&nbsp; &nbsp; &nbsp; 8%&nbsp; &nbsp; &nbsp; --&nbsp; &nbsp; &nbsp;-0%<br>nolayer&nbsp; &nbsp;1.24&nbsp; &nbsp; &nbsp; 9%&nbsp; &nbsp; &nbsp; 0%&nbsp; &nbsp; &nbsp; --</tt></p></div> </blockquote><p>no layer being the fastest is no surprise for me. It's synonym for<nobr> <wbr></nobr><tt>:perlio</tt> on most platforms and with no option you have no overhead for setting layer. What's so surprising is that<nobr> <wbr></nobr>:raw being so slow. I got similar result on my FreeBSD boxes.</p><p>Dan the Just Another Perl Benchmarker</p> dankogai 2006-05-04T09:10:22+00:00 journal Thing started moving http://use.perl.org/~dankogai/journal/29487?from=rss <p>Sometimes rant is good. Things started moving at last.</p><p>Both Encode and Jcode is now officially registered. And MERCEL finally responded.</p><p>This time I fell victim but I know only too well I am the one who victimize my fellows by neglecting them. If that happens to you, plese don't hesitate to yell at me.</p><p>After all we are all busy and no one can respond to every single message received. And sometimes thoese messages are not received by network errors, spam filters, and such. As a matter of fact my mail server receives 120-150 thousand SMTP connections, mostly from infected PCs. My mail filters (yes, plural) are pretty good but they are not perfect.</p><p>Thank you for your patience and thank you too for your impatience. We definitely need both.</p><p>Dan the Responded CPAN Author</p> dankogai 2006-05-02T12:53:00+00:00 cpan CPAN Name Squatting http://use.perl.org/~dankogai/journal/29483?from=rss <p>CPAN Authors and Perl Porters,</p><p>I recently came across two cases of namespace squatting.</p><p>Case: Attribute::Memoize</p><p>That was taken by MARCEL but the module is missing. I guess MARCEL deleted Attribute::Memoize in favor of Attribute::Util which has the same functionality. But I don't like the idea of grab-bagging of multiple Attribute handlers in a single module so I mailed him what he wants to do with it. The mail was sent on April 8th and I got no reponse since then.</p><p>Case: Crypt::Camellia</p><p>That module does Camellia cipher for Crypt::CBC. The algorithm became open source only recently (April 13th) so it is almost impossible that the name space be registered by someone else. But it is registered by JCDUQUE. It is registered as RcdOg but once again the module itself is missing (naturally). Since JCDUQUE has registered Many Crypt:: modules, he did so assuming it will soon be available.</p><p>I now have a very strong doubt of module registration system. Do we really need that? And who and how the registration be processed is in the haze. I have requested to register Encode and Jcode before. Encode is even in core but those requests were simply ignored.</p><p>http://search.cpan.org/ seems to be taking more practical approach. Just index whatever does REALLY exist. So Attribute::Memoize and Crypt::Camellia belongs to me from its point of view. But once you fire up CPAN shell, it's registration that has te precedence.</p><p>I want some action be taken.</p><p>Dan the Foresaken by CPAN</p> dankogai 2006-05-01T08:44:16+00:00 cpan Google Summer of Code 2006 http://use.perl.org/~dankogai/journal/29435?from=rss <p>To punish me for my contempt of Google, Fate has made me a Summer of Code Mentor myself.</p><p> <a href="http://blog.livedoor.jp/dankogai/archives/50469306.html">http://blog.livedoor.jp/dankogai/archives/50469306.html</a></p> dankogai 2006-04-24T18:22:36+00:00 journal Bugs Manifesto http://use.perl.org/~dankogai/journal/29172?from=rss <p>For those who are not subscribed to p6l or p5p.</p><p>[April 1st, 2006, 00:00 GMT+9]</p><p>Larry Wall and Audrey Tang jointly announced that Parrot, Pugs, and all language-related projects be dysintegrated to Bugs. Bugs have ruled this planet for half a billion years and they shall do so for for years to come. Beats heck out of avians, mammals, reptiles or gems.</p><p>Their Manifesto is now available at</p><p> &nbsp; &nbsp; <a href="http://blog.livedoor.jp/dankogai/mov/lamdaorz.mov">http://blog.livedoor.jp/dankogai/mov/lamdaorz.mov</a></p><p>Stay tuned!</p><p>Dan the Deranged, Infested, and Undefined, Reporting Live from Triassic</p> dankogai 2006-04-01T07:32:37+00:00 journal Inline::PHP http://use.perl.org/~dankogai/journal/29171?from=rss <p>Not only perl hackers but also the rest of hackers seem to make too much fun of PHP. That was so true that in YAPC::Asia even Matz and Larry was making fun of that (well, Larry made fun of every computer languages including perl but PHP part was the most horrendous).</p><p>I felt sorry for PHP folks so I came up with this. Ingy's Module::Compile made it so spiffy. </p><blockquote><div><p> <tt>#!/usr/local/bin/perl<br>use strict;<br>use warnings;<br>use Inline::PHP;<br>&lt;?php echo "Hello, PHP\n" ?&gt;<br>no Inline::PHP;<br>print "Hello, rest of the world!\n";</tt></p></div> </blockquote><p>prints</p><blockquote><div><p> <tt>Hello, PHP!<br>Hello, rest of the world!</tt></p></div> </blockquote><p>And here is the module.</p><blockquote><div><p> <tt>package Inline::PHP;<br>use 5.008001;<br>use strict;<br>use warnings;<br>our $VERSION = '0.01';<br>use Module::Compile -base;<br>sub pmc_compile {<br>&nbsp; &nbsp; my ($class, $html) = @_;<br>&nbsp; &nbsp; $html =~ s/no\s+$class\s*.*;\n//o;<br>&nbsp; &nbsp; open my $php, "|-" or exec 'php' or die $!;<br>&nbsp; &nbsp; print {$php} $html;<br>&nbsp; &nbsp; close $html;<br>&nbsp; &nbsp; return q();<br>}<br>1;<br>__END__</tt></p></div> </blockquote><p>&lt;?php echo "Enjoy!" ?&gt;</p><p>Dan the Lambdaorz</p> dankogai 2006-04-01T07:23:17+00:00 yapc Lambda Calculus on Perl6 http://use.perl.org/~dankogai/journal/26596?from=rss <tt>(also posted on p6l)<br>Folks,<br><br>I recently needed to write a series of codes on lambda calculus in perl.&nbsp; As MJD has shown Perl 5 can handle lambda calculus but I am beginning to get tired of whole bunch of 'my $x = shift' needed.<br><br>&nbsp; our $ZERO =<br>&nbsp; &nbsp; &nbsp; sub { my $f = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sub { my $x = shift; $x }};<br>&nbsp; our $SUCC =<br>&nbsp; &nbsp; &nbsp; sub { my $n = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sub { my $f = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sub { my $x = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $f-&gt;($n-&gt;($f)($x)) }}};<br>&nbsp; our $ADD =<br>&nbsp; &nbsp; &nbsp; sub{ my $m = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sub { my $n = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sub { my $f = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sub { my $x = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$m-&gt;($f)($n-&gt;($f)($x)) }}}};<br>&nbsp; our $MULT =<br>&nbsp; &nbsp; &nbsp; sub { my $m = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sub { my $n = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sub { my $f = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $m-&gt;($n-&gt;($f)) }}};<br>&nbsp; our $POW =<br>&nbsp; &nbsp; &nbsp; sub { my $m = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sub { my $n = shift;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $n-&gt;($m) }};<br><br>And I found that these can be made much, much simpler and more intuitive with Perl 6, even more so than scheme!<br><br>&nbsp; our $ZERO = sub($f){ sub($x){ $x }};<br>&nbsp; our $SUCC = sub($n){ sub($f){ sub($x){ $f.($n.($f)($x)) }}};<br>&nbsp; our $ADD&nbsp; = sub($m){ sub($n){ sub($f){ sub($x){ $m.($f)($n.($f)($x)) }}}};<br>&nbsp; our $MULT = sub($m){ sub($n){ sub($f){ $m.($n.($f)) }}};<br>&nbsp; our $POW&nbsp; = sub($m){ sub($n){ $n.($m) }};<br><br>You can even make it simpler by removing dots but I leave it that way because it looks more like the original notation that way (i.e.&nbsp; zero<nobr> <wbr></nobr>:= &amp;#955;f.&amp;#955;x.x).<br><br>Runs perfectly fine on Pugs 6.2.8.&nbsp; Add the code below and see it for yourself.<br><br>&nbsp; my $one&nbsp; &nbsp; &nbsp;= $SUCC.($ZERO);<br>&nbsp; my $two&nbsp; &nbsp; &nbsp;= $SUCC.($one);<br>&nbsp; my $four&nbsp; &nbsp; = $ADD.($two)($two);<br>&nbsp; my $eight&nbsp; &nbsp;= $MULT.($two)($four);<br>&nbsp; my $sixteen = $POW.($four)($two);<br>&nbsp; for($one, $two, $four, $eight, $sixteen) -&gt; $n {<br>&nbsp; &nbsp; &nbsp; $n.(sub($i){ 1 + $i})(0).say<br>&nbsp; };<br><br>Maybe we can use this for advocacy.<br><br>Dan the Perl 6 User Now<br><br>P.S.&nbsp; I am surprised to find Pugs does not include this kind of sample scripts.<br></tt> dankogai 2005-09-05T03:38:53+00:00 journal ppencode vs. rrencode http://use.perl.org/~dankogai/journal/26582?from=rss <p>My friend Takesako-san has come up with a wonderful hack called <a href="http://namazu.org/~takesako/ppencode/demo.html"> ppencode</a> at <a href="http://ll.jus.or.jp/2005/">LLDN2005</a>. </p><p>In response to that, a ruby hacker came up with <a href="http://mono.kmc.gr.jp/~oxy/hiki.cgi?rrencode_en"> rrencode</a> which turns a given data into a ruby script that consists entirely of symbols -- no alphabet whatsoever.</p><p>Now I wonder if we could do that in perl. But perl does not have ruby's <tt>$&gt;&lt;&lt;</tt> which does <tt>print</tt>. Even Acme::EyeDrops makes use of <tt>eval</tt>. The best approximation I came up with was build the string and feed it to <tt>s//$_/e</tt> but even that contains an 's' and 'e'. Any idea?</p><p>Dan the Code Obfuscunator</p> dankogai 2005-09-03T05:48:22+00:00 journal Homeland Security without Homepage Access http://use.perl.org/~dankogai/journal/26001?from=rss This is my first entry to the U.S. with fingerprints recorded. Visa Waiver no longer waives that intimidating Homeland Securty Act measures.<br><br>That much I understood a priori. What I didn't know was....<br><br>Officer:<br> &nbsp; &nbsp; &nbsp; &nbsp; You are visiting here for....<br>Dan:<br> &nbsp; &nbsp; &nbsp; &nbsp; A conference. OSCON 2005<br>Officer:<br> &nbsp; &nbsp; &nbsp; &nbsp; Your company is...<br>Dan:<br> &nbsp; &nbsp; &nbsp; &nbsp; I'm self-employed.<br>Officer:<br> &nbsp; &nbsp; &nbsp; &nbsp; What kind of conference?<br>Dan:<br> &nbsp; &nbsp; &nbsp; &nbsp; Open Source.<br>Officer:<br> &nbsp; &nbsp; &nbsp; &nbsp; Open Source? What is that?<br><br>How many times have you hosted OSCON, Portland?<br><br>Officer:<br> &nbsp; &nbsp; &nbsp; &nbsp; Do you have any information about the conference with you?<br>Dan:<br> &nbsp; &nbsp; &nbsp; &nbsp; Well, I have mails. Nice computer you've got. Can you check web pages with that?<br>Officer:<br> &nbsp; &nbsp; &nbsp; &nbsp; Unfortunately, no. Don't you have anything in paper?<br>Dan:<br> &nbsp; &nbsp; &nbsp; &nbsp; No. Do you want to check my powerbook?<br>Officer:<br> &nbsp; &nbsp; &nbsp; &nbsp; That's fine. I believe you. But next time you visit bring more materials about the conference.<br>Dan:<br> &nbsp; &nbsp; &nbsp; &nbsp; Yes, sir.<br><br>How fortunate I am not a U.S. Citizen. If I were I couldn't stand the system that checks my fingerprint and portrait without being able to check puny web pages.<br><br>Dan the Persona Non Grata dankogai 2005-08-01T05:09:45+00:00 journal