so I know that there are many ways of doing what I am asking for, but all that I have found is not helping me for what I am trying to do. It is supposed to be a simple find and replace script using stdin and stdout. I have a script called replace.pl and this is what i have in it:
#!/usr/bin/perl
use strict;
use warnings;
while(<STDIN>){
$_ = s/$ARGV[0]/$ARGV[1]/g;
print STDOUT $_;
}
When I run echo "replace a with b please" | replace.pl 'a' 'b'
all I get back is a "1". My desire output is "replace b with b please" but what ever I try to do, it is not changing it. Could any one tell me what i am doing wrong here?