Commits

Toby Inkster committed 7b11ebd

Perl 5.8 backcompat

  • Participants
  • Parent commits 9147e8c
  • Tags 0.005

Comments (0)

Files changed (2)

File lib/DateTimeX/Auto.pm

 
 	BEGIN {
 		$DateTimeX::Auto::AUTHORITY = 'cpan:TOBYINK';
-		$DateTimeX::Auto::VERSION   = '0.004';
+		$DateTimeX::Auto::VERSION   = '0.005';
 	}
 
 	sub import
 		if ($string =~ /^(\d{4})-(0[1-9]|1[0-2])-([0-2][0-9]|30|31)(Z?)$/)
 		{
 			my $dt;
-			my $z = $4 // '';
+			my $z = defined($4) ? $4 : '';
 			eval {
 				$dt = $class->SUPER::new( year => $1, month=>$2, day=>$3, hour=>0, minute=>0, second=>0 );
 				$dt->{+__PACKAGE__}{format} = 'D';
 		if ($string =~ /^(\d{4})-(0[1-9]|1[0-2])-([0-2][0-9]|30|31)T([0-1][0-9]|2[0-4]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(Z?)$/)
 		{
 			my $dt;
-			my $z    = $8 // '';
-			my $nano = $7 // '';
+			my $z    = defined($8) ? $8 : '';
+			my $nano = defined($7) ? $7 : '';
 			eval {
 				$dt = $class->SUPER::new( year => $1, month=>$2, day=>$3, hour=>$4, minute=>$5, second=>$6 );
 				$dt->{+__PACKAGE__}{format} = 'DT';
 			return $self->SUPER::_stringify;
 		}
 		
-		my $trailer = $self->{+__PACKAGE__}{trailer} // '';
+		my $trailer = $self->{+__PACKAGE__}{trailer};
+		$trailer = '' unless defined $trailer;
 		
 		if ($self->{+__PACKAGE__}{format} eq 'D')
 		{
 
 	BEGIN {
 		$DateTimeX::Auto::Duration::AUTHORITY = 'cpan:TOBYINK';
-		$DateTimeX::Auto::Duration::VERSION   = '0.004';
+		$DateTimeX::Auto::Duration::VERSION   = '0.005';
 	}
 
 	sub new

File meta/changes.ttl

 		dcs:item   [ rdfs:label "Support DateTime::Durations."@en ; a dcs:Addition ]
 		] .
 
+my:project :release my:v_0-005.
+my:v_0-005
+	a               :Version ;
+	dc:issued       "2012-05-20"^^xsd:date ;
+	:revision       "0.005"^^xsd:string ;
+	:file-release   <http://backpan.cpan.org/authors/id/T/TO/TOBYINK/DateTimeX-Auto-0.005.tar.gz> ;
+	rdfs:label      "The 'Why You No Upgrade?' Release";
+	dcs:changeset [
+		dcs:versus my:v_0-004 ;
+		dcs:item   [ rdfs:label "Replace a few uses of the defined-or operator (//) with defined($foo)?$foo:$bar, for back-compat with Perl 5.8."@en ; a dcs:Bugfix ]
+		] .
+