File: Var.pm

package info (click to toggle)
libexcel-template-perl 0.34-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 608 kB
  • sloc: perl: 3,471; xml: 210; makefile: 2
file content (75 lines) | stat: -rw-r--r-- 1,030 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package Excel::Template::Element::Var;

use strict;

BEGIN {
    use vars qw(@ISA);
    @ISA = qw(Excel::Template::Element);

    use Excel::Template::Element;
}

sub resolve { ($_[1])->param($_[1]->resolve($_[0], 'NAME')) }

1;
__END__

=head1 NAME

Excel::Template::Element::Var - Excel::Template::Element::Var

=head1 PURPOSE

To provide parameter substitution.

=head1 NODE NAME

VAR

=head1 INHERITANCE

Excel::Template::Element

=head1 ATTRIBUTES

=over 4

=item * NAME

This is the name of the parameter to substitute here.

=back

=head1 CHILDREN

None

=head1 EFFECTS

None

=head1 DEPENDENCIES

This will only be used within CELL tags.

=head1 USAGE

This is used exactly like HTML::Template's TMPL_VAR. There is one exception -
since you can have variable names inside the parameters, you can do something
like:

  <loop name="LOOPY">
    <var name="$SomeParam"/>
  </loop>

Where the actual name to be substituted is, itself, a parameter.

=head1 AUTHOR

Rob Kinyon (rob.kinyon@gmail.com)

=head1 SEE ALSO

CELL

=cut