Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: split string using optimized code or perl one liner

by johngg (Canon)
on Feb 22, 2017 at 15:09 UTC ( [id://1182536] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    johngg@shiraz:~/perl/Monks > perl -Mstrict -Mwarnings -E '
    say join q{.}, sub { map { pop } 1 .. @_ }->
       ( split m{\.}, shift );' www.perlmonks.org.split.reduce.code.check
    check.code.reduce.split.org.perlmonks.www
    
  2. or download this
    echo www.perlmonks.org.split.reduce.code.check | perl -lnE 'say sub{ma
    +p pop,@_}->(split/(\.)/)'