Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37041603
en ru br
ALT Linux repositórios
S:0.03-alt2

Group :: Desenvolvimento/Perl
RPM: perl-String-TT

 Principal   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

A versão atual: 0.03-alt2
Data da compilação: 17 outubro 2013, 10:57 ( 545.1 weeks ago )
Tamanho:: 26.79 Kb

Home page:   http://search.cpan.org/dist/String-TT/

Licença: perl
Sumário: use TT to interpolate lexical variables
Descrição:

String::TT exports a `tt' function, which takes a TT
(Template Toolkit) template as its argument.  It uses the
current lexical scope to resolve variable references.  So if you say:

 my $foo = 42;
 my $bar = 24;

 tt '[% foo %] <-> [% bar %]';

the result will be `42 <-> 24'.

TT provides a slightly less rich namespace for variables than perl, so
we have to do some mapping.  Arrays are always translated from
`@array' to `array_a' and hashes are always translated from `%hash'
to `hash_h'.  Scalars are special and retain their original name, but
they also get a `scalar_s' alias.  Here's an example:

 my $scalar = 'scalar';
 my @array  = qw/array goes here/;
 my %hash   = ( hashes => 'are fun' );

 tt '[% scalar %] [% scalar_s %] [% array_a %] [% hash_h %]';

There is one special case, and that's when you have a scalar that is
named like an existing array or hash's alias:

 my $foo_a = 'foo_a';
 my @foo   = qw/foo array/;

 tt '[% foo_a %] [% foo_a_s %]'; # foo_a is the array, foo_a_s is the scalar

In this case, the `foo_a' accessor for the `foo_a' scalar will not
be generated.  You will have to access it via `foo_a_s'.  If you
delete the array, though, then `foo_a' will refer to the scalar.

This is a very cornery case that you should never encounter unless you
are weird.  99% of the time you will just use the variable name.

Mantenedor currente: Igor Vlasenko

Lista dos contribuidores

Lista dos rpms provida por esta srpm:

  • perl-String-TT
ACL:
     
    projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
    mantenedor atual: Michael Shigorin
    mantenedor da tradução: Fernando Martini aka fmartini © 2009