If you provide one or more string arguments, they are concatenated
together with spaces and placed between opening and closing tags.
Since "=>" is exactly the same as "," except that is converts the
token to the left of itself to a string, what you are passing is in
fact two strings, not a single-pair hash reference.
Again from CGI:
If the first argument is an associative array reference,
then the keys and values of the associative array become
the HTML tag's attributes:
print a({-href=>'fred.html',-target=>'_new'},
"Open a new frame");
So what you need to write is this:
print $cgi->img ({-src => '../../../images/foo.png'});
since { ... } is how you generate a hash reference in-place. For
arrays, it's [ ... ]. You can remember them because the brackets used
for construction are the same as those used for access. You would not
believe how long it took for me to realise that.
God, I love that camel!
Paul.
--
Paul Collins <sneakums at eircom.net> - - - - - [ A&P,a&f ]
GPG: 0A49 49A9 2932 0EE5 89B2 9EE0 3B65 7154 8131 1BCD
PGP: 88BA 2393 8E3C CECF E43A 44B4 0766 DD71 04E5 962C
"Where? Where is the town? Now it's nothing but flowers!"
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!