LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

No subject

No subject


Wed Jul 5 18:17:25 IST 2006


    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!"





More information about the Webdev mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell