Perl-Sensitive Sunglasses | |
PerlMonks |
RE: RE: required explicit package error.by nuance (Hermit) |
on Jun 15, 2000 at 23:43 UTC ( [id://18376]=note: print w/replies, xml ) | Need Help?? |
You never actually print to anywhere, try opening another file for output. I've rewritten your example above, call this with progname.pl datafile results
Notice you can use the same regular expression to match the line and extract the data, also the regular expression is more general and will catch lines that aren't formatted exactly as you anticipated. Update: I should probably explain the regular expression, just in case you aren't totally familiar with them. It matches any line that begins with total, has anything at all in the middle, but ends with tw0 numbers separated by whitespace. It also has optional whitespace at the end (spaces at the ends of lines can be a real pain). Note the use of + for items that definitely have to be there and * for things taht are optional. Nuance
In Section
Seekers of Perl Wisdom
|
|