Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: $. - smarter than you might think

by shmem (Chancellor)
on Jun 22, 2006 at 23:13 UTC ( #557037=note: print w/replies, xml ) Need Help??


in reply to Re^2: $. - smarter than you might think
in thread $. - smarter than you might think

heh.. that makes me think about a $SIG{__DIE__} handler which not only says harshly "Can't do method foo in context bar in file quux line 1024" or such, but prints the 3 lines above and below the error as well...
don't talk nonsense at blah.pl line 23. 21 learn('nothing'); 22 sub blah (\[&]) { 23 warn "don't talk nonsense"; > 24 $_[0]->(); 25 } 26 sub learn { 27 my $self->teach(shift); Can't use string ("bar") as a subroutine ref while "strict refs" in us +e at blah.pl line 24.

I discovered this playing with your code, btw. Thanks!

cheers,
--shmem


_($_=" "x(1<<5)."?\n".q/)Oo.  G\        /
                              /\_/(q    /
----------------------------  \__(m.====.(_("always off the crowd"))."
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^4: $. - smarter than you might think
by radiantmatrix (Parson) on Jun 26, 2006 at 15:56 UTC
      Hey, good on ye... it's always nice to see bad hacks smoothened into a reasonable thing.

      radiantmatrix ++ if $self->($points_left).

      But! you have an extra ) on line two of your code ;) And if would get picky, I'd rather write warn +($. == $d ? '>' : ' ') than print STDERR. Flavours :)

      thx & greets,
      --shmem

      _($_=" "x(1<<5)."?\n".q/)Oo.  G\        /
                                    /\_/(q    /
      ----------------------------  \__(m.====.(_("always off the crowd"))."
      ");sub _{s,/,($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e,e && print}
      

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://557037]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2021-05-09 14:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (100 votes). Check out past polls.

    Notices?