in reply to Re^2: Convert date
in thread Convert date
The following code does not print any warning for me:
>perl -wle "my $date='20080501'; $date =~ s/^(\d{4})(\d{2})(\d{2})$/$1 +-$2-$3/;print $date" 2008-05-01
So the problem must be with your other code and/or how you're using it. My guess is that $date in your case is not defined. Print out $date before trying a substitution on it:
print "I think \$date is [$date]\n";
|
|---|