http://www.perlmonks.org?node_id=802962


in reply to Re: Parsing a table with variable columns on each line
in thread Parsing a table with variable columns on each line

Now available with more punctuation variables:

#!/usr/bin/perl -l use strict; while( <> ) { chomp; local $, = "\t"; my ($name, $val1, $val2, @val3) = split ( "\t" ); print $name, $val1, $val2, $_ for @val3; }

Update: Edited because I apparently didn't understand the original question. The point of setting $, instead of using join remains.

Replies are listed 'Best First'.
Re^3: Parsing a table with variable columns on each line
by Anonymous Monk on Oct 26, 2009 at 13:52 UTC
    Thank you. Job is done now.