#!/usr/bin/perl use strict; $SIG{__DIE__} = sub { if(my ($d) = $_[0] =~ /line (\d+)/) { seek DATA,0,0; while() { if($. == $d) { warn '> '.$..' '.$_; } else { warn ' '.$..' '.$_ if ($. > $d - 4) && ($. < $d + 4); } } } }; my $foo = 'bar'; blah($foo); learn('nothing'); sub blah (\[&]) { warn "don't talk nonsense"; $_[0]->(); } sub learn { my $self->teach(shift); warn "got it"; } __END__