in reply to s/// operator

$test = "mouse_eatsCat_andDog.txt"; $test =~ s/"_(.+)"/$1/; #because I want to get "eatsCat_andDog.txt"

Your string doesn't contain a quote(") followed by an underscore(_), so your regex never matches.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: s/// operator
by perlUser345 (Acolyte) on Nov 19, 2015 at 19:25 UTC

    OMG!!! The dumbest mistake ever! Thank you very much!