git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Start encouraging English.pm (Was: [PATCH v2] git-send-email.perl: Add sub maildomain_sanitize)

From
Jari Aalto <jari.aalto@cante.net>
Date
Apr 16, 2010, 17:00 UTC
Message-ID
<87iq7rqqn3.fsf_-_@jondo.cante.net>
In-Reply-To
<201004161811.14259.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 5 quoted lines
> O.K.
>
>
> Note however that while setting $_ ($ARG with English) simplifies regexp
> matching
Speaking of which...
Could we please move to using this everywhere:
    use English qw( -no_match_vars );

That would give all the benefits of readability without performance penalties. The load time seems to be neglible:

    $ perl --version | grep v5
    This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
    $ time perl -e 'print'
    real    0m0.005s
    user    0m0.000s
    sys     0m0.004s
    $ time perl -e 'use English qw( -no_match_vars ); print'
    real    0m0.017s
    user    0m0.008s
    sys     0m0.008s
> you have to take care to use
>
>> +sub maildomain_sanitize {
>> +	local $_ = shift;
Show 7 quoted lines
>    local $_ = shift;
>
> and not
>
>    my $_ = shift; 
>
> And to use 'local'.
As done.

The Perl 5.12 now finally allow my'ing of $ARG too. But maybe we don't switch to it just yet...

Jari
Previous: Jakub NarebskiNext: Brian Gernhardt
Message 9 of 12 in “send-email: --smtp-domain improvements”
  1. 0/3 send-email: --smtp-domain improvementsBrian Gernhardt, Apr 9, 2010
  2. 1/3 send-email: Don't use FQDNs without a '.'Brian Gernhardt, Apr 9, 2010
  3. Junio C HamanoApr 9, 2010
  4. git-send-email.perl: Add sub maildomain_sanitizeJari Aalto, Apr 13, 2010
  5. git-send-email.perl: add maildomain_sanitize()Jari Aalto, Apr 13, 2010
  6. Jakub NarebskiApr 15, 2010
  7. git-send-email.perl: Add sub maildomain_sanitizeJari Aalto, Apr 16, 2010
  8. Jakub NarebskiApr 16, 2010
  9. Jari AaltoApr 16, 2010
  10. 2/3 Document send-email --smtp-domainBrian Gernhardt, Apr 9, 2010
  11. 3/3 send-email: Add sendemail.smtpdomainBrian Gernhardt, Apr 9, 2010
  12. Jakub NarebskiApr 9, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.