Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
No such thing as a small change
 
PerlMonks  

Re: Another 'ode to backslash' ;-)

by EvanK (Chaplain)
on Sep 24, 2001 at 06:22 UTC ( [id://114255]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Another 'ode to backslash' ;-)

That's really pretty cool...but a suggestion to make it a little less annoying and a LOT shorter:
@a=('\' x 74,'\' x 117,'\' x 115,'\' x 116,'\' x 32,'\' x 65,'\' x 110 +,'\' x 111,'\' x 116,'\' x 104,'\' x 101,'\' x 114,'\' x 32,'\' x 80, +'\' x 101,'\' x 114,'\' x 108,'\' x 32,'\' x 72,'\' x 97,'\' x 99,'\' + x 107,'\' x 101,'\' x 114);foreach $a(@a) {print length $a, ",";}

______________________________________________
RIP
Douglas Noel Adams
1952 - 2001

Replies are listed 'Best First'.
Re: Re: Another 'ode to backslash' ;-)
by Asmo (Monk) on Sep 24, 2001 at 14:45 UTC
    yes, of course it's shorter, but it's not the same result on the screen whenn you look at the code ;-) anyway, thx for your reply
Re: Re: Another 'ode to backslash' ;-)
by hopes (Friar) on Oct 02, 2001 at 19:00 UTC
    There is an error in your code. See perldoc perlop
    or see perlop

    q/STRING/
    'STRING'
    A single-quoted, literal string. A backslash represents a
    backslash unless followed by the delimiter or another backslash,
    in which case the delimiter or backslash is interpolated.


    So '\' don't is what you expect. You have to write '\\' instead.
    Yeah, it's tricky. Note that
    print '\\\machine';
    is the same as
    print '\\\\machine';
    but not
    print '\\machine';
    You can use q;\\; if you want to obfuscate more.

    Regards

    Hopes

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://114255]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.