Update: Darn - it's back. Completely ignore the below meditation, instead to post a question!

This is a rehash of a stack-overflow answer I just made. I hope that's not against modern Perlmonks etiquette!

I recently got an odd error in some code that definitely worked before:

Can't upgrade BIND (1) to 9 at Foo.pm line 999

Google told me only that someone had seen the same error in a cgi once.

How I fixed it might be instructive although I'm still not exactly sure what it means. The code, that worked in some calling circumstances but not others, was a simple method forwarding method that looked a little like this:

sub quick_method { return shift->SUPER::some_other_method(@_); }

It's a little lazy, sure, but according to perl's left to right evaluation, it should (and usually was) the equivalent of this:

sub quick_method { my $self = shift; my @args = @_; return $self->SUPER::some_other_method(@args); }

I'm guessing that since @_ is, under some circumstances, a special way of accessing the stack and, under other circumstances, a fairly regular global list, the way in which the method was called was hitting different code paths.

Moral of the story - don't get too cute about modifying and using @_ in the same line of code!


In reply to Don't get too cute about modifying and using @_ in the same line of code by aufflick

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.