Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
So if I was a careless lout, I could claim 28, but I am not...
sub r {my$s;$s.=chop for@_=@_;$s.0?(&r,$s):()}

Tilly, I have tested your line as follows
sub r {my$s;$s.=chop for@_;$s?(&r,$s):()} #0 1 2 3 3 #123456789012345678901234567890123 # jeff,john,mary # jjm,eoa,fhr,fny
on v5.6.1-AS628. and it worked fine.

I suppose I am missing something, but I dont see what.
Why are you doing @_=@_ and $s.0??
Is this an issue for an earlier version of perl? As far as I understand these are redundant ops. When does $s.0 evalute in a boolean sense different to $s? And what is the point of assigning @_ to itself?
I am confused.

OTOH it does mean that you can claim 5 less chars, for a total of 33.
:-)
Or am I being a lout?

Yves


In reply to Re: Re (tilly) 1: (Golf) Strings-to-Array by demerphq
in thread (Golf) Strings-to-Array by japhy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others wandering the Monastery: (16)
    As of 2014-08-27 20:40 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (252 votes), past polls