Questions tagged [mason]

HTML::Mason, or Mason for short, is a Perl-based templating system for generating dynamic HTML or other content.

HTML::Mason or it's successor Mason 2 (simply called Mason), is a Perl-based templating system for generating HTML or other content.

Its features make it a suitable backend for high load sites serving dynamic content, such as online newspapers or database driven e-commerce sites.

Official home page: http://www.masonhq.com/

Mason book: https://masonbook.houseabsolute.com/

143 questions
23
votes
3 answers

How to make Mason2 UTF-8 clean?

Reformulating the question, because @optional asked me it wasn't clear and linked one HTML::Mason based solution Four easy steps to make Mason UTF-8 Unicode clean with Apache, mod_perl, and DBI , what caused confusions the original is 4 years old…
kobame
  • 5,766
  • 3
  • 31
  • 62
15
votes
9 answers

Is Mason a framework?

I've been having an agruement with a friend that Mason (Perl) is not a framework, but a templating language. I feel Mason for Perl does what JSP does for Java (as an analogy, not pure technical comparison). From what I know, JSP is not a framework…
Arvind
  • 387
  • 3
  • 11
7
votes
2 answers

Perl: Javascript::V8 templates - from the perl

Looking for template engine like HTML::Mason (or Mason), so what "compiles" source components into perl code, but instead of perl-code will "compile" components into JavaScript code and after run/execute them with Javascript::V8 perl…
kobame
  • 5,766
  • 3
  • 31
  • 62
6
votes
1 answer

What is the order of execution of Mason blocks in a component

What will be the sequence of execution if these blocks are present in a Mason component? %args %init %once %shared %attr %flags
Sunil
  • 856
  • 12
  • 24
6
votes
1 answer

Global Variable mason2 in POET

I'm new to Mason2/POET and I have been using this guide http://search.cpan.org/~jswartz/Poet/lib/Poet/Manual/Tutorial.pod to create my first website. Now I would like to create a new global variable (example: $User) but then I have no idea or what…
blues
  • 167
  • 1
  • 7
6
votes
1 answer

Get the return value of a HTML Form Post method

I have a HTML form in a Mason component(A.m) that uses the post method to call another Mason component(B.m). I want this Mason component(B.m) to return a value to the HTML form in the Mason component(A.m). Then I want to pass this returned value to…
jas7
  • 2,893
  • 6
  • 23
  • 36
5
votes
1 answer

Conditional in Mason code

If I want to create a block of html code that displays if a boolean value in mason is true is there a way to do this without using print to print each line of the html code? i.e. is there a way to do something like this <% if($boolean) { %>
  • thurmc
    • 495
    • 1
    • 8
    • 29
  • 5
    votes
    1 answer

    Make Vim ignore first character in line while indenting

    Whenever I have to edit Perl Mason files, I always have problems indenting lines due to Perl code starting with %. For example:
    % if( !$something ) { <% $title %> % }
    Any…
    André Gil
    • 624
    • 7
    • 13
    5
    votes
    2 answers

    Why would Perl's CGI::cookie be able to set a cookie in IE, but not Firefox?

    I have a bit of Perl CGI code which I'm trying to run in the project web space of a SourceForge account. The code is able to set a browser cookie just fine when talking to IE, but the cookie is not set when talking to Firefox. When I test with…
    Steve Perkins
    • 11,520
    • 19
    • 63
    • 95
    5
    votes
    2 answers

    Is it safe to recursively call one anonymous sub from another?

    The reason I want to use anonymous subs instead of named ones is because I want to define these subs inside Mason subcomponents(http://www.masonbook.com/book/chapter-2.mhtml#TOC-ANCHOR-7), which don't behave well with named subs. E.g. if I write…
    Yakov
    • 53
    • 5
    5
    votes
    4 answers

    Where can I find a Perl module for converting a Perl data structure into a JavaScript one?

    Where can I find a Perl module for converting a Perl data structure into a JavaScript one? e.g. this is my code (Mason): % # convert our @cti data structure into a javascript one var cti = [ % foreach my $cti_category (@cti) { { …
    someguy
    • 1,923
    • 5
    • 21
    • 19
    4
    votes
    2 answers

    An automated way to do string extraction for Perl/Mason i18n?

    I'm currently working on internationalizing a very large Perl/Mason web application, as a team of one (does that make this a death march??). The application is nearing 20 years old, and is written in a relatively old-school Perl style; it doesn't…
    hitstuff
    • 71
    • 2
    4
    votes
    3 answers

    Good IDE or syntax highlighting editor for Mason?

    Can anyone recommend some good IDEs or editors for Mason? At this point I'm just using VIM but it would be nice to have an editor that supports syntax highlighting as well as general syntax checking. There are plenty that support Perl of course,…
    dreadwail
    • 15,098
    • 21
    • 65
    • 96
    4
    votes
    1 answer

    Perl Mason Syntax Validation

    Is there a way to validate perl mason syntax at the command line? I know for regular perl modules you can just use perl -c, but that throws errors for mason-specific syntax like docstrings and the like... For example: <%doc> DOCUMENTATION SHOULD…
    therealmitchconnors
    • 2,732
    • 1
    • 18
    • 36
    4
    votes
    1 answer

    Mason methods scope - override

    Using Mason2. Have 3 components. /Base.mc /tmp/Base.mc /tmp/index.mc The /tmp/index.mc with a content: hello from <% $m->request_path %>
    <% $.Some %> the $.Some is an method defined in the /Base.mc: <%augment wrap><% inner()…
    cajwine
    • 3,100
    • 1
    • 20
    • 41
    1
    2 3
    9 10