Here's a quickie example that should get you on your way:
#!/usr/bin/perl my $Gibberish=<<EOGibberish; This is a sentence. It's not a particularly great sentence, but it's a sentence nonetheless. It would suck if someone accidentally changed it! EOGibberish use strict; use warnings; use autodie; my $search; open my $FH, '<', $0; binmode $FH; seek $FH, 55, 0; read $FH, $search, 8; close $FH; $Gibberish =~ s/$search/XXXXXXXX/g; print $Gibberish;
When I run it here, I get:
marco@Boink:~ $ perl splorch.pl This is a XXXXXXXX. It's not a particularly great XXXXXXXX, but it's a XXXXXXXX nonetheless. It would suck if someone accidentally changed it!
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: Masters of Loops and Filehandles
by roboticus
in thread Masters of Loops and Filehandles
by pbyfire
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |