Mason::Plugin::Defer(3pm) User Contributed Perl Documentation Mason::Plugin::Defer(3pm)NAME
Mason::Plugin::Defer - Defer computing parts of output until the end of the request
SYNOPSIS
<head>
<title><% $m->defer(sub { $m->page->title }) %></title>
% $.Defer {{
% my $content = join(", ", @{ $m->page->meta_content });
<meta name="description" content="<% $content %>">
% }}
<body>
...
DESCRIPTION
The defer feature allows sections of output to be deferred til the end of the request. You can set up multiple deferred code blocks which
will execute and insert themselves into the output stream at request end.
REQUEST METHOD
defer (code)
Returns a marker string that is unique and will not appear in normal output. At the end of the request, each marker string is replaced
with the output of its associated code. e.g.
<title><% $m->defer(sub { $m->page->title }) %></title>
FILTER
Defer
Applies "$m->defer" to the content block. e.g.
% $.Defer {{
% my $content = join(", ", @{ $m->page->meta_content });
<meta name="description" content="<% $content %>">
% }}
SEE ALSO
Mason
AUTHOR
Jonathan Swartz <swartz@pobox.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Jonathan Swartz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-05-02 Mason::Plugin::Defer(3pm)
Check Out this Related Man Page
Mason::Plugin::LvalueAttributes(3pm) User Contributed Perl Documentation Mason::Plugin::LvalueAttributes(3pm)NAME
Mason::Plugin::LvalueAttributes - Create lvalue accessors for all rw component attributes
SYNOPSIS
<%class>
has 'a' => (is => "rw")
has 'b' => (is => "ro")
</%class>
<%init>
# set a to 5
$.a = 5;
# set a to 6
$.a(6);
# error
$.b = 7;
</%init>
DESCRIPTION
This plugins creates an Lvalue accessor for every read/write attribute in the component. Which means that instead of writing:
$.name( "Foo" );
you can use the more natural syntax
$.name = "Foo";
WARNING
Standard Moose setter features such as type checking, triggers, and coercion will not work on Lvalue attributes. You should only use this
plugin when the convenience of the Lvalue attributes outweighs the need for setter features.
ACKNOWLEDGEMENTS
Inspired by Christopher Brown's MooseX::Meta::Attribute::Lvalue.
SEE ALSO
Mason
AUTHOR
Jonathan Swartz <swartz@pobox.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Jonathan Swartz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.14.2 2012-05-02 Mason::Plugin::LvalueAttributes(3pm)
i have a file having content
a|b|c
1|2|33
4|6|55
end
a|b|d
3|4|55
end
a|b|c
45|67|98
end
so i want to print 3rd field of header a|b|c and footer end.
e.g. o/p should be
33
55
98 (7 Replies)
Dear All,
Im new on Java programming and I need to write a code that display a text file content in pop up window. I tried to make some changes on some examples that I found on the net but with no use.
Please your help :( (0 Replies)
I am not sure if this is doable. I am trying to open and print the content of the file by replacing all instances fo perl to PERL . This is my code but it is
giving me the number count instead of the actual lines with changes.
open (PERLHISTORY, 'sample.txt') or die "The file sample.txt could... (3 Replies)
Greetings.
So the question is basically the same as it's in the title.
I'd like to write a program that changes a file by rows. So to clarify it.
(i know i shouldn't use code,/code here but i would like to separate it)
So for example a text file looks like something like this:
Happy... (5 Replies)
Hi..
I have some content as
Hello how are you?
Where are you?
i need the above content to be placed in a file called hello.sh
So,when i execute a file called hi.sh it should automatically create the file hello.sh and write the above content into it. I know to create a file using touch... (4 Replies)
hi all,
i am using a Ubuntu work station. i have following piece of code that works ok. But i cant figure out a way to insert a string call $Name into the title of the window i am opening. As you can see, i tried two different ways without a success. Can someone please help me out here? :(
... (3 Replies)
cat is the normal unix command to display the content of a file.
Is there any program to display the content of the file.
If there is, then can you send me the code. (5 Replies)
HI All,
I have a file with content as below
Filename:
my name is xyz
my name abc
my name is bdf
end
Filename:
my name uvx
my name edd
my name jhn
end
i want to edit the content and save into another file as
Filename1:
my name is xyz
Filename1:
my name abc
Filename1:
my name is... (4 Replies)
Hi, as the title, I have an array @f_lines with gene information in it. How can I put the content of @f_lines into a file so that I can read it?
I tried this:
open(OUTPUT, "file"); # put gene information in this file;
@f_lines = ("gene1", "gene2", "gene3"...); # gene information;
print... (3 Replies)
Hi All,
I wanted to write a perl script to read the content in a file,the file content is either 0 (zero) OR 1. The idea is like this.
If (content =1), then it will proceed to perform some step. and then update the file content to 0(zero)
else
if (content =0), it will update the content to... (11 Replies)