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

Re: Cannot find the error

by Athanasius (Archbishop)
on Apr 03, 2020 at 14:23 UTC ( [id://11114996]=note: print w/replies, xml ) Need Help??


in reply to Cannot find the error

Hello gudmo,

... #my $debug = "true"; print "Let's start\n" if $debug; ...

A better way to do this is with the constant pragma, which plays well with strict and still gives you the benefits of conditional compilation:

#!/usr/bin/perl use strict; use warnings; use constant DEBUG => 0; ... print "Let's start\n" if DEBUG; ...

Update: Fixed typo: missing constant in the definition of DEBUG (!) Thanks, pryrt.

Hope that’s of interest,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-03-29 04:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found