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

I don't have three whole years of Perl experience, but I think this is broken. What are you expecting it to do? $regex will contain a line (at least a newline) from the first file given on the command line. What's Perl supposed to do with that when you give it as an expression by itself?

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

Replies are listed 'Best First'.
Re^3: modifying a file with regex!
by linuxkid (Sexton) on Mar 17, 2012 at 21:31 UTC
    a s/// regex left without being bound to a variable with ~= just acts upon $_

    --linuxkid


    imrunningoutofideas.co.cc
      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.

      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.