in reply to Re^2: modifying a file with regex!
in thread modifying a file with regex!

a s/// regex left without being bound to a variable with ~= just acts upon $_

--linuxkid


imrunningoutofideas.co.cc

Replies are listed 'Best First'.
Re^4: modifying a file with regex!
by choroba (Cardinal) on Mar 18, 2012 at 00:18 UTC
    But in your code, there is no s/// regex, there is a variable. And even if there had been any change in $_, there is no output going on.
Re^4: modifying a file with regex!
by aaron_baugher (Curate) on Mar 18, 2012 at 01:03 UTC

    But a variable that contains a string that looks like a regex isn't a regex, and Perl won't know to automatically treat it like one. Have you tried running your own script yet? Aren't you curious what it does?

    Aaron B.
    My Woefully Neglected Blog, where I occasionally mention Perl.

    A reply falls below the community's threshold of quality. You may see it by logging in.