I'm creating a script to take regex input from the command line and process it; something like this:
chomp(my $regex = $ARGV[0]);
my $name = '11528734-3.jpg';
$name =~ $regex;
print $name . "\n";
My input into the script is: "s/.jpg/_thumbnail.jpg/g" but $name isn't processing the regex input from the command line.
Any advice on how to make this work?
Thanks!
$name?s/foo/bar/and was expecting the=~ $regexto "expand" to=~ s/foo/bar/.