Thanks it works.
Questions: What does "return" do different compared to "next" in
a subroutine? Also does the way I did my return part look okay?
The error output (Exiting subroutine via next at C:\Perl\bin\myscript.pl line 188.) never comes up in my text file (bas.txt) for some
unknown reason?
if ($data =~ /patternmatch/i)
{
open FILY, ">bas2.txt";
print FILY "Skip $data\n";
return ">bas2.txt";
}