SGML::DTD
Tony Bowden
tony at kasei.com
Tue Nov 20 06:10:06 CST 2001
On Mon, Nov 19, 2001 at 11:51:46PM +0000, Andrew McFarland wrote:
> foreach ($attributes{$_}) {print "$_"};
You almost certainly never want to print "$_" either, unless you're
absolutely sure you're trying to stringify.
You probably just want: print $_;
Which is equivalent to: print;
Which means you'd want:
print foreach $attributes{$_};
Not that that will work in this case either, if you've references
there, but it's a better plan in general.
Of course, if you're just trying to see what's there first in a case
like this for debugging, use Data::Dumper or Data::Denter rather than
rolling your own loop and print ....
Tony
More information about the Belfast-pm
mailing list