URI::Template(3pm) User Contributed Perl Documentation URI::Template(3pm)NAME
URI::Template - Object for handling URI templates (RFC 6570)
SYNOPSIS
use URI::Template;
my $template = URI::Template->new( 'http://example.com/{x}' );
my $uri = $template->process( x => 'y' );
# uri is a URI object with value 'http://example.com/y'
DESCRIPTION
This module provides a wrapper around URI templates as described in RFC 6570: http://tools.ietf.org/html/rfc6570
INSTALLATION
perl Makefile.PL
make
make test
make install
METHODS
new( $template )
Creates a new URI::Template instance with the template passed in as the first parameter.
template
This method returns the original template string.
variables
Returns an array of unique variable names found in the template. NB: they are returned in random order.
expansions
This method returns an list of expansions found in the template. Currently, these are just coderefs. In the future, they will be more
interesting.
process( \%vars )
Given a list of key-value pairs or an array ref of values (for positional substitution), it will URI escape the values and substitute them
in to the template. Returns a URI object.
process_to_string( \%vars )
Processes input like the "process" method, but doesn't inflate the result to a URI object.
AUTHORS
o Brian Cassidy <bricas@cpan.org>
o Ricardo SIGNES <rjbs@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2007-2012 by Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-05-30 URI::Template(3pm)
Check Out this Related Man Page
URI::data(3) User Contributed Perl Documentation URI::data(3)NAME
URI::data - URI that contain immediate data
SYNOPSIS
use URI;
$u = URI->new("data:");
$u->media_type("image/gif");
$u->data(scalar(`cat camel.gif`));
print "$u
";
open(XV, "|xv -") and print XV $u->data;
DESCRIPTION
The "URI::data" class supports "URI" objects belonging to the data URI scheme. The data URI scheme is specified in RFC 2397. It allows
inclusion of small data items as "immediate" data, as if it had been included externally. Examples:
data:,Perl%20is%20good
data:image/gif;base64,R0lGODdhIAAgAIAAAAAAAPj8+CwAAAAAI
AAgAAAClYyPqcu9AJyCjtIKc5w5xP14xgeO2tlY3nWcajmZZdeJcG
Kxrmimms1KMTa1Wg8UROx4MNUq1HrycMjHT9b6xKxaFLM6VRKzI+p
KS9XtXpcbdun6uWVxJXA8pNPkdkkxhxc21LZHFOgD2KMoQXa2KMWI
JtnE2KizVUkYJVZZ1nczBxXlFopZBtoJ2diXGdNUymmJdFMAADs=
"URI" objects belonging to the data scheme support the common methods (described in URI) and the following two scheme specific methods:
$uri->media_type( [$new_media_type] )
This method can be used to get or set the media type specified in the URI. If no media type is specified, then the default
"text/plain;charset=US-ASCII" is returned.
$uri->data( [$new_data] )
This method can be used to get or set the data contained in the URI. The data is passed unescaped (in binary form). The decision
about whether to base64 encode the data in the URI is taken automatically based on what encoding produces the shortest URI string.
SEE ALSO
URI
COPYRIGHT
Copyright 1995-1998 Gisle Aas.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.8.0 1999-03-20 URI::data(3)
Man Page
13 More Discussions You Might Find Interesting
1. Post Here to Contact Site Administrators and Moderators
Hello,
Anybody in here has any idea where I can get a template like this one for vBulletin. I have actually got my board but it just doesn't look good in the template that I have! Thanks anyway!
him (2 Replies)
Hello,
I am trying to make a disaster recovery of my Unix System.
Is there a site where I can find template from Disaster Recovery Domain. So this can help me to have the principals chapter to make a good report.
Thanks a lot ........ (5 Replies)
I want to build a Makefile that simply takes a template file and modifies it (sed or perl, probably) before installing the result in the right place - my problem is creating the variable for substitution...
So I have
SYSTEM = SYS1 SYS2
SYS1_CHANNELS = CHANNEL1 CHANNEL2 CHANNEL4... (1 Reply)
Hi all,
Need your help. I am doing a simple template program , getting some error ... here is the code
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include<iostream>
#include<string>
#include <sstream>
using namespace std;
class Base_class
{
public:
Base_class(){... (1 Reply)
Hi,
I have a template file and want to replace 3 parameters to the values that I want. these values are in a parameter file.
Any idea how to do this in perl?
the parameter file looks like:
host_name = jupiter
PORT = 1562
IPADDRESS = 10.1.34.10
the template file has lots of entry.... (1 Reply)
Hello,
This might sound like a really silly question but that is why i post it in Unix for Dummies :)
I am a little confused as to how I can install software or remove software from an image (say an ubuntu template created out of an already existing system). Is there a direct way to do that to... (3 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Basically, the prompt is make a makefile with various sub makefiles in their respective subdirectories. All code... (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I have been trying to make the program swap but i have been getting errors with the makefile such as
driver.o:... (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
read data set, and search for array value to get avegare
2. Relevant commands, code, scripts,... (3 Replies)
Hello Again,
I am just wanted to know if we can call the Template using "require_once" at PHP?
Any views around happy to discuss.
Thanks in Advance (2 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Here are my directions. I am pretty sure I am doing this right, but I just want someone more experienced to look... (4 Replies)
OSX
I have been grinding my teeth on a portion of code. I am building a bash script that edits a html email template. In the template, I have place holders for SED (or whatever program is appropriate) to use as anchors for find and replace, with user defined corresponding html code. The HTML code... (3 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
The code in project2 is for a program that formats C++ code into HTML for presentation in a webpage. For example,... (1 Reply)