#!perl -d use strict; package Obj; use overload q{""} => 'string'; sub new { bless { string => pop }, shift } sub dostuff () {} sub string { dostuff; # These naughty lines (in a real module dostuff; # they'd do probably something useful) simply dostuff; # want to waste your time when debugging! dostuff; # There is no exit, is one? dostuff; # Thought there is a difference between dostuff; # "n test" and "s test"? - Nope! dostuff; # Try to "r"eturn, too - turns out it dostuff; # takes you further than you intended. dostuff; # Here comes "c 20" to your sole rescue: dostuff; # It will graciously take you up to shift->{string} # this line. Counting lines is fun, you know! } sub reply { print "Hi lonely one!\n"; } package main; sub test { my $o = Obj->new("World"); print "Hello $o!\n"; $o->reply(); } test; # ... this by debugger command "s", then "s test" and/or "n test" __END__