Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- open(FILE, "$ARGV[0]") or die "Could not open file: $ARGV[0]";
- my $counter = 0;
- while(<FILE>) {
- @words = split /[.?!]/, $_;
- foreach $word (@words) {
- if($word =~ /([0-9])/){
- if($word =~ s/($ARGV[1]\b)/\u$1/) {
- print $word2;
- $counter++;
- }
- print $word . " ";
- }
- else{
- print $word . " ";
- }
- }
- }
- print "Changed words ($ARGV[1]): " . $counter . "\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement