Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[doc] Nits with builtin::trim #23212

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

Open
grr opened this issue Apr 21, 2025 · 1 comment · May be fixed by #23216
Open

[doc] Nits with builtin::trim #23212

grr opened this issue Apr 21, 2025 · 1 comment · May be fixed by #23216

Comments

@grr
Copy link

grr commented Apr 21, 2025

Where

builtin::trim

Description

  1. Don't suggest String::Util. it uses suboptimal implementations throughout, If you need to suggest an alternative, builtin::compat is a good candidate, name included. It also has better backwards compatibliity: 5.8 vs. String::Util's 5.14.

  2. Don't propagate the slower combined regex. Instead of:

$str =~ s/\A\s+|\s+\z//urg;

use:
s/\A\s+//u, s/\s+\z//u for my $copy = $str;

@jesuslozanomosterin
Copy link

IMHO To the perlfaq chatper adecuate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants