in reply to File Parsing REGEX

Use the split /PATTERN/,EXPR,LIMIT form of split, specify a limit, which is the maximum number of fields split will split the record into.

my ($name, $email, $text) = split /,/, $_, 3;

Replies are listed 'Best First'.
Re: Re: File Parsing REGEX
by nite_man (Deacon) on Feb 11, 2004 at 12:26 UTC

    For case

    my ($name, $email, $text) = split /,/, $_, 3;
    it's working but how about case
    my ($name, $email, $text, $status) = split /,/, $_;
    ???

    ~ Schiller