[Rt-devel] Use of qw(...) as parentheses is deprecated
Walter Vargas
walter at covetel.com.ve
Thu Jun 9 01:29:02 EDT 2011
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]
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
--
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-devel/attachments/20110609/4f70b9ce/attachment.html>
More information about the rt-devel
mailing list