or download this
open my $h, '>', $file # try to open a file
or die "Can't open '$file' for writing: $!\n"; # if that fails, te
+rminate with a message
while(<$fh>) { # reading a line via <$fh> assigns per default
+to $_
s/foo/bar/; # s/// operates per default on $_
}