in reply to Re^2: extracting columns
in thread extracting columns
I find it a bit more readable but... it's a matter of taste!
Don't declare "my" variables that you do not use.
Use a regex when you want to "keep" something.
Use split when you want to "throw away something"
Use list slice to "throw away" extraneous stuff from a split() or a match "global".
Forget even declaring, for example, $effects if it is not used.my ($id, $name, $effects, $size) = split /\t/; #wrong
The use of "undef" instead of list slice is just fine for a case like this.
List slice is great when you want #12, #3, #1, #50-67 in that order.
|
|---|