in reply to split question

The pattern is a regular expression pattern. ;)

split /\|/, $line;

have a look at perldoc -f split (split) and perlre.

--
Allolex

Update Sat Jan 31 05:05:13 2004: Added slashes. I saw that particular syntax on comp.lang.perl.misc, and just assumed that it would work (mea maxima culpa).

Replies are listed 'Best First'.
Re: Re: split question
by davido (Cardinal) on Jan 31, 2004 at 08:24 UTC
    split \|, $line;

    Huh? Try:  split /\|/, $line;

    You forgot your quote-like regexp characters.

    Or to answer the OP's question:

    my $delimiter = quotemeta( '|' ); my @array = split /$delimiter/, $line;


    Dave