Just a little doodling, and presto.

$_=do{sub IO::Handle::DESTROY{!$i++and print} $i=bless[];"Just another Perl hacker.\n"}

I believe this requires Perl 5.8.0 or newer.


Dave

Replies are listed 'Best First'.
Re: Package scope SPOILER
by ikegami (Patriarch) on Oct 06, 2004 at 02:30 UTC

    btw, works in
    Active Perl v5.6.1 built for MSWin32-x86-multi-thread, build 635 and
    Active Perl v5.8.0 built for MSWin32-x86-multi-thread, build 806.

    Explanation

Re: Package scope
by gaal (Parson) on Oct 05, 2004 at 16:45 UTC

      Yes, I must admit that prior to seeing merlyn use IO::Handle in one of his posts, I was unaware of the fact that it applied to filehandles even without explicitly using the package IO::Handle. I learn a lot from his posts, as I do from the posts of many others here at the monastery. To your point, most of the obfu's I've posted (some better than others) were based on themes that were inspired by one discussion thread or another here at the Monastery.

      And those Obfus I've posted that weren't inspired by PerlMonk topics were inspired by things I read while reading the POD and the various O'Reilly books for which I seem to have an addiction.

      That might be one reason that some of them were less... interesting than others. Often I'll find myself learning about some topic, and as I tinker with the new thing, I'll wind up with a new JAPH strategy occurring to me. Some will say that obfu is entirely pointless, but to me, it's always been like that transistor radio I dismantled when I was seven to see what was inside. To me obfu is simply an excuse to fiddle with the parts of Perl that I'm currently familiarizing myself with.

      This one, for example, could have done more to hide the words being printed. But the point wasn't what would be the output, but rather, how it gets to your screen.

      I thank all of you who put up with my little brainstorms. They're educational and fun to me, and maybe as has happened to me many times, others will see something posted and find it intriguing enough to dig a little deeper themselves.


      Dave

Re: Package scope
by ysth (Canon) on Oct 05, 2004 at 17:09 UTC
    My head hurts. It does work on 5.6.2 for me, though.