Hi, Anonymous Monk
Thanks for your calm advice and code. Below is code which worked.
$html .= $cgi->div({-id=>'container'},
$cgi->img({src=>'images/pic.png', height=>'100px',
+ width=>'150px'}),
(
(($session->is_expired) || ($session->is_empty))
? ($cgi->p("false"))
:($cgi->p("true"))
+
),
$cgi->div(
{-id=>'menu_bar'},
# rest of html
And here is code, which didn't
$html .= $cgi->div({-id=>'container'},
$cgi->img({src=>'images/pic.png', height=>'100px',
+ width=>'150px'}),
(
(while ($num <=5)
{($cgi->p($num))
($num++)})
),
$cgi->div(
{-id=>'menu_bar'},
What I did wrong in 'while' case.
I went through links, provided by you. So here $html .= $cgi->div#rest of code, is one big statement and rest of part on right side are expressions.
But, could not grasped the concept and structure behind parenthesis well.
And is it possible to use other Perl blocks in this fashion.?
|