Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Another Subroutine Redefined Post

by JadeNB (Chaplain)
on Nov 10, 2009 at 23:24 UTC ( [id://806368]=note: print w/replies, xml ) Need Help??


in reply to Another Subroutine Redefined Post

I could post an actual subroutine, if someone might find it of some value...

Yes, let's see! As others have mentioned, your code doesn't have anything visibly wrong with it in isolation (although you probably want to call your subroutine using the modern syntax greater(@args) rather than &greater(@args)).

I think just as useful as the actual code snippet is the exact error message, wording, line numbers, and all.

Replies are listed 'Best First'.
Re^2: Another Subroutine Redefined Post
by Heffstar (Acolyte) on Nov 24, 2009 at 16:42 UTC

    Rather than posting an entire script (because I don't have a small example), here's another thought to mull over...

    In one particular case, the error "subroutine X redefined at ..." appears only sometimes. I was able to duplicate it, not by refreshing my page, but by navigating back and reclicking the link.

    Could this have something to do with a previously-loaded subroutine in my server process' memory that's being redefined?

      I'm a little confused—you say “I could post an actual subroutine”, but then say that you don't want to post a code snippet?

      Anyway, I think that it's important to realise that Perlmonks are happy to give you all the help we can, but that you have to show that you're willing to meet us halfway—saying “I won't take the effort to make a small code sample, but you should take the effort to guess why a problem might be occurring anyway” isn't likely to lead anywhere useful.

        In actual truth, I'm having a hard time finding a script that's small enough to post. Posting a single subroutine would probably not help. The "smallest" is ~1000 lines. I will make another attempt to find a script that is suitable, but it may be a little while... thanks for the will to help; it really is appreciated.

        On your earlier comment, you mention throwing away the "&" on my sub calls because it's the old convention. Aside from being more modern, are there other benefits of doing so?

        A side note about these errors... after making some code changes, I'll attempt to run the script and good ol' "Internal Server Error" rears it's ugly head (I guess that happens sometimes eh?). I'll fix the error and upon refreshing the page and rerunning the script, every single subroutine I've got defined in my script will show in the logs as redefined. Yet further refreshes WON'T cause them to appear as redefined. Server cache maybe?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-04-24 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found