I've used the s/// operator with great success before. However, this time I'm getting some weird results.
I have this:
$test = "mouse_eatsCat_andDog.txt"; $test =~ s/"_(.+)"/$1/; #because I want to get "eatsCat_andDog.txt" print "$test"; #result is "mouse_eatsCat_andDog.txt"
I'm very puzzled by this! I've tried this with no success as well:
$test =~ s/"^mouse_(.+)"/$1/;I made it work using a different method so that I got only "eatsCat_andDog.txt" but I want to know why the above method doesn't work. Thanks!
In reply to s/// operator by perlUser345
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |