CIPP
view release on metacpan or search on metacpan
lib/CIPP/Manual.pm view on Meta::CPAN
[ MY ] ENCVAR=encoded_variable >
=head2 Description
Use this command to URL encode the content of a scalar variable. Parameters passed via URL always have to be encoded this way, otherwise you risk syntax clashes.
=head2 Parameter
=over 8
=item B<VAR>
This is the variable you want to be encoded.
=item B<ENCVAR>
The encoded result will be stored in this variable.
=item B<MY>
If you set the MY switch the created variable will be declared using 'my'. Its scope reaches to the end of the block which surrounds the <?URLENCODE> command.
=back
=head2 Example
In this example we link an external CGI script and pass the content of the variable $query after using <?URLENCODE> on it.
<?URLENCODE VAR=$query MY ENCVAR=$enc_query>
<A HREF="www.search.org?query=$enc_query">
find something
</A>
Hint: in CGI::CIPP and Apache::CIPP environments you also can use the <?A> command for doing this.
=head1 COMMAND <?USE>
=head2 Type
Import
=head2 Syntax
<?USE NAME=perl_module >
=head2 Description
With this command you can access the extensive Perl module library. You can access any Perl module which is installed on your system.
In a new.spirit environment you can place user defined modules in the prod/lib directory of your project, which is included in the library search path by default.
If you want to use a CIPP Module (generated with new.spirit and the <?MODULE> command), use <?REQUIRE> instead.
=head2 Parameter
=over 8
=item B<NAME>
This is the name of the module you want to use. Nested module names are delimited by ::. This is exactly what the Perl use pragma expects (you guessed right, CIPP simply translates <?USE> to use :-).
It is not possible to use a variable or expression for NAME, you must always use a literal string here.
=back
=head2 Example
The standard modules File::Path and Text::Wrap are imported to your program.
<?USE NAME="File::Path">
<?USE NAME="Text::Wrap">
=head1 COMMAND <?VAR>
=head2 Type
Variables and Scoping
=head2 Syntax
<?VAR NAME=variable
[ MY ]
[ DEFAULT=value ]
[ NOQUOTE ]>
...
<?/VAR>
=head2 Description
This command defines and optionally declares a Perl variable of any type (scalar, array and hash). The value of the variable is derived from the content of the <?VAR> block. You can assign constants, string expressions and any Perl expressions this w...
It is not possible to nest the <?VAR> command or to use any CIPP command inside the <?VAR> block. The content of the <?VAR> block will be evaluated and assigned to the variable.
=head2 Parameter
=over 8
=item B<NAME>
This is the name of the variable. You must specify the full Perl variable here, including the $, @ or % sign to indicate the type of the variable.
These are some examples for creating variables using <?VAR>.
<?VAR NAME=$skalar>a string<?/VAR>
<?VAR NAME=@liste>(1,2,3,4)<?/VAR>
<?VAR NAME=%hash>( 1 => 'a', 2 => 'b' )<?/VAR>
=item B<DEFAULT>
If you set the DEFAULT parameter, this value will be assigned to the variable, if the variable is actually undef. In this case the content of the <?VAR> block will be ignored.
Setting the DEFAULT parameter is only supported for scalar variables.
You can use this feature to provide default values for input parameters this way.
<?VAR NAME=$event DEFAULT="show">$event<?/VAR>
Hint: you may think there must be a easier way of doing this. You are right. :-) We recommend you using this alternative code, the usage of DEFAULT is deprecated.
<?PERL>
( run in 1.339 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )