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
Alternate regexp delimiters trigger a warning #89
Comments
If you're making a list of quote delimiters, {} should be supported too.
…On Mon, Jun 29, 2020, 03:34 Scott Baker ***@***.***> wrote:
Consider the following code to remove https:// from a string
my $str = "https://google.com";
# Triggers a warning (but is must more readable)
$str =~ s|https://||;
# No warning, but a lot harder to read
$str =~ s/https:\/\///;
I think alternate regexp delimiters should be considered standard. At
least some primary chars like: |, /, !', and maybe @` should be OK.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#89>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFURPKWVKTLZETW6WSF2RADRY7ORTANCNFSM4OKY75RA>
.
|
Pipe is possible but I'm not a fan because it's a fairly distance character for non-Perl devs who aren't used to other Perl devs using it. (I never used it personally.) Will |
I dunno why but I've always used Not really clear what this means:
|
FWIW I favor being extremely liberal in delimiters. |, for example, is visually quite distinct, and can have the right 'look' in some cases. Of course, if the strings to be delimited contain ! but not | , then | is a superior choice. And I can imagine some application which has painted itself into a corner where the only character that is not in a delimited string is '3' is, in which case the digit 3 is the ideal delimiter. I personally like to have any printable character available as a delimiter, just in case. |
I took an informal poll on #perl and |
I think the point here is to restrict this and get back some sanity. I remember seeing code that used FWIW, I personally like using |
Sorry, this is my poor phrasing. I meant that, if you're not a Perl developer who saw a different Perl developer use the pipe operator as a delimiter, you wouldn't even think about using it. Of course, this is a presumption on my part. I'm okay adding the pipe symbol as a delimiter. I'll try to add it this week. (I want to add a bunch of docs and merge other stuff too for a release this weekend.) |
Sounds good. Thank you for being flexible on this issue. |
Honestly, no reason here for me to be stubborn. The pipe symbol still gives us all we want. Also, I'm not likely to argue a point that is in opposition to both @gonzus and @jeffreykegler. :) |
PR now available. |
* Add proper documentation to Guacamole.pm. * GH #88: Fix bareword STDIN with -t and file op precedence. * GH #87: Document Standard Perl in standard.pm. * GH #89: Added '|' as a delimiter for QLike values. * GH #90: Support methods without arglists (Thanks, chromatic!) * GH #93: Explain Standard Perl better. (Thanks, brian d foy) * GH #97: Fix test dependency. (Thanks, Graham @plicease Ollis)
This is now available in 0.005, on CPAN: https://metacpan.org/pod/standard. |
This is issue is resolved after testing with 0.005. |
Consider the following code to remove
https://
from a stringI think alternate regexp delimiters should be considered standard. At least some primary chars like:
|
,/
,!', and maybe
@` should be OK.The text was updated successfully, but these errors were encountered: