Jim Gibson <jimsgib...@gmail.com> writes: [...]
> For debugging purposes, I usually declare a variable at the top of my program: > > my $debug = 1; > > Then I sprinkle print statements controlled by this variable throughout my > program: > > print "\$_=$_\n" if $debug; > > When my program is debugged and ready to run, I change the declaration of > $debug to this: > > my $debug; > > and the print statements are turned off. I also usually define a > command-line option (-d) that sets $debug to true, allowing me to turn > debugging on and off at will. I like the heck out of that idea. I'd been using prints liberally too, but my sophistication of usage hadn't got much beyond stoneage. I've been using a print clause I can insert by typing an abrev that gives me a starter `print "hpdb _\n";' And where you see the underscore is where my cursor would land when I typed the abrev `hpd<spc>'. I thought I was really getting with it... hehe. What you posted is like the difference between a manual clutch, and torque converter. And then controlling if with a cmdline switch... alright.. now were talking. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/