Tue Mar 29 09:21:18 2011szabgab [...] gmail.com - Ticket created
Subject:
Use of uninitialized value $v in split at .../CGI/Simple.pm line 704.
Date:
Tue, 29 Mar 2011 15:21:09 +0200
To:
bug-CGI-Simple [...] rt.cpan.org
From:
Gabor Szabo <szabgab [...] gmail.com>
perl -w -MCGI::Simple -e'$c = CGI::Simple->new; $v = $c->Vars;
$v->{nosuch} = undef'
generates the warning
Use of uninitialized value $v in split at .../CGI/Simple.pm line 704.
Is this considered a bug?
Gabor
Sat Oct 06 02:51:34 2018MANWAR [...] cpan.org - Correspondence added
Hi Gabor,
Thanks for reporting the issue.
What do you think is better approach?
sub STORE {
my ( $q, $p, $v ) = @_;
return unless defined $v;
$q->param( $p, split $q->{'.sep'}, $v );
}
or
sub STORE {
my ( $q, $p, $v ) = @_;
no warnings 'uninitialized';
$q->param( $p, split $q->{'.sep'}, $v );
}
Sat Oct 06 02:51:35 2018The RT System itself - Status changed from 'new' to 'open'
Sat Oct 06 02:51:35 2018MANWAR [...] cpan.org - Taken
Sat Oct 06 02:52:06 2018MANWAR [...] cpan.org - Severity Normal added
Sat Oct 06 02:52:06 2018MANWAR [...] cpan.org - Broken in 1.20 added
Sat Oct 06 03:05:04 2018gabor [...] szabgab.com - Correspondence added
Subject:
Re: [rt.cpan.org #67061] Use of uninitialized value $v in split at .../CGI/Simple.pm line 704.
Date:
Sat, 6 Oct 2018 07:04:39 +0000
To:
bug-CGI-Simple [...] rt.cpan.org
From:
Gabor Szabo <gabor [...] szabgab.com>
I don't remember the whole thing but out of those two snippets I'd
prefer the first one as that is more explicit.
Gabor
On Sat, Oct 6, 2018 at 6:51 AM Mohammad Sajid Anwar via RT
<bug-CGI-Simple@rt.cpan.org> wrote:
Show quoted text
>
> Queue: CGI-Simple
> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=67061 >
>
> Hi Gabor,
>
> Thanks for reporting the issue.
> What do you think is better approach?
>
> sub STORE {
> my ( $q, $p, $v ) = @_;
> return unless defined $v;
> $q->param( $p, split $q->{'.sep'}, $v );
> }
>
>
> or
>
> sub STORE {
> my ( $q, $p, $v ) = @_;
> no warnings 'uninitialized';
> $q->param( $p, split $q->{'.sep'}, $v );
> }
Sat Oct 06 03:13:40 2018MANWAR [...] cpan.org - Correspondence added
Good advise.
I will release the patch soon.
Sat Oct 06 19:24:55 2018MANWAR [...] cpan.org - Status changed from 'open' to 'resolved'
Sat Oct 06 19:24:57 2018MANWAR [...] cpan.org - Fixed in 1.21 added