Re: [Mason] problems setting up mason in CentOS 6
That is strange. What happens if you just create the obj directory manually? On Jan 5, 2016, at 9:53 PM, Richard Weltywrote: > On 1/6/16 12:26 AM, Adam Sjøgren wrote: >> Richard writes: >> >>> i am using .mhtml for the components, but the exposed web pages >>> are all .html and i want mason to process them. >> [...] >> >>> >> Don't you want "\.m?html$" here? >> >> "m+" means "one or more 'm's". I think you want "m?" meaning "zero or >> one 'm's". > yeah dumb mistake. spotted it a couple of minutes ago, fixed it and have > moved on. > > now getting an internal server error. saw some selinux issues, ran > audit2allow and > cleaned that up, but still getting the internal server error. apache log > says it's a > permissions problem with mason-data but i don't see the issue and i > don't see any > new selinux messages in audit.log > > ls -ld /web/na-motor/mason-data/ > drwxr-xr-x. 2 apache apache 4096 Jan 6 00:51 /web/na-motor/mason-data/ > > [Wed Jan 06 00:51:31 2016] [error] [client 104.236.140.111] Cannot > create directory '/web/na-motor/mason-data/obj' (mkdir > /web/na-motor/mason-data/obj: Permission denied at > /usr/share/perl5/HTML/Mason/Interp.pm line 301.\n) for user 'apache', > group 'apache'. Perhaps you need to create or set permissions on your > data_dir ('/web/na-motor/mason-data'). \nStack:\n > [/usr/share/perl5/HTML/Mason/Interp.pm:318]\n > [/usr/share/perl5/HTML/Mason/Interp.pm:222]\n > [/usr/share/perl5/HTML/Mason/Interp.pm:169]\n > [/usr/share/perl5/HTML/Mason/Interp.pm:155]\n > [/usr/share/perl5/Class/Container.pm:329]\n > [/usr/share/perl5/Class/Container.pm:53]\n > [/usr/share/perl5/HTML/Mason/ApacheHandler.pm:632]\n > [/usr/share/perl5/HTML/Mason/ApacheHandler.pm:411]\n [(eval 35):6]\n > [-e:0]\n > > -- > rwe...@averillpark.net > Averill Park Networking - GIS & IT Consulting > OpenStreetMap - PostgreSQL - Linux > Java - Web Applications - Search > > > -- > ___ > 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
Re: [Mason] Poet Toolbar injection
In your app.psgi, there should be a line enable "Debug”; Remove that. On Nov 12, 2015, at 3:34 AM, Carrington, Matthew (Produban)wrote: > > I have had some problems with the development mode toolbar injection > interfering with my javascript. Can anyone tell me how to stop the injection > of the toolbar when in development mode ? > > Any help much appreciated. > > Matthew > Emails aren't always secure, and they may be intercepted or changed > after they've been sent. Produban doesn't accept liability if this > happens. If you think someone may have interfered with this email, > please get in touch with the sender another way. This message and any > documents attached to it do not create or change any contract unless > otherwise specifically stated. Any views or opinions contained in this > message are solely those of the author, and do not necessarily represent > those of Produban, unless otherwise specifically stated and the sender > is authorised to do so. Produban doesn't accept responsibility for > damage caused by any viruses contained in this email or its attachments. > Emails may be monitored. If you've received this email by mistake, > please let the sender know at once that it's gone to the wrong person > and then destroy it without copying, using, or telling anyone about its > contents. Produban Servicios Informaticos Generales, S.L. (UK Branch). > Registered office: Shenley Wood House, Chalkdell Drive, Shenley Wood, > Milton Keynes MK5 6LA. Branch registration number BR 008486. > Ref:[PDB#014] > > -- > ___ > 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
Re: [Mason] Import
No, these variables are only initialized once per class so not possible to vary based on request. On Nov 11, 2015, at 8:00 AM, Carrington, Matthew (Produban)wrote: > Poet provides a useful facility to import a variable into a component ... > > e.g. From Poet::Manual::Subclassing ... > >package MyApp::Import >use DBI; >use Poet::Moose; >extends 'Poet::Import'; > >method provide_dbh ($caller, $poet) { >$dbh = DBI->connect(...); >} > > ... that I've found very useful but I wondered whether it was possible to > return a different database handle depending upon a URL parameter. Can I > access any information about the request within this method ? If so, how ? > > Does anyone know if this is possible ? > > Matthew > Emails aren't always secure, and they may be intercepted or changed > after they've been sent. Produban doesn't accept liability if this > happens. If you think someone may have interfered with this email, > please get in touch with the sender another way. This message and any > documents attached to it do not create or change any contract unless > otherwise specifically stated. Any views or opinions contained in this > message are solely those of the author, and do not necessarily represent > those of Produban, unless otherwise specifically stated and the sender > is authorized to do so. Produban doesn't accept responsibility for > damage caused by any viruses contained in this email or its attachments. > Emails may be monitored. If you've received this email by mistake, > please let the sender know at once that it's gone to the wrong person > and then destroy it without copying, using, or telling anyone about its > contents. Produban Servicios Informaticos Generales, S.L. (UK Branch). > Registered office: Shenley Wood House, Chalkdell Drive, Shenley Wood, > Milton Keynes MK5 6LA. Branch registration number BR 008486. > Ref:[PDB#014] > -- > ___ > 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
Re: [Mason] Generating output where lines should start with the % character.
On Dec 3, 2014, at 6:19 AM, Guido Brugnara g...@leader.it wrote: On 03/12/2014 13:07, Jozef Mojzis wrote: Need generate an output from an Mason component where the lines should start with the '%' character. If \% is acceptable in your case: pre \%there lines start % for my $x (1..3) { \% this is % $x % % } \%there lines end /pre %filter s/^\\%/%/ /%filter There is also the %text section: https://metacpan.org/pod/distribution/HTML-Mason/lib/HTML/Mason/Devel.pod#text -- Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151iu=/4140/ostg.clktrk___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] how to debug Mason code?
What web framework is this - mod_perl? On Sep 11, 2014, at 2:58 AM, -, - fract...@mailbox.hu wrote: 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 -- 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=157508191iu=/4140/ostg.clktrk___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- 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=157508191iu=/4140/ostg.clktrk___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] mason 2 extends and .mp files
Yeah, I don’t think there’s any way to do this, because the .mp gets an automatically assigned superclass. You just have to use a component consisting entirely of the extends %flag and a %class section. :/ On Aug 29, 2014, at 11:24 AM, James Orr james.o...@gmail.com wrote: I can use a %flags section to set extends, but the docs say that a raw extends in a %class section will not work reliably. How best to set this for .mp files? -- Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- 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=157508191iu=/4140/ostg.clktrk ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Best way to setup with apache?
Any particular reason you need to keep using Apache, as opposed to (say) Starman? Sorry, I don’t normally like to answer questions that way :), it’s just that most people using PSGI/Plack seemed to have migrated away from Apache for the backend process. On Aug 13, 2014, at 11:09 AM, James Orr james.o...@gmail.com wrote: I'm currently using Plack::Handler::Apache2, but I'm getting some intermittent errors ... Can't get the name of an anonymous package at /usr/lib/perl5/Class/MOP/Package.pm line 243. I've seen some stuff about mod_psgi but google doesn't turn up much about it, and it's not a package available through apt-get. -- ___ 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
Re: [Mason] path_info not populated
It’s supposed to be turned on automatically for chandlers though. Will take a look when I get a moment. On Aug 11, 2014, at 1:40 PM, William Cox mydimens...@gmail.com wrote: Populating path_info is disabled by default. See https://metacpan.org/pod/Mason::Component#allow_path_info to turn it on per-component. On Mon, Aug 11, 2014 at 3:49 PM, James Orr james.o...@gmail.com wrote: Using mason 2.22 I created a simple g/dhandler.mc file ... PATH: % $m-path_info %BR/ REQUEST: % $m-request_path % Accessing /g/something brings up the page ok, but path_info remains empty. What am I missing? -- ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- William Cox e: mydimens...@gmail.com www.google.com/+WilliamCoxx -BEGIN GEEK CODE BLOCK- Version: 3.1 GCS d- s+:+() a C++()$ UBLC(++)$ P+++()$ L++(+++)$ !E--- W++(+++)$ !N !o? K--? !w--- !O M++ !V- PS-(--)@ PE+() Y+ !PGP t++ !5 X+++ !R tv(+) b+++ DI+(++) D+() G e h--- r+++ y+++ --END GEEK CODE BLOCK-- -- ___ 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
Re: [Mason] path_info not populated
James: This is working fine for me with a simple script and the same file structure as you described. Can you post your script? On Aug 11, 2014, at 1:40 PM, William Cox mydimens...@gmail.com wrote: Populating path_info is disabled by default. See https://metacpan.org/pod/Mason::Component#allow_path_info to turn it on per-component. On Mon, Aug 11, 2014 at 3:49 PM, James Orr james.o...@gmail.com wrote: Using mason 2.22 I created a simple g/dhandler.mc file ... PATH: % $m-path_info %BR/ REQUEST: % $m-request_path % Accessing /g/something brings up the page ok, but path_info remains empty. What am I missing? -- ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- William Cox e: mydimens...@gmail.com www.google.com/+WilliamCoxx -BEGIN GEEK CODE BLOCK- Version: 3.1 GCS d- s+:+() a C++()$ UBLC(++)$ P+++()$ L++(+++)$ !E--- W++(+++)$ !N !o? K--? !w--- !O M++ !V- PS-(--)@ PE+() Y+ !PGP t++ !5 X+++ !R tv(+) b+++ DI+(++) D+() G e h--- r+++ y+++ --END GEEK CODE BLOCK-- -- ___ 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
Re: [Mason] access the psgi environment..
$m-req gets you the Plack::Request object. $m-req-env to get the PSGI env. On Mar 5, 2014, at 7:27 AM, A Kobame kobam...@gmail.com wrote: This is the only way access the PSGI $env? $m-{orig_request_params}-{req}-{env} or I'm only blind and need more RTFM to learn a nicer method, like $poet-psgi_env or such? ak. -- Subversion Kills Productivity. Get off Subversion Make the Move to Perforce. With Perforce, you get hassle-free workflows. Merge that actually works. Faster operations. Version large binaries. Built-in WAN optimization and the freedom to use Git, Perforce or both. Make the move to Perforce. http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Subversion Kills Productivity. Get off Subversion Make the Move to Perforce. With Perforce, you get hassle-free workflows. Merge that actually works. Faster operations. Version large binaries. Built-in WAN optimization and the freedom to use Git, Perforce or both. Make the move to Perforce. http://pubads.g.doubleclick.net/gampad/clk?id=122218951iu=/4140/ostg.clktrk ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] empty % % = different errors...
That's a funny one! Fixed in the next release. (Empty tags will be forbidden w/consistent error message.) Thanks Jon On Feb 28, 2014, at 11:34 AM, A Kobame kobam...@gmail.com wrote: Hi all, Searched a half hour the error in the next (now shortened) component. %init $.title = TITLE; /%init %filter SomeFilter% $yield-() %/%filter % % % $.SomeFilter {{ some long text here... % }} % $.SomeFilter {{ some long text here... % $.title % some long text here... % }} Sure, now - when it is shortened, the error is clearly visible - the empty % % What is strange, the error-message - what says: '}}' without matching '{{' at /.../comps/tmp/index.mc line 15 the line15 is the closing }} of the second filter. When removed the empty % % the page is rendered OK. So, incorrect error detection. For curiosity, when remove the correct % $.title %, the error message changes to usable one: whitespace required after '%' at /.../comps/tmp/index.mc line 5 After this, i checked some variants: %% - (without space) the error is: '%' without matching '%' at % % - (one space): whitespace required after '%' at % % - (two or more spaces): whitespace required before '%' at IMHO, if the % \s* % construction is intentionaly not allowed, it should give a consistent error message - or at least - should NOT detected as an filter }} closing error. Lastly - IMHO the % \s* % should be rendered as an EMPTY string. ak. -- Flow-based real-time traffic analytics software. Cisco certified tool. Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer Customize your own dashboards, set traffic alerts and generate reports. Network behavioral analysis security monitoring. All-in-one tool. http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/4140/ostg.clktrk___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Flow-based real-time traffic analytics software. Cisco certified tool. Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer Customize your own dashboards, set traffic alerts and generate reports. Network behavioral analysis security monitoring. All-in-one tool. http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/4140/ostg.clktrk___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Strange behavior of an attribute
So far I've determined that it has to do with Poet's special handling of ArrayRef[Int]. If you remove that isa, it works. On Feb 26, 2014, at 1:56 PM, A Kobame kobam...@gmail.com wrote: app=testapp rm -rf ./$app poet new $app || exit 1 rm $app/comps/Base.mc cat 'EOF' $app/comps/ftest.mc %class use Data::Dumper; has 'field' = (isa = 'ArrayRef[Int]', default = sub{[1,3]}); /%class % Dumper $.field % EOF -- Flow-based real-time traffic analytics software. Cisco certified tool. Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer Customize your own dashboards, set traffic alerts and generate reports. Network behavioral analysis security monitoring. All-in-one tool. http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/4140/ostg.clktrk___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Strange behavior of an attribute
I've released a fix in Poet 0.15, let me know if it works for you. Jon On Feb 26, 2014, at 2:47 PM, A Kobame kobam...@gmail.com wrote: :-) Thanx. Additionally, it works when the ftest.mc is called from another component. e.g., the: ftest.mc gives the right result. ak. On Wed, Feb 26, 2014 at 11:38 PM, Jonathan Swartz swa...@pobox.com wrote: So far I've determined that it has to do with Poet's special handling of ArrayRef[Int]. If you remove that isa, it works. On Feb 26, 2014, at 1:56 PM, A Kobame kobam...@gmail.com wrote: app=testapp rm -rf ./$app poet new $app || exit 1 rm $app/comps/Base.mc cat 'EOF' $app/comps/ftest.mc %class use Data::Dumper; has 'field' = (isa = 'ArrayRef[Int]', default = sub{[1,3]}); /%class % Dumper $.field % EOF -- Flow-based real-time traffic analytics software. Cisco certified tool. Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer Customize your own dashboards, set traffic alerts and generate reports. Network behavioral analysis security monitoring. All-in-one tool. http://pubads.g.doubleclick.net/gampad/clk?id=126839071iu=/4140/ostg.clktrk___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Poet::Cache not working for Mason components
In Poet::Mason it sets the default cache_root_class to Poet's Cache class: method get_options ($class:) { my %defaults = ( cache_root_class = $poet-app_class('Cache'), There is a Poet test for this in Poet::t::PSGIHandler (test_cache). Is this test passing for you? Jon On Jan 13, 2014, at 4:42 AM, Kamil Niechajewicz k.niechajew...@firma.bankier.pl wrote: Hello, We wanted to start using Poet::Cache in our application and discovered a really weird problem. Following manual from here (http://search.cpan.org/~jswartz/Poet-0.10/lib/Poet/Cache.pm), we need to configure default cache store - I did it for Memcached, in global.cfg: cache: defaults: driver: Memcached servers: [127.0.0.1:11211] Then I should just start my app and use $m-cache in Mason components, right? The problem is - whenever I use $m-cache, it uses File driver instead of Memcached. I checked and it looks like Poet::Cache works well when used from scripts or Perl modules (it loads correct cache object), but for Mason components its always default File cache. This led me to Mason::Plugins::Cache and I realized that I have no idea how this class works together with Poet's caching. It seems that the problem lies somewhere in between - Poet's configuration is not passed correctly to Mason::Plugin, but why? -- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431iu=/4140/ostg.clktrk___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Problems installing HTML::Mason
That's really strange. You might try using cpanm (https://metacpan.org/module/App::cpanminus). I'd recommend that anyway. On Oct 13, 2013, at 12:46 PM, Ronny Trommer r.trom...@open-factory.org wrote: Hello list, I have a strange issue installing Mason with CPAN in my Ubuntu 10.04 LTS with v5.10.1 environment. Running If I run the command perl -MCPAN -einstall HTML::Mason I get the following error message: !-- SNIP -- . CPAN: File::Temp loaded ok (v0.2304) CPAN: Time::HiRes loaded ok (v1.9719) Package seems to come without Makefile.PL. (The test -f /root/.cpan/build/JSWARTZ-KcKu7d/Makefile.PL returned false.) Writing one on our own (setting NAME to HTMLMason) CPAN.pm: Going to build J/JS/JSWARTZ/HTML-Mason-1.52.tar.gz Checking if your kit is complete... Looks good Bareword found where operator expected at ./Makefile.PL line 1, near 18 gid (Missing operator before gid?) Number found where operator expected at ./Makefile.PL line 2, near 17 (Missing semicolon on previous line?) Bareword found where operator expected at ./Makefile.PL line 2, near 17 uid (Missing operator before uid?) Number found where operator expected at ./Makefile.PL line 3, near 20 (Missing semicolon on previous line?) Bareword found where operator expected at ./Makefile.PL line 3, near 20 ctime (Missing operator before ctime?) Number found where operator expected at ./Makefile.PL line 4, near 20 (Missing semicolon on previous line?) Bareword found where operator expected at ./Makefile.PL line 4, near 20 atime (Missing operator before atime?) Number found where operator expected at ./Makefile.PL line 5, near 23 (Missing semicolon on previous line?) Bareword found where operator expected at ./Makefile.PL line 5, near 23 SCHILY (Missing operator before SCHILY?) Number found where operator expected at ./Makefile.PL line 6, near 22 (Missing semicolon on previous line?) Bareword found where operator expected at ./Makefile.PL line 6, near 22 SCHILY (Missing operator before SCHILY?) Number found where operator expected at ./Makefile.PL line 7, near 18 (Missing semicolon on previous line?) Bareword found where operator expected at ./Makefile.PL line 7, near 18 SCHILY (Missing operator before SCHILY?) ERROR from evaluation of /root/.cpan/build/JSWARTZ-KcKu7d/HTML-Mason-1.52/Makefile.PL: ERROR from evaluation of /root/.cpan/build/JSWARTZ-KcKu7d/HTML-Mason-1.52/PaxHeader/Makefile.PL: syntax error at ./Makefile.PL line 1, near 18 gid Warning: No success on command[/usr/bin/perl Makefile.PL INSTALLDIRS=site] JSWARTZ/HTML-Mason-1.52.tar.gz /usr/bin/perl Makefile.PL INSTALLDIRS=site -- NOT OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install !-- SNIP -- Thank you in advance and have a nice evening. Greetings Ronny -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
[Mason] removing all Mason mailing lists except mason-users
There are a number of old Mason mailing lists that have been unused or barely used for a while (except by spammers. :) I'm deleting all except mason-users. Best Jon -- October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60133471iu=/4140/ostg.clktrk ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] dhandler calls function defined in another dhandler, why?
All HTML::Mason components are defined in the same package, so you should not use named subroutines. Use anonymous subroutines instead. On Apr 16, 2013, at 6:27 AM, Pavel Cina pavel.cina.exter...@ts.fujitsu.com wrote: Hi, I have two dhalndlers: /api/resources/devices/bs2/tapes/dhandler /api/resources/devices/bs2/disks/dhandler Both implements function called handle_get: .../tapes/dhandler: sub handle_get { put_log(TAPE handle_get); ... } .../disks/dhandler: sub handle_get { put_log(DISK handle_get); ... } Sometimes happens, that DISK dhandler calls handle_get function defined in TAPE dhandler or vice versa. Here one example from my log file: OK case: 2013-04-11T17:53:17+02:00 rho1 (debug) SQM [13243]: 127.0.0.1 /api/resources/devices/bs2/tapes /api/resources/devices/bs2/tapes/dhandler 2013-04-11T17:53:17+02:00 rho1 (debug) SQM [13243]: 127.0.0.1 /api/resources/devices/bs2/tapes TAPE dhandler(Method:GET, Path:, Data:) 2013-04-11T17:53:17+02:00 rho1 (debug) SQM [13243]: 127.0.0.1 /api/resources/devices/bs2/tapes TAPE handle_get Error case: 2013-04-11T17:53:18+02:00 rho1 (debug) SQM [13238]: 127.0.0.1 /api/resources/devices/bs2/tapes /api/resources/devices/bs2/tapes/dhandler 2013-04-11T17:53:18+02:00 rho1 (debug) SQM [13238]: 127.0.0.1 /api/resources/devices/bs2/tapes TAPE dhandler(Method:GET, Path:, Data:) 2013-04-11T17:53:18+02:00 rho1 (debug) SQM [13238]: 127.0.0.1 /api/resources/devices/bs2/tapes DISK handle_get How can this happen? Is it a bug or normal behavior? Cheers Pavel -- Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason Wiki
Sounds good. The old wiki was overrun by spam and impossible to maintain. Presumably they have a better system at wikibooks. On Apr 3, 2013, at 12:47 PM, Jerker Montelius jerker.montel...@gmail.com wrote: While surfing the web I actually found a good Perl wiki site. http://en.wikibooks.org/wiki/Perl_Programming It even has a entry on old Mason. http://en.wikibooks.org/wiki/Perl_Programming/HTML::Mason hovever this page is very rough. Lets use this for a mason wiki On 03/28/2013 12:06 PM, Jerker Montelius wrote: Yes and there should be a section where you can share your best components. On 03/28/2013 11:45 AM, Jérôme Étévé wrote: I support the idea :) I used to refer to the old wiki quite a lot and also participate my bits. Cheers, Jerome. On 28 March 2013 10:25, Jerker Montelius jerker.montel...@gmail.com wrote: Is there a Mason wiki of some sort? One of the great advantages of old mason was the excellent documentation. Jerker -- Own the Future-Intelreg; Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Minimize network downtime and maximize team effectiveness. Reduce network management and security costs.Learn how to hire the most talented Cisco Certified professionals. Visit the Employer Resources Portal http://www.cisco.com/web/learning/employer_resources/index.html ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Trouble capturing the values of multi-select form elements
Are you using Poet? If so this might help: https://metacpan.org/module/Poet::Manual::Intro#Multiple-values-for-parameters On Mar 25, 2013, at 8:04 AM, Wil Peters wil.pet...@xs4all.nl wrote: Hi, I'm new to mason2. In html::mason it was fairly easy to capture the values of a multi-select formfield in the receiving component. Now, when I post values only 1 value is received. Same problem occurs when I use a checkbox that can be ticket more than once. This is my form: form action=query_design method=post select name=table_classes multiple=multiple option value=table-borderedtable-bordered/option option value=table-condensedtable-condensed/option option value=table-hovertable-hover/option /select button type=submit name=submit value=OKOK/button /form This is a piece of code in the receiving component 'query_design.mc', testing whether a list or a scalar variable is received: % my @list; % eval { @list = @{$.table_classes}; }; # check if list is received % if ( !$@ ) { # It is indeed a list % for my $i ( @list ) { listvalue--% $i %br % } % } else { # It's a scalar % $.table_classes % % } Now, even when i select all 3 values in the select field 'table_classes', only 1 value is received. So no list... In html::mason I could grab the values as a list in this way! Question: how to capture all the values of multiselect form fields in the receiving component? Kind regards, Wil Peters. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_mar ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Component from a string?
I haven't thought about how to do on-the-fly component compilation in Mason 2 yet. It made the code a lot cleaner not to have to plan for it, and I wasn't sure if anyone would need it. :) It should be possible since Class::MOP and Moose have utilities for creating classes on the fly. Let me know if you come up with a good solution. Jon On Jan 7, 2013, at 10:47 PM, Allan Engelhardt all...@cybaea.com wrote: Thanks Rolf, but I am trying to use Mason2. Anyone know of a solution there? Allan On 7 January 2013 23:23, Rolf Schaufelberger r...@plusw.de wrote: Yes, Am 07.01.2013 um 22:55 schrieb Allan Engelhardt all...@cybaea.com: Suppose I have a string (from a database or whatever) that I want to compile, run, and insert into the current component - is that possible? Something like (not tested): % # test.mc %init my $s = q{pI know 1+1=% 1+1 %./p}; # From external source /%init pI know many facts/p % $m-magic( $s ) % for some function magic( ... ) which should probably be called scomp_from_string or somesuch for HTML::Mason see the docs for HTML::Mason::Interp::make_component # Make an anonymous component my $anon_comp = eval { $interp-make_component ( comp_source = '%perlmy $name = World;/%perlHello % $name %!' ) }; die $@ if $@; $m-comp($anon_comp); Allan Mit freundlichen Grüßen Rolf Schaufelberger -- Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS and more. Get SQL Server skills now (including 2012) with LearnDevNow - 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only - learn more at: http://p.sf.net/sfu/learnmore_122512___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS and more. Get SQL Server skills now (including 2012) with LearnDevNow - 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only - learn more at: http://p.sf.net/sfu/learnmore_122512___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] index files do not work on 2.20 if allow_path_info is not set
Cool, thanks, let me know when it's ready! On Jan 7, 2013, at 5:36 AM, Pedro Melo m...@simplicidade.org wrote: Done https://github.com/jonswar/perl-mason/pull/16#commits-pushed-baa1643 Jonathan, its not read yet, need to update the docs. Lunch time around here, I'll do that when I get back. The original fix for #8 was overly eager and caused this bug. I think the new patch is much better, simpler to understand. Bye, On Mon, Jan 7, 2013 at 1:05 PM, Oliver Paukstadt pst...@sourcentral.org wrote: On Mon, 2013-01-07 at 12:21 +, Pedro Melo wrote: Hi, On Mon, Jan 7, 2013 at 7:13 AM, Jonathan Swartz swa...@pobox.com wrote: On Jan 6, 2013, at 1:03 PM, Oliver Paukstadt pst...@sourcentral.org wrote: There is a test for this case as far as I understand line 104 in Mason-2.20/lib/Mason/t/ResolveURI.pm correct. But this one is designed wrong in my eyes. It fits the implementation, not what was reality before the 2.20 release and what is reasonable and expected. No. That test is for dhandler + index presence. Line 101 in your fork, looks like Jon did some cleanup since 2.20 release. Does this test conflict with the new check in line 107? Regards, Oliver Paukstadt -- Oliver Paukstadt pst...@sourcentral.org -- Pedro Melo @pedromelo http://www.simplicidade.org/ http://about.me/melo xmpp:m...@simplicidade.org mailto:m...@simplicidade.org -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] index files do not work on 2.20 if allow_path_info is not set
On Jan 6, 2013, at 1:03 PM, Oliver Paukstadt pst...@sourcentral.org wrote: There is a test for this case as far as I understand line 104 in Mason-2.20/lib/Mason/t/ResolveURI.pm correct. But this one is designed wrong in my eyes. It fits the implementation, not what was reality before the 2.20 release and what is reasonable and expected. Index files are for being displayed, when a directory is hit. Having them only displayed when allow_path_info is set is like having to define allow_path_info inside of all dhandlers. Agreed. Jon -- Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] index files do not work on 2.20 if allow_path_info is not set
Oliver - I think you're right, this was a mistake. It was the result of https://github.com/jonswar/perl-mason/issues/8 I'm not sure what the right behavior should be. For the sake of good SEO, you generally want canonical urls and it's suboptimal to allow /foo/bar and /foo/bar/ to map to the exact same thing. One of them should redirect to the other. In the old Apache world, /foo/bar would redirect to /foo/bar/, but these days it is much more common to have urls without trailing slashes. Feedback welcome. I agree, though, the current situation is very un-DWIM-ish. Jon On Jan 4, 2013, at 11:36 AM, Oliver Paukstadt pst...@sourcentral.org wrote: Hi while reading through latest Mason::Manual::RequestDispatch and Mason::Interp::_build_match_request_path to understand trailing slash handling I found that my installation was Mason-2.19 and latest was 2.20 with the trailing slash change for directories. So I updated and everything looks broken now. ;-) As far as I can see an access to a directory with trailing slash (except / itself) will never match an index.mc until allow_path_info is set to 1. This is the only way to get the check in _build_match_request_path for index.mc valid, because path_info now is '/' and it is not a dhandler. This is really bad, what was the reason to do it this way? Maybe the simplest fix could be a check similar to is_dhandler like is_index to get index files delivered without allow_path_info set. From my point of view (is_index and path_info eq '') could lead to a redirect adding a slash to path if attribute force_directory_slash is set. Regards, Oliver Paukstadt -- Oliver Paukstadt pst...@sourcentral.org -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and much more. Get web development skills now with LearnDevNow - 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122812 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Using MooseX::Method::Signatures without warning
On Tue, Dec 11, 2012 at 8:51 AM, Allan Engelhardt all...@cybaea.com wrote: If I have a Mason component with %class use MooseX::Method::Signatures; ... /%class then I get an unimportant but annoying warning about Prototype mismatch: sub MC0::(some component)::method () vs none that I haven't been able to remove. This is presumably because Mason uses Method::Signatures::Simple somewhere deep within the bowels of the beast? Yep. See https://metacpan.org/module/Mason::Component::Moose for more. I like to keep my log files clean: does anybody have a trick for getting rid of this? Do you really need MooseX::Method::Signatures? I don't see a way around it... There may be a way to replace Method::Signatures::Simple with MooseX::Method::Signatures throughout Mason. I haven't given it any thought though. Jon -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Documentation for Defer?
It is in its own plugin which is enabled by default: Mason::Plugin::Defer. That was the cleanest implementation but it's definitely not optimal for documentation, I need to mention it in a few more places. On Nov 13, 2012, at 11:17 PM, Allan Engelhardt wrote: Is the Defer (filter) method documented anywhere? It is mentioned in Mason::Manual::Filters with a reference to Mason::Filters::Standard. Sadly, however, the latter seems to be silent on the matter both in the POD and in the source. Plainly it exists _somewhere_ -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Monitor your physical, virtual and cloud infrastructure from a single web console. Get in-depth insight into apps, servers, databases, vmware, SAP, cloud infrastructure, etc. Download 30-day Free Trial. Pricing starts from $795 for 25 servers or applications! http://p.sf.net/sfu/zoho_dev2dev_nov ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Inverse of Mason::Interp-write_object_file ?
_load_class_from_object_file? On Nov 2, 2012, at 3:42 AM, Allan Engelhardt wrote: What is the inverse of Mason::Interp-write_object_file() ? Within Poet, I am changing this function to (potentially) modify the $object_file argument (to handle Unicode [1]) which works a charm, but I wanted to make sure I do the same modification before the file is loaded. Then I think I have a robust unicode handling in Poet for modules, content, and URLs. Yay! Allan [1] This is just to make completely sure that I handle the various ways of composing the same strings in unicode; currently, I use the normalization form D for everything in output (though this possibly is not the right thing to do for the singletons; I will worry about those later). Before converting into byte stream for syswrite and PSGI, of course -- LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central http://p.sf.net/sfu/logmein12331_d2d ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- LogMeIn Central: Instant, anywhere, Remote PC access and management. Stay in control, update software, and manage PCs from one command center Diagnose problems and improve visibility into emerging IT issues Automate, monitor and manage. Do more in less time with Central http://p.sf.net/sfu/logmein12331_d2d ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Removing default sidebar
:) That's Plack::Middleware::Debug. You can remove it by commenting out the appropriate line in bin/app.psgi. # Add Plack middleware here # if ( $conf-is_development ) { enable Plack::Middleware::StackTrace; enable Plack::Middleware::Debug; === } On Nov 1, 2012, at 3:26 AM, Allan Engelhardt wrote: This has got to be a FAQ but I can't find it anywhere in the documentation. After creating a new project with Poet (e.g. the example blog project) the default pages generated have tons of cruft added to them, apparently to support the black debug bar at the right. 1. Where is this added? 2. How do I get rid of it? Permanently. Forever. All of the several hundred lines. -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Passing complex GET parameters to Mason2
$.args ($self-args) will return a hashref of arguments passed to a component. It's like %ARGS, except that it's a method call rather than a magic scalar. On Oct 24, 2012, at 5:18 AM, Kamil Niechajewicz wrote: Hello, We ran into a problem recently – we have quite complex form that is used to edit multiple rows of data. This means we have input structure like this: input type=text name=row_1 / input type=text name=row_2 / input type=text name=row_n / There can be also additional data related to each row so: input type=radio name=row_1_type / input type=radio name=row_1_category / With old Mason we could just use %ARGS and process it manually with regexps and create nested array-hash structure: [0] = { name = …, type = …, category = … }, [1] = { name = …, type = …, category = … }, [n] = { name = …, type = …, category = … } But Mason2 uses Moose constructor and requires parameters to be defined as attributes – its obvious defining every possible number of such row data will be very tedious and ugly: %class has 'row_1_name'; has 'row_1_type'; has 'row_1_category' . . . has 'row_n_name'; has 'row_n_type'; has 'row_n_category' /%class How to solve this problem in a Mason2 way? Some frameworks allow to use naming convention with square brackets that describe nested nature of input data: input type=text name=row[1][name] / input type=radio name=row[1][type] / etc. but I don't think Mason2 supports this. Would it be possible to create some pre-processing method that would prepare data in such format for passing into Moose constructor, so we could use more advanced Moose attributes for GET data, and just pre-process it before it reaches the actual component? Or is there a better way? Other way to do this I think is to use class meta methods and just create needed attributes on runtime, this would save a lot of typing, but we still are not flexible, as we need to generate certain number of input rows, and if we receive one more row it will break. Mason2 is great so far, but sometimes we run into problems when doing more advanced stuff thats not described anywhere. Hope someone can point us in the right direction. Regards, KN -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_sfd2d_oct___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason 2 and Dancer error.
Don't know. So I assume it works with simple template, but not with Mason? The stack trace isn't helpful, unfortunately, as it doesn't mention who is calling Memoize::flush_cache. On Oct 4, 2012, at 5:36 AM, Renato Tegon Forti wrote: Hi All, I am trying run Mason2 on Dancer, but I get “Runtime Error”. In apache2 I have modperl and: Location /dacer SetHandler perl-script PerlHandler Plack::Handler::Apache2 PerlSetVar psgi_app /home/ubuntu/MyWeb-App/bin/app.pl /Location I have these modules installed as follows: curl -L http://cpanmin.us | perl - --sudo Dancer cpan -i Plack::Handler::Apache2 cpan -i Dancer::Template::Mason2 In conf: (config.yml) # ... # simple: default and very basic template engine # template_toolkit: TT # template: simple template: 'mason2' # ... In App: vi lib/MyWeb/App.pm package MyWeb::App; use Dancer ':syntax'; our $VERSION = '0.1'; get '/' = sub { template 'index'; }; get '/foo', sub { template 'foo' = { title = 'bar' }; }; get '/hello/:name' = sub { # do something return Hello .param('name'); }; true; Thanks for help. Runtime Error runtime error CODE(0x7f181171dc78) not memoized at /usr/share/perl/5.14/Memoize.pm line 202. /usr/share/perl/5.14/Memoize.pm around line 202 199 sub flush_cache { 200 my $func = _make_cref($_[0], scalar caller); 201 my $info = $memotable{$revmemotable{$func}}; 202 die $func not memoized unless defined $info; 203 for my $context (qw(S L)) { 204 my $cache = $info-{$context}; 205 if (tied %$cache ! (tied %$cache)-can('CLEAR')) { Stack main in -e l. 0 main in -e l. 0 Plack::Handler::Apache2 in /usr/local/share/perl/5.14.2/Plack/Handler/Apache2.pm l. 91 Plack::Handler::Apache2 in /usr/local/share/perl/5.14.2/Plack/Handler/Apache2.pm l. 66 Dancer::Handler in /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 123 Dancer::Handler in /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 76 Dancer::Handler in /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 113 Try::Tiny in /usr/local/share/perl/5.14.2/Try/Tiny.pm l. 100 Dancer::Exception in /usr/local/share/perl/5.14.2/Dancer/Exception.pm l. 47 Dancer::Exception in /usr/local/share/perl/5.14.2/Dancer/Exception.pm l. 35 Dancer::Handler in /usr/local/share/perl/5.14.2/Dancer/Handler.pm l. 107 Dancer::Object in /usr/local/share/perl/5.14.2/Dancer/Object.pm l. 16 Dancer::Error in /usr/local/share/perl/5.14.2/Dancer/Error.pm l. 37 Dancer::Error in /usr/local/share/perl/5.14.2/Dancer/Error.pm l. 276 Settings { appdir = '/home/ubuntu/MyWeb-App/bin/..', apphandler = 'PSGI', appname = 'MyWeb::App', auto_reload = '0', charset = 'utf-8', confdir = '/home/ubuntu/MyWeb-App/bin/..', content_type = 'text/html', daemon = 0, engines = {}, envdir = '/home/ubuntu/MyWeb-App/environments', environment = 'development', handlers = {}, import_warnings = 1, layout = 'main', log = 'core', logger = 'console', plugins = {}, port = '3000', public = '/home/ubuntu/MyWeb-App/public', server = '0.0.0.0', server_tokens = 1, show_errors = '1', startup_info = 1, template = 'mason2', traces = 0, views = '/home/ubuntu/MyWeb-App/views', warnings = '1' } Environment { DANCER_APPDIR = '/home/ubuntu/MyWeb-App/bin/..', DOCUMENT_ROOT = '/var/www', GATEWAY_INTERFACE = 'CGI/1.1', HTTP_ACCEPT = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', HTTP_ACCEPT_CHARSET = 'ISO-8859-1,utf-8;q=0.7,*;q=0.3', HTTP_ACCEPT_ENCODING = 'gzip,deflate,sdch', HTTP_ACCEPT_LANGUAGE = 'pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4', HTTP_CACHE_CONTROL = 'max-age=0', HTTP_CONNECTION = 'keep-alive', HTTP_COOKIE = 'expected_tab=facebook; welcome_info_name=Renato%20Tegon%20Forti; plack_session=283e3f595178cd9a7c853cc5f2abc229b3606bbd', HTTP_HOST = 'www.doksafe.com', HTTP_USER_AGENT = 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4', HTTP_X_FORWARDED_FOR = '189.55.11.94', HTTP_X_FORWARDED_PORT = '80', HTTP_X_FORWARDED_PROTO = 'http', MOD_PERL = 'mod_perl/2.0.5', MOD_PERL_API_VERSION = '2', PATH = '/usr/local/bin:/usr/bin:/bin', PATH_INFO = '/foo', PATH_TRANSLATED = '/var/www/foo', QUERY_STRING = '', REMOTE_ADDR = '10.0.3.59', REMOTE_PORT = '59066', REQUEST_METHOD = 'GET', REQUEST_URI = '/dancer/foo', SCRIPT_FILENAME = '/var/www/dancer', SCRIPT_NAME = '/dancer', SERVER_ADDR = '10.0.4.50', SERVER_ADMIN = 'webmaster@localhost', SERVER_NAME = 'www.doksafe.com', SERVER_PORT = '80', SERVER_PROTOCOL = 'HTTP/1.1', SERVER_SIGNATURE = ' Apache/2.2.22 (Ubuntu) Server at www.doksafe.com Port 80 ', SERVER_SOFTWARE = 'Apache/2.2.22 (Ubuntu)', 'psgi.errors' = *::STDERR,
Re: [Mason] Different url's same actions...
On Sep 28, 2012, at 11:42 AM, T.Lawrance wrote: There are other examples of how to do internationalization on the Mason book and Mason HQ sites. Yes, for HTML::Mason, like the suggested %shared blocks. Thank you anyway for suggestions, I'll thinking about how to implement it in Mason2. But, I have some internal feeling that this should be done somewhat before Mason take controll, like at some Middleware level (urlrewrite?) or using Mason::Plugin::RouterSimple or like... You could try a Plack middleware, like https://metacpan.org/module/Plack::Middleware::Rewrite -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason Tidy!
I can't repro that one - are you using any particular options? On Oct 3, 2012, at 4:15 AM, Pedro Melo wrote: Hi, On Tue, Oct 2, 2012 at 7:53 AM, Jonathan Swartz swa...@pobox.com wrote: These should be fixed in 2.56, coming to CPAN shortly. Let me know. Yes, they are all solved, but I spotted a new one where extra space creeps in: /layouts/master.mc, %ARGS, site = 'Site Name', punch = 'goot times', content = $content, favicon = 'std.ico', masontidy adds an extra space after the /layouts/master.mc,ExtraSpaceHere Bye, -- Pedro Melo @pedromelo http://www.simplicidade.org/ http://about.me/melo xmpp:m...@simplicidade.org mailto:m...@simplicidade.org -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Configure Mason2 + Poet on Apache2. How to?
Mason 2 will work with Apache/mod_perl 1. On Oct 3, 2012, at 1:43 PM, Renato Tegon Forti wrote: Hi I have one project that use Mason 1, this run in mod_perl on apache and use SSL (only port 443). Now I want rewrite it to use Mason2! But I need run it on SSL, and then I think that I need Apache2. I try found one tutorial that shows how to configure it, but I don’t find. Anyone can help-me? How configure Mason2 + Poet on Apache2? What I must do? Thanks -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason Tidy!
These should be fixed in 2.56, coming to CPAN shortly. Let me know. Speaking of white-space: empty % lines gain an extra space (also visible in git-gui as a big read block :) ). More: if a file ends with a empty % line, the entire line is removed… Fixing… -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] new Mason/Poet site
The new Mason site is up, still at http://www.masonhq.com/ Thanks to Joe Shin for the design! This is naturally a Poet/Mason site, albeit a very simple one - the source is available at https://github.com/joeshin/mason-site Let me know if you see any problems, browser-specific issues etc. Thanks Jon On May 24, 2012, at 1:36 PM, Jonathan Swartz wrote: I want to create a new Mason/Poet site to replace the current masonhq.com. I see it along the lines of sites like Moose (http://moose.iinteractive.com/) PSGI/Plack (http://plackperl.org/) Dancer (http://perldancer.org/) i.e., much less ambitious and self-contained, mostly some nice marketing, a few menu items, and links off to search.cpan.org and github. I'll also host the existing frozen wiki content for archive purposes. The problem is, I am *really* bad and slow with website design, it's way too open-ended for me and I am effectively style-blind. So I'm asking for help from some dedicated/grateful Mason user(s) out there with some design sense. All i need is a clean HTML/CSS home page and skeleton, with logo and color choices, and I can add any additional pages. :) You'd be saving hours of painful effort for me. I'd be happy to return the favor by working on your favorite features/documentation, by giving you personalized help in converting your existing Mason 1 site, etc. And hopefully it will lead to more adoption/retention for Mason. Let me know - thanks! Jon -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason Tidy!
On Oct 1, 2012, at 5:05 AM, Pedro Melo wrote: Hi, On Fri, Sep 28, 2012 at 6:47 PM, Jonathan Swartz swa...@pobox.com wrote: Yes, this was certainly a bug... I tried to preserve both cases (newline and no-newline at end of file), but it turns out that perltidy always enforces a newline at end, so I'm just going to do the same. Hope no one feels strongly about not having a newline at end. I for one would prefer to keep the last newline. Some git tools give me warnings when the last newline is missing (eg git-gui). Yup, that's what I did. Speaking of white-space: empty % lines gain an extra space (also visible in git-gui as a big read block :) ). More: if a file ends with a empty % line, the entire line is removed… Fixing… -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason Tidy!
[forwarding to list] Yes, this was certainly a bug... I tried to preserve both cases (newline and no-newline at end of file), but it turns out that perltidy always enforces a newline at end, so I'm just going to do the same. Hope no one feels strongly about not having a newline at end. Thanks Jon On Sep 21, 2012, at 7:36 AM, Giovanni Pensa wrote: Thanks for Mason-Tidy! I've just started playing with it, but I've found a misfeature that stops me from using it: the last line loses the newline. (We could debate about it, but I really likes newlines at the end of files.) -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Different url's same actions...
This ought to be easy to do, as it's a common need. You can certainly do this in /eshop/warenkorb/versand: % $m-go('/echop/cart/shipping'); but that's tedious, there ought to be a way to create a single configuration table and handle this all at a higher level just before control enters Mason. Let me think a little about the cleanest place. On Sep 26, 2012, at 9:04 AM, T.Lawrance wrote: Hi all, What is the best way achieving translated url support with Poet? Mean, in the english version of site want: /eshop/cart/shipping e.g. german version should be: /eshop/warenkorb/versand the shipping.mc and versand.mc are doing the same thing, only in different languages, and they are should be at different path, like shipping.mc should be in cart directory and versand.mc should be in warenkorb directory. But the components are the same... What is the best practice in the Poet for url-translation? - doing many symbolic links? because the components must be files... - or try somewhat (don't know how, yet) rewriting urls in input to english version and at output to translated one (where to do this?) in some middleware level, or at Poet level? Any ideas, please? thanx. ak. -- How fast is your code? 3 out of 4 devs don\\\'t know how their code performs in production. Find out how slow your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219672;13503038;z? http://info.appdynamics.com/FreeJavaPerformanceDownload.html___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason tidy
Ok. I forgot about backslashes at end of line so I'll look at those. But I have no idea what that was there in the first place. Are you telling me you are using this alpha software with no backups??! :) On Sep 21, 2012, at 6:04 AM, Shane McCarron wrote: Looks great so far! The only thing I ran into was some weirdness I had in an autohandler. I had lines like this: %method methodName\ %args $foo /%args\ HTML\ /%method It didn't like the escaped newline. But I have no idea what that was there in the first place. On Fri, Sep 21, 2012 at 4:49 AM, Jonathan Swartz swa...@pobox.com wrote: I've released masontidy 2.53 which tidies %perl blocks and %-lines together. It should also handle the case below with intervening methods, btw. Give it a try and let me know how it does on your code base. Jon I think basically all the perl sections should combine with all the inline sections but I can't imagine how you will do that. I do NOT think it would be necessary to support weird constructs like main component perl sections that have other sections embedded in them. For example %perl some perl code /%perl some HTML other HTML % inline mason %method something %perl . /%perl embedded HTML in a method % inline in a method more HTML %perl another block /%perl /%method % other inline mason back in main component %perl perl in main component /%perl some embedded HTML in main component I probably do nonsense like that, but if I do I should really be moving those methods to the end of the component. When running masontidy on a sample file I get a lot of output like Ignoring -b; you may not specify a destination stream and -b together. Not sure what that means, but I assume it is something from perltidy. No idea, did you put -b in your perltidy options list? You shouldn't need to. I am an idiot - I forgot there even WAS a local .perltidyrc. I haven't used perl tidy on that project in years. Thanks! When building on a Windows machine the generated .bat file works fine, but the generated native perl has the wrong #! line in it. Not sure if there is a way to fix that, but if there is then it would work right when called from a Cygwin shell on Windows (I use that for a development environment sometimes). I just have #!/usr/bin/perl at the top of bin/mason, I've always thought that was the correct thing to put. I don't have a Windows environment but let me know if you figure out a way to fix it. I will give it a think. -- Shane McCarron halindr...@gmail.com -- Shane McCarron halindr...@gmail.com -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason tidy
I've released masontidy 2.53 which tidies %perl blocks and %-lines together. It should also handle the case below with intervening methods, btw. Give it a try and let me know how it does on your code base. Jon I think basically all the perl sections should combine with all the inline sections but I can't imagine how you will do that. I do NOT think it would be necessary to support weird constructs like main component perl sections that have other sections embedded in them. For example %perl some perl code /%perl some HTML other HTML % inline mason %method something %perl . /%perl embedded HTML in a method % inline in a method more HTML %perl another block /%perl /%method % other inline mason back in main component %perl perl in main component /%perl some embedded HTML in main component I probably do nonsense like that, but if I do I should really be moving those methods to the end of the component. When running masontidy on a sample file I get a lot of output like Ignoring -b; you may not specify a destination stream and -b together. Not sure what that means, but I assume it is something from perltidy. No idea, did you put -b in your perltidy options list? You shouldn't need to. I am an idiot - I forgot there even WAS a local .perltidyrc. I haven't used perl tidy on that project in years. Thanks! When building on a Windows machine the generated .bat file works fine, but the generated native perl has the wrong #! line in it. Not sure if there is a way to fix that, but if there is then it would work right when called from a Cygwin shell on Windows (I use that for a development environment sometimes). I just have #!/usr/bin/perl at the top of bin/mason, I've always thought that was the correct thing to put. I don't have a Windows environment but let me know if you figure out a way to fix it. I will give it a think. -- Shane McCarron halindr...@gmail.com -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] mmm-mason.el for mason2
On Sep 13, 2012, at 7:40 AM, Vegard Vesterheim wrote: On Thu, 13 Sep 2012 10:08:51 -0400 Jonathan Swartz swa...@pobox.com wrote: I never got MMM mode to work reliably even for Mason 1. :) But it would be awesome if it did work. Anyone using it? Well, I am ;-). The most useful part is automatic indentation. I guess that your recently announced masontidy could help in that regard. Further along the awesomeness scale: For pure perl scripts, I find flymake very useful. Imagine having on-the-fly syntax checking while writing Mason2 code! I guess this would have to activate the mason compiler behind the scenes somehow. Is this possible? You can call $interp-_compile($source_file, $path) where $source_file is the component file and $path is the component path. The latter doesn't really matter for validation purposes. This wlil return the generated class that would normally go into an object file, or throw a fatal error if there was a syntax problem. There ought to be a public API method for this, but I'm not sure the existing _compile is the right level to expose. Give it a try and let me know. Jon -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason tidy
On Sep 13, 2012, at 9:49 AM, Pedro Melo wrote: On Thu, Sep 13, 2012 at 4:02 AM, Jonathan Swartz swa...@pobox.com wrote: masontidy tidies the Perl code embedded in Mason components. It works with See below for an example. Please give it a try (make sure you have backup!) and let me know of problems. Well, the test suite will fail if you (like me) have a global .perltidyrc Not sure if there is a switch to ask Perl::Tidy to disable the global rc file though. Ah. I'll just have to generate an empty .perltidyrc and point it explicitly to that in the tests. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] mmm-mason.el for mason2
I never got MMM mode to work reliably even for Mason 1. :) But it would be awesome if it did work. Anyone using it? On Sep 13, 2012, at 9:40 AM, Vegard Vesterheim wrote: Has anyone attempted to port mmm-mason.el to Mason2? http://www.masonhq.com/?odeForEmacs - Vegard V - -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason tidy
On Sep 13, 2012, at 9:49 AM, Pedro Melo wrote: On Thu, Sep 13, 2012 at 4:02 AM, Jonathan Swartz swa...@pobox.com wrote: masontidy tidies the Perl code embedded in Mason components. It works with See below for an example. Please give it a try (make sure you have backup!) and let me know of problems. Well, the test suite will fail if you (like me) have a global .perltidyrc Not sure if there is a switch to ask Perl::Tidy to disable the global rc file though. Where was your .perltidyrc? I couldn't reproduce this. It looks for ~/.perltidyrc in the perltidy script, but masontidy goes through the Perl::Tidy::perltidy API. -- Got visibility? Most devs has no idea what their production app looks like. Find out how fast your code is with AppDynamics Lite. http://ad.doubleclick.net/clk;262219671;13503038;y? http://info.appdynamics.com/FreeJavaPerformanceDownload.html ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
[Mason] Mason tidy
File under ought to have been written ten years ago, but oh well: https://metacpan.org/module/masontidy masontidy tidies the Perl code embedded in Mason components. It works with %-lines, % % tags, and the various Perl blocks, in both Mason 1 and Mason 2 syntax. It does not (yet) attempt to tidy the HTML or other non-Perl content in a component. See below for an example. Please give it a try (make sure you have backup!) and let me know of problems. Best Jon - BEFORE: %if($contents||$allow_empty) { ul %foreach my $line (@lines) { li%2+(3-4)*6%/li li% foo($.bar,$.baz, $.bleah)%/li %} /ul %} %init my @articles = @{Blog::Article::Manager-get_articles(sort_by=create_time,limit=5)}; /%init AFTER: % if ( $contents || $allow_empty ) { ul % foreach my $line (@lines) { li% 2 + ( 3 - 4 ) * 6 %/li li% foo( $.bar, $.baz, $.bleah) %/li % } /ul %} %init my @articles = @{ Blog::Article::Manager-get_articles ( sort_by = create_time, limit = 5 ) }; /%init -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason2: Filter (component with content) syntax
Hi Roman, There are two separate issues here: (1) where are filters defined, and (2) how are they applied. 1. In Mason 2 filters are defined by methods, rather than by components. This makes sense for a large variety of filters that don't output content of their own but simply process their incoming content in some way. e.g. an uppercase filter: method Upper () { return sub { uc($_[0]) } } However, it is still possible to define a filter out of a piece of component, e.g. your example of a Javascript filter that wraps its input with a script tag: %filter Javascript script type=javascript % $yield-() % /script /%filter 2. As you know the main syntax for applying filters is with perl lines, e.g. % $.Upper {{ some text that will be uppercased % }} I chose this because it seemed like a similar situation to other brace-delimited control structures: if, for, while, etc. However, there is an another syntax for applying filters that is still supported, though currently not documented: % $.Upper { % some text that will be uppercased % } % I think this is more like the inline markup you are looking for. It is too much tag soup for me, but if people like it for certain situations then we could leave it officially supported and document it. Jon On May 16, 2012, at 7:17 AM, Roman Daniel wrote: Hi, I used Mason1 quite a lot and recently switched to Mason2 for new projects. I wonder what was reason for leaving the component with content syntax in favour of perl lines, i.e. why % $.js {{ % }} instead of | $.js / ? In my old code I had components (methods) with content which served as an active markup adding some real markup before and after block of text without any changes to the content. Examples: | SELF:javascript javascript to be properly wrapped by script tag, CDATA section and jquery onDomReady wrapper / SELF:elem, ($important? 'strong': ()) text to be empasized or not/ SELF:elem, ($active? ('a', href=$edit_url): ()) text to be make link or not/ I appreciated that the old syntax was visually similar to HTML markup and could be placed (indented) accordingly. td SELF:elem, ($active? ('a', href=$edit_url): ()) text to be make link or not//td Is there some similar syntax for active markup, not actually changing its content, available also in Mason2? Thanks for reply, Roman Daniel -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Running multiple Mason scripts
Hi Marc - just working through email backlog and noticed that this went unanswered. First of all, as you may have noticed, all the psgi/plack Mason support has moved to Poet, so I'd suggest you look there if you are still pursuing this. If you have several different sites, I think it is cleanest to have a separate Poet environment for each of them, with its own app.psgi and Mason component root. You can run them on different ports and have an nginx or similar running in front that maps domain names to different ports. This is what I do on my own servers. HTH, Jon On May 5, 2012, at 10:06 AM, sono...@fannullone.us wrote: Hello all, I'm new to Mason and just installed the demo script from here: https://github.com/jonswar/perl-mason/tree/master/eg/blog From the README, I'm running it via $ plackup app.psgi I'm curious, though, how I would run multiple Mason scripts? What if I have, say, a shopping cart, a blog, and something else? Would I run them on different ports? Also, how would I run them on a shared server? Can they just be uploaded to the cgi-bin directory and run like plain vanilla Perl scripts? I know that I could run them under CGI, but I read where it's very slow doing it that way. If someone could point me to something to read, I'd appreciate it. Thanks, Marc -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] static analysis tool for Mason
Can you be more specific? What in particular are you looking to analyze? On Jul 3, 2012, at 6:24 PM, Sridhar, Meera wrote: Hi, Is there a static analysis tool (or something similar) for Mason. Thanks! -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats.http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Components distribution format template switcher
On Jul 2, 2012, at 5:17 AM, A Kobame wrote: Hi folks, I'm wondering that here is any preferred/recommentd component distribution method? Display components tend to be site and application specific; I've never figured out a way to package them generically. I think the best thing to do for now is publish components, or entire example Mason/Poet sites, on github and let people pick out what they need. The second question is about the html-template separation. E.g. What is the best way having an separate directory, e.g. /templates, where one can put some _poet-specific_ site-templates, together with template-specific methods, css, js and etc.. and the main execution flow only fill the template as one of last actions - probably from /Base.mc. How to implement for example: http://example.com/some/component?template=print e.g. in the normal execution flow the site will use some default template, but when get the arg template=print (or any other template-name) will search the /templates for the requested template (like print) and will use/fill that one... I understand than this is too application specific, and some apps simply doesn't need this, but would be nice have some hints, what is the right way to do this tasks like this. Is the right way using subrequests here with $m-visit ? Any other hints? Yes, I think $m-visit is the right way to do this. Jon -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Official HTML::Mason (Mason1) repository?
https://github.com/jonswar/perl-html-mason is going to be the official one going forward. It was cloned from Dave's git server but hasn't been used for a release yet. On Jun 29, 2012, at 3:56 AM, Pedro Melo wrote: Hi, which git repository is the canonical for HTML::Mason? Thanks, -- Pedro Melo @pedromelo http://www.simplicidade.org/ http://about.me/melo xmpp:m...@simplicidade.org mailto:m...@simplicidade.org -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mastering an app.psgi for multiple PSGI applications - poet's tree and config
On Jun 12, 2012, at 7:07 AM, Pedro Melo wrote: Hi, On Tue, Jun 12, 2012 at 12:50 PM, A Kobame kobam...@gmail.com wrote: I want run more different applications under STARMAN, so my app.psgi will looks like: [...] the question is: how to correctly configure the two poet apps, when - they are in separate trees (different dirs, different components, different config key-values, but - one Startman (plackup for development) but later for production want Starman - one /static want use poet - not pure Mason (because maybe someday will move the apps into separate computers, so want use $poet's config YAML and so..) Any recommendation? AFAIK, you can't. There can be only one Poet app per perl interpreter. ... Eventually I'll have to tackle this, but I'm not sure if Jonathan is willing to accept a pull request on this. So be prepared to keep your private Poet tree if you really cannot have multiple starman's. Yes, right now there are a number of singletons in Poet: the environment, the configuration, and the Mason interpreter. This is easiest and most convenient in the common case, but obviously there's more than one person who would like multiple Poet object sets per process... Unfortunately I'm not in this situation right now, so the solution is likely to come from a motivated external party. Pedro, I'd certainly handle a pull request that solves this if it doesn't break how things work for current folks. :) Jon -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] PHP makes bad things happen?
That's really strange. And Mason and PHP configured on separate paths? Or are they processing the same URLs, one wrapping the other? On May 29, 2012, at 9:10 AM, Eddie Rowe wrote: The ISP techie's answer sounds like a load to me. Everything used to work just fine before versions of PHP were changed. Testing your theory: PHP 5.2.14 installed, working with a disabled Mason. reenabled mason and php files still render, but mason directed files throw the 502 error. On Tue, May 29, 2012 at 11:59 AM, Jonathan Swartz swa...@pobox.com wrote: 9) Was told by the ISP techie that there must be something in my Mason scripts that conflict with PHP Can you confirm or deny this part at all? In particular can you reinstall php5, disable Mason temporarily, and see that php5 works w/o Mason? That would have to be a first step. Jon -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
[Mason] new Mason/Poet site - help wanted
I want to create a new Mason/Poet site to replace the current masonhq.com. I see it along the lines of sites like Moose (http://moose.iinteractive.com/) PSGI/Plack (http://plackperl.org/) Dancer (http://perldancer.org/) i.e., much less ambitious and self-contained, mostly some nice marketing, a few menu items, and links off to search.cpan.org and github. I'll also host the existing frozen wiki content for archive purposes. The problem is, I am *really* bad and slow with website design, it's way too open-ended for me and I am effectively style-blind. So I'm asking for help from some dedicated/grateful Mason user(s) out there with some design sense. All i need is a clean HTML/CSS home page and skeleton, with logo and color choices, and I can add any additional pages. :) You'd be saving hours of painful effort for me. I'd be happy to return the favor by working on your favorite features/documentation, by giving you personalized help in converting your existing Mason 1 site, etc. And hopefully it will lead to more adoption/retention for Mason. Let me know - thanks! Jon -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] just wondering: why is Poet called Poet?
Named after my favorite robot in Infocom's Suspended (http://en.wikipedia.org/wiki/Suspended). -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason advantages
Hi Marc, As the author I'm obviously biased, but I'll give you my take on the three key differences between Poet+Mason and analagous combos, e.g. Catalyst+TT, Dancer+TT, and Mojolicious. 1) Builds upon the best of CPAN Poet+Mason depends proudly on Moose and Plack/PSGI (as well as a few other best-of-breed CPAN distributions). Being able to depend on the presence of these powerful modules means that we get quite a lot for free, and can focus on interesting features instead of reinventing the wheel. Mason components compile down to Moose classes. Mason and Poet plugins are Moose roles. Poet freely takes advantage of PSGI middleware and uses the Plack::Request/Plack::Response objects as a base request/response API. There aren't separate branches of code or feature sets or documentation for Moose/non-Moose users or for PSGI/non-PSGI users. In contrast, Dancer and Mojolicious are proud of their lack of dependencies, because it makes installation easier; true enough. But this means a lot of wheel reinvention and divergent usage patterns depending on what is present. Dancer, for example, invents its own before/after hooks and its own base request/response API. Mojolicious, with its zero dependency promise, has to reinvent everything for its baseline behavior. Some people do seem afraid of the cost of Moose installation and of largish installation chains in general. So for them, the lack of dependencies is an advantage. My feeling is that tools like local::lib and perlbrew and cpanm and Pinto and Carton make it increasingly easy to control the Perl and CPAN environment that your application uses (with or without root access), so why not depend on the best? 2) Perl-based template language Mason does not attempt to invent a new programming language syntax for templates. It is just Perl, wrapped with just enough extra syntax and features to facilitiate templating. Mason components compile into Moose classes in an obvious way. This gives Mason templates enormous power (whatever Perl can do, Mason can do) and just as importantly, predictability - if you know Perl and Moose then you know how your components will behave, and if you forget how a piece of Mason syntax translates, you can just look at the compiled class or walk through with the Perl debugger. In contrast, TT is really is a separate language that you have to learn and understand. It is well-designed in some aspects, but is undeniably (and intentionally) weak compared with Perl and has a number of well-known quirks (e.g. with variable scoping). One purported advantage of TT over Mason is that it is friendlier for non-programmers (e.g. designers). Another is that its weakness as a programming language is actually a strength, in that it encourages you to put complex code into Perl classes. The paragraphs above apply equally to HTML::Template, except it is even further along the intetionally-weak/quirky/designer-friendly spectrum. 3) Combined controller and view In most frameworks the controllers and views are strictly separated. A controller gathers data from appropriate model(s), then constructs a hash of data and passes it to a template to render the page. In theory the controller method and template are decoupled, so that you could create multiple templates for a single controller method (one for browser, one for mobile, etc.). In practice, you almost never do this; there is one template per controller method, and the two *are* quite coupled. If you want to figure out how a page is rendered, you have to look at both the controller and view. If you want to change how the page is rendered in any meaningful way, you have to modify both the controller and the view. So with Catalyst development you constantly having to look in, and edit, two places at once. You also have more decisions to make about which code goes where. In Poet+Mason, it's very clear which component handles a URL, and that component contains both the controller and the view. You only have to look in one place and modify things in one place, and you aren't wasting time packing and unpacking a stash in between two coupled pieces of code. Catalyst and MVC devotees would say that the separation between C and V is valuable, to ensure you aren't doing too much in templates. Whether this applies when said templates compile to full OO classes is less clear. Hope that helps! Jon -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason2: no default HTML escaping
On Wed, 9 May 2012, Paul Wallingford wrote: The problem is context. Escaping is appropriate in certain contexts and not in others. There are many ways to determine context, quite a few of them slow. The speed issues of Mason2, due largely to Moose as discussed in the past, means you do not want to add anything that makes things even slower. Are you talking about a speed issue besides startup speed? Honestly, I'd surprised if Mason 2 was significantly slower than Mason 1 at run time. Mason 2 is noticeably *faster* than Mason 1 in terms of raw component call speed. This is because Mason 1 component calls did a bunch of custom stack maintenance and so on, whereas in Mason 2 it is pretty much component_class-new(@args)-run(). Mason 2 is probably slower to startup than Mason 1, like anything that uses Moose. I can't get real worked up over this. I use Moose for all sorts of stuff and the startup speed never seems to bother me. I guess I'm not running lots of tiny scripts real frequently? Need to rerun and publish these benchmarks. Jon -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason2: no default HTML escaping
As you noted, escaping by default would be fine and largely a non-argument if Mason were explicitly a Web template language, but it's not. I'm confused Stephen, because this statement seems to contradict your other statement that escaping by default never works right, because too many templates contain a mix of html, javascript, css, etc. and that this is action at a distance (paraphrasing). Mason is not explicitly a Web template language, but Poet *is* explicitly a web framework and reserves the right to tweak Mason settings appropriately. So it might well be reasonable to turn on HTML escaping by default for Poet. In any case, it seems like default escaping is a reasonable feature for Mason to make available sans any scary caveats. Though ideally you'd be able to turn it on/off on a component or a directory basis, or even on a partial-component basis, rather than a giant on/off switch for your whole site. If a thoughtful framework like django does this by default, then I'd say it's a pretty good bet Poet ought to as well. Jon -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason2: no default HTML escaping
I think the default for text outside a %perl block should be HTML style escaping, since it seems that most Mason2 apps are web apps and most non-web Mason2 apps would need some sort of Perl to generate their output (and there is always the here-doc for boilerplate text). Have to disagree, I use Mason to generate httpd.conf files all the time. In fact Poet will have a plugin to do just that. But for the specific Mason interpreter that Poet creates to answer web requests, I am leaning towards escaping html by default, as long as there are various convenient ways to turn it off. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Trouble Installing Poet
The latest Moose (2.06) broke Mason pre-2.19 in a big way; I was importing MooseX::HasDefaults::RO in an incorrect way that just happened to work before. Hence, lots of errors about attibutes. Please upgrade to the latest Mason and try again. Let me know if this does not work with the latest Mason and Poet. Thanks Jon On May 5, 2012, at 8:13 PM, sono...@fannullone.us wrote: We're having trouble installing Poet 0.05 on OS X. The install can be forced, but it's unusable. Here's the summary: Test Summary Report --- t/Conf.t (Wstat: 1536 Tests: 6 Failed: 6) Failed tests: 1-6 Non-zero exit status: 6 t/Environment.t (Wstat: 256 Tests: 1 Failed: 1) Failed test: 1 Non-zero exit status: 1 t/Import.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/Log.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/PSGIHandler.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output t/Script.t (Wstat: 512 Tests: 2 Failed: 2) Failed tests: 1-2 Non-zero exit status: 2 t/Util.t (Wstat: 65280 Tests: 0 Failed: 0) Non-zero exit status: 255 Parse errors: No plan found in TAP output Files=10, Tests=12, 15 wallclock secs ( 0.07 usr 0.04 sys + 12.35 cusr 1.12 csys = 13.58 CPU) Result: FAIL Failed 7/10 test programs. 9/12 subtests failed. make: *** [test_dynamic] Error 255 FAIL There are also a lot of lines like these: Attribute (app_name) of class Poet::Environment has no associated methods (did you mean to provide an is argument?) Attribute (conf) of class Poet::Environment has no associated methods (did you mean to provide an is argument?) Attribute (importer) of class Poet::Environment has no associated methods (did you mean to provide an is argument?) We're running Perl 5.14.2 via Perlbrew and everything is up-to-date. Any ideas on why this is failing and how I can get it installed? Thanks, Marc -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Odd session behaviour - plackup vs starman
Please keep replies on the mailing list, thanks. You need to use $session-set and $session-get. Otherwise you are just setting the in-memory hash, which would only work in a single-process server like plackup. You need to use the File store for the same reason - Starman has multiple processes. HTH Jon On May 2, 2012, at 12:00 PM, Dane Buson wrote: builder { # Include PSGI middleware here enable 'Session'; $app; }; I tried using file Session, and didn't see different behavior. enable Session, store = File; Versions: Starman 0.3000 Plack 0.9972 Thanks. On Wed, May 2, 2012 at 11:44 AM, Jonathan Swartz swa...@pobox.com wrote: How is the session middleware configured? On May 2, 2012, at 10:58 AM, Dane Buson wrote: I'm having trouble where things I store in session work in Plackup, but not Starman. I'm getting an undefined for my $myid variable in Starman but not in Plackup. Code: %init my $session = $m-req-session; my $myid = $session-{myid}; -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason2: no default HTML escaping
On Mar 7, 2012, at 1:49 AM, Pedro Melo wrote: On Wed, Mar 7, 2012 at 12:11 AM, Jonathan Swartz swa...@pobox.com wrote: I hear your concerns. So I'm not sure which of these you are suggesting: 1) Substitution tags should be HTML-escaped by default in Mason. This one would be my choice *if* Mason was used only for the web. I still think it is difficult to est this default, given that substitution tags can be used when generating javascript, JSON, css, etc. even in a web environment. At the very least we'd need the ability to turn the default on/off on a per-component or directory basis, rather than for an entire site. 2) DefaultFilter should be implemented and documented in core Mason, so that it doesn't require a separate plugin install. I think this should happen either way. Maybe not move into the core, but at least document it, and remove the big scary CAVEAT section from the DefaultFilter docs (I know its not your module, but I think if you suggested it to Stephen he would agree). For now, I've added DefaultFilter to the Mason documentation in multiple places. The previous paragraph, and the fact that we can't target components to specific HTTP methods (like Dave mentioned in the GET/POST parameters thread), argue that the Mason dispatcher is a bit too limited. I have mixed feelings about it. On one hand I like that its simple, just drop files into a directory and you are done. On the other, if we could add route filters for HTTP method, mime/type and/or others, we could tweak the defaults for each request, and provide saner HTTP error codes. The Mason dispatcher will probably always be feature-light compared with other frameworks. But adding the ability to filter on GET/POST does seem reasonable. Suggestions on syntax welcome. It could be a class method, e.g. CLASS-allow_http_methods('POST'); or perhaps Mason looks for specifically named methods, e.g. method handle_POST { ... } -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason Critic
I wasn't aware that had been written. :) On Apr 23, 2012, at 2:22 AM, Vyshak K wrote: Hi, I am facing problem in getting HTML::Mason::Critic module. Can you tell me where i can get this module. Thanks, Vyshak K -- DISCLAIMER: This e-mail message may contain confidential, proprietary or legally privileged information. It should not be used by anyone who is not the original intended recipient. If you have erroneously received this message, please delete it immediately and notify the sender. The recipient acknowledges and / or as the case may be, are unable to exercise control or ensure or guarantee the integrity of/over the contents of the information contained in e-mail transmissions and further acknowledges that any views expressed in this message are those of the individual sender and no binding nature of the message shall be implied or assumed unless the sender does so expressly with due authority of VIT as applicable. Before opening any attachments please check them for viruses and defects. -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] I need help !!!!!!!
What error? On Apr 24, 2012, at 8:54 AM, Eugenio Duran Aroche wrote: I have problem whith methods in Mason, I have 2 component (comp1.mas and comp2.mas), and the methods is on comp1.mas and call it from comp2.mas, and return error. comp1.mas %method metodo % print hello world; /%method comp2.mas % my $comp = $m-fetch_comp(comp1.mas); % $comp-call_method(metodo); -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] I need help !!!!!!!
You must have an error log somewhere with a more specific error than that. On Apr 24, 2012, at 9:29 AM, Eugenio Duran Aroche wrote: The erro is An internal error related to a template has occurred De: Jonathan Swartz swa...@pobox.com Para: Eugenio Duran Aroche edu...@estudiantes.uci.cu CC: mason-users@lists.sourceforge.net Enviados: Martes, 24 de Abril 2012 12:09:01 Asunto: Re: [Mason] I need help !!! What error? On Apr 24, 2012, at 8:54 AM, Eugenio Duran Aroche wrote: I have problem whith methods in Mason, I have 2 component (comp1.mas and comp2.mas), and the methods is on comp1.mas and call it from comp2.mas, and return error. comp1.mas %method metodo % print hello world; /%method comp2.mas % my $comp = $m-fetch_comp(comp1.mas); % $comp-call_method(metodo); -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
[Mason] Poet: a web framework for Mason
I'm pleased to announce Poet, a modern Perl web framework designed especially for Mason developers: http://search.cpan.org/perldoc?Poet Features include: * A common-sense directory hierarchy for web development * A configuration system that scales elegantly with multiple coders and multiple layers (development/production) * Integration with PSGI/Plack for server APIs and engines * Integration with Log::Log4perl for logging, wrapped with much simpler configuration * Integration with CHI for powerful and flexible caching * Easy access to common objects and utilities from anywhere in your application * And of course, the power of Mason, for request routing and content generation. Poet was designed and developed over the past six years at Hearst Digital Media. Today it is used to generate Hearst's magazine websites (including Cosmopolitan, Esquire and Good Housekeeping) as well as many internal systems. I'm very grateful to Hearst for agreeing to this open source release (though they bear no responsibility for its support or maintenance). Some people nowadays use Mason as a view layer in a large MVC framework (i.e. as a replacement for TT), and that's just fine, even if it leaves some of Mason's features untouched. But Poet is a web framework for those who, like me, think Mason is a great way to handle the *whole* web request, not just the view layer. For those who like their page logic right next to their template, MVC doctrine be damned. Poet just turns web requests into Mason requests, and happily lets Mason handle the rest of the work. At the same time it provides the web development structure and utilities that Mason, as a templating system, has always felt obligated to omit. There's much more to come than I could put in this initial release, and I'm looking forward to pressing on with it! Blog announcement with similar content here: http://www.openswartz.com/2012/04/21/poet-a-web-framework-for-mason/ Feedback welcome as always. Best Jon -- For Developers, A Lot Can Happen In A Second. Boundary is the first to Know...and Tell You. Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! http://p.sf.net/sfu/Boundary-d2dvs2 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] M2: protect embedded javascript against DollarDot Plugin
Oliver - in answer to your original question, I don't have any good ideas about the best way to escape $. in code, but I'm open to ideas you have and would be willing to put some kind of escaping syntax in, as long as it didn't break something else in the process :) On Apr 1, 2012, at 7:49 AM, Roman Daniel wrote: I would use Moose (and Mason) modifiers If you really need the return value of javascript %around javascript % my $added; % $.Capture(\$added) {{ $.get(/news, {}, function(d) { $(#news).append(d); }); % }} return $orig-($self). $added; /%around It is a bit cumbersome. But If you dont' need the return value and the only usage of $.javascript is to immediately output it % $.javascript % things go much simpler %after javascript $.get(/news, {}, function(d) { $(#news).append(d); }); /%after and you can replace % $.javascript % with % $.javascript; (% $.javascript % still works, but I think is confusing because the value is output as a side effect) Roman Daniel Dne 31. března 2012 20:26 Oliver Paukstadt pst...@sourcentral.org napsal(a): Hello, I am using H::M for a long time and started to play with M2 now. While doing some experiments porting one of my sites I had to embed some jQuery code: %class method javascript {return $self-SUPER::javascript() . q{ $.get(/news, {}, function(d) { $(#news).append(d); }); }; }; /%class This results in $self-get (/news, {}, function(d) { after processing. Any idea how to protect or preserve the jquery DollarDot inside single quotes? $}.q{.get(/news, ... is really ugly and octal encodings are only available in interpolating double quotes. Greetings Oliver -- Oliver Paukstadt pst...@sourcentral.org -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason2: no default HTML escaping
On Mar 6, 2012, at 5:18 PM, Paul Wallingford wrote: On 3/6/2012 4:11 PM, Jonathan Swartz wrote: I hear your concerns. So I'm not sure which of these you are suggesting: 1) Substitution tags should be HTML-escaped by default in Mason. 2) DefaultFilter should be implemented and documented in core Mason, so that it doesn't require a separate plugin install. #1 is hard to do because Mason is supposed to be content-type agnostic - usable for HTML generation but also other kinds of content generation. #2 is more reasonable. Here is a question to ponder. Mason, it seems, was born originally with the idea in mind for generating web pages. Tools that are generic have their place, but so do tools that specialize. Tools that specialize can implement optimizations since they do not have to consider possibilities outside their specialty. Case in point is the question of HTML filters in the Mason core. So, the question is: Has anyone used Mason for anything serious other than web page generation? If the amount of people or projects using Mason that are not web based is essentially zero, it may be better to add web specific features and optimizations. I do not know the answer to this question, except my own experience, which is that 100% of my Mason projects are for the web. I use Mason to generate httpd and other conf files at work. You're probably correct, though, that 99% of Mason's use is in generating web content. However, that isn't always HTML pages; I've used it to generate javscript and JSON results too, where HTML escaping would definitely be unwelcome. So I think it's better to have a well-supported, easy way to html-escape all substitution tags than to put this in as the global default. Jon -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason2: no default HTML escaping
On Mar 7, 2012, at 1:59 AM, Jérôme Étévé wrote: On 7 March 2012 09:49, Pedro Melo m...@simplicidade.org wrote: #1 is hard to do because Mason is supposed to be content-type agnostic - usable for HTML generation but also other kinds of content generation. The default filter is defined in the interpreter instance. If you need to use Mason to generate any type of content, you can perfectly have different interpreters with different default filters. Anything wrong with that? Nothing wrong with that. It's fine to be able to set a default filter in each interpreter. I just don't think it can be the default for Mason out of the box. If users really insist on having the same Mason interpreter to render different types of contents, maybe the default filter should be a property of the component? Define it in Base.mc for your HTML generating component directory .. job done. That would be nice. The problem is that the default filter affects compilation of the component (in particular, it affects how % % tags are converted to Perl) so it isn't a simple call you could put in the %class section, for example - it would have to be a %flags, and currently there is no way to inherit those. But I agree, it's appealing to be able to set the default filter on a per-component basis, just for the components that output HTML. Would just like a better syntax than %flags default_filters = ['H'] /%flags Yuck. Jon -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason2: no default HTML escaping
I hear your concerns. So I'm not sure which of these you are suggesting: 1) Substitution tags should be HTML-escaped by default in Mason. 2) DefaultFilter should be implemented and documented in core Mason, so that it doesn't require a separate plugin install. #1 is hard to do because Mason is supposed to be content-type agnostic - usable for HTML generation but also other kinds of content generation. #2 is more reasonable. On Mar 5, 2012, at 4:55 AM, Jérôme Étévé wrote: On 5 March 2012 12:33, Pedro Melo m...@simplicidade.org wrote: For now I'm using the DefaultFilter plugin. It saves me a lot of typing and I believe it to be worth it, so my problem is solved. I Agree with Pedro. Being able to define a default filter and explicitly choose another one (or none) when needed is much better from a security point of view, but also for programming convenience (who said I'm lazy at typing | html ? :)). After all, software that uses default settings (right now I'm thinking of Catalyst's default model or default view) is not so uncommon.. -- Pedro Melo @pedromelo http://www.simplicidade.org/ http://about.me/melo xmpp:m...@simplicidade.org mailto:m...@simplicidade.org -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Jerome Eteve. http://sigstp.blogspot.com/ http://twitter.com/jeteve -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Can Mason be used without a server?
Well, you need a server of some kind to create a web interface, but there are *very* simple servers nowadays, e.g. servers that fit inside a single Perl process. Have you tried getting this to work on your local machine: http://search.cpan.org/perldoc?Mason::Manual::Tutorial Jon On Feb 22, 2012, at 9:01 PM, Harvey S. Frey wrote: Problem: I want to use an HTML page as an alternative to Windows Explorer, so I can annotate, edit and sort files. BUT, Javascript won't let me access any local files. Desired solution: Embedding perl scripts to let me, for example, run an editor on a file. I suppose I could do it if I ran a local server, like TomCat, but that gets to be too much of a kludge. Question: Can I use Mason to embed perl scripts in an HTML file, which I can run locally, without a server? -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] www.masonhq.com back to work?
Am 11.02.2012 um 13:04 schrieb Jonathan Swartz: Nowadays, the action has moved on to other places, like the Catalyst list. People still use Mason 1 and/or 2, but it's a much smaller part of their development stack. This, BTW, describes me. I use Mason 1 solely for templating on new projects. If I switch to Mason 2 that won't change. Yes, sadly Dave is one of those that believe in a separate controller layer in modules. They are all wrong, but they comprise about 90% of the Perl community so what can you do :p Could you explain your opinion about this They are all wrong a bit more ? Nic Wolff summarized this pretty well, but I'll give my spin. In Catalyst, URLs are handled by controller classes. A controller gathers data from appropriate model(s), then constructs a hash of data and passes it to a template to render the page. In theory the controller method and template are decoupled, so that you could create multiple templates for a single controller method (one for browser, one for mobile, etc.). In practice, there is almost always a one-to-one correspondence between controller method and template, and the two *are* quite coupled. If you want to figure out how a page is rendered, you have to look at both the controller and view. If you want to change how the page is rendered in any meaningful way, you have to modify both the controller and the view. So I find that with Catalyst development I'm constantly having to look in, and edit, two places at once. I also have more decisions to make about which code goes where. In Mason, URLs are handled by components. A component gathers data from appropriate model(s), then renders the page itself. You only have to look in one place and modify things in one place. Now with Mason 1 one could make a case that it's better to put logic in real OO classes whenever possible. With Mason 2, components *are* Moose classes; you get just as much OO power and goodness in a component as you do in a class. For example, a component can have a BUILD method that sets up attributes based on URL, params etc., and a number of render methods that refer to those attributes. This is a much richer controller-view interaction than passing a hash between two completely separate pieces of code. Jon -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] www.masonhq.com back to work?
I've little interest in trying to make Mason 2 lightweight enough for standard CGI. Honestly given the ready availability of mod_perl, FastCGI, and Starman, I don't understand why standard CGI is even considered a viable option anymore (but I'm sure diehard CGI fans will yell at me for saying this). I need to deply on my $4 per century hosting, but I need to use all the latest software, and I expect everything to just work even though I can't install CPAN modules, get a shell, or use more than 8MB of memory. Of course, while I joke, this is exactly why PHP has been so insanely popular, so there's a lot to be said for actually making this work. Yes, and I'm glad some other Perl solutions make an effort to work in a lightweight environment. (I know Mark Stosberg has long been the champion of plain CGI users for example). I'm just not interested in competing in this space myself. I'd rather cater to the power users that have a reasonably robust hosting solution and don't mind installing a few dependencies. -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] www.masonhq.com back to work?
On Feb 10, 2012, at 7:57 PM, Dave Rolsky wrote: On Thu, 9 Feb 2012, Paul Wallingford wrote: 1) Different configurations for the web server side. How do I make this work with: - Apache / mod_perl (for production) - Apache /Fast CGI (for production) - Standard CGI (for development or servers I cannot change significantly) - other servers such as AOL, etc. Use Catalyst, Dancer, or some other framework that supports all of these (and other) deployment modes. Plack/PSGI supports all these deployment modes, in fact it's kind of their raison d'etre. You don't need Catalyst/Dancer for that. (In fact one of the things that bother me about Catalyst/Dancer is that they implement their own support for this instead of just relying on Plack/PSGI - in Catalyst's case this is historical, Dancer has less of an excuse other than not wanting dependencies.) 6) Moose is slow. So slow, that even the Moose people address it in their FAQ. What can I do to speed it up? What if I can only run on a standard CGI server that does not have mod_perl? Is it possible to use Mouse instead? Will Mason2 have a conniption? Are there things I can do with Mason so that it will not utilize some of the slower Moose features? Moose doesn't have a FAQ, so I'm not sure what you're referring to. search.cpan.org/perldoc?Moose::Manual::FAQ sure looks like one :) Here's some other possibilities ... * Nobody is using Mason 1 _or_ 2. They've all moved on to Template::Declare, Quicksilver, and Ruby on Rails. Rails is for cool people. Those of us still on the list are totally unhip losers. I'd rephrase that as follows: Few people are using Mason or Perl for *new* web development projects; the've all moved on to Rails and Django. At least that's what I observe from my perch in San Francisco, which admittedly has a higher than normal share of hip people and startups. Compare these pages to see what I mean: http://sfbay.craigslist.org/search/jjj/sfc?query=perlsrchType=T http://sfbay.craigslist.org/search/jjj/sfc?query=railssrchType=T I know this is only one datapoint, but it's one that's very relevant to my life and has been moving in the wrong direction for a while. Nonetheless, I'm still hopelessly devoted to Perl and so seek out the few jobs that feature it. :) * Mason 1 is very stable, and it has good documentation. People are happy with it for now, and so aren't jumping to use a new templating system, even one named Mason 2. Yes. And just so everyone understands where my expectations are at: I didn't *expect* a whole bunch of people to jump to Mason 2 any time soon (if ever). It was not that kind of mild upgrade. It's a big leap, something of an experiment, possibly a little before its time (given that Moose and especially Plack/PSGI are still maturing), more like a whole new templating system with a similar syntax than an upgrade as its name might suggest. I briefly thought about changing the name, but I'm too fond of this one. * The list was a lot more active in the days when people used Mason as their entire web framework, often paired with mod_perl. I can't count the number of threads we've had about mod_perl issues. Yes. Take a look at the mailing list archives during the peak - e.g. http://marc.info/?l=masonr=1b=200010w=2 - and notice how many questions are not about Mason per se but rather mod_perl and Perl web development in general. I too see a lot of those same discussions in the Catalyst list now. Nowadays, the action has moved on to other places, like the Catalyst list. People still use Mason 1 and/or 2, but it's a much smaller part of their development stack. This, BTW, describes me. I use Mason 1 solely for templating on new projects. If I switch to Mason 2 that won't change. Yes, sadly Dave is one of those that believe in a separate controller layer in modules. They are all wrong, but they comprise about 90% of the Perl community so what can you do :p Jon -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] www.masonhq.com back to work?
On Feb 10, 2012, at 9:29 PM, Bill Walz wrote: Hi all. Mason 1 has paid my bills for over 7 years plus. It is amazing. I get what he is saying. But all Linux distributions now support it. gone are are the days of libapreq2 pain. I guess what I am trying to say is that I have many many components that would help folks. In fact now I am jQuery and jqGrid focused I have them them as well. Serverd up through Mason. But know way to give back. Mason 1 is shunned but why? Mason2 is a concept. I deal with production. Who is shunning Mason 1?? Bill I'm really happy that you and others still get a lot of value from Mason 1. I hope I haven't implied anywhere that I expect people to switch over to Mason 2 if Mason 1 is serving their needs. (Though I understand that the name itself can't help but imply that a little.) I just don't want to *work* on Mason 1 anymore, because the code is old and I'm tired of looking at it :), and honestly there isn't that much that needs to be done with it other than the occasional bug fix. Jon -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] www.masonhq.com back to work?
I do understand that much of this delay with Moose is startup and that by pulling various tricks, like FastCGI or mod_perl, performance can be improved past the first invocation. I have not run a comparison test using mod_perl or FastCGI yet. Yes, much of the delay is startup - I'd be interested to see a comparison test with a persistent Perl environment. In my brief benchmarks Mason 2 was actually *faster* than Mason 1 in terms of component call overhead, because it is leveraging Moose's optimizations for constructors and method calls as opposed to implementing its own call stack etc. FastCGI and mod_perl aren't tricks, they are the most basic common sense implementation choices. As in, not starting a Perl interpreter and loading all your modules and reinitializing your world for every request. It's like saying I don't feel like using a compiler and this hand-interpreted C is really slowing me down. :) I don't begrudge you for using plain CGI in your environment if it works for you, but is it an important benchmark point for modern web development? Check out http://search.cpan.org/perldoc?Starman for a really easy high-performance persistent engine to use with Plack/PSGI. However, note that Jonathan's rationale for stripping out the web code and using Plack is that it allowed Mason 2 to run under a wide variety of platforms and servers, not just Apache with mod_perl. http://search.cpan.org/~jswartz/Mason-2.15/lib/Mason.pm Under acknowledgements: Thanks to Tatsuhiko Miyagawa and the PSGI/Plack team, who freed me from ever worrying about server backends again. True, but plain CGI was honestly not on the list of things I was worrying about in the first place. :) Someone else had to write the CGI handler for Mason 1. Has anyone profiled Moose to find out what is actually taking so much time? I know this was done with PHP5 and a lot of the slowness (which turned out to be in the way PHP4 created objects) was addressed. I'm fairly sure the Moose team has profiled and optimized a whole bunch. AFAICT they are not *unconcerned* about performance, but their top priority is creating the most powerful post-modern OO system they can and that has a cost. I have not tested Mouse yet, but I plan to, however, the Mouse documentation states it is 4 times faster than Moose. I was going to contact the author to find out what Moose has that Mouse omits to see if anything Mason critical is missing. Of course, Jonathan would be a better choice to ask that question since he would know better than I if any missing features might cause a problem. I tried using Mouse once (for CHI) and backed out quickly. There were too many compromises IMO to ensure compatibility between Mouse and Moose. Again, to beat this into the ground, the main (only?) thing Mouse saves is startup time and that's just not important to me in a web context where you can have a persistent Perl interpreter. Obviously it is more important for people using Mason in a non-web context. Jon -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] www.masonhq.com back to work?
Christian: How do you mean fully work? You mean with the ability to edit things? I'm not sure how much of a site Mason needs going forward, maybe something like http://moose.iinteractive.com/ with a few pages, and otherwise relying on external web services like metacpan.org/github/stackoverflow/etc. I would like to archive the old wiki somewhere for posterity, although it is so old at this point that any advice there should be considered suspect. Are you volunteering to give it an overhaul? :) Jon On Feb 9, 2012, at 10:20 AM, Christian wrote: Hello Mason-Users List, Jonathan and Dave When will www.masonhq.com will fully work again, even as snap-shot for 1.x? Maybe the old, non-wiki style site would still work? I preferred that one ;-) It's a long time where newbies may hesitate to start of cause of the current state? Sorry if that has been discussed already, didn't found such a thread. Best Regards, Christian - administra...@itassistance.ch - -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Virtualization Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason2: How to modify object file content (translated template)?
Hi Roman, The place to override this is Mason::Compilation: https://metacpan.org/module/Mason::Compilation output_class_header() is probably what you want to override in this case. Give it a try and let me know of problems. Jon On Jan 23, 2012, at 3:01 AM, Roman Daniel wrote: What is the recommended way how to prepend some text at the beginning of an object file? I wanted all my templates to be considered utf8 source files. But I didn't want to write %class use utf8; /%class in each template. So I created custom Interp class and overwrote Mason::Interp::write_object_file around write_object_file = sub { my $orig = shift; my ( $this, $object_file, $object_contents, @rest ) = @_; $object_contents = use utf8;\n$object_contents; return $orig-( $this, $object_file, $object_contents, @rest ); }; But I found very quickly that this little modification broke my inheritance. The reason was that generated code relies on # FLAGS comment to be at the very first line of the object file: # FLAGS: {extends:/Page.mc} our ($_class_cmeta, $m, $_m_buffer, $_interp); BEGIN { local $_interp = Mason::Interp-current_load_interp; $_interp-component_moose_class-import; $_interp-component_import_class-import; } ... I modified the custom class and put use utf8 after FLAGS line if present: around write_object_file = sub { my $orig = shift; my ( $this, $object_file, $object_contents, @rest ) = @_; # all content files are utf8 # 2012-01-22 we must respect the flags $object_contents =~ /^(?:#\s*FLAGS.*?\n)?/sg; $object_contents =~ s/\G/use utf8;\n/; return $orig-( $this, $object_file, $object_contents, @rest ); }; It works but I am not sure how reliable this method is. Aren't there any other lines except of FLAGS which further processing relied upon? Thanks for any reply Roman -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Try before you buy = See our experts in action! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-dev2 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason2 on Dancer - server name
Mason 2 doesn't have anything itself to access the web environment. Is there any way to call Dancer's functions from a Mason template? On Dec 9, 2011, at 4:27 AM, Stephen Fenwick-Paul wrote: I expect this is a question I should already known the answer to, but I need to ask. How do I get hold of my server's name within the template. In the bad old days one could grab it from %ENV. If I Dumper of $m I can see the server name under vairious structures, but I assume this is a most inelegant way of accessing it. thanks Stephen -- Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Learn Windows Azure Live! Tuesday, Dec 13, 2011 Microsoft is holding a special Learn Windows Azure training event for developers. It will provide a great way to learn Windows Azure and what it provides. You can attend the event by watching it streamed LIVE online. Learn more at http://p.sf.net/sfu/ms-windowsazure ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] propagating a redirect from a subexec
Try aborting with 302 instead of just returning. On Oct 21, 2011, at 1:19 AM, Louis-David Mitterrand wrote: On Thu, Jul 07, 2011 at 09:24:49AM -0700, Jonathan Swartz wrote: Have you checked the return value of $m-subexec? Yes, if subexec return value is 302 I just return that value from the component, but the redirect does not happen. What else should I do? On Jul 6, 2011, at 1:38 AM, Louis-David Mitterrand wrote: Hi, I've run into problems when a redirect is triggerred within a subexec'ed component: the redirect is not detected by the (outer) calling component which then can't act on it. Is there a way to deal with a redirect in the context of a subexec'ed component? Thanks, -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Cache::Memcached
Unfortunately I don't think Mason's conf parser is smart enough to know that's an arrayref. You might need to bite the bullet and write a small handler.pl, or initialize Mason caching somewhere in your app. On Oct 17, 2011, at 11:25 AM, Philip Cooper wrote: I'm attempting to switch from Mason file cache to Memcached. My httpd.conf settings are as below: PerlSetVar MasonDataCacheApi chi PerlAddVar MasonDataCacheDefaults driver = Memcached PerlAddVar MasonDataCacheDefaults servers=[ 'foo-1.bar.com:11211', 'foo-2.bar.com:11211' ] PerlAddVar MasonDataCacheDefaults debug = 1 My problem is that the server argument in Memcached.pm come through as a string '[ 'foo-1.bar.com:11211', 'foo-2.bar.com:11211' ]' rather than array, and the connection the the memcached servers fail. what am I doing wrong? thanks, Philip -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity and more. Splunk takes this data and makes sense of it. Business sense. IT sense. Common sense. http://p.sf.net/sfu/splunk-d2d-oct ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason2 Help
I've reproduced this on my server. The right content is being returned, but with a httpd/unix-directory content type. swartz GET -eSs http://localhost:2400 GET http://localhost:2400 -- 200 OK Connection: close Date: Wed, 14 Sep 2011 18:10:50 GMT Server: Apache/2.2.3 (Unix) Content-Type: httpd/unix-directory Client-Date: Wed, 14 Sep 2011 18:10:51 GMT Client-Peer: 127.0.0.1:2400 Client-Response-Num: 1 Client-Transfer-Encoding: chunked Hi! The local time is Wed Sep 14 11:10:51 2011. The DefaultType doesn't help in this case because the content type has already been set by mod_dir. So what's the right way to handle this? Something inside the PSGI handler that sets the content type to text/html if it was already set to a directory? Jon On Sep 13, 2011, at 3:45 PM, Joseph Shin wrote: Hi All, I was messing around with Mason2 and ran into this issue when using Plack::Handler::Apache2 with Mason. When i go to: http://www.p5k.com I get: you have chosen to open.. which is a: httpd/unix-directory When I go to: http://www.p5k.com/index All is well. http://old.nabble.com/Content-Type-For-Index.mc-td31176468.html Describes my problem to a tee, but removing the DocumentRoot and bouncing the server doesn't solve this issue. Any Ideas? Thanks! Joe VirtualHost *:80 ErrorLog /var/log/httpd/p5k.error_log ServerName p5k.com ServerAlias www.p5k.com Location / SetHandler perl-script PerlResponseHandler Plack::Handler::Apache2 PerlSetVar psgi_app /home/webuser/p5k.com/web/app.psgi DefaultType text/html /Location /VirtualHost -- BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA Learn about the latest advances in developing for the BlackBerryreg; mobile platform with sessions, labs more. See new tools and technologies. Register for BlackBerryreg; DevCon today! http://p.sf.net/sfu/rim-devcon-copy1 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA Learn about the latest advances in developing for the BlackBerryreg; mobile platform with sessions, labs more. See new tools and technologies. Register for BlackBerryreg; DevCon today! http://p.sf.net/sfu/rim-devcon-copy1 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] default_escape_flags in Mason2
Nice, I didn't even know that existed. Thanks Stephen! :) On Aug 25, 2011, at 8:35 AM, Stephen Clouse wrote: On Thu, Aug 25, 2011 at 8:56 AM, Mark Grimes mgri...@cpan.org wrote: Is there currently an equivalent to default_escape_flags? Is it possible to implement along with the n flag functionality? https://metacpan.org/module/Mason::Plugin::DefaultFilter -- Stephen Clouse stephenclo...@gmail.com -- EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason 2.13 and Windows Seven
What does foo.pl contain? Please make it as minimal as possible. Also do the Mason unit tests pass/fail? On Aug 17, 2011, at 2:38 PM, Jean-Michel Caricand wrote: Hello, I have the same errors with your minimal example hello : c:\mason2perl foo.pl Unrecognized escape \J passed through at (eval 381) line 1. Unrecognized escape \A passed through at (eval 381) line 1. Unrecognized escape \T passed through at (eval 381) line 1. Unrecognized escape \m passed through at (eval 381) line 1. Unrecognized escape \o passed through at (eval 381) line 1. Can't locate object method _set_class_cmeta via package MC0::foo_mc at C:/st rawberry/perl/site/lib/Mason/Interp.pm line 440. c:\mason2 Jean-Michel -- Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason 2.13 and Windows Seven
Thanks Stephen. To be clear is there something Mason should be doing about this, or is it on Jean-Michel's end? On Aug 17, 2011, at 3:12 PM, Stephen Clouse wrote: On Wed, Aug 17, 2011 at 4:50 PM, Jonathan Swartz swa...@pobox.com wrote: What does foo.pl contain? Please make it as minimal as possible. Also do the Mason unit tests pass/fail? Without even looking at code I'm going to guess this is a path separator issue. open my $fh, C:\Documents and Settings\Administrator\Desktop\foo.txt; Unrecognized escape \D passed through at - line 1. Unrecognized escape \A passed through at - line 1. Unrecognized escape \D passed through at - line 1. The issue doesn't appear on Linux because you're unlikely to be using pathnames with embedded backslashes there. -- Stephen Clouse stephenclo...@gmail.com -- Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Dancer/Mason2/Apache Not memoized error
Ok. Sorry to hear about your back :(, hope you feel better. I was thinking about making this change, which changes the default data dir to always be alongside the comp root. If you are able, can you apply this change to your version and see if it makes the default better under apache? (For some reason I'm not able to reproduce your bug on my system). Also, clearly, I need to improve the error message when the object dir is not writable. Thanks Jon --- a/lib/Dancer/Template/Mason2.pm +++ b/lib/Dancer/Template/Mason2.pm @@ -1,5 +1,6 @@ package Dancer::Template::Mason2; use Dancer::Config 'setting'; +use File::Basename; use FindBin; use Mason; use strict; @@ -14,7 +15,7 @@ sub init { my $config = $self-config || {}; $root_dir = $config-{comp_root} ||= setting('views') || $FindBin::Bin . '/views'; -$config-{data_dir} ||= $FindBin::Bin . /data; +$config-{data_dir} ||= dirname($root_dir) . /data; $config-{autoextend_request_path} = 0 if !exists( $config-{autoextend_request_path} ); $_engine = Mason-new(%$config); On Aug 1, 2011, at 1:35 AM, Stephen Fenwick-Paul wrote: Thanks for the reply. Sorry for the delay. I've done my back in and typing on my laptop upside down is one of the skills they don't teach at college. But my small investigation points towards the default value of data_dir being the issue. When running Dancer in standalone mode data_dir correctly points to 'data' in the application's root. But when running under apache it appears towant 'data' to be in /usr/sbin - where, on Ubuntu, apache2 resides. So setting data_dir to something sensible fixes my problem. On Mon, Jul 25, 2011 at 11:39 PM, Jonathan Swartz swa...@pobox.com wrote: It worked for me. I'm able to see the Running with Mason via Apache. It would be great to get the stacktrace where that not memoized error is happening. Maybe you can load Devel::SimpleTrace or Carp::Always in the apache process? On Jul 22, 2011, at 3:40 AM, Stephen Fenwick-Paul wrote: Hi all I'm getting a CODE(0x7fe2bc5dfba8) not memoized at /usr/share/perl/5.10/Memoize.pm line 204. when using Mason2 with PerlDancer, but only when running under Apache. How to reproduce (install Dancer Dancer::Template::Mason2 first): Make a simple dancer app: $ dancer Simple Start it: $ Simple/bin/app.pl And view http://localhost:3000 And you will see a default page. Good. Copy views/index.tt to views/index.mc Copy views/layout/main.tt to views/layout/main.mc and convert them to Mason2 or just simple HTML pages index,mc: pRunning with Mason/p main.mc: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-type content=text/html; charset=% $.settings-{charset} % / titleSimple/title link rel=stylesheet href=% $.request-{uri_base} %/css/style.css / /head body % $.content % /body /html %args $.content $.request $.settings /%args And in config.yml replace: template: simple with template: mason2 Restart dancer: bin/app.pl and all is good. Now do it under Apache: Create a httpd.conf: PerlModule Dancer::Template::Mason2; VirtualHost *:80 ServerName www.simple.new ServerAlias simple.new DocumentRoot /home/yours/DancerTest/Simple Directory /home/yours/DancerTest/Simple AllowOverride None Order allow,deny Allow from all /Directory Location / SetHandler perl-script PerlHandler Plack::Handler::Apache2 PerlSetVar psgi_app /home/yours/DancerTest/Simple/bin/app.pl /Location ErrorLog /var/log/apache2/simple_error_log CustomLog /var/log/apache2/simple_access_log common /VirtualHost (This is taken from Dancers Deployment guide) Start apache go to http://www.simple.new and you will get the runtime error. I've got latest versions of Dancer, Mason2 Dancer::Template::Mason2; ta for any insights Stephen -- 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Got Input? Slashdot Needs You. Take our quick survey online. Come on, we don't ask for help often. Plus, you'll get
Re: [Mason] Slides form recent SPUG Mason presentation?
Sure, sorry you missed it. The slides are at http://www.slideshare.net/jonswar/2011-07spugmason2/ There isn't much content there - most of the action was in the demo (which in turn was based on https://metacpan.org/module/Mason::Manual::Tutorial). You'll find the most information in the docs and in the blog posts at http://www.openswartz.com/. One of these days I will create a screencast. :) Best Jon On Jul 28, 2011, at 12:45 PM, BenRifkah Bergsten-Buret wrote: Hey Jonathan, I'm sorry I missed your visit to my neck of the woods. Is there any chance that you have slides from the Mason presentation? Thanks, -- Ben -- Got Input? Slashdot Needs You. Take our quick survey online. Come on, we don't ask for help often. Plus, you'll get a chance to win $100 to spend on ThinkGeek. http://p.sf.net/sfu/slashdot-survey___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- BlackBerryreg; DevCon Americas, Oct. 18-20, San Francisco, CA The must-attend event for mobile developers. Connect with experts. Get tools for creating Super Apps. See the latest technologies. Sessions, hands-on labs, demos much more. Register early save! http://p.sf.net/sfu/rim-blackberry-1 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] CHI / FastMmap not caching
Check the Cache:FastMmap docs for parameters you can tweak. Maybe max page size? Or, use the File driver which should have no such limitation. On Jul 26, 2011 9:05 AM, Ryan Perry lt;rpe...@madisonip.comgt; wrote: So it seems my DB query gives me back 100KB of data. nbsp;If I shrink what I'm trying to cache it works beautifully. nbsp;How can I over come this limit OR what's a good way to deal with this? On Mon, Jul 25, 2011 at 5:51 PM, Jonathan Swartz lt;swa...@pobox.comgt; wrote: You seem to be getting one key (DoctorSigs_AC-...) but setting a different one (Sigh-...). Try a dead-simple example where you are getting and setting a single static key (e.g. 'main') and see if you can get that to work first. Jon On Jul 25, 2011, at 1:40 AM, Ryan Perry wrote: gt; CHI / FastMmap are not caching/reading my data correctly. nbsp;When I do this I do get files in /var/spool/mason/site/cache. gt; gt; httpd.conf: gt; nbsp; nbsp; nbsp; PerlAddVar nbsp; nbsp; nbsp;MasonDataCacheApi chi gt; nbsp; nbsp; nbsp; PerlAddVar nbsp; nbsp; nbsp;MasonDataCacheDefaults driver =gt; FastMmap gt; gt; gt; gt; nbsp; nbsp;my $cache2 = $m-gt;cache; gt; nbsp; nbsp; nbsp; nbsp;my $sigh = $cache2-gt;get('DoctorSigs_AC-' . $session{DoctorCode}); gt; nbsp; nbsp;unless ($sigh) { gt; nbsp; nbsp; nbsp; nbsp; warn 'big sigh'; gt; nbsp; nbsp; nbsp; nbsp; $sigh=$dbh-gt;selectcol_arrayref(q{ SELECT 'Sigh' }); gt; gt; nbsp; nbsp; nbsp; nbsp;$cache2-gt;set('Sigh' . $session{var}, $sigh, {expires_in =gt; '1w'}); gt; nbsp; nbsp; nbsp; nbsp;warn setting cache for 'Sigh-$session{var}' for 1 week; gt; gt; nbsp; nbsp; nbsp;} gt; gt; If I recall, CHI has a slightly different expires syntax, but I don't recall... gt; gt; gt; -- gt; Ryan Perry gt; CEO/Network Engineer gt; MadisonIP gt; madisonIP.com gt; -- gt; Storage Efficiency Calculator gt; This modeling tool is based on patent-pending intellectual property that gt; has been used successfully in hundreds of IBM storage optimization engage- gt; ments, worldwide. nbsp;Store less, Store more with what you own, Move data to gt; the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/___ gt; Mason-users mailing list gt; Mason-users@lists.sourceforge.net gt; https://lists.sourceforge.net/lists/listinfo/mason-users -- Ryan Perry CEO/Network Engineer MadisonIP madis -- Magic Quadrant for Content-Aware Data Loss Prevention Research study explores the data loss prevention market. Includes in-depth analysis on the changes within the DLP market, and the criteria used to evaluate the strengths and weaknesses of these DLP solutions. http://www.accelacomm.com/jaw/sfnl/114/51385063/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason2 and utf8
Hi Jozef, I'd like Mason to handle encoding intelligently, but since I don't regularly work with utf8, you and others will have to help me with the design. This should probably be in a plugin, e.g. Mason::Plugin::UTF8. Some have already thought about this on stackoverflow: http://stackoverflow.com/questions/5858596/how-to-make-mason2-utf8-clean So for the things you particularly mention, something like this might work: package Mason::Plugin::UTF8; use Moose; with 'Mason::Plugin'; 1; package Mason::Plugin::UTF8::Request; use Mason::PluginRole; use Encode; # Encode all output in utf8 - ** only works with Mason 2.13 and beyond ** # after 'process_output' = sub { my ($self, $outref) = @_; $$outref = encode_utf8( $$outref ); }; # Decode all parameters as utf8 # around 'run' = sub { my $orig = shift; my $self = shift; my %params = @_; while (my ($key, $value) = each(%params)) { $value = decode_utf8($value); } $self-$orig(%params); } 1; It would probably be best if you or someone else knowledgable about utf8 issues created this plugin rather than myself. But let me know if there are things needed in the Mason core to make this easier. Jon On Jul 26, 2011, at 3:51 AM, Jozef Mojzis wrote: Hi Jon, Please, can you post some guidelines, how to correctly use Mason2 in the utf8 environment? PSGI (plackup) want bytes, therefore even with the next simple component - /index.mc: %init use utf8; my $name = ödön; /%init Hello % uc($name) % plackup throw error with the message: Body must be bytes and should not contain wide characters (UTF-8 strings) What is correct way deal with this issue? (so, where to do Encode::{de|en}code_utf8?) Especially: 1. components output with utf8 2. handling utf8 GET/POST arguments... Thank you for help. jm -- Got Input? Slashdot Needs You. Take our quick survey online. Come on, we don't ask for help often. Plus, you'll get a chance to win $100 to spend on ThinkGeek. http://p.sf.net/sfu/slashdot-survey ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] CHI / FastMmap not caching
You seem to be getting one key (DoctorSigs_AC-...) but setting a different one (Sigh-...). Try a dead-simple example where you are getting and setting a single static key (e.g. 'main') and see if you can get that to work first. Jon On Jul 25, 2011, at 1:40 AM, Ryan Perry wrote: CHI / FastMmap are not caching/reading my data correctly. When I do this I do get files in /var/spool/mason/site/cache. httpd.conf: PerlAddVar MasonDataCacheApi chi PerlAddVar MasonDataCacheDefaults driver = FastMmap my $cache2 = $m-cache; my $sigh = $cache2-get('DoctorSigs_AC-' . $session{DoctorCode}); unless ($sigh) { warn 'big sigh'; $sigh=$dbh-selectcol_arrayref(q{ SELECT 'Sigh' }); $cache2-set('Sigh' . $session{var}, $sigh, {expires_in = '1w'}); warn setting cache for 'Sigh-$session{var}' for 1 week; } If I recall, CHI has a slightly different expires syntax, but I don't recall... -- Ryan Perry CEO/Network Engineer MadisonIP madisonIP.com -- Storage Efficiency Calculator This modeling tool is based on patent-pending intellectual property that has been used successfully in hundreds of IBM storage optimization engage- ments, worldwide. Store less, Store more with what you own, Move data to the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Storage Efficiency Calculator This modeling tool is based on patent-pending intellectual property that has been used successfully in hundreds of IBM storage optimization engage- ments, worldwide. Store less, Store more with what you own, Move data to the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Subclassing HTML::Mason::Request fails with unknown parameter 'ah' to constructor
Sorry, I don't know. I see that you copied that code directly out of the example in Subclassing.pod, but I've never tried to use it and can't say for sure if its behavior is still supported. But presumably you should know whether your application are using ApacheHandler or CGIHandler, so it's probably unnecessary to try to alter the superclass dynamically. Jon On Jul 21, 2011, at 6:09 PM, Greg Wickham wrote: Hi Jonathan, Testing the constructor of my new class the value being passed to the alter_superclass method is 'HTML::Mason::Request::ApacheHandler'. So the answer to the question seems like yes. Ideas? -greg On Jul 18, 2011, at 3:13 PM, Jonathan Swartz wrote: Are you subclassing HTML::Mason::Request::ApacheHandler, defined around line 47 of HTML::Mason::ApacheHandler? On Jul 16, 2011, at 4:43 AM, Greg Wickham wrote: Hi All, Kind of stumped trying to get a subclass of HTML::Mason::Request working with Mason 1.42. The error is: [Fri Jul 15 07:24:09 2011] [error] [client 172.16.189.1] The following parameter was passed in the call to MyApp::Mason::Request-new() but was not listed in the validation options: ah\n\nStack:\n [/usr/share/perl5/HTML/Mason/ApacheHandler.pm:882]\n [/usr/share/perl5/HTML/Mason/ApacheHandler.pm:822]\n [/var/www/perl/MyApp/Mason.pm:41]\n [-e:0]\n, referer: http://fusion/index.html It seems that 'ah' is being passed in as an argument to the constructor of the new class (MyApp::Mason::Request) but it is not being recognised by the superclass. The new class (MyApp::Mason::Request) is very tiny / simple - at the moment the only method that exists is 'new': sub new { my $class = shift; $class-alter_superclass( $HTML::Mason::ApacheHandler::VERSION ? 'HTML::Mason::Request::ApacheHandler' : $HTML::Mason::CGIHandler::VERSION ? 'HTML::Mason::Request::CGI' : 'HTML::Mason::Request' ); my $self = $class-SUPER::new( @_ ); return( $self ); } httpd configuration is with a package: LocationMatch .*(\.html|\.pl|\.xml|\/)$ DefaultType text/html SetHandler perl-script PerlHandler MyApp::Mason /LocationMatch And in the package MyApp::Mason there is my $apacheHandler = new HTML::Mason::ApacheHandler( request_class = 'MyApp::Mason::Request', Everything kind of looks ok. Any help appreciated. -greg -- -- -- AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on Lean Startup Secrets Revealed. This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Subclassing HTML::Mason::Request fails with unknown parameter 'ah' to constructor
Are you subclassing HTML::Mason::Request::ApacheHandler, defined around line 47 of HTML::Mason::ApacheHandler? On Jul 16, 2011, at 4:43 AM, Greg Wickham wrote: Hi All, Kind of stumped trying to get a subclass of HTML::Mason::Request working with Mason 1.42. The error is: [Fri Jul 15 07:24:09 2011] [error] [client 172.16.189.1] The following parameter was passed in the call to MyApp::Mason::Request-new() but was not listed in the validation options: ah\n\nStack:\n [/usr/share/perl5/HTML/Mason/ApacheHandler.pm:882]\n [/usr/share/perl5/HTML/Mason/ApacheHandler.pm:822]\n [/var/www/perl/MyApp/Mason.pm:41]\n [-e:0]\n, referer: http://fusion/index.html It seems that 'ah' is being passed in as an argument to the constructor of the new class (MyApp::Mason::Request) but it is not being recognised by the superclass. The new class (MyApp::Mason::Request) is very tiny / simple - at the moment the only method that exists is 'new': sub new { my $class = shift; $class-alter_superclass( $HTML::Mason::ApacheHandler::VERSION ? 'HTML::Mason::Request::ApacheHandler' : $HTML::Mason::CGIHandler::VERSION ? 'HTML::Mason::Request::CGI' : 'HTML::Mason::Request' ); my $self = $class-SUPER::new( @_ ); return( $self ); } httpd configuration is with a package: LocationMatch .*(\.html|\.pl|\.xml|\/)$ DefaultType text/html SetHandler perl-script PerlHandler MyApp::Mason /LocationMatch And in the package MyApp::Mason there is my $apacheHandler = new HTML::Mason::ApacheHandler( request_class = 'MyApp::Mason::Request', Everything kind of looks ok. Any help appreciated. -greg -- -- -- AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on Lean Startup Secrets Revealed. This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- AppSumo Presents a FREE Video for the SourceForge Community by Eric Ries, the creator of the Lean Startup Methodology on Lean Startup Secrets Revealed. This video shows you how to validate your ideas, optimize your ideas and identify your business strategy. http://p.sf.net/sfu/appsumosfdev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] mason2: methods go vs visit
Ok. Can you actually post the full error message so I can see the stack? What version of Mason are you using? And can you run 't/Request.t' in the Mason distribution to see if it passes, since that tests visit()? Thanks Jon On Jun 30, 2011, at 11:28 AM, Jozef Mojzis wrote: Hi Jon, With index.mc %init $m-go(/test); /%init this is index i got an correct internal redirect to /test.mc. But when try the visit method either: %init $m-visit(/test); /%init this is index or in the form %init my $obuff; $m-visit({out_method = \$obuf}, /test); /%init this is index got an 2 page long error message like: Attribute (req) is required at /Users/jm/perl5/lib/perl5/darwin-thread-multi-2level/Class/MOP/Class.pm line 524 Class::MOP::Class::_construct_instance('Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x10213b428)', 'HASH(0x1021d4350)') called at /Users/jm/perl5/lib/perl5/darwin-thread-multi-2level/Class/MOP/Class.pm line 497 Class::MOP::Class::new_object('Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x10213b428)', 'HASH(0x1021d4350)') called at /Users/jm/perl5/lib/perl5/darwin-thread-multi-2level/Moose/Meta/Class.pm line 269 Moose::Meta::Class::new_object('Moose::Meta::Class::__ANON__::SERIAL::1=HASH(0x10213b428)', 'HASH(0x1021d4350)'). It is looks like a bug. :) Thanx. jm. -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- All of the data generated in your IT infrastructure is seriously valuable. Why? It contains a definitive record of application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-d2d-c2 ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Issues with HTMLFilters — Mason2 dies
Ok, thanks. I'll get right on this. On Jun 22, 2011, at 2:49 PM, Matthias Dietrich wrote: Hi, after upgrading from Mason 2.07, HTMLFilters don't work anymore. Using % $foo | H % causes this error message: 'ARRAY(0x107541e48)' is neither a code ref nor a filter object at /opt/local/lib/perl5/site_perl/5.12.2/Mason/Request.pm line 353. It's also not possible to install the HTMLFilters plugin with the latest Mason: jomo # Failed test 'test_html_filters died ('ARRAY(0x100f9a738)' is neither a code ref nor a filter object at /Users/clt/perl5/lib/perl5/Mason/Request.pm line 353.)' Severity is critical, because it brakes Mason2 when using filters, which are essential for websites. I also filed a bug: #69038 — https://rt.cpan.org/Ticket/Display.html?id=69038 Matthias -- rainboxx Software Engineering Matthias Dietrich rainboxx Matthias Dietrich | Phone: +49 7141 / 2 39 14 71 Königsallee 43 | Fax : +49 3222 / 1 47 63 00 71638 Ludwigsburg| Mobil: +49 151 / 50 60 78 64 | WWW : http://www.rainboxx.de CPAN: http://search.cpan.org/~mdietrich/ XING: https://www.xing.com/profile/Matthias_Dietrich18 GULP: http://www.gulp.de/profil/rainboxx.html -- Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] email on error
If you have a HTML::Mason::Exception object (which you should have if the error was thrown from inside Mason), you can call as_text or as_html on it. See HTML::Mason::Exceptions. On Jun 14, 2011, at 2:01 PM, Ryan Perry wrote: I've set up my handler to email me errors, but how can I get the information Mason normally provides with error mode set to 'output' (into those emails that is)? -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Component call with $.var fails with syntax error
This was a parsing omission - $. does not work inside tags. Will be fixed in the next release. Use $self- as a workaround until then. Thanks Jon On Jun 8, 2011, at 7:32 AM, Matthias Dietrich wrote: With Mason v2.07 and Catalyst, the following line: /user/edit_card/reel_add.mc, friends = $.friends fails with the following message (two lines and lots of spaces after friends): syntax error at /serv/catalyst/unusuals/root/comps/user/user_profile_edit.mc line 92, near $.friends The line written as: /user/edit_card/reel_add.mc, friends = $self-friends works. Is this a wanted behavior? Didn't expect that and haven't found anything in the docs that mentions this. Matthias -- rainboxx Software Engineering Matthias Dietrich rainboxx Matthias Dietrich | Phone: +49 7141 / 2 39 14 71 Königsallee 43 | Fax : +49 3222 / 1 47 63 00 71638 Ludwigsburg| Mobil: +49 151 / 50 60 78 64 | WWW : http://www.rainboxx.de CPAN: http://search.cpan.org/~mdietrich/ XING: https://www.xing.com/profile/Matthias_Dietrich18 GULP: http://www.gulp.de/profil/rainboxx.html -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] mason redirect not working
Hi Anuj, $m-redirect is only for mod_perl environments. You should ask this in the appropriate internal Amazon mailing list. Jon On Jun 8, 2011, at 12:02 PM, Anuj Kumar wrote: I wrote this in a .m file to redirect but its not redirecting unless ( defined $order){ # Redirect customer to YA home page FLLogError(Requested order does not exist. Redirecting... ); my $url = $Std-url('/gp/css/homepage'); $m-redirect($url); # $m-comp('/gp/css/homepage'); # $m-abort(); } and in the error logs i got Requested order does not exist. Redirecting... ; backtrace { Safe::Root0::HTML::Mason::Commands::__ANON__()@/apollo/env/MDotComEU/perl/amazonMason/HTML/Mason/Component.pm:136 | HTML::Mason::Request::call_next()@/local/apollo/_env/MDotComEU-swit1na.1754017.43602681.113571363/mason/www.marksandspencer.com/gp/css/autohandler:100 | Safe::Root0::HTML::Mason::Commands::__ANON__()@/apollo/env/MDotComEU/perl/amazonMason/HTML/Mason/Component.pm:136 | HTML::Mason::Request::call_next()@/local/apollo/_env/MDotComEU-swit1na.1754017.43602681.113571363/mason/www.marksandspencer.com/autohandler:154 | Safe::Root0::HTML::Mason::Commands::__ANON__()@/apollo/env/MDotComEU/perl/amazonMason/HTML/Mason/Component.pm:136 } Thanks Regards, Anuj -- Anuj Kumar Third Year Undergraduate, Dept. of Computer Science and Engineering NIT Durgapur -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Mason 2.0.6 - Plack session expiration
I think this is part of the psgi design, to have everything exposed to the app as simple Perl data structures instead of objects. Something to ask the psgi/plack mailing list. On Apr 21, 2011, at 2:08 PM, Dane Buson wrote: Not so much, it's just a hash ref. I did eventually just clean out the session info, which is adequate, but not quite what I wanted. C'est La Vie. On Wed, Apr 13, 2011 at 7:53 PM, Beckheng Lam bi.ken@gmail.com wrote: Hi, Could $m-req-session call expire method? /Heng 于 2011年04月12日 07:18, Dane Buson 写道: I have what I hope is a stupid question. I know I can get/set session keys from the Plack session via $m-req. Is there a direct way to call the Plack Session expire method? i.e. When a user wants to force a logout, how do I force an expire of the plack_session? -- ___ -- 诸法从缘起,如来说是因。 彼法因缘尽,是大沙门说。 -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your peers are replacing JEE containers with lightweight application servers - and what you can gain from the move. http://p.sf.net/sfu/vmware-sfemails___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your peers are replacing JEE containers with lightweight application servers - and what you can gain from the move. http://p.sf.net/sfu/vmware-sfemails___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Multiple values in Mason 2.06
See: http://search.cpan.org/perldoc/Mason::Plugin::PSGIHandler#Run_parameters On Apr 23, 2011, at 7:23 AM, Beckheng Lam wrote: Dear, Thanks for taking the time to read this. I use $.args to access the multiple values. It seems that only lastest value was got. I'm not sure what happens. My test componment: eg/blog/comps/test.mc: Content: %init use Data::Dumper; print Dumper($.args-{'a'}); print 'br/'; print Dumper($m-req-param('a')); /%init http request: http://localhost:5001/test?a=1a=2 The output result: $VAR1 = '2'; $VAR1 = '1'; $VAR2 = '2'; /Heng -- 诸法从缘起,如来说是因。 彼法因缘尽,是大沙门说。 -- Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your peers are replacing JEE containers with lightweight application servers - and what you can gain from the move. http://p.sf.net/sfu/vmware-sfemails ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your peers are replacing JEE containers with lightweight application servers - and what you can gain from the move. http://p.sf.net/sfu/vmware-sfemails ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] Error while loading app.psgi: Can't locate object method expand_to_plugins
What does your plugin class look like? Does it contain with 'Mason::Plugin';? On Thu, 14 Apr 2011 13:15 +0800, Beckheng Lam bi.ken@gmail.com wrote: Hi, I want to add customize filter. I added the plugin in app.psgi via '+IiBlog::Filters'. But it show me the message as title said. Following plugins what I use. my @plugins = ('PSGIHandler', 'HTMLFilters', '+IiBlog::Filters'); Would somebody tell me why? /Heng -- 诸法从缘起,如来说是因。 彼法因缘尽,是大沙门说。 -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
Re: [Mason] %ARGS
$.args returns a hashref of all the args passed to the component. It was intended to be a substitute for %ARGS. Give it a try and let me know if anything's lacking. Jon On Mar 14, 2011, at 7:26 PM, Larry Owen wrote: I'm loving mason 2 so far, but ... I've really gotten used to the %ARGS, is there anything like that in mason 2? I really have a need to _not_ specify all my args in my component. Thanks, Larry -- Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users -- Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users
[Mason] mason 2 file extensions
I want Mason 2 to have default file extensions that it facilitates and enforces (though they can be changed via parameters). Here's what I'm thinking of going with: .mc - top-level component A top-level component can serve as the page component in a request. .mi - internal component An internal component can only be accessed from other components. .mp - pure-perl component A pure-perl component contains only code; it is parsed as if its entire content was within a %class block. You do not need to (and are not allowed to) include Mason tags in this component, and it will not produce any output if called. Originally I used .m for top-level component, but someone was kind enough to point out that this is used for Objective-C class files, which will become ever more widely used if Apple has its way. :) I've checked all three of the above on http://www.fileinfo.com/ and they don't seem to have any strong associations. Opinions welcome before this sets into stone! Thanks Jon -- Free Software Download: Index, Search Analyze Logs and other IT data in Real-Time with Splunk. Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. http://p.sf.net/sfu/splunk-dev2dev ___ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users