in reply to
A quick date swap from a string
You declare "my $date" twice:
my $date= shift; ... my $date;
The second one creates a new lexical with an undefined value. So the subsequent substitution and return are working with undef;
Comment on
Re: A quick date swap from a string
In Section
Seekers of Perl Wisdom