- or download this
#!/usr/bin/perl
...
perl tricky_html_filter.pl foo.html
=cut
- or download this
my $file = shift || 'E:/path/to/dummy1.html';
open INFILE, '<', $file, or die "$!: can't open $file\n";
- or download this
while (<INFILE>) {
s/(background-color:#)(?:[0-9a-f]{6}|[0-9a-f]{3})/$1ffffff/i;
print;
}
- or download this
while (<INFILE>) {
print;
}
- or download this
while ($_ = <INFILE>} {
print $_;
}
- or download this
while (my $line = <INFILE>} {
print $line;
}
- or download this
s/(background-color:#)(?:[0-9a-f]{6}|[0-9a-f]{3})/$1ffffff/i;
- or download this
$1ffffff
- or download this
#!/usr/bin/perl
...
s/(background-color:#)(?:[0-9a-f]{6}|[0-9a-f]{3})/$1ffffff/i;
print;
}
- or download this
perl -pi -e"s/(background-color:#)(?:[0-9a-f]{6}|[0-9a-f]{3})/$1ffffff
+/i" /path/to/dummy1.html
# be sure and replace " with ' if you run this on *NIX