Use of qw(...) as parentheses is deprecated

Regards,

I am implementing RT4 on Perl 5.14, and get the following warning when
starting RT:

[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]

[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: sip.covetel.com.ve Ext 276002
Táchira - Venezuela.

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