Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the PPI CPAN distribution.

Report information
The Basics
Id: 18415
Status: resolved
Priority: 0/
Queue: PPI

People
Owner: Nobody in particular
Requestors: mlockner [...] iowatelecom.net
Cc:
AdminCc:

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



Subject: PPI::Node::find returning empty string?
This is borderline wishlist, but... Although I can see the virtue in having PPI::Node::find's value being a valid boolean when used in such a context, it was not my first expectation. I had to look up the function documentation to find out why it was returning an empty string. My expectation was that it would instead return a reference to the empty list if there were no results matching the search criteria; I think that would be a more common intuitive expectation. I realize it probably isn't something that can be changed at this point, and that you might not want to anyway, but that it was at least worth speaking up about.
On Tue Mar 28 14:00:22 2006, guest wrote: Show quoted text
> This is borderline wishlist, but... > > Although I can see the virtue in having PPI::Node::find's value being > a valid boolean when used in such a context, it was not my first > expectation. I had to look up the function documentation to find out > why it was returning an empty string. > > My expectation was that it would instead return a reference to the > empty list if there were no results matching the search criteria; I > think that would be a more common intuitive expectation. > > I realize it probably isn't something that can be changed at this > point, and that you might not want to anyway, but that it was at least > worth speaking up about.
While I have also found that behavior confusing, I think it's too late to change this behavior. Perl::Critic relies on it. I suggest that this bug be rejected. -- Chris
Well, when I added it in the first place, it was done to allow expressions like. my $things = $document->find(...) or die "Failed to find expected whatever"; And I agree it's probably too late to fix it now. Resolving WONTFIX