Skip Menu |

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

Report information
The Basics
Id: 133361
Status: open
Priority: 0/
Queue: String-Util

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

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



Subject: String::Util::trim returns empty string when called on a reference
Behaviour change with 'trim': v1.26: perl -E 'use String::Util "trim";say ref trim(qr/a/)' Regexp v1.31 perl -E 'use String::Util "trim";say ref trim(qr/a/)' (returns empty string) I'm not entirely sure what the preferred behaviour should be, though I think I'd prefer it to die or do nothing when called on a ref, rather than returning an empty string.
It's not returning an empty string, it's converting the reference to a string. $ perl -E 'use String::Util "trim";say trim(qr/a/)' (?^u:a)
On Fri Sep 18 08:14:24 2020, haarg wrote: Show quoted text
> It's not returning an empty string, it's converting the reference to a > string. > > $ perl -E 'use String::Util "trim";say trim(qr/a/)' > (?^u:a)
Just shows how fried my brain is :-( Yes, it stringifies whatever is passed as arg, but this is not the same behaviour as < v1.30 which is how it broke some $work tests. I just wonder whether this changed behaviour is desirable, and worry about what else out there might be broken by this. For what it is worth, we switched to this new version anyway.