-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@array->join should default to something #241
Comments
My impulse is to make That you might want the default to be something other than empty string just underlines the point. |
This is starting to get complex, I am going to split this out in to separate issues: what Back to the topic at hand: You are correct that I have phrased this in a less than descriptive manner. Currently ->join does default to something, err rather nothing, more specifically undef. Thus the issue is that you get a warning about use of undef but it
and here is the code in question from /home/benh/perl5/lib/perl5/autobox/Core.pm (where ever that is built from) sub join { my $arr = CORE::shift; my $sep = CORE::shift; CORE::join $sep, @$arr; } So to take another attempt at clarifying my point, it seems like a poor interface to allow for something supply warnings and still preform a reasonable action. This could be solved by supplying a value to $sep. The current action would be maintained, sans warnings, by defaulting to q{}. Thus do we want to do this to solve the issue with the warning? |
If I understand what you're saying, you're concerned with preserving the current behavior? That's why changing it to throw an exception is not ok? Normally, I'd agree, and it is correct procedure. However, Because of all that, I'd say its highly unlikely |
Currently @Array->join warns a bunch but because join undef actually works it does what I expected. So should join default to q{}? or should we make a slightly more useful default on this one? A single space would be nice and useful in more cases then join(q{}).
The text was updated successfully, but these errors were encountered: