Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Why do I get a "used only once" warning here?

by repellent (Priest)
on Mar 16, 2009 at 16:01 UTC ( [id://750933]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Why do I get a "used only once" warning here?
in thread Why do I get a "used only once" warning here?

Understood - you have to weigh the pros and cons of a log_once(). Just some thoughts:

If you had a logging package that expected all other functions to be logged, except for a select few, and then for the select few you sprinkle some state variables around, doesn't that introduce some action-at-a-distance & maintenance difficulties in the far future?

Granted, if there was just one or two state variables around, it would just be easy to remember, but wouldn't it also be that much harder to locate later?

Replies are listed 'Best First'.
Re^4: Why do I get a "used only once" warning here?
by rovf (Priest) on Mar 16, 2009 at 17:45 UTC
    doesn't that introduce some action-at-a-distance & maintenance difficulties in the far future?

    I don't think so. At the point of logging, we know whether logging should be "once" or "always", and in all solutions proposed so far this would be clear from looking at the place where the logging occurs. From a programming point of view, I think a log_once() function would be easier to understand, though; OTOH, I expect that we might get diagnostics in the future (besides logging) which also should be executed only once, so I have not decided yet which way to go.

    At least the discussion in this thread provided me with enough insight that I now see what possibilities I have.

    -- 
    Ronald Fischer <ynnor@mm.st>

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (8)
As of 2024-04-25 11:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found