in reply to split at pipe character

you could always single quote and save yourself the trouble of escaping:

@code = split '|', $id;

Update: I stand corrected. Thanx Juerd.


He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/

Replies are listed 'Best First'.
Re: Re: split at pipe character
by Juerd (Abbot) on Mar 04, 2002 at 18:56 UTC
    Wrong.
    Many people think that, but any string that is not a single space (chr(32)) will implicitly be used as a regex, so split '|' will still be split /|/ and thus equal split //.
    See also Perl6 RFC 361.

    ++ vs lbh qrpbqrq guvf hfvat n ge va Crey :)
    Nabgure bar vs lbh qvq fb jvgubhg ernqvat n znahny svefg.
    -- vs lbh hfrq OFQ pnrfne ;)
        - Whreq