Hello,
what I can understand from your question is that:

- you have a web application, written by someone else
- the application is currently working
- you want to fix/enhance/troubleshoot it
- whenever you add something to the output of some components, using
data::dumper, the application stops working and it hangs

Why the application hangs? Well it's hard to tell without seeing the actual
code, if data::dumper is correctly installed one reason is that the page is
probably trying to make some AJAX calls, maybe it expects some JSON output,
but if you add some debugging info to the output the JSON output will be
messed up, the Javascript code won't be able to interpreter it and the
application would just hang...

Some suggestions:

- you can check your log files (are you running your app under Apache?) to
see if there are some problems with the page
- then you can use Chrome/Firefox developer tools to see what's going on
(which component has been called? what GET/POST data has been submitted? is
there any error at the Javascript console?)
- and then Guido's answer is correct: don't just print your variable to the
page output:

% print Dumper \%my_hash;

print it to the standard error output:

% print STDERR Dumper \%my_hash;

this won't mess the page output (so your app should still work without any
problem): the dump will be sent to the web server logs files and you can
read it from there.

If you are using Poet/Mason2 you can also have a look at Poet::Util::Debug (
https://metacpan.org/pod/Poet::Util::Debug)

Bye

Il giorno mar 16 ago 2016 alle ore 17:33 Hiram Gibbard <hgibb...@gmail.com>
ha scritto:

> Hi All,
>
> I'm wondering if there is a way to echo or print our vars or arrays within
> the Mason tags? I'm trying to trouble shoot this application so I can make
> enhancements, and I can't tell why pages are not loading.
>
> I tried data::dumper, but anytime I try and add anything to print out it
> just hangs. What do i mean by hang? well the developer used mason within
> javascript, so when this div tries to load it just sits there saying
> searching and never completes. So I know its error'ing out, but I can't see
> it anywhere. So I'm trying to figure out a way to print out some vars or an
> array so I can see the data.
>
> I've tried using the <%text><text> mason tag but i'm either not doing it
> right or that doesn't apply. I guess my main question would be, how can one
> get verbose information from data within the mason tags? I will take any
> tips. can i call the text tag within other tags like init or once?
>
> Thanks in advance,
>
> --
> Hiram Gibbard
> hgibb...@gmail.com
> http://hiramgibbard.com
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Mason-users mailing list
> Mason-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mason-users
>
------------------------------------------------------------------------------
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to