Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: perl compiler optimizer curiosity (Logging and Debugging References)

by eyepopslikeamosquito (Archbishop)
on Mar 12, 2022 at 06:33 UTC ( [id://11142025] : note . print w/replies, xml ) Need Help??


in reply to perl compiler optimizer curiosity

Assuming (like me) you generally prefer logging to crack-pipe debugging sessions, have you considered more mainstream alternatives to your home-grown debug subroutine ... such as Log::Log4perl or Smart::Comments?

See also:

Logging References Added Later

CPAN:

Perl Monks:

Debugging References Added Later

Perl core docs:

Other:

See Also

  • Comment on Re: perl compiler optimizer curiosity (Logging and Debugging References)
  • Download Code

Replies are listed 'Best First'.
Re^2: perl compiler optimizer curiosity
by Fletch (Bishop) on Mar 12, 2022 at 07:00 UTC

    Seconding these recommendations. Log4perl overhead will be similar to your solution in the disabled case (a sub call immediately returning, which while negligible is something) and the flexibility it offers is well worth that. Smart::Comments on the other hand if not enabled are truly just comments with no overhead save skipping over during compilation (same as any other comment). The catch is that it uses mildly ebil source filtering to work so be aware (although I canít offhand recall a time or two it ever caused problems nor actually enumerate what they were). Personally Iíve mostly moved to using l4p exclusively.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Re^2: perl compiler optimizer curiosity
by 1nickt (Canon) on Mar 12, 2022 at 17:43 UTC

    See also Log::Any.

    The way forward always starts with a minimal test.