From 674160c45cd60d2e3584ae17f183a51a7a35f7ae Mon Sep 17 00:00:00 2001 From: hjp Date: Fri, 15 Aug 2003 21:28:39 +0000 Subject: [PATCH] Avoid warning about undefinded value when calling legend for the first time. --- TimeSeries.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TimeSeries.pm b/TimeSeries.pm index 91ac301..f236e3e 100644 --- a/TimeSeries.pm +++ b/TimeSeries.pm @@ -6,7 +6,7 @@ use Data::Dumper; use HTTP::Date qw(parse_date); use Time::Local qw(timegm_nocheck); -$VERSION = do { my @r=(q$Revision: 1.6 $=~/\d+/g);sprintf "%d."."%02d"x$#r,@r}; +$VERSION = do { my @r=(q$Revision: 1.7 $=~/\d+/g);sprintf "%d."."%02d"x$#r,@r}; sub new { my ($class, %opts) = @_; @@ -54,7 +54,7 @@ sub legend { my ($self, @legend) = @_; my $oldlegend = $self->{legend}; $self->{legend} = [@legend] if (@legend); - return @$oldlegend; + return $oldlegend ? @$oldlegend : (); } sub style {