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

Re^4: split string using optimized code or perl one liner

by haukex (Archbishop)
on Feb 24, 2017 at 05:59 UTC ( [id://1182707] : note . print w/replies, xml ) Need Help??


in reply to Re^3: split string using optimized code or perl one liner
in thread split string using optimized code or perl one liner

It works for me (Linux):

$ echo www.perlmonks.org.split.reduce.code.check | \ perl -lF'(\.)' -E'say sub{map pop,@_}->(@F)' check.code.reduce.split.org.perlmonks.www

Replies are listed 'Best First'.
Re^5: split string using optimized code or perl one liner
by choroba (Cardinal) on Feb 24, 2017 at 06:26 UTC
    It doesn't for me. I needed to add -na to the switches.

    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      It doesn't for me. I needed to add -na to the switches.

      Oh, right - perl5200delta:

      -F now implies -a and -a implies -n

      Previously -F without -a was a no-op, and -a without -n or -p was a no-op, with this change, if you supply -F then both -a and -n are implied and if you supply -a then -n is implied. You can still use -p for its extra behaviour. [perl #116190]