[clue-tech] Fun perl script
Mike Staver
staver at fimble.com
Tue Aug 1 09:55:06 MDT 2006
That's, that's what I was looking for. I'll see what kind of havoc I
can cause today.
Jeff Schroeder wrote:
> Mike asked:
>
>> Since I've not done much in perl before, I'm a little confused as to
>> where the source code of the webpage comes into play here. Which
>> variable would it be? I ask because I'd like to run something like
>> this against the source of the page:
>>
>> $source =~ s/Bush/Kerry/g;
>
> The $_ variable contains the content of each line in the page source, so
> you can merely update the "else" block at the bottom to do whatever
> substitutions you'd like:
>
> else {
> ($out = $_) =~ s/Bush/King George/g;
> $out =~ s/Windows/Linux/g;
> $out =~ s/this/that/g;
> print "$out\n";
> }
>
> My Perl's a little rusty, but I think that'll do it.
>
> Have fun!
> Jeff
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> clue-tech mailing list
> clue-tech at cluedenver.org
> http://www.cluedenver.org/mailman/listinfo/clue-tech
--
-Mike Staver
staver at fimble.com
mstaver at globaltaxnetwork.com
More information about the clue-tech
mailing list