dd-b has asked for the wisdom of the Perl Monks concerning the following question:
For logging, and debugging, I often need to print something where I don't really know what it is or whether it's defined. I want to print it in such a way that I can always tell from the output. I don't need the full value (for complex structures).
This seems like such a common need, I'm a little surprised I haven't found anything that does it. Does anybody else have this problem? Is there a solution?
(The aspect that burns me most frequently is an undef variable blowing up the print; I want it to just say "undef" or something. Trying to suppress writing requirements, in hopes of finding something in existence.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: "Safe" print?
by McA (Priest) on May 13, 2013 at 22:38 UTC | |
|
Re: "Safe" print?
by LanX (Saint) on May 13, 2013 at 22:39 UTC | |
|
Re: "Safe" print?
by ambrus (Abbot) on May 14, 2013 at 08:23 UTC | |
by locked_user sundialsvc4 (Abbot) on May 14, 2013 at 13:45 UTC | |
by ambrus (Abbot) on May 14, 2013 at 14:41 UTC | |
by dd-b (Pilgrim) on May 14, 2013 at 19:17 UTC | |
by ambrus (Abbot) on May 14, 2013 at 21:13 UTC | |
by LanX (Saint) on May 14, 2013 at 15:20 UTC | |
|
Re: "Safe" print?
by pemungkah (Priest) on May 15, 2013 at 03:31 UTC |