[Rt-devel] Use of qw(...) as parentheses is deprecated

Kevin Falcone falcone at bestpractical.com
Thu Jun 9 09:13:37 EDT 2011


On Thu, Jun 09, 2011 at 12:59:02AM -0430, Walter Vargas wrote:
>    Regards,
>    I am implementing RT4 on Perl 5.14, and get the following warning when starting RT:

Thanks for the patch, this and one other warning was fixed in 137967c4
which is currently available in 4.0.1rc1 and will be part of 4.0.1

-kevin

>    [Thu Jun 9 04:40:20 2011] [warning]: Use of qw(...) as parentheses is deprecated at
>    /opt/rt4/sbin/../lib/RT/Articles.pm line 794. (/opt/rt4/sbin/../lib/RT/Articles.pm:794)
>    ---
>    Historically we could do:
>    for my $item qw(a b c){ . . . }
>    But this is deprecated since version 5.13.5 of Perl [1]
>    I know it's a harmless warning, but I'll fix it by doing the following: Patch [2]
>    diff --git a/Articles.pm b/Articles.pm
>    index 355a2bd..b25c514 100644
>    --- a/Articles.pm
>    +++ b/Articles.pm
>    @@ -583,7 +583,7 @@ sub Search {
>    require Time::ParseDate;
>    - foreach my $date qw(Created< Created> LastUpdated< LastUpdated>) {
>    + foreach my $date (qw(Created< Created> LastUpdated< LastUpdated>)) {
>    next unless ( $args{$date} );
>    my $seconds = Time::ParseDate::parsedate( $args{$date}, FUZZY => 1, PREFER_PAST => 1 );
>    my $date_obj = RT::Date->new( $self->CurrentUser );
>    @@ -791,7 +791,7 @@ sub Search {
>    );
>    }
>    - foreach my $field qw(Name Summary Class) {
>    + foreach my $field (qw(Name Summary Class)) {
>    my @MatchLike =
>    ( ref $args{ $field . "~" } eq 'ARRAY' )
>    [1]
>    [1]http://search.cpan.org/~jesse/perl-5.14.0/pod/perl5135delta.pod#Use_of_qw(...)_as_parentheses
>    [2] [2]http://www.covetel.com.ve/0001-Fixing-Warning-of-qw.patch
>    --
>    Walter Vargas
>    GNU/Linux ID: 269566
>    Debian Of Course!
>    Cooperativa Venezolana de Tecnolog*as Libres R.S.
>    Coordinador General.
>    @Movil 04165023755
>    @sip: [3]sip.covetel.com.ve Ext 276002
>    Tchira - Venezuela.
> 
> References
> 
>    Visible links
>    1. http://search.cpan.org/~jesse/perl-5.14.0/pod/perl5135delta.pod#Use_of_qw(...)_as_parentheses
>    2. http://www.covetel.com.ve/0001-Fixing-Warning-of-qw.patch
>    3. http://sip.covetel.com.ve/

> _______________________________________________
> List info: http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-devel/attachments/20110609/e7184253/attachment.pgp>


More information about the rt-devel mailing list