Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the String-Formatter CPAN distribution.

Report information
The Basics
Id: 67851
Status: resolved
Priority: 0/
Queue: String-Formatter

People
Owner: Nobody in particular
Requestors: hanenkamp [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Use of uninitialized value $hunks in join or string
I use String::Errf as part of our exception objects (similar to Throwable::X). If I throw an exception that doesn't include all the fields in the payload as are named in the message formats, I get this warning. The most annoying part is that in the exceptions, I get the warning in the catching code well away from where the potential warning was actually caused. On the other hand, I don't know what a "better" solution is. The uninitialized warning really is legitimate. Replacing it with an empty string or something else might be worse. Perhaps String::Formatter needs a way to configure undef handling for the generated subroutines. If that's done, though, I don't know what String::Errf ought to do, but then I could at least use my own String::Errf-like String::Formatter that handled undef the way I want it to. Cheers.
Subject: Re: [rt.cpan.org #67851] Use of uninitialized value $hunks in join or string
Date: Fri, 29 Apr 2011 17:33:03 -0400
To: Andrew Sterling Hanenkamp via RT <bug-String-Formatter [...] rt.cpan.org>
From: Ricardo Signes <rjbs [...] cpan.org>
* Andrew Sterling Hanenkamp via RT <bug-String-Formatter@rt.cpan.org> [2011-04-29T17:22:46] Show quoted text
> I use String::Errf as part of our exception objects (similar to > Throwable::X). If I throw an exception that doesn't include all the fields in > the payload as are named in the message formats, I get this warning. The most > annoying part is that in the exceptions, I get the warning in the catching > code well away from where the potential warning was actually caused.
This is a good bug report, but I'm afraid I don't have a good response yet. All you get it, "I'll think about it." -- rjbs
I think the behavior as it stands is right enough to not be a bug. I agree that it is really irritating that you can't do anything else. I think that in the future, it should be possible to have the formatter (a) throw or (b) use a placeholder or something like this. (In some cases, using 0 as the placeholder for numified undef is sane. Using "" as the placeholder for stringified undef is probably not so good.) Now that I know what I think I should do, I will make a note of it and… probably not do it right away. But I'll have a todo item for work instead of thinking. -- rjbs
I've replaced this with https://github.com/rjbs/String-Formatter/issues/1 which has a bit more information in it. -- rjbs