sub get_date_perl { my $date = substr( $_[0], index( $_[0], '|' ) + 1, 8 ); # skipping the scalars and doing return join '', unpack... # did not result in a performance improvement. my ( $month, $day, $year ) = unpack( "A2A2A4",$date ); return $year.$month.$day; }