Problems? Is your data what you think it is? | |
PerlMonks |
Re^3: extracting columnsby Marshall (Canon) |
on Mar 25, 2012 at 19:02 UTC ( [id://961517]=note: print w/replies, xml ) | Need Help?? |
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 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. Focus the code on what is used from the input - forget the stuff that is not used. Explain what $effects would have meant - but its not important to this code - in some kind of comment section - if that this important to the overall description of the input file.
The use of "undef" instead of list slice is just fine for a case like this.
In Section
Seekers of Perl Wisdom
|
|