Dear Wongsapat,
I assume that your input is a character state matrix, out of which you want to infer a tree, which you then want to display as a png image, correct?
The first thing you need to do is do the actual inference, for example under a maximum parsimony optimality criterion. For this you *cannot* use Bio::Phylo. Tree inference is very computationally intensive (because many possible tree shapes need to be evaluated) so a scripting language such as Perl is going to be too slow. You will want to use one of the commonly used programs for this such as paup, phylip, or others.
Once you have the tree, you can use Bio::Phylo to display it as a png image.
Good luck, best wishes,
Rutger