Debug until I drop
(includes writing say 'Checkpoint 1'; every other line - increasing the number of course)
Go home about five minutes before the office closes
Get back to work next morning (after dreaming about bugs)
Look at code for a few minutes
Find the obvious bug (often assignment instead of comparison, or using the wrong variable name)
Do happy dance that everything works now
Re: When my script doesn't work, I ...
Download Code Replies are listed 'Best First'.
You should use Devel::Trace. That would save you a lot of adding checkpoints :)
FWIW, I also use the invaluable Devel::TraceUse to find out why a script works flawless on machine A where it fails on machine B and quite often find out that it isn't my code that fails, but a bad/old module that is not updated on machine B.