If you're getting a blank outfile, that either means print is failing (you could check by putting "or die $!" after your print statement), or your if( $fields[5] =~ m/Withdrawn/ ) {... is never matching.
I suspect the latter. So why would your match fail if the data is coming from a file, but not if coming from a __DATA__ block? You'll have to investigate that yourself. But here are a few possibilities: There's an extra tab in there somewhere making 'Withdrawn' actually live one column to the right. There aren't enough tabs, making 'Withdrawn' live to the left of where you're expecting it. Your tabs in the file are actually a fixed number of spaces rather than an actual tab character. Your data is mistyped. ...one of those are the likely culprits.
Dave
In reply to Re: Where is my output stream to a file going?
by davido
in thread Where is my output stream to a file going?
by lomSpace
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |