Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- foreach(@ARGV) {
- open IN, '<', $_
- or die "Cannot open $_";
- open OUT, '>', "$_.new"
- or die "Cannot create $_.new";
- while(<IN>) {
- s/foo/bar/;
- ...
- print OUT $_;
- }
- close IN;
- close OUT;
- rename "$_.new" "$_";
- }
Advertisement
Add Comment
Please, Sign In to add comment