in reply to Help with Perl/Catalyst/Mason
First of all, please check the generated HTML (javascript) code, and see if there is anything abnormal about it. That is always your best bet to debug these sorts of things.
Second, you ought to learn how to use Mason as a templating language. The Mason book is available for free online reading. Please read about the different blocks available (<%args>, <%init> at the very least), and for $DEITY's sake, please do not embed that much code in the middle of your HTML. Mason is fairly good in separating code and HTML. Here's your code rewritten:
<%args> $foo $bar $baz $biz </%args> ... your html code ... deletes += <% $del_count %>; if(deletes > 0) { return confirm('Delete ' . + deletes + . 'Items? '); } ... your html code ... <%init> my @update = split(/,/, $biz); my $del_count = 0; if ($baz == 2 and and{ $tab_id == $_ } @update) { # ??? foreach ($foo, $bar) { $del_count += scalar split(/,/, $_); } } </%init>
I don't know what is wrong with your code, but I do wonder what and{ $tab_id == $_ } @update is supposed to mean...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with Perl/Catalyst/Mason
by Anonymous Monk on Jun 30, 2012 at 10:36 UTC | |
by sharkeyph (Initiate) on Jul 02, 2012 at 19:04 UTC | |
by sharkeyph (Initiate) on Jul 02, 2012 at 19:14 UTC | |
by Anonymous Monk on Jul 03, 2012 at 08:47 UTC | |
|
Re^2: Help with Perl/Catalyst/Mason
by sharkeyph (Initiate) on Jul 02, 2012 at 19:03 UTC |