in reply to Re: Perl one-liner for array at bash shell
in thread Perl one-liner for array at bash shell

Ok this works perfectly too... what does the m# the ,# and the $& stand for here? Love perl special chars !
  • Comment on Re^2: Perl one-liner for array at bash shell

Replies are listed 'Best First'.
Re^3: Perl one-liner for array at bash shell
by Anonymous Monk on Aug 22, 2017 at 21:12 UTC
    m#.*,# is the same as /.*,/ but the slashes were already used by s///, and the vars are $\ (set by perl -l to "\n", see perlrun) and $&. Same thing:
    perl -ple 's{ [;\s]+ }{ m{.*,}; $/ . $& }egx' perl -ple '($a)=/(.*,)/; s/[;\s]+/\n$a/g'