in reply to Re: Do not understand code
in thread Do not understand code

That's right, kids, when you're writing Perl, remember to restrict yourselves to the subset of the language that looks sort of like C, otherwise people might not understand! The statement unlink $file if /.BGV/; should obviously have been written this way:
my @str = split //; for (my $i = 1; $i < scalar(@str) - 2; $i++) { if ($str[$i] eq 'B' && $str[$i+1] eq 'G' && $str[$i+2] eq 'V') { unlink $file; $i = scalar(@str) - 2; } }
See how much more readable that is?

Replies are listed 'Best First'.
Re^3: Do not understand code
by Anonymous Monk on Sep 28, 2017 at 16:45 UTC
    No way! All I know is Python, so this the only right way to write Perl!