how to debug Mason code?

"-, -" <[email protected]> Thu, 11 Sep 2014 11:58:22 +0200
Newsgroups gmane.comp.web.mason.user
Message-ID <CAGpMhKxRZT6L7CT891wuameRWNOg4R0hFQuMUk_e8jG=dQHU_g@mail.gmail.com>
--===============0465085851830204982==
Content-Type: multipart/alternative; boundary=001a11c165307a80d30502c735e9

--001a11c165307a80d30502c735e9
Content-Type: text/plain; charset=UTF-8

Dear Mason-users!

I'm a software developer from Hungary. We've got a large code which is a
mix of HTML, Perl, and special Mason commands. Our task is to understand,
maintain and develop this code.

My question: is there any tool out there which we were able to debug our
code effectivly? We would like to use breakpoints, step into and step over
functions, watch variables while the code is running line-by-line, etc...
Or... is there any way for example to force Komodo or Eclipse to
handle/able to debug Mason code?

Our giant code has the structure shown below:

<script type="text/javascript">
    function validateform() {
        var example1  = /example/;
        var example2     = example;
        <JAVASCRIPT CODE HERE>
    (function($) {
        $(document).ready(function(){
            var msg = '<% $message %>';
            });
    })(jQuery);
</script>

<link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
<div id="debug" style="display:none"></div>
% if ($info->{attr_changed} =~ /y/) {
    <div class="alert-status" >
    <EXAMPLE>
    </div>
% }


<%method example>
    <%init>
        my $f = $path;
        my $result = open my $fh, "<", $f;

         if(!$result) {
die "Couldn't open '".$f."' for reading because: ".$!;
          }

                 my $line_counter;
                 while(!eof $fh) {
$line_counter++;
                          my $line = readline $fh;
if (index($line, $userinput) > 0) {
                                         print "EXAMPLE"\n";
                                         print "\n" . $line =~
m/($userinput)/;
                          }
}
    </%init>
</%method>



We would like to debug our Mason/Javascript/Perl code line-by-line and
watching the variables meanwhile. Is it possible?
Our problem is that for example Firebug never displays the mason scripts
and the Perl code... so I'm unable to put breakpoints into the code, etc.

Please help!

Thank you very much for your answer,
Regards,
Zoltan Trencsenyi

--001a11c165307a80d30502c735e9
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><font face=3D"arial, sans-serif">Dear Mason-users!</font><=
br><div style=3D"font-size:13px;font-family:arial,sans-serif"><span style=
=3D"color:rgb(0,0,0);font-family:&#39;Times New Roman&#39;;font-size:medium=
"><br></span></div><div style=3D"font-size:13px;font-family:arial,sans-seri=
f"><span style=3D"color:rgb(0,0,0);font-family:&#39;Times New Roman&#39;;fo=
nt-size:medium">I&#39;m a software developer from Hungary.=C2=A0</span><spa=
n style=3D"color:rgb(0,0,0);font-family:&#39;Times New Roman&#39;;font-size=
:medium">We&#39;ve got a large code which is=C2=A0</span><span style=3D"col=
or:rgb(0,0,0);font-family:&#39;Times New Roman&#39;;font-size:medium">a mix=
 of HTML, Perl, and special Mason commands. Our task is to understand, main=
tain and develop this code.</span></div><div style=3D"font-size:13px;font-f=
amily:arial,sans-serif"><span style=3D"color:rgb(0,0,0);font-family:&#39;Ti=
mes New Roman&#39;;font-size:medium"><br></span></div><div style=3D"font-si=
ze:13px;font-family:arial,sans-serif"><font color=3D"#000000" face=3D"Times=
 New Roman" size=3D"3">My question: is there any tool out there which we we=
re able to debug our code effectivly? We would like to use breakpoints, ste=
p into and step over functions, watch variables while the code is running l=
ine-by-line, etc...</font></div><div style=3D"font-size:13px;font-family:ar=
ial,sans-serif"><font color=3D"#000000" face=3D"Times New Roman" size=3D"3"=
>Or... is there any way for example to force Komodo or Eclipse to handle/ab=
le to debug Mason code?=C2=A0</font></div><div style=3D"font-size:13px;font=
-family:arial,sans-serif"><font color=3D"#000000" face=3D"Times New Roman" =
size=3D"3"><br></font></div><div><font color=3D"#000000" face=3D"Times New =
Roman" size=3D"3">Our giant code has the structure shown below:</font></div=
><div><font color=3D"#000000" face=3D"Times New Roman" size=3D"3"><br></fon=
t></div><div><font color=3D"#000000" face=3D"Times New Roman" size=3D"3"><d=
iv>&lt;script type=3D&quot;text/javascript&quot;&gt;</div><div>=C2=A0 =C2=
=A0 function validateform() {</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 var exa=
mple1 =C2=A0=3D /example/;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 var exampl=
e2 =C2=A0 =C2=A0 =3D example;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 &lt;JAV=
ASCRIPT CODE HERE&gt;</div><div>=C2=A0 =C2=A0 (function($) {<br></div><div>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 $(document).ready(function(){</div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 var msg =3D &#39;&lt;% $message %&gt;&#3=
9;;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 });<br></div><div>=
=C2=A0 =C2=A0 })(jQuery);</div><div>&lt;/script&gt;</div><div><br></div><di=
v>&lt;link rel=3D&quot;stylesheet&quot; type=3D&quot;text/css&quot; href=3D=
&quot;css/stylesheet.css&quot; /&gt;</div><div>&lt;div id=3D&quot;debug&quo=
t; style=3D&quot;display:none&quot;&gt;&lt;/div&gt;</div><div>% if ($info-&=
gt;{attr_changed} =3D~ /y/) {</div><div>=C2=A0 =C2=A0 &lt;div class=3D&quot=
;alert-status&quot; &gt;</div><div>=C2=A0 =C2=A0 &lt;EXAMPLE&gt;</div><div>=
=C2=A0 =C2=A0 &lt;/div&gt;</div><div>% }</div><div><br></div><div><br></div=
><div>&lt;%method example&gt;</div><div>=C2=A0 =C2=A0 &lt;%init&gt;</div><d=
iv>=C2=A0 =C2=A0 =C2=A0 =C2=A0 my $f =3D $path;</div><div>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 my $result =3D open my $fh, &quot;&lt;&quot;, $f;</div><div><br>=
</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if(!$result) {</div><div><span=
 class=3D"" style=3D"white-space:pre">           	</span>die &quot;Couldn&#=
39;t open &#39;&quot;.$f.&quot;&#39; for reading because: &quot;.$!;</div><=
div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }</div><div><br></div><div>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0my $line_counter;</d=
iv><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0while=
(!eof $fh) {</div><div><span class=3D"" style=3D"white-space:pre">	        =
          </span>$line_counter++;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 my $line =3D re=
adline $fh;</div><div><span class=3D"" style=3D"white-space:pre">	         =
         </span>if (index($line, $userinput) &gt; 0) {</div><div>=C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print &quot;E=
XAMPLE&quot;\n&quot;;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0print &quot;\n&quot; . $line =3D~ m/($userin=
put)/;</div><div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }</div><div>}</div><div>=C2=A0 =C2=A0 &l=
t;/%init&gt;</div><div>&lt;/%method&gt;</div></font></div><div style=3D"fon=
t-size:13px;font-family:arial,sans-serif"><font color=3D"#000000" face=3D"T=
imes New Roman" size=3D"3"><br></font></div><div style=3D"font-size:13px;fo=
nt-family:arial,sans-serif"><br></div><div style=3D"font-size:13px;font-fam=
ily:arial,sans-serif"><font color=3D"#000000" face=3D"Times New Roman" size=
=3D"3"><br></font></div><div style=3D"font-size:13px;font-family:arial,sans=
-serif"><font color=3D"#000000" face=3D"Times New Roman" size=3D"3">We woul=
d like to debug our Mason/Javascript/Perl code line-by-line and watching th=
e variables meanwhile. Is it possible?</font></div><div style=3D"font-size:=
13px;font-family:arial,sans-serif"><font color=3D"#000000" face=3D"Times Ne=
w Roman" size=3D"3">Our problem is that for example Firebug never displays =
the mason scripts and the Perl code... so I&#39;m unable to put breakpoints=
 into the code, etc.</font></div><div style=3D"font-size:13px;font-family:a=
rial,sans-serif"><br></div><div style=3D"font-size:13px;font-family:arial,s=
ans-serif">Please help!</div><div style=3D"font-size:13px;font-family:arial=
,sans-serif"><font color=3D"#000000" face=3D"Times New Roman" size=3D"3"><b=
r></font></div><div style=3D"font-size:13px;font-family:arial,sans-serif"><=
font color=3D"#000000" face=3D"Times New Roman" size=3D"3">Thank you very m=
uch for your answer,</font></div><div style=3D"font-size:13px;font-family:a=
rial,sans-serif"><font color=3D"#000000" face=3D"Times New Roman" size=3D"3=
">Regards,</font></div><div style=3D"font-size:13px;font-family:arial,sans-=
serif"><font color=3D"#000000" face=3D"Times New Roman" size=3D"3">Zoltan T=
rencsenyi</font></div></div>

--001a11c165307a80d30502c735e9--


--===============0465085851830204982==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
--===============0465085851830204982==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

--===============0465085851830204982==--