XP is just a number | |
PerlMonks |
Re^2: Split lines in file to columnsby haukex (Archbishop) |
on Mar 24, 2019 at 22:26 UTC ( [id://1231630]=note: print w/replies, xml ) | Need Help?? |
You can put your data after the _END_ statement Normally, one would use the __DATA__ token for this purpose - see Special Literals in perldata. Update: Another nitpick: The special variables $1 etc. should only be used if the match succeeds. And the two lines could be shortened to: my ($col1, $data_b, $xyz, $description) = /^\s*(\S+)\s+(\S+)\s+(\S+)\s+(.*)$/ or die "Failed to parse: $_";
In Section
Seekers of Perl Wisdom
|
|