I am making a program that replaces any occurence of a certain piece of text.
ok.. this is what does work.. it doesn't have the "REPLACING" part.. cause i can't remember how to replace text.
foreach $line (@script) {
if ($line =~ /big/)
print $line;
}
elsif ($line =~ /heavy/)
print $line;
else {
print $line;
}
}
now all i need to know is how to replace the text.. in this example i would like to figure out how to change big to small and heavy to light...
any ideas?
i think it is something like this:
foreach $line (@script) {
if ($line =~ /big/small/)
print $line;
}
elsif ($line =~ /heavy/light/)
print $line;
else {
print $line;
}
}
but that doesn't work... help!
thanks!
ok.. this is what does work.. it doesn't have the "REPLACING" part.. cause i can't remember how to replace text.
foreach $line (@script) {
if ($line =~ /big/)
print $line;
}
elsif ($line =~ /heavy/)
print $line;
else {
print $line;
}
}
now all i need to know is how to replace the text.. in this example i would like to figure out how to change big to small and heavy to light...
any ideas?
i think it is something like this:
foreach $line (@script) {
if ($line =~ /big/small/)
print $line;
}
elsif ($line =~ /heavy/light/)
print $line;
else {
print $line;
}
}
but that doesn't work... help!
thanks!