view release on metacpan or search on metacpan
t/000-report-versions.t view on Meta::CPAN
# Error storage
$YAML::Tiny::errstr = '';
}
# Printable characters for escapes
my %UNESCAPES = (
z => "\x00", a => "\x07", t => "\x09",
n => "\x0a", v => "\x0b", f => "\x0c",
r => "\x0d", e => "\x1b", '\\' => '\\',
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/TimeTracker/Command/TellRemote.pm view on Meta::CPAN
. $task->say_project_tags;
# Use bytes for creating the digest, otherwise we'll get into trouble
# https://rt.cpan.org/Public/Bug/Display.html?id=93139
my $token = sha1_hex( encode_utf8($message), $cfg->{secret} ) if $cfg->{secret} ;
my $url = $cfg->{url} . '?message=' . uri_escape_utf8($message);
$url .= '&token='. $token if $cfg->{secret};
my $res = $ua->get($url);
unless ( $res->is_success ) {
error_message( 'Could not post to remote status via %s: %s',
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
META.json
META.yml
README
t/00-load.t
t/csv/catch-all.csv
t/csv/escape.csv
t/csv/fix.csv
t/csv/without-columns.csv
t/manifest.t
t/pod-coverage.t
t/pod.t
t/script-create_loginrc.t
t/template/catch-all.tmpl
t/template/escape.tmpl
t/template/fix.tmpl
t/template/name-text.tmpl
xt/boilerplate.t
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/URIUtils.pm view on Meta::CPAN
base => $args{base},
scheme => $url->scheme,
has_recognized_scheme => $url->has_recognized_scheme,
opaque => $url->opaque,
path => $url->path, # unescaped string
fragment => $url->fragment,
canonical => $url->canonical . "",
authority => $url->authority,
query => $url->query, # escaped
# server/host methods
host => $url->host,
port => $url->port,
default_port => $url->default_port,
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Unliner/Grammar/PostProc.pm view on Meta::CPAN
return $o;
}
sub arg {
my $o = shift;
## FIXME: handle \ escapes properly
$o =~ s/^'|'$//g if $o =~ /^'/;
$o =~ s/^"|"$//g if $o =~ /^"/;
return $o;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
t/wrt_html.t view on Meta::CPAN
# diag($small_tag);
is(
$small_tag,
'<small title="<thing with angle brackets>">text</small>',
'got a tag with escaped attributes'
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Wax.pm view on Meta::CPAN
}
return $error;
}
# helper for `dump_command`: escape/quote a shell argument on POSIX shells
fun _escape ($arg) {
# https://stackoverflow.com/a/1250279
# https://github.com/boazy/any-shell-escape/issues/1#issuecomment-36226734
$arg =~ s!('{1,})!'"$1"'!g;
$arg = "'$arg'";
$arg =~ s{^''|''$}{}g;
return $arg;
lib/App/Wax.pm view on Meta::CPAN
# that the dumped command can be used as a command line. a better
# (but still imperfect/incomplete) implementation would require at
# least two extra modules: Win32::ShellQuote and String::ShellQuote:
# https://rt.cpan.org/Public/Bug/Display.html?id=37348
method dump_command ($args) {
return join(' ', map { /[^0-9A-Za-z+,.\/:=\@_-]/ ? _escape($_) : $_ } @$args);
}
# takes a URL and returns a $filename => $error pair where
# the filename is the path to the saved file and the error
# is the first error message encountered while trying to download
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/WebSearchUtils.pm view on Meta::CPAN
"",
defined($args{prepend}) ? $args{prepend} : "",
$query0,
defined($args{append}) ? $args{append} : "",
);
my $query_esc = URI::Escape::uri_escape($query);
my $time_param = '';
if (my $p = $args{time_past}) {
if ($p eq 'h' || $p eq 'hour') {
$time_param = 'tbs=qdr:h';
lib/App/WebSearchUtils.pm view on Meta::CPAN
} else {
return [400, "Invalid time_past value '$p'"];
}
} elsif ($args{time_start} && $args{time_end}) {
my ($t1, $t2) = ($args{time_start}, $args{time_end});
$time_param = "tbs=".URI::Escape::uri_escape(
"cdr:1,cd_min:".
($args{time_start}->strftime("%m/%d/%Y")).
",cd_max:".($args{time_end}->strftime("%m/%d/%Y"))
);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Widget/JSApp.pm view on Meta::CPAN
my $js_conf = "";
if ($#attrib > -1) {
$js_conf .= ", {" if (!$js_conf);
for (my $i = 0; $i < $#attrib; $i += 2) {
$js_conf .= "," if ($i > 0);
$js_conf .= " \"$attrib[$i]\" : \"" . $self->escape_double_quoted_value($attrib[$i+1]) . "\"";
}
}
if ($self->{jsapp_conf}) {
$js_conf .= ($js_conf) ? ",\n" : ", {\n";
$js_conf .= $self->{jsapp_conf};
lib/App/Widget/JSApp.pm view on Meta::CPAN
foreach my $attrib (sort keys %$attribs) {
$so_name = $attribs->{$attrib};
$so_name = $attrib if (!$so_name || $so_name eq "1");
$value = $context->so_get($so_name);
$value = join(",",@$value) if (ref($value) eq "ARRAY");
$js_conf .= ",\n \"$attrib\" : \"" . $self->escape_double_quoted_value($value) . "\"";
}
}
if (defined $self->{jsapp_domain}) {
my ($value_domain, $values, $labels, $domain_alias);
lib/App/Widget/JSApp.pm view on Meta::CPAN
&App::sub_exit($html) if ($App::trace);
return($html);
}
sub escape_double_quoted_value {
my ($self, $value) = @_;
$value =~ s/"/\\"/g;
$value =~ s/\r//msg;
$value =~ s/\n/\\n/msg;
return($value);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Widget.pm view on Meta::CPAN
my $result = "<input type=hidden name='app.event' value='${name}.${event}${args}'/>";
&App::sub_exit($result) if ($App::trace);
return($result);
}
# unescape URL-encoded data
sub url_unescape {
my $self = shift;
my($todecode) = @_;
$todecode =~ tr/+/ /; # pluses become spaces
$todecode =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
return $todecode;
}
# URL-encode data
sub url_escape {
my $self = shift;
my ($toencode,$charset) = @_;
if ($charset) {
$toencode=~s/($charset)/uc sprintf("%%%02x",ord($1))/eg;
}
lib/App/Widget.pm view on Meta::CPAN
$toencode =~ tr/ /+/; # spaces become pluses
}
return $toencode;
}
# HTML-escape data
sub html_escape {
&App::sub_entry if ($App::trace);
my ($self, $text) = @_;
if (!defined $text) {
$text = "";
}
lib/App/Widget.pm view on Meta::CPAN
return($value);
}
sub html {
my ($self) = @_;
return $self->html_escape($self->{name});
}
# get the URL of the host
sub host_url {
my ($url, $protocol, $server, $port, $port_str);
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $Pod::Escapes::Name2character_number{$1}
? chr($Pod::Escapes::Name2character_number{$1})
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
elsif (eval "require Pod::Text; 1" && $Pod::Text::VERSION < 3) {
inc/Module/Install/Metadata.pm view on Meta::CPAN
defined $2
? chr($2)
: defined $mapping->{$1}
? $mapping->{$1}
: do {
warn "Unknown escape: E<$1>";
"E<$1>";
};
}gex;
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
script/wp-tools view on Meta::CPAN
$str =~ s/([\Q$bre\E])/\\$1/g;
$str =~ s/\n/\\n/g;
return $str;
}
# to work around the fact that `tar --transform' can't correctly escape the
# delimiter of a sed substitution expression in the replacement text, this
# subroutine finds a delimiter that can be used safely without escaping
sub _find_sed_delimiter {
my $str = join('', @_);
my $bre = '$.*[\]^';
view all matches for this distribution
view release on metacpan or search on metacpan
perlcritic.rc view on Meta::CPAN
[-RegularExpressions::ProhibitComplexRegexes]
# Use named character classes instead of explicit character lists.
[-RegularExpressions::ProhibitEnumeratedClasses]
# Use character classes for literal meta-characters instead of escapes.
[-RegularExpressions::ProhibitEscapedMetacharacters]
# Use `eq' or hash instead of fixed-pattern regexps.
[RegularExpressions::ProhibitFixedStringMatches]
view all matches for this distribution
view release on metacpan or search on metacpan
misc/server.pl view on Meta::CPAN
use strict;
use warnings;
use Socket;
use IO::Socket;
use LWP::Simple qw(get);
use URI::Escape qw(uri_escape);
use JSON qw(to_json from_json);
use Data::Dumper;
# get commandline arguments
my ($ModulesPath, $Port) = @ARGV;
misc/server.pl view on Meta::CPAN
# this pushes some action to the client to be performed and
# returns after the client answers
sub push
{
my ($action) = @_;
my $url = 'http://localhost:3001/?data='.uri_escape(to_json($action));
my $content = get($url);
#print STDERR "sending async ".Dumper($action)."\nurl = $url\n";
#print STDERR "-> $content\n\n";
my $info = from_json($content);
return $info->{'content'};
view all matches for this distribution
view release on metacpan or search on metacpan
bin/getvideo view on Meta::CPAN
=head1 DESCRIPTION
Download single videos or choose videos from a playlist or an uploader.
Call C<getvideo> followed by the space separated urls or enter the urls after calling C<getvideo>. If the urls are
entered after calling C<getvideo>, shell metacharacters are escaped automatically.
The urls can also be passed with a file: C<getvideo -f|--file filename>. The urls in the file have to be space separated.
If a passed url results in more than one video, it is shown a menu with the video titles. The user can then choose from
the menu which videos to download. It is possible to filter the video titles of the list menu with a regexp. The filter
view all matches for this distribution
view release on metacpan or search on metacpan
script/_chinese-zodiac-of view on Meta::CPAN
# my ($word, $is_cur_word, $after_ws) = @_;
#
# #say "D:add_unquoted word=$word is_cur_word=$is_cur_word after_ws=$after_ws";
#
# $word =~ s!^(~)(\w*)(/|\z) | # 1) tilde 2) username 3) optional slash
# \\(.) | # 4) escaped char
# \$(\w+) # 5) variable name
# !
# $1 ? (not($after_ws) || $is_cur_word ? "$1$2$3" : _expand_tilde($2, $3)) :
# $4 ? $4 :
# ($is_cur_word ? "\$$5" : $ENV{$5})
script/_chinese-zodiac-of view on Meta::CPAN
#sub _add_double_quoted {
# no warnings 'uninitialized';
#
# my ($word, $is_cur_word) = @_;
#
# $word =~ s!\\(.) | # 1) escaped char
# \$(\w+) # 2) variable name
# !
# $1 ? $1 :
# ($is_cur_word ? "\$$2" : $ENV{$2})
# !egx;
script/_chinese-zodiac-of view on Meta::CPAN
#bash versions 4.2-4.3):
#
#1) quotes and backslashes are stripped (bash's `COMP_WORDS` contains all the
# quotes and backslashes);
#
#2) quoted phrase that contains spaces, or phrase that contains escaped spaces is
# parsed as a single word. For example:
#
# command "First argument" Second\ argument
#
# bash would split it as (represented as Perl):
script/_chinese-zodiac-of view on Meta::CPAN
# # add things to words, etc
# local point=... # calculate the new point
# COMPREPLY=( `COMP_LINE="foo ${words[@]}" COMP_POINT=$point foo` )
# }
#
# To avoid these word-breaking characters to be split/grouped, we can escape
# them with backslash or quote them, e.g.:
#
# command "http://example.com:80" Foo\:\:Bar
#
# which bash will parse as:
script/_chinese-zodiac-of view on Meta::CPAN
# v => 1.1,
# summary => 'Format completion for output (for shell)',
# description => <<'_',
#
#Bash accepts completion reply in the form of one entry per line to STDOUT. Some
#characters will need to be escaped. This function helps you do the formatting,
#with some options.
#
#This function accepts completion answer structure as described in the `Complete`
#POD. Aside from `words`, this function also recognizes these keys:
#
script/_chinese-zodiac-of view on Meta::CPAN
# array.
#
#* esc_mode
#
# Escaping mode for entries. Either `default` (most nonalphanumeric characters
# will be escaped), `shellvar` (like `default`, but dollar sign `$` will also be
# escaped, convenient when completing environment variables for example),
# `filename` (currently equals to `default`), `option` (currently equals to
# `default`), or `none` (no escaping will be done).
#
#* word
#
script/_chinese-zodiac-of view on Meta::CPAN
# ESCAPE_WORDS:
# for my $entry (@$words) {
# my $word = ref($entry) eq 'HASH' ? $entry->{word} : $entry;
# my $summary = (ref($entry) eq 'HASH' ? $entry->{summary} : undef) // '';
# if ($esc_mode eq 'shellvar') {
# # escape $ also
# $word =~ s!([^A-Za-z0-9,+._/:~-])!\\$1!g;
# } elsif ($esc_mode eq 'none') {
# # no escaping
# } else {
# # default
script/_chinese-zodiac-of view on Meta::CPAN
# format_completion($completion, $opts) -> str|array
#
#Format completion for output (for shell).
#
#Bash accepts completion reply in the form of one entry per line to STDOUT. Some
#characters will need to be escaped. This function helps you do the formatting,
#with some options.
#
#This function accepts completion answer structure as described in the C<Complete>
#POD. Aside from C<words>, this function also recognizes these keys:
#
script/_chinese-zodiac-of view on Meta::CPAN
#array.
#
#=item * esc_mode
#
#Escaping mode for entries. Either C<default> (most nonalphanumeric characters
#will be escaped), C<shellvar> (like C<default>, but dollar sign C<$> will also be
#escaped, convenient when completing environment variables for example),
#C<filename> (currently equals to C<default>), C<option> (currently equals to
#C<default>), or C<none> (no escaping will be done).
#
#=item * word
#
script/_chinese-zodiac-of view on Meta::CPAN
#bash versions 4.2-4.3):
#
#1) quotes and backslashes are stripped (bash's C<COMP_WORDS> contains all the
# quotes and backslashes);
#
#2) quoted phrase that contains spaces, or phrase that contains escaped spaces is
# parsed as a single word. For example:
#
# command "First argument" Second\ argument
#
# bash would split it as (represented as Perl):
script/_chinese-zodiac-of view on Meta::CPAN
# # add things to words, etc
# local point=... # calculate the new point
# COMPREPLY=( C<COMP_LINE="foo ${words[@]}" COMP_POINT=$point foo> )
#}
#
#To avoid these word-breaking characters to be split/grouped, we can escape
#them with backslash or quote them, e.g.:
#
#command "http://example.com:80" Foo\:\:Bar
#
#which bash will parse as:
script/_chinese-zodiac-of view on Meta::CPAN
# s/([\\\"\@\$])/\\$1/g;
# return qq("$_") unless /[^\040-\176]/; # fast exit
#
# s/([\a\b\t\n\f\r\e])/$esc{$1}/g;
#
# # no need for 3 digits in escape for these
# s/([\0-\037])(?!\d)/sprintf('\\%o',ord($1))/eg;
#
# s/([\0-\037\177-\377])/sprintf('\\x%02X',ord($1))/eg;
# s/([^\040-\176])/sprintf('\\x{%X}',ord($1))/eg;
#
script/_chinese-zodiac-of view on Meta::CPAN
# modify_answer(answer=>$fres, suffix=>"=");
# $fres->{path_sep} = "=";
# # XXX actually not entirely correct, we want normal
# # escaping but without escaping "=", maybe we should
# # allow customizing, e.g. esc_mode=normal, dont_esc="="
# # (list of characters to not escape)
# $fres->{esc_mode} = "none";
# goto RETURN_RES;
# }
# } else {
# $fres = complete_arg_val(
script/_chinese-zodiac-of view on Meta::CPAN
# s/([\\\"\@\$])/\\$1/g;
# return qq("$_") unless /[^\040-\176]/; # fast exit
#
# s/([\a\b\t\n\f\r\e])/$esc{$1}/g;
#
# # no need for 3 digits in escape for these
# s/([\0-\037])(?!\d)/sprintf('\\%o',ord($1))/eg;
#
# s/([\0-\037\177-\377])/sprintf('\\x%02X',ord($1))/eg;
# s/([^\040-\176])/sprintf('\\x{%X}',ord($1))/eg;
#
script/_chinese-zodiac-of view on Meta::CPAN
# say double_quote('$foo'); # => "\$foo"
#
#This code is taken from C<quote()> in L<Data::Dump>. Maybe I didn't look more
#closely, but I couldn't a module that provides a function to do something like
#this. L<String::Escape>, for example, provides C<qqbackslash> but it does not
#escape C<$>.
#
#=head2 single_quote($str) => STR
#
#Like C<double_quote> but will produce a Perl single quote literal representation
#instead of the double quote ones. In single quotes, only literal backslash C<\>
#and single quote character C<'> are escaped, the rest are displayed as-is, so
#the result might span multiple lines or contain other non-printable characters.
#
# say single_quote("Mom's"); # => 'Mom\'s' (with the quotes)
# say single_quote("a\\"); # => 'a\\"
# say single_quote('"'); # => '"'
script/_chinese-zodiac-of view on Meta::CPAN
# )x;
#
## note: order is important here, brace encloses the other
#our $RE_WILDCARD_BASH =
# qr(
# # non-escaped brace expression, with at least one comma
# (?P<bash_brace>
# (?<!\\)(?P<slashes_before_bash_brace>\\\\)*\{
# (?P<bash_brace_content>
# $re_bash_brace_element(?:, $re_bash_brace_element )+
# )
# (?<!\\)(?:\\\\)*\}
# )
# |
# # non-escaped brace expression, to catch * or ? or [...] inside so
# # they don't go to below pattern, because bash doesn't consider them
# # wildcards, e.g. '/{et?,us*}' expands to '/etc /usr', but '/{et?}'
# # doesn't expand at all to /etc.
# (?P<literal_brace_single_element>
# (?<!\\)(?:\\\\)*\{
# $re_bash_brace_element
# (?<!\\)(?:\\\\)*\}
# )
# |
# (?P<bash_class>
# # non-empty, non-escaped character class
# (?<!\\)(?:\\\\)*\[
# (?: \\\\ | \\\[ | \\\] | [^\\\[\]] )+
# (?<!\\)(?:\\\\)*\]
# )
# |
# (?P<bash_joker>
# # non-escaped * and ?
# (?<!\\)(?:\\\\)*(?:\*\*?|\?)
# )
# |
# (?P<sql_joker>
# # non-escaped % and ?
# (?<!\\)(?:\\\\)*[%_]
# )
# |
# (?P<literal>
# [^\\\[\]\{\}*?%_]+
script/_chinese-zodiac-of view on Meta::CPAN
# }
#
# } elsif (defined($p = $m{literal_brace_single_element})) {
# push @res, quotemeta($p);
# } elsif (defined($p = $m{bash_class})) {
# # XXX no need to escape some characters?
# push @res, $p;
# } elsif (defined($p = $m{sql_joker})) {
# push @res, quotemeta($p);
# } elsif (defined($p = $m{literal})) {
# push @res, quotemeta($p);
script/_chinese-zodiac-of view on Meta::CPAN
# $bool = contains_wildcard($wildcard_str)
#
#Return true if C<$str> contains wildcard pattern. Wildcard patterns include
#I<joker> such as C<*> (meaning zero or more of any characters) and C<?> (exactly
#one of any character), I<character class> C<[...]>, and I<brace> C<{...,}>
#(brace expansion). A pattern can be escaped using a bacslash so it becomes
#literal, e.g. C<foo\*> does not contain wildcard because it's C<foo> followed by
#a literal asterisk C<*>.
#
#Aside from the abovementioned wildcard patterns, bash does other types of
#expansions/substitutions too, but these are not considered wildcard. These
script/_chinese-zodiac-of view on Meta::CPAN
#
#Convert bash wildcard to SQL pattern. This includes:
#
#=over
#
#=item * converting unescaped C<*> to C<%>
#
#=item * converting unescaped C<?> to C<_>
#
#=item * escaping unescaped C<%>
#
#=item * escaping unescaped C<_>
#
#=back
#
#Unsupported constructs will cause the function to die.
#
script/_chinese-zodiac-of view on Meta::CPAN
#sub _emit_plain {
# my $self = shift;
# $self->{stream} .= defined $_[0] ? $_[0] : '~';
#}
#
## Double quoting is for single lined escaped strings.
#sub _emit_double {
# my $self = shift;
# (my $escaped = $self->escape($_[0])) =~ s/"/\\"/g;
# $self->{stream} .= qq{"$escaped"};
#}
#
## Single quoting is for single lined unescaped strings.
#sub _emit_single {
# my $self = shift;
# my $item = shift;
# $item =~ s{'}{''}g;
# $self->{stream} .= "'$item'";
script/_chinese-zodiac-of view on Meta::CPAN
# $text = "\n$text";
# return $text;
#}
#
## Escapes for unprintable characters
#my @escapes = qw(\0 \x01 \x02 \x03 \x04 \x05 \x06 \a
# \x08 \t \n \v \f \r \x0e \x0f
# \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17
# \x18 \x19 \x1a \e \x1c \x1d \x1e \x1f
# );
#
## Escape the unprintable characters
#sub escape {
# my $self = shift;
# my ($text) = @_;
# $text =~ s/\\/\\\\/g;
# $text =~ s/([\x00-\x1f])/$escapes[ord($1)]/ge;
# return $text;
#}
#
#1;
### YAML/Old/Dumper/Base.pm ###
script/_chinese-zodiac-of view on Meta::CPAN
## their own sub-parser.)
#sub _parse_node {
# my $self = shift;
# my $preface = $self->preface;
# $self->preface('');
# my ($node, $type, $indicator, $escape, $chomp) = ('') x 5;
# my ($anchor, $alias, $explicit, $implicit, $class) = ('') x 5;
# ($anchor, $alias, $explicit, $implicit, $preface) =
# $self->_parse_qualifiers($preface);
# if ($anchor) {
# $self->anchor2node->{$anchor} = CORE::bless [], 'YAML-anchor2node';
script/_chinese-zodiac-of view on Meta::CPAN
# $self->die('YAML_LOAD_ERR_BAD_SEQ_ELEMENT');
# }
#
# # Check whether the preface looks like a YAML mapping ("key: value").
# # This is complicated because it has to account for the possibility
# # that a key is a quoted string, which itself may contain escaped
# # quotes.
# my $preface = $self->preface;
# if ( $preface =~ /^ (\s*) ( \w .*? \: (?:\ |$).*) $/x or
# $preface =~ /^ (\s*) ((') (?:''|[^'])*? ' \s* \: (?:\ |$).*) $/x or
# $preface =~ /^ (\s*) ((") (?:\\\\|[^"])*? " \s* \: (?:\ |$).*) $/x
script/_chinese-zodiac-of view on Meta::CPAN
# elsif ($self->inline =~ /^\[/) {
# $node = $self->_parse_inline_seq($anchor);
# }
# elsif ($self->inline =~ /^"/) {
# $node = $self->_parse_inline_double_quoted();
# $node = $self->_unescape($node);
# $node = $self->_parse_implicit($node) if $implicit;
# }
# elsif ($self->inline =~ /^'/) {
# $node = $self->_parse_inline_single_quoted();
# $node = $self->_parse_implicit($node) if $implicit;
script/_chinese-zodiac-of view on Meta::CPAN
#
##==============================================================================
## Utility subroutines.
##==============================================================================
#
## Printable characters for escapes
#my %unescapes = (
# 0 => "\x00",
# a => "\x07",
# t => "\x09",
# n => "\x0a",
# 'v' => "\x0b", # Potential v-string error on 5.6.2 if not quoted
script/_chinese-zodiac-of view on Meta::CPAN
# r => "\x0d",
# e => "\x1b",
# '\\' => '\\',
# );
#
## Transform all the backslash style escape characters to their literal meaning
#sub _unescape {
# my $self = shift;
# my ($node) = @_;
# $node =~ s/\\([never\\fart0]|x([0-9a-fA-F]{2}))/
# (length($1)>1)?pack("H2",$2):$unescapes{$1}/gex;
# return $node;
#}
#
#1;
### YAML/Old/Loader/Base.pm ###
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/ZofCMS/Plugin/ImageGallery.pm view on Meta::CPAN
sub _form_template {
return <<'END_TEMPLATE';
<tmpl_if name='success'>
<p>Your image has been successfully uploaded.</p>
<p><a href="<tmpl_var escape='html' name='success_href'>">Upload another image</a></p>
<tmpl_else>
<form action="" method="POST" id="plug_image_gallery_form" enctype="multipart/form-data">
<div>
<tmpl_if name='error'><p class="error"><tmpl_var escape='html' name='error'></p></tmpl_if>
<input type="hidden" name="page" value="<tmpl_var escape='html' name='page'>">
<input type="hidden" name="dir" value="<tmpl_var escape='html' name='dir'>">
<tmpl_if name='is_edit'><input type="hidden" name="plug_image_gallery_id" value="<tmpl_var escape='html' name='id'>"></tmpl_if>
<ul>
<tmpl_unless name='is_edit'><li>
<label for="plug_image_gallery_file">Image: </label
><input type="file" name="plug_image_gallery_file" id="plug_image_gallery_file">
</li></tmpl_unless>
<li>
<label for="plug_image_gallery_description">Description: </label
><textarea name="plug_image_gallery_description" id="plug_image_gallery_description" cols="60" rows="5"><tmpl_var escape='html' name='plug_image_gallery_description'></textarea>
</li>
</ul>
<input type="submit" name="plug_image_gallery_submit" value="<tmpl_if name='is_edit'>Update<tmpl_else>Upload</tmpl_if>">
</div>
</form>
lib/App/ZofCMS/Plugin/ImageGallery.pm view on Meta::CPAN
}
sub _list_template {
return <<'END_TEMPLATE';
<tmpl_if name='is_view'>
<a class="plug_image_gallery_return_to_image_list" href="/index.pl?page=<tmpl_var escape='html' name='page'>&dir=<tmpl_var escape='html' name='dir'>">Return to image list.</a>
<div id="plug_image_gallery_photo"><img src="/<tmpl_var escape='html' name='photo'>" width="<tmpl_var escape='html' name='width'>" height="<tmpl_var escape='html' name='height'>" alt=""><tmpl_if name='has_description'><p class="plug_image_gallery...
<tmpl_else>
<tmpl_if name='has_images'>
<ul class="plug_image_gallery_list">
<tmpl_loop name='images'>
<li<tmpl_if name='alt'> class="alt"</tmpl_if>>
<tmpl_if name='has_view'><a <tmpl_if name='want_lightbox'>rel="<tmpl_var escape='html' name='lightbox_rel'>" href="/<tmpl_var escape='html' name='lightbox_src'>" title="<tmpl_var escape='html' name='lightbox_desc'>"<tmpl_else>href...
<tmpl_if name="has_description"><p><tmpl_var name='description'></p></tmpl_if>
<tmpl_if name="edit">
<form action="" method="POST">
<div>
<input type="hidden" name="plug_image_gallery_id" value="<tmpl_var escape='html' name='id'>">
<input type="hidden" name="page" value="<tmpl_var escape='html' name='page'>">
<input type="hidden" name="dir" value="<tmpl_var escape='html' name='dir'>">
<input type="submit" class="input_submit" name="plug_image_gallery_action" value="Edit">
<input type="submit" class="input_submit" name="plug_image_gallery_action" value="Delete">
</div>
</form>
</tmpl_if>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/ZofCMS/Plugin/AntiSpamMailTo.pm view on Meta::CPAN
=encoding utf8
=head1 NAME
App::ZofCMS::Plugin::AntiSpamMailTo - "smart" HTML escapes to protect mailto:foo@bar.com links from not-so-smart spam bots
=head1 SYNOPSIS
In your Main Config file or ZofCMS template:
view all matches for this distribution