in reply to Is this expected behavior for chomp/split...?!

See split. Most likely you want split /\t/, $_, 8 if you always want 8 columns.

Replies are listed 'Best First'.
Re^2: Is this expected behavior for chomp/split...?!
by Krambambuli (Curate) on May 20, 2009 at 12:17 UTC
    I don't know the exact number of fields, and I do not want the newline in the last element.

    So I decided to chomp _after_ the split:
    @x = split(...) chomp $x[-1];
    Thanks!

    Krambambuli
    ---