Skip Menu |

This queue is for tickets about the Params-Validate CPAN distribution.

Report information
The Basics
Id: 80250
Status: resolved
Priority: 0/
Queue: Params-Validate

People
Owner: Nobody in particular
Requestors: carnil [...] debian.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 1.06
  • 1.07
Fixed in: 1.09



From: CARNIL [...] cpan.org
Subject: "state" example in pod is broken
Hi This bug has been forwarded from http://bugs.debian.org/690735 There seem to be a small that the state example in POD is not working this way. Following [1] it seems correct what is suggested by Anthony. [1]: http://www.perlmonks.org/?node_id=794116 The original report follows: Package: libparams-validate-perl Version: 1.06-1 Severity: normal File: /usr/lib/perl5/Params/Validate.pm Show quoted text
>From the docs:
You can also use the "state" feature to do this: use feature 'state'; sub foo { state %spec = ( ... ); my %params = validate( @_, \%spec ); } Doesn't quite work: anthony@Zia:~$ perl -E 'state %foo = (a => 1)' Initialization of state variables in list context currently forbidden at -e line 1, at EOF Execution of -e aborted due to compilation errors. The example should read something like this: use feature 'state'; sub foo { state $spec = { ... }; my %params = validate( @_, $spec ); } Which, I confess, I haven't (yet) tested. Appears to be tradition :-P -- System Information: Debian Release: wheezy/sid APT prefers testing APT policy: (500, 'testing'), (200, 'unstable'), (150, 'stable'), (100, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 3.5-trunk-amd64 (SMP w/8 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages libparams-validate-perl depends on: ii libc6 2.13-35 ii libmodule-implementation-perl 0.06-1 ii perl 5.14.2-13 ii perl-base [perlapi-5.14.2] 5.14.2-13 libparams-validate-perl recommends no packages. libparams-validate-perl suggests no packages. -- no debconf information Thanks in advance, Salvatore Bonaccorso, Debian Perl Group
Subject: Re: [rt.cpan.org #80250] Resolved: "state" example in pod is broken
Date: Thu, 1 Nov 2012 22:05:51 +0100
To: Dave Rolsky via RT <bug-Params-Validate [...] rt.cpan.org>
From: Salvatore Bonaccorso <carnil [...] debian.org>
Hi There still seem to be a small 'glitch' in the documentation, 1.07 changes: @@ -579,7 +579,7 @@ You can also use the C<state> feature to do this: use feature 'state'; sub foo { - state %spec = ( ... ); + state $spec = { ... }; my %params = validate( @_, \%spec ); } But in the second line there is \%spec, should then also be $spec. Regards, Salvatore
Download signature.asc
application/pgp-signature 836b

Message body not shown because it is not plain text.