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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jakub Narebski <jnareb@xxxxxxxxx> writes:
> 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;

>    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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]