Thread View: news.software.readers
4 messages
4 total messages
Started by Ignatios Souvatzis
Fri, 10 Dec 2010 14:23
[slrn] cleanscore: Warnings with new perl
Author: Ignatios Souvatzis
Date: Fri, 10 Dec 2010 14:23
Date: Fri, 10 Dec 2010 14:23
65 lines
3221 bytes
3221 bytes
I stumbled upon this after upgrading perl:
marie bin !% cleanscore.old
Prototype after '%' for main::insert_comment : %% at cleanscore.old line 30.
Prototype after '%' for main::end_of_score : %$ at cleanscore.old line 31.
Prototype after '%' for main::end_of_score : %$ at cleanscore.old line 326.
Prototype after '%' for main::insert_comment : %% at cleanscore.old line 358.
After some headaches leater, trying to understand perltut and perlsub and
the code in question, I came up with the appended patch (integrated in
pkgsrc since then, and sent to the author).
Apparently, the prototypes were added a bit hastily ... or whoever
added them, knew as much about them as I did yesterday morning.
En detail:
sub foo(%) eats all parameters and passes them as a list. Inside
the sub you get the parameters one by one with "shift", for example.
sub foo(\%\%) expects two hashes as parameters (but you'd have to
consume them that way inside the subroutine).
sub foo(%%) ... well... on a call, still all parameters are eaten
and processed into a list for the subroutine, and the 2nd %, or
the $ after the %, or whatever, used to be silently ignored for a
couple of years, but nowadays it creates a warning.
Regards,
-is
$NetBSD: patch-aa,v 1.1 2010/12/09 14:59:37 is Exp $
--- cleanscore.orig 2010-12-09 12:33:33.000000000 +0000
+++ cleanscore
@@ -27,8 +27,8 @@ use Getopt::Std;
sub help();
sub reset_vars(%);
-sub insert_comment(%%);
-sub end_of_score(%$);
+sub insert_comment(%);
+sub end_of_score(%);
sub clean_file($);
# globals variables.
@@ -323,7 +323,7 @@ sub clean_file($)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-sub end_of_score(%$)
+sub end_of_score(%)
{
my $entry = shift;
my $file_is_changed = shift;
@@ -355,7 +355,7 @@ sub end_of_score(%$)
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-sub insert_comment(%%)
+sub insert_comment(%)
{
my $comment=shift;
my $entry=shift;
Re: [slrn] cleanscore: Warnings with new perl
Author: Adam Funk
Date: Mon, 13 Dec 2010 19:26
Date: Mon, 13 Dec 2010 19:26
17 lines
1771 bytes
1771 bytes
On 2010-12-10, Ignatios Souvatzis wrote:
> I stumbled upon this after upgrading perl:
>
> marie bin !% cleanscore.old
> Prototype after '%' for main::insert_comment : %% at cleanscore.old line 30.
> Prototype after '%' for main::end_of_score : %$ at cleanscore.old line 31.
> Prototype after '%' for main::end_of_score : %$ at cleanscore.old line 326.
> Prototype after '%' for main::insert_comment : %% at cleanscore.old line 358.
What version of perl? (I'm now using 5.10.1 & I've never seen those
errors.)
--
History teaches that grave threats to liberty often come in times of
urgency, when constitutional rights seem too extravagant to endure.
(Thurgood Marshall)
Re: [slrn] cleanscore: Warnings with new perl
Author: Ignatios Souvatzis
Date: Tue, 14 Dec 2010 14:40
Date: Tue, 14 Dec 2010 14:40
25 lines
2040 bytes
2040 bytes
Adam Funk wrote: > On 2010-12-10, Ignatios Souvatzis wrote: > >> I stumbled upon this after upgrading perl: >> >> marie bin !% cleanscore.old >> Prototype after '%' for main::insert_comment : %% at cleanscore.old line 30. >> Prototype after '%' for main::end_of_score : %$ at cleanscore.old line 31. >> Prototype after '%' for main::end_of_score : %$ at cleanscore.old line 326. >> Prototype after '%' for main::insert_comment : %% at cleanscore.old line 358. > > What version of perl? (I'm now using 5.10.1 & I've never seen those > errors.) |% perl -v | fmt | head -5 |This is perl 5, version 12, subversion 2 (v5.12.2) built for |arm-netbsd-thread-multi | |Copyright 1987-2010, Larry Wall | Regards, -is -- seal your e-mail: http://www.gnupg.org/
Re: [slrn] cleanscore: Warnings with new perl
Author: Adam Funk
Date: Thu, 16 Dec 2010 12:16
Date: Thu, 16 Dec 2010 12:16
30 lines
1986 bytes
1986 bytes
On 2010-12-14, Ignatios Souvatzis wrote: > Adam Funk wrote: >> On 2010-12-10, Ignatios Souvatzis wrote: >> >>> I stumbled upon this after upgrading perl: >>> >>> marie bin !% cleanscore.old >>> Prototype after '%' for main::insert_comment : %% at cleanscore.old line 30. >>> Prototype after '%' for main::end_of_score : %$ at cleanscore.old line 31. >>> Prototype after '%' for main::end_of_score : %$ at cleanscore.old line 326. >>> Prototype after '%' for main::insert_comment : %% at cleanscore.old line 358. >> >> What version of perl? (I'm now using 5.10.1 & I've never seen those >> errors.) > >|% perl -v | fmt | head -5 >|This is perl 5, version 12, subversion 2 (v5.12.2) built for >|arm-netbsd-thread-multi >| >|Copyright 1987-2010, Larry Wall >| Ah, something to look forward to. -- Unix is a user-friendly operating system. It's just very choosy about its friends.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads