Nothing to do with your question, but...
while ($newline = <FILEHANDLE>){
use strict; use warnings;
and then
while (my $newline = <FILEHANDLE>){
if ($newline = /^>/) {
This is most probably not what you want, since you're assigning to $newline. You want
if ($newline =~ /^>/) {
instead.
$stuff = $newline; &play_with($stuff);
Unless play_with() modifies its argument, you may want to pass $newline directly to it, without passing through an intermediate variable. But more importantly, the &-form of sub call is now obsolete and likely not to do what one may think, so unless you do know, don't!
In reply to Re: How do I backtrack while reading a file line-by-line?
by blazar
in thread How do I backtrack while reading a file line-by-line?
by mdunnbass
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |