Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: bless this japh

by tlhf (Scribe)
on Jun 07, 2002 at 14:28 UTC ( [id://172533]=note: print w/replies, xml ) Need Help??


in reply to bless this japh

Well, with a little deparsing and stuff goin on;
# ($", $/) = (' ', "\n"); $blessed = ref bless([], 'just::another::perl::hacker'); foreach $element ($blessed) { $element =~ s/:+/$"/g; print $element . $/; }


For some reason I find it a shame the code only loops once. It looks like it should have a loop in. Maybe add a split somewhere?

tlhf
xxx
Getting it to allow q(just'another'perl'hacker) right in the text is still cool though.

Replies are listed 'Best First'.
Re: Re: bless this japh
by domm (Chaplain) on Jun 07, 2002 at 14:41 UTC
    For some reason I find it a shame the code only loops once.

    As Dog_and_Pony pointed out, the only reason for the for-loop is to put the return value of ref into $_.

    So, in good obfu-manners something (for) is used for soemthing different than what it's ususally used for.

    --
    #!/usr/bin/perl
    for(ref bless[],just'another'perl'hacker){s-:+-$"-g&&print$_.$/}
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://172533]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-28 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found