use strict;
sub main{
my $date = "some text with the numbers 2010063011 and more text";
print "Input Date: $date\n";
my ($year, $month, $day) = $date =~ /\b(\d{4})(\d{2})(\d{2})\b/;
print qq{
Date: $date
Year: $year
Month: $month
Day: $day\n} if (defined $year && defined $month && defined $day);
}
main();
, , 2010063011, , 20100630, .