in reply to A Reg Exp Question

This is a job for a full blown parser. You can look into Parse::RecDescent on CPAN.

This is because it sounds like you'll want to match even:

print "Bob was $frank \"yes!\" around"."No Way!", $foo, "\n"; #or print "joe" if $bar;
Which a normal regexp will be unable to follow easily.

That said, if this is a one-time job with certain rules you can rely on, there are ways to do what you want. For example, if every statement ends with a semi-colon, and the word "print" is never used in strings in the Perl script, you could try matching

/print[^;]*;/
But be aware that even something as simple as:
if($foo){ print "Bar" } # or $foo= "Ask frank to print the report";
Would mess that up. If you have a situation with many situations, use a real Parser.

Note also that you might mess up the logic of a program. See:

print "Foo\n" while &func($bar);
If your program relies on &func($bar) being called several times, you would have eliminated the entire statement if using the simple regexp; Thanks to lhoward for introducing me to Parse::RecDescent