Skip Menu |

This queue is for tickets about the Data-ICal CPAN distribution.

Report information
The Basics
Id: 17648
Status: resolved
Priority: 0/
Queue: Data-ICal

People
Owner: Nobody in particular
Requestors: mark [...] summersault.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.07
Fixed in: (no value)



Subject: PATCH: squelch warnings.
This patch addresses a number of warnings that can come about when there are undefined values being passed around.
Subject: warnings.patch
--- old-mark/perllib/Data/ICal/Property.pm 2006-01-20 16:37:04.000000000 -0500 +++ new-mark-2/perllib/Data/ICal/Property.pm 2006-02-14 11:10:57.000000000 -0500 @@ -75,6 +75,8 @@ sub as_string { my $self = shift; + # squelch warnings like: Use of uninitialized value in concatenation + no warnings; my $string = uc( $self->key ) . $self->_parameters_as_string . ":" . $self->_value_as_string . "\n"; @@ -100,6 +102,7 @@ sub _value_as_string { my $self = shift; my $value = $self->value(); + return undef unless defined $value; $value =~ s/\\/\\/gs; $value =~ s/\Q;/\\;/gs;
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #17648] PATCH: squelch warnings.
Date: Tue, 14 Feb 2006 11:33:28 -0500
To: Guest via RT <bug-Data-ICal [...] rt.cpan.org>
From: jesse <jesse [...] fsck.com>
Show quoted text
> + # squelch warnings like: Use of uninitialized value in concatenation > + no warnings; > my $string = uc( $self->key ) > . $self->_parameters_as_string . ":" > . $self->_value_as_string . "\n";
I think I'd be happier with a variant that initialized what we're returning or tested the undef, rather than the large hammer.
Subject: Re: [rt.cpan.org #17648] PATCH: squelch warnings.
Date: Tue, 14 Feb 2006 11:46:12 -0500
To: Jesse via RT <bug-Data-ICal [...] rt.cpan.org>
From: Mark Stosberg <mark [...] summersault.com>
On Tue, Feb 14, 2006 at 11:33:38AM -0500, Jesse via RT wrote: Show quoted text
> > + # squelch warnings like: Use of uninitialized value in concatenation > > + no warnings; > > my $string = uc( $self->key ) > > . $self->_parameters_as_string . ":" > > . $self->_value_as_string . "\n";
> > I think I'd be happier with a variant that initialized what we're > returning or tested the undef, rather than the large hammer.
I agree that would be better. Feel free to refactor in that direction. Mark