Re: how to debug Mason code?

Jonathan Swartz <[email protected]> Sat, 13 Sep 2014 07:48:46 -0700
Newsgroups gmane.comp.web.mason.user
Message-ID <[email protected]>
--===============8544399438196489046==
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_7978BE4C-4668-4ABE-B15C-039E067B98D9"


--Apple-Mail=_7978BE4C-4668-4ABE-B15C-039E067B98D9
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

What web framework is this - mod_perl?

On Sep 11, 2014, at 2:58 AM, -, - <[email protected]> wrote:

> Dear Mason-users!
>=20
> 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.
>=20
> 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?=20
>=20
> Our giant code has the structure shown below:
>=20
> <script type=3D"text/javascript">
>     function validateform() {
>         var example1  =3D /example/;
>         var example2     =3D example;
>         <JAVASCRIPT CODE HERE>
>     (function($) {
>         $(document).ready(function(){
>             var msg =3D '<% $message %>';
>             });
>     })(jQuery);
> </script>
>=20
> <link rel=3D"stylesheet" type=3D"text/css" href=3D"css/stylesheet.css" =
/>
> <div id=3D"debug" style=3D"display:none"></div>
> % if ($info->{attr_changed} =3D~ /y/) {
>     <div class=3D"alert-status" >
>     <EXAMPLE>
>     </div>
> % }
>=20
>=20
> <%method example>
>     <%init>
>         my $f =3D $path;
>         my $result =3D open my $fh, "<", $f;
>=20
>          if(!$result) {
>            	die "Couldn't open '".$f."' for reading because: ".$!;
>           }
>=20
>                  my $line_counter;
>                  while(!eof $fh) {
> 	                  $line_counter++;
>                           my $line =3D readline $fh;
> 	                  if (index($line, $userinput) > 0) {
>                                          print "EXAMPLE"\n";
>                                          print "\n" . $line =3D~ =
m/($userinput)/;
>                           }
> }
>     </%init>
> </%method>
>=20
>=20
>=20
> 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.
>=20
> Please help!
>=20
> Thank you very much for your answer,
> Regards,
> Zoltan Trencsenyi
> =
--------------------------------------------------------------------------=
----
> 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=3D157508191&iu=3D/4140/ostg.=
clktrk_______________________________________________
> Mason-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mason-users


--Apple-Mail=_7978BE4C-4668-4ABE-B15C-039E067B98D9
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=us-ascii

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space;"><div>What web framework is this - =
mod_perl?</div><br><div><div>On Sep 11, 2014, at 2:58 AM, -, - &lt;<a =
href=3D"mailto:[email protected]">[email protected]</a>&gt; =
wrote:</div><br class=3D"Apple-interchange-newline"><blockquote =
type=3D"cite"><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"font-family: 'Times New Roman'; font-size: =
12px;"><br></span></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><span =
style=3D"font-family: 'Times New Roman'; font-size: 12px;">I'm a =
software developer from Hungary.&nbsp;</span><span style=3D"font-family: =
'Times New Roman'; font-size: 12px;">We've got a large code which =
is&nbsp;</span><span style=3D"font-family: 'Times New Roman'; font-size: =
12px;">a mix of HTML, Perl, and special Mason commands. Our task is to =
understand, maintain and develop this code.</span></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><span =
style=3D"font-family: 'Times New Roman'; font-size: =
12px;"><br></span></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><font face=3D"Times =
New Roman" size=3D"3">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...</font></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><font face=3D"Times =
New Roman" size=3D"3">Or... is there any way for example to force Komodo =
or Eclipse to handle/able to debug Mason code?&nbsp;</font></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><font face=3D"Times =
New Roman" size=3D"3"><br></font></div><div><font face=3D"Times New =
Roman" size=3D"3">Our giant code has the structure shown =
below:</font></div><div><font face=3D"Times New Roman" =
size=3D"3"><br></font></div><div><font face=3D"Times New Roman" =
size=3D"3"><div>&lt;script type=3D"text/javascript"&gt;</div><div>&nbsp; =
&nbsp; function validateform() {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; =
var example1 &nbsp;=3D /example/;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; =
var example2 &nbsp; &nbsp; =3D example;</div><div>&nbsp; &nbsp; &nbsp; =
&nbsp; &lt;JAVASCRIPT CODE HERE&gt;</div><div>&nbsp; &nbsp; (function($) =
{<br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; =
$(document).ready(function(){</div><div>&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; var msg =3D '&lt;% $message %&gt;';</div><div>&nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });<br></div><div>&nbsp; &nbsp; =
})(jQuery);</div><div>&lt;/script&gt;</div><div><br></div><div>&lt;link =
rel=3D"stylesheet" type=3D"text/css" href=3D"css/stylesheet.css" =
/&gt;</div><div>&lt;div id=3D"debug" =
style=3D"display:none"&gt;&lt;/div&gt;</div><div>% if =
($info-&gt;{attr_changed} =3D~ /y/) {</div><div>&nbsp; &nbsp; &lt;div =
class=3D"alert-status" &gt;</div><div>&nbsp; &nbsp; =
&lt;EXAMPLE&gt;</div><div>&nbsp; &nbsp; &lt;/div&gt;</div><div>% =
}</div><div><br></div><div><br></div><div>&lt;%method =
example&gt;</div><div>&nbsp; &nbsp; &lt;%init&gt;</div><div>&nbsp; =
&nbsp; &nbsp; &nbsp; my $f =3D $path;</div><div>&nbsp; &nbsp; &nbsp; =
&nbsp; my $result =3D open my $fh, "&lt;", =
$f;</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;if(!$result) {</div><div><span class=3D"" style=3D"white-space:pre">=
           	</span>die "Couldn't open '".$f."' for reading because: =
".$!;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
}</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp;my $line_counter;</div><div>&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;while(!eof $fh) =
{</div><div><span class=3D"" style=3D"white-space:pre">	                 =
 </span>$line_counter++;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $line =3D =
readline $fh;</div><div><span class=3D"" style=3D"white-space:pre">	 =
                 </span>if (index($line, $userinput) &gt; 0) =
{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp;print "EXAMPLE"\n";</div><div>&nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print "\n" . =
$line =3D~ m/($userinput)/;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
}</div><div>}</div><div>&nbsp; &nbsp; =
&lt;/%init&gt;</div><div>&lt;/%method&gt;</div></font></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><font face=3D"Times =
New Roman" size=3D"3"><br></font></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><br></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><font face=3D"Times =
New Roman" size=3D"3"><br></font></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><font face=3D"Times =
New Roman" size=3D"3">We would like to debug our Mason/Javascript/Perl =
code line-by-line and watching the variables meanwhile. Is it =
possible?</font></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><font face=3D"Times =
New Roman" size=3D"3">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.</font></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><br></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif">Please =
help!</div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><font face=3D"Times =
New Roman" size=3D"3"><br></font></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><font face=3D"Times =
New Roman" size=3D"3">Thank you very much for your =
answer,</font></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><font face=3D"Times =
New Roman" size=3D"3">Regards,</font></div><div =
style=3D"font-size:13px;font-family:arial,sans-serif"><font face=3D"Times =
New Roman" size=3D"3">Zoltan Trencsenyi</font></div></div>
=
--------------------------------------------------------------------------=
----<br>Want excitement?<br>Manually upgrade your production =
database.<br>When you want reliability, choose Perforce<br>Perforce =
version control. Predictably reliable.<br><a =
href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D157508191&amp;iu=3D=
/4140/ostg.clktrk_______________________________________________">http://p=
ubads.g.doubleclick.net/gampad/clk?id=3D157508191&amp;iu=3D/4140/ostg.clkt=
rk_______________________________________________</a><br>Mason-users =
mailing =
list<br>[email protected]<br>https://lists.sourceforge.net=
/lists/listinfo/mason-users<br></blockquote></div><br></body></html>=

--Apple-Mail=_7978BE4C-4668-4ABE-B15C-039E067B98D9--


--===============8544399438196489046==
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
--===============8544399438196489046==
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

--===============8544399438196489046==--