in reply to What am I doing wrong with 'split'

You need to escape your escape.

perl -e '$s="85|mat\@com";$sep="\\\|"; ($key,$email)=split($sep,$s); +print "$key\t$email\n";' 85 mat@com

Replies are listed 'Best First'.
Re^2: What am I doing wrong with 'split'
by flexvault (Monsignor) on Aug 11, 2013 at 10:08 UTC

    rnewsham,

    Thanks, makes sense now that you pointed it out.

    Regards...Ed

    "Well done is better than well said." - Benjamin Franklin