#To store the values $str = $epoch . "SpLiTvAlUe" . $url . ""SpLiTvAlUe" . $desc; # To print the values unshift (@array, $str); if (@array > 10){ pop(@array) } foreach (@array){ my ($epoch, $url, $desc)= split (/\"SpLiTvAlUe\"/); print $epoch . " " . $url . " " . $desc . "\n"; }