- or download this
my @comp = "seed\n"; # Fix 1
while ($line = <>) {
...
print $line if $comp[0] =~ /^\Q$comp[1]\E\z/; # Fix 2
shift(@comp);
}
- or download this
my @comp = "seed\n";
while ($line = <>) {
...
print $line if $comp[0] eq $comp[1];
shift(@comp);
}
- or download this
my $last = "";
while (<>) {
print if $_ eq $last;
$last = $_;
}