in reply to getting a filename

For that matter, why not trim down the first few lines? If I count correctly, you check for the existence of these files three times: glob, -e, and readdir

I also think that a substr would be a much simpler idea here than a split command. (But I will concede that split(/im/,$message,2) will work fine)

foreach $from (glob("$free_path/$Account::cata_acc/_data/messages/im*" +)) { substr($from, 0, 2) = ''; # Delete the leading "im" print <<EOF; # Trimmed for brevity trim=window.open("...") trim.creator=self EOF }
buckaduck