Please send questions to
st10@humboldt.edu .
#!/usr/bin/perl -w
#######################################################
# lect08_in_place_cmd_line
#
# A script --- BUT its purpose is REALLY to remind you
# of a command you can type STRAIGHT from the command
# line (and then the script is equivalent to that line,
# for reference)
#
# modified by Sharon Tuttle from "Learning Perl",
# by Schartz and Phoenix
#
# last modified: 10-11-04
#######################################################
# if type AT THE CMD LINE:
# prompt> perl -p -i.bak -w -e 's/Randall/Randal/g' fred*.dat
#
# ...then that's roughly the SAME as running the FOLLOWING
# script! (with the up-top #!, of course)
@ARGV = glob "fred*.dat";
$^I = ".bak";
while (<>)
{
s/Randall/Randal/g;
print;
}
# end of lect08_in_place_cmd_line