#!/usr/bin/perl -w
use strict;
my $str = "I like to eat pizza. Every friday, I do.";
$str =~ s/\./_/g;
print $str;
Output:
C:\>perl pg61.pl
I like to eat pizza_ Every friday, I do_
I had to 'backslash' the period to prevent it from matching any character in the string. The 'g' on the end of the substitution means 'throughout the whole string as opposed to only the first period'.