in reply to Regex not working

You still have to print.
How can I use Perl's -i option from within a program?

Replies are listed 'Best First'.
Re^2: Regex not working
by bluethundr (Pilgrim) on Dec 27, 2008 at 16:08 UTC
    That's it guys! Adding the print statement and the newline is what did it! You guys rule! And I just know if I persist at learning this stuff, obvious things like this won't bite me in the ass anymore.

    Cheers!
    #!/usr/bin/perl -w use strict; $^I = ".bak"; while (<>) { if (/^#!/) { $_ .= "## Copyright (C) 2008 by C'est Mois\n"; } print; }