in reply to Re: If unsuccessful action (updated)
in thread If unsuccessful action

Thanks for the reply and suggestions. I have been trying to figure out a way to get some more debugging and I like the start by adding an ELSE block to the inner IF block. would I only need to add the listed ELSE say ERR suggestion or would there be some more additional syntax?

Replies are listed 'Best First'.
Re^3: If unsuccessful action
by 1nickt (Canon) on Apr 03, 2020 at 22:01 UTC

    Hi again,

    It's of course up to you how you debug. I showed the simplest pseudo action I could, as an example. But note that say is only available in Perl version >= 5.10 (and must be imported with use feature 'say'; or use 5.010;. It's the equivalent of print "$str\n";).

    Since you are starting a big ex post facto debugging project, you might like to begin to implement a logging system (using Log::Any) so that once you've fixed your issues you can run at a higher log level and the log statements you entered to debug will be ignored, but still there for future use (and could use different output adapters in production than in beta/testing, for example). That's what I would do.

    For a more quick-and-dirty tool while really debugging, where you aren't going to want to keep the statement, there's a newly updated module XXX by the mad genius Ingy döt Net I noticed recently that might be helpful.

    Hope this helps!


    The way forward always starts with a minimal test.