view release on metacpan or search on metacpan
t/dispatch/employee.t view on Meta::CPAN
req( $test, 404, 'root', 'GET', "$base/53432" );
req( $test, 403, 'demo', 'GET', "$base/53432" );
req( $test, 404, 'root', 'GET', "$base/heathledger" );
# this one triggers "wide character in print" warnings
#req( $test, 404, 'root', 'GET', "$base/" . uri_escape_utf8('/employee/nick//////áÄÄoÄÅ¡ÄqwšášÄšýš..-...-...-..-.00') );
note( 'single-character nicks' );
$status = req( $test, 404, 'root', 'GET', "$base/4" );
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/DubiousHTTP/Tests.pm view on Meta::CPAN
</p>
HTML
$page =~s{href="(/[^"]+)"}{ 'href="'. garble_url($1). '"' }eg;
for( grep { $_->TESTS } @cat ) {
$page .= "<h3>".html_escape($_->SHORT_DESC)."</h3>";
$page .= $_->LONG_DESC_HTML;
$page .= "<p class=runtest><a href=/".$_->ID.">Run Test</a></p>\n";
}
$page .= "</body></html>";
return "HTTP/1.0 200 ok\r\n".
lib/App/DubiousHTTP/Tests.pm view on Meta::CPAN
next if $cat ne 'all' && $_->ID ne $cat;
for my $t ($_->TESTS) {
last if defined $limit && --$limit <= 0;
if (!@bad_pages) {
$html .= sprintf("checks.push({ num:%s, harmless:'%s', desc:'%s', valid:%d, file:'%s' });\n",
$t->NUM_ID, url_encode($t->url($good_page)), quotemeta(html_escape($t->DESCRIPTION)), $t->VALID,$good_page)
} else {
my $bad_urls = "[".join(",", map { "'".url_encode($t->url($_))."'" } @bad_pages)."]";
$html .= sprintf("checks.push({ num:%s, bad:%s, harmless: '%s', desc:'%s', valid:%d });\n",
$t->NUM_ID, $bad_urls, url_encode($t->url($good_page)), quotemeta(html_escape($t->DESCRIPTION)), $t->VALID)
}
}
}
$html .= sprintf("reference='%x' + Math.floor(time()/1000).toString(16);\n", rand(2**32));
$html .= "runtests();\n</script>\n";
lib/App/DubiousHTTP/Tests.pm view on Meta::CPAN
my $rand = rand();
for(@cat) {
next if $cat ne 'all' && $_->ID ne $cat;
for($_->TESTS) {
my $num = $_->NUM_ID;
my $xid = quotemeta(html_escape($_->LONG_ID));
my $url = url_encode($_->url($page));
my $html = $mkhtml->("$url?rand=$rand",$xid);
$jsglob .= "checks.push({ "
. "num: $num, page: '$url', xid: '$xid', "
. 'desc: "'.quotemeta(html_escape($_->DESCRIPTION)) .'",'
. 'valid: '.$_->VALID .','
. 'html: '.($html =~m{^function} ? $html : '"'.quotemeta($html).'"')
."});\n";
}
}
$jsglob .= "div_title.innerHTML = '<h1>".html_escape($title)."</h1>';";
$jsglob .= "runtests()\n";
my $html = _auto_static_html()."<script>$jsglob</script>\n";
return "HTTP/1.0 200 ok\r\n".
"Content-type: text/html\r\n".
lib/App/DubiousHTTP/Tests.pm view on Meta::CPAN
" <a class=trylink target=_blank download='" + test['file'] + "' href=" + test['page'] + ">try</a>" +
" <a class=srclink target=_blank href=/src" + test['page'] + ">src</a>"
: "" ) + "<br>";
}
function escapeAttribute(attr) {
return attr
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/DuckPAN/Fathead.pm view on Meta::CPAN
my $dbh = DBI->connect ("dbi:CSV:", undef, undef, {
f_dir => $self->output_txt->parent,
f_ext => ".txt/r",
csv_sep_char => "\t",
csv_quote_char => undef,
csv_escape_char => undef,
csv_allow_whitespace => 1,
csv_allow_quotes => 1,
RaiseError => 1,
PrintError => 0,
csv_tables => {
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/Env.pm view on Meta::CPAN
push @exclude, qr/\W/
unless $opt{AllowIllegalVariableNames};
my $env = $self->_envhash;
my @vars = grep { exists $env->{$_} } $self->_filter_env( $include, \@exclude );
return join( q{ }, map { "$_=" . App::Env::_Util::shell_escape( $env->{$_} ) } @vars );
}
#-------------------------------------------------------
# return a list of included variables, in the requested
lib/App/Env.pm view on Meta::CPAN
$envstr = $env->str( @match_specifications, \%options );
This function returns a string which may be used with the *NIX B<env>
command to set the environment. The string contains space separated
C<var=value> pairs, with shell magic characters escaped.
The environment may be pared down by passing I<match specifications>
and an C<Exclude> option; see the documentation for the B<env> method,
L</Context 4>, for more information.
Because the B<TERMCAP> environment variable is often riddled with
escape characters, which are not always handled well by shells, the
B<TERMCAP> variable is I<always> excluded unless it is explicitly
included via an exact variable name match specification. For example,
$envstr = $env->str( qr/.*/, 'TERMCAP );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/EscapeUtils.pm view on Meta::CPAN
cmdline_src => 'stdin_or_args',
stream => 1,
},
);
$SPEC{uri_escape} = {
v => 1.1,
summary => 'URI-escape lines of input (in standard input or arguments)',
args => {
%arg_strings,
},
result => {
schema => 'str*',
stream => 1,
},
};
sub uri_escape {
require URI::Escape;
my %args = @_;
my $strings = $args{strings};
my $cb = sub {
my $str = $strings->();
if (defined $str) {
return URI::Escape::uri_escape($str);
} else {
return undef;
}
};
return [200, "OK", $cb];
}
$SPEC{uri_unescape} = {
v => 1.1,
summary => 'URI-unescape lines of input (in standard input or arguments)',
args => {
%arg_strings,
},
result => {
schema => 'str*',
stream => 1,
},
};
sub uri_unescape {
require URI::Escape;
my %args = @_;
my $strings = $args{strings};
my $cb = sub {
my $str = $strings->();
if (defined $str) {
return URI::Escape::uri_unescape($str);
} else {
return undef;
}
};
return [200, "OK", $cb];
}
$SPEC{js_escape} = {
v => 1.1,
summary => 'Encode lines of input (in standard input or arguments) '.
'as JSON strings',
args => {
%arg_strings,
lib/App/EscapeUtils.pm view on Meta::CPAN
result => {
schema => 'str*',
stream => 1,
},
};
sub js_escape {
require String::JS;
my %args = @_;
my $strings = $args{strings};
lib/App/EscapeUtils.pm view on Meta::CPAN
};
return [200, "OK", $cb];
}
$SPEC{js_unescape} = {
v => 1.1,
summary => 'Interpret lines of input (in standard input or arguments) as '.
'JSON strings and return the decoded value',
args => {
%arg_strings,
lib/App/EscapeUtils.pm view on Meta::CPAN
result => {
schema => 'str*',
stream => 1,
},
};
sub js_unescape {
require String::JS;
my %args = @_;
my $strings = $args{strings};
lib/App/EscapeUtils.pm view on Meta::CPAN
};
return [200, "OK", $cb];
}
$SPEC{backslash_escape} = {
v => 1.1,
summary => 'Escape lines of input using backslash octal sequence '.
'(or \\r, \\n, \\t)',
args => {
%arg_strings,
lib/App/EscapeUtils.pm view on Meta::CPAN
result => {
schema => 'str*',
stream => 1,
},
};
sub backslash_escape {
require String::Escape;
my %args = @_;
my $strings = $args{strings};
lib/App/EscapeUtils.pm view on Meta::CPAN
};
return [200, "OK", $cb];
}
$SPEC{backslash_unescape} = {
v => 1.1,
summary => 'Restore backslash octal sequence (or \\r, \\n, \\t) to '.
'original characters in lines of input (in stdin or arguments)',
args => {
%arg_strings,
lib/App/EscapeUtils.pm view on Meta::CPAN
result => {
schema => 'str*',
stream => 1,
},
};
sub backslash_unescape {
require String::Escape;
my %args = @_;
my $strings = $args{strings};
lib/App/EscapeUtils.pm view on Meta::CPAN
};
return [200, "OK", $cb];
}
$SPEC{html_escape} = {
v => 1.1,
summary => 'HTML-escape lines of input (in stdin or arguments)',
args => {
%arg_strings,
},
result => {
schema => 'str*',
stream => 1,
},
};
sub html_escape {
require HTML::Entities;
my %args = @_;
my $strings = $args{strings};
lib/App/EscapeUtils.pm view on Meta::CPAN
};
return [200, "OK", $cb];
}
$SPEC{html_unescape} = {
v => 1.1,
summary => 'HTML-unescape lines of input (in stdin or arguments)',
args => {
%arg_strings,
},
result => {
schema => 'str*',
stream => 1,
},
};
sub html_unescape {
require HTML::Entities;
my %args = @_;
my $strings = $args{strings};
lib/App/EscapeUtils.pm view on Meta::CPAN
};
return [200, "OK", $cb];
}
$SPEC{shell_escape} = {
v => 1.1,
summary => 'Shell-escape lines of input (in stdin or arguments)',
args => {
%arg_strings,
},
result => {
schema => 'str*',
stream => 1,
},
};
sub shell_escape {
require ShellQuote::Any::Tiny;
my %args = @_;
my $strings = $args{strings};
lib/App/EscapeUtils.pm view on Meta::CPAN
};
return [200, "OK", $cb];
}
$SPEC{pod_escape} = {
v => 1.1,
summary => 'Quote POD special characters in input (in stdin or arguments)',
args => {
%arg_strings,
},
result => {
schema => 'str*',
stream => 1,
},
};
sub pod_escape {
require String::PodQuote;
my %args = @_;
my $strings = $args{strings};
lib/App/EscapeUtils.pm view on Meta::CPAN
};
return [200, "OK", $cb];
}
$SPEC{perl_dquote_escape} = {
v => 1.1,
summary => 'Encode lines of input (in stdin or arguments) inside Perl double-quoted strings',
args => {
%arg_strings,
},
result => {
schema => 'str*',
stream => 1,
},
};
sub perl_dquote_escape {
require String::PerlQuote;
my %args = @_;
my $strings = $args{strings};
lib/App/EscapeUtils.pm view on Meta::CPAN
};
return [200, "OK", $cb];
}
$SPEC{perl_squote_escape} = {
v => 1.1,
summary => 'Encode lines of input (in stdin or arguments) inside Perl single-quoted strings',
args => {
%arg_strings,
},
result => {
schema => 'str*',
stream => 1,
},
};
sub perl_squote_escape {
require String::PerlQuote;
my %args = @_;
my $strings = $args{strings};
lib/App/EscapeUtils.pm view on Meta::CPAN
This distributions provides the following command-line utilities:
=over
=item * L<backslash-escape>
=item * L<backslash-unescape>
=item * L<html-escape>
=item * L<html-unescape>
=item * L<js-escape>
=item * L<js-unescape>
=item * L<perl-dquote-escape>
=item * L<perl-squote-escape>
=item * L<pod-escape>
=item * L<shell-escape>
=item * L<uri-escape>
=item * L<uri-unescape>
=back
=head1 FUNCTIONS
=head2 backslash_escape
Usage:
backslash_escape(%args) -> [status, msg, payload, meta]
Escape lines of input using backslash octal sequence (or \r, \n, \t).
This function is not exported.
lib/App/EscapeUtils.pm view on Meta::CPAN
Return value: (str)
=head2 backslash_unescape
Usage:
backslash_unescape(%args) -> [status, msg, payload, meta]
Restore backslash octal sequence (or \r, \n, \t) to original characters in lines of input (in stdin or arguments).
This function is not exported.
lib/App/EscapeUtils.pm view on Meta::CPAN
Return value: (str)
=head2 html_escape
Usage:
html_escape(%args) -> [status, msg, payload, meta]
HTML-escape lines of input (in stdin or arguments).
This function is not exported.
Arguments ('*' denotes required arguments):
lib/App/EscapeUtils.pm view on Meta::CPAN
Return value: (str)
=head2 html_unescape
Usage:
html_unescape(%args) -> [status, msg, payload, meta]
HTML-unescape lines of input (in stdin or arguments).
This function is not exported.
Arguments ('*' denotes required arguments):
lib/App/EscapeUtils.pm view on Meta::CPAN
Return value: (str)
=head2 js_escape
Usage:
js_escape(%args) -> [status, msg, payload, meta]
Encode lines of input (in standard input or arguments) as JSON strings.
This function is not exported.
lib/App/EscapeUtils.pm view on Meta::CPAN
Return value: (str)
=head2 js_unescape
Usage:
js_unescape(%args) -> [status, msg, payload, meta]
Interpret lines of input (in standard input or arguments) as JSON strings and return the decoded value.
This function is not exported.
lib/App/EscapeUtils.pm view on Meta::CPAN
Return value: (str)
=head2 perl_dquote_escape
Usage:
perl_dquote_escape(%args) -> [status, msg, payload, meta]
Encode lines of input (in stdin or arguments) inside Perl double-quoted strings.
This function is not exported.
lib/App/EscapeUtils.pm view on Meta::CPAN
Return value: (str)
=head2 perl_squote_escape
Usage:
perl_squote_escape(%args) -> [status, msg, payload, meta]
Encode lines of input (in stdin or arguments) inside Perl single-quoted strings.
This function is not exported.
lib/App/EscapeUtils.pm view on Meta::CPAN
Return value: (str)
=head2 pod_escape
Usage:
pod_escape(%args) -> [status, msg, payload, meta]
Quote POD special characters in input (in stdin or arguments).
This function is not exported.
lib/App/EscapeUtils.pm view on Meta::CPAN
Return value: (str)
=head2 shell_escape
Usage:
shell_escape(%args) -> [status, msg, payload, meta]
Shell-escape lines of input (in stdin or arguments).
This function is not exported.
Arguments ('*' denotes required arguments):
lib/App/EscapeUtils.pm view on Meta::CPAN
Return value: (str)
=head2 uri_escape
Usage:
uri_escape(%args) -> [status, msg, payload, meta]
URI-escape lines of input (in standard input or arguments).
This function is not exported.
Arguments ('*' denotes required arguments):
lib/App/EscapeUtils.pm view on Meta::CPAN
Return value: (str)
=head2 uri_unescape
Usage:
uri_unescape(%args) -> [status, msg, payload, meta]
URI-unescape lines of input (in standard input or arguments).
This function is not exported.
Arguments ('*' denotes required arguments):
view all matches for this distribution
view release on metacpan or search on metacpan
share/status/app/lib/angular/angular-resource.js view on Meta::CPAN
* If you are using a url with a suffix, just add the suffix, like this:
* `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')`
* or even `$resource('http://example.com/resource/:resource_id.:format')`
* If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be
* collapsed down to a single `.`. If you need this sequence to appear and not collapse then you
* can escape it with `/\.`.
*
* @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
* `actions` methods. If any of the parameter value is a function, it will be executed every time
* when a param value needs to be obtained for a request (unless the param was overridden).
*
share/status/app/lib/angular/angular-resource.js view on Meta::CPAN
// strip trailing slashes and set the url
url = url.replace(/\/+$/, '');
// then replace collapse `/.` if found in the last URL path segment before the query
// E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`
url = url.replace(/\/\.(?=\w+($|\?))/, '.');
// replace escaped `/\.` with `/.`
config.url = url.replace(/\/\\\./, '/.');
// set params - delegate param encoding to $http
forEach(params, function(value, key){
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FQStat/System.pm view on Meta::CPAN
require File::Spec;
my $_cmd = $cmd;
if (defined $ssh and $ssh ne '') {
# too slow...
return $_cmd; # err, right!
# my $cmd_escape = $cmd;
# $cmd_escape =~ s/'/\\'g/; # bad
# my $problem = run(
# 'perl', '-e',
# q|use ExtUtils::MakeMaker; if(-x '|
# . $cmd_escape
# . q|' or MM->maybe_command('|
# . $cmd_escape
# . q|'){exit(0)}else{exit(1)}|
# );
# return $_cmd unless $problem;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/FirefoxMultiAccountContainersUtils.pm view on Meta::CPAN
my $container = $args{container};
my @urls;
for my $url0 (@{ $args{urls} || ["about:blank"] }) {
my $url = "ext+container:";
$url .= "name=" . URI::Escape::uri_escape($container);
$url .= "&url=" . URI::Escape::uri_escape($url0);
push @urls, $url;
}
my @cmd = (
"firefox",
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Fotagger/Display/SDL.pm view on Meta::CPAN
$self->draw_image;
while (1) {
MAIN: while ($event->poll) {
my $type = $event->type();
exit if ($type == SDL_QUIT);
exit if ($type == SDL_KEYDOWN && $event->key_name() eq 'escape');
my $key = $event->key_name();
if ($type == SDL_KEYDOWN && !$app->tagging) {
given($key) {
when (['n','return']) {
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/Gallery.pm view on Meta::CPAN
my $thumb = catfile $args{out}, 'thumb';
my $tmpl = HTML::Template::Compiled->new(
(($args{tmpl} // '') eq '')
? (scalarref => \$default_template)
: (filename => $args{tmpl}),
default_escape => 'HTML',
);
make_path $full, $thumb;
for my $path (@images) {
my $basename = fileparse $path;
view all matches for this distribution
view release on metacpan or search on metacpan
script/_genpass-id view on Meta::CPAN
#
# my ($word, $is_cur_word, $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/_genpass-id 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/_genpass-id 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/_genpass-id 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/_genpass-id 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/_genpass-id view on Meta::CPAN
# instead of the lines joined together). Returning array is useful if you are
# doing completion inside `Term::ReadLine`, for example, where the library
# expects an array.
#
#* `esc_mode` (str): Escaping mode for entries. Either `default` (most
# nonalphanumeric characters will be escaped), `shellvar` (like `default`, but
# dollar sign `$` will not 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).
#
#* `path_sep` (str): If set, will enable "path mode", useful for
# completing/drilling-down path. Below is the description of "path mode".
script/_genpass-id view on Meta::CPAN
# convert_wildcard_to_sql
# );
#
#our $RE_WILDCARD_BASH =
# qr(
# # non-escaped brace expression, with at least one comma
# (?P<brace>
# (?<!\\)(?:\\\\)*\{
# (?: \\\\ | \\\{ | \\\} | [^\\\{\}] )*
# (?:, (?: \\\\ | \\\{ | \\\} | [^\\\{\}] )* )+
# (?<!\\)(?:\\\\)*\}
# )
# |
# # 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<braceno>
# (?<!\\)(?:\\\\)*\{
# (?: \\\\ | \\\{ | \\\} | [^\\\{\}] )*
# (?<!\\)(?:\\\\)*\}
# )
# |
# (?P<class>
# # non-empty, non-escaped character class
# (?<!\\)(?:\\\\)*\[
# (?: \\\\ | \\\[ | \\\] | [^\\\[\]] )+
# (?<!\\)(?:\\\\)*\]
# )
# |
# (?P<joker>
# # non-escaped * and ?
# (?<!\\)(?:\\\\)*[*?]
# )
# |
# (?P<sql_wc>
# # non-escaped % and ?
# (?<!\\)(?:\\\\)*[%_]
# )
# )ox;
#
#sub contains_wildcard {
script/_genpass-id view on Meta::CPAN
# $self->{stream} .= defined $_[0] ? $_[0] : '~';
#}
#
#sub _emit_double {
# my $self = shift;
# (my $escaped = $self->escape($_[0])) =~ s/"/\\"/g;
# $self->{stream} .= qq{"$escaped"};
#}
#
#sub _emit_single {
# my $self = shift;
# my $item = shift;
script/_genpass-id view on Meta::CPAN
# $text =~ s/^/$indent/gm;
# $text = "\n$text";
# return $text;
#}
#
#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
# );
#
#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/_genpass-id view on Meta::CPAN
#
#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/_genpass-id 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/_genpass-id view on Meta::CPAN
# $self->die('YAML_PARSE_ERR_INDENTATION')
# if $self->indent - $offset > 1;
#}
#
#
#my %unescapes = (
# 0 => "\x00",
# a => "\x07",
# t => "\x09",
# n => "\x0a",
# 'v' => "\x0b",
script/_genpass-id view on Meta::CPAN
# r => "\x0d",
# e => "\x1b",
# '\\' => '\\',
# );
#
#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
script/_genpass-wordlist view on Meta::CPAN
#
# my ($word, $is_cur_word, $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/_genpass-wordlist 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/_genpass-wordlist 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/_genpass-wordlist 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/_genpass-wordlist 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/_genpass-wordlist view on Meta::CPAN
# instead of the lines joined together). Returning array is useful if you are
# doing completion inside `Term::ReadLine`, for example, where the library
# expects an array.
#
#* `esc_mode` (str): Escaping mode for entries. Either `default` (most
# nonalphanumeric characters will be escaped), `shellvar` (like `default`, but
# dollar sign `$` will not 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).
#
#* `path_sep` (str): If set, will enable "path mode", useful for
# completing/drilling-down path. Below is the description of "path mode".
script/_genpass-wordlist view on Meta::CPAN
# convert_wildcard_to_sql
# );
#
#our $RE_WILDCARD_BASH =
# qr(
# # non-escaped brace expression, with at least one comma
# (?P<brace>
# (?<!\\)(?:\\\\)*\{
# (?: \\\\ | \\\{ | \\\} | [^\\\{\}] )*
# (?:, (?: \\\\ | \\\{ | \\\} | [^\\\{\}] )* )+
# (?<!\\)(?:\\\\)*\}
# )
# |
# # 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<braceno>
# (?<!\\)(?:\\\\)*\{
# (?: \\\\ | \\\{ | \\\} | [^\\\{\}] )*
# (?<!\\)(?:\\\\)*\}
# )
# |
# (?P<class>
# # non-empty, non-escaped character class
# (?<!\\)(?:\\\\)*\[
# (?: \\\\ | \\\[ | \\\] | [^\\\[\]] )+
# (?<!\\)(?:\\\\)*\]
# )
# |
# (?P<joker>
# # non-escaped * and ?
# (?<!\\)(?:\\\\)*[*?]
# )
# |
# (?P<sql_wc>
# # non-escaped % and ?
# (?<!\\)(?:\\\\)*[%_]
# )
# )ox;
#
#sub contains_wildcard {
script/_genpass-wordlist view on Meta::CPAN
# $self->{stream} .= defined $_[0] ? $_[0] : '~';
#}
#
#sub _emit_double {
# my $self = shift;
# (my $escaped = $self->escape($_[0])) =~ s/"/\\"/g;
# $self->{stream} .= qq{"$escaped"};
#}
#
#sub _emit_single {
# my $self = shift;
# my $item = shift;
script/_genpass-wordlist view on Meta::CPAN
# $text =~ s/^/$indent/gm;
# $text = "\n$text";
# return $text;
#}
#
#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
# );
#
#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/_genpass-wordlist view on Meta::CPAN
#
#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/_genpass-wordlist 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/_genpass-wordlist view on Meta::CPAN
# $self->die('YAML_PARSE_ERR_INDENTATION')
# if $self->indent - $offset > 1;
#}
#
#
#my %unescapes = (
# 0 => "\x00",
# a => "\x07",
# t => "\x09",
# n => "\x0a",
# 'v' => "\x0b",
script/_genpass-wordlist view on Meta::CPAN
# r => "\x0d",
# e => "\x1b",
# '\\' => '\\',
# );
#
#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/GhaInstall/JSON.pm view on Meta::CPAN
}
sub _decode_string {
my $pos = pos;
# Extract string with escaped characters
m!\G((?:(?:[^\x00-\x1f\\"]|\\(?:["\\/bfnrt]|u[0-9a-fA-F]{4})){0,32766})*)!gc; # segfault on 5.8.x in t/20-mojo-json.t
my $str = $1;
# Invalid character
unless (m/\G"/gc) {
_throw('Unexpected character or invalid escape while parsing string')
if m/\G[\x00-\x1f\\]/;
_throw('Unterminated string');
}
# Unescape popular characters
if (index($str, '\\u') < 0) {
$str =~ s!\\(["\\/bfnrt])!$ESCAPE{$1}!gs;
return $str;
}
# Unescape everything else
my $buffer = '';
while ($str =~ m/\G([^\\]*)\\(?:([^u])|u(.{4}))/gc) {
$buffer .= $1;
# Popular character
view all matches for this distribution
view release on metacpan or search on metacpan
# How to fix
# Take a look at the META.yml Spec at https://metacpan.org/pod/CPAN::Meta::History::Meta_1_4
# (for version 1.4) or https://metacpan.org/pod/CPAN::Meta::Spec (for version 2),
# and change your META.yml accordingly.
#
# How to escape from trap
#
# meta-spec:
# version: 1.4
# url: http://module-build.sourceforge.net/META-spec-v1.4.html
# How to fix
# Take a look at the META.json Spec at https://metacpan.org/pod/CPAN::Meta::History::Meta_1_4
# (for version 1.4) or https://metacpan.org/pod/CPAN::Meta::Spec (for version 2),
# and change your META.json accordingly.
#
# How to escape from trap
#
# "meta-spec" : {
# "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
# "version" : 2
# },
view all matches for this distribution
view release on metacpan or search on metacpan
git-autofixup view on Meta::CPAN
}
}
return @hunks;
}
# Dequote and unescape filenames that appear in diff output.
#
# If the filename is otherwise "normal" but contains spaces it's followed by a
# trailing tab, and if it contains uncommon control characters or non-ASCII
# characters, then the filename gets surrounded in double-quotes and non-ASCII
# characters get replaced with octal escape sequences.
#
# For details about exactly what gets quoted, see the sq_lookup array in
# git/quote.c.
#
# Assume --no-prefix or similar has been used and the diff doesn't include
git-autofixup view on Meta::CPAN
sub dequote_diff_filename {
$_ = shift;
s/\t$//m; # Remove trailing tab.
if (startswith($_, '"')) {
s/^"|"$//gm; # Remove surrounding quotes.
# Replace octal and control character escapes.
s/\\((?:\d{3})|(?:[abtnvfr"\\]))/"qq(\\$1)"/eeg;
}
return $_;
}
view all matches for this distribution
view release on metacpan or search on metacpan
0.96008 2015-05-22
Updating for release of version 0.96008
Added missing mock data (Ivan Wills)
Added note to keep track of where things are (Ivan Wills)
Added pipe (|) to special escaped characters (Ivan Wills)
Added cpan tag (Ivan Wills)
Udated the documentation (Ivan Wills)
Added the ability to limit the maximum number of runs (Ivan Wills)
Updated manifest with renamed readme (Ivan Wills)
Added missing documentation (Ivan Wills)
Basic implementation working (Ivan Wills)
New script to show recent changes (Ivan Wills)
0.91 2014-11-03
Updating for release of version 0.91 (Ivan Wills)
Added escaped character at the end of the line to stop future edits removing final spaces (Ivan Wills)
Fixed needed whitespace (Ivan Wills)
Remember lists are 0 based! (Ivan Wills)
Added skipping test on windows as "echo" toggles or sets the echo state (Ivan Wills)
Added protection against DESTROY calling AUTOLOAD (Ivan Wills)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GitGerrit.pm view on Meta::CPAN
state $gerrit;
unless ($gerrit) {
my ($username, $password) = get_credentials;
require Gerrit::REST;
$gerrit = Gerrit::REST->new(config('baseurl'), $username, $password);
eval { $gerrit->GET("/projects/" . uri_escape_utf8(config('project'))) };
if (my $error = $@) {
set_credentials($username, $password, 'reject') if $error->{code} == 401;
die $error;
} else {
set_credentials($username, $password, 'approve');
lib/App/GitGerrit.pm view on Meta::CPAN
return [] unless @queries;
# If we're inside a git repository, restrict the query to the
# current project's reviews.
if (my $project = config('project')) {
$project = uri_escape_utf8($project);
@queries = map "q=project:$project+$_", @queries;
}
push @queries, "n=$Options{limit}" if $Options{limit};
lib/App/GitGerrit.pm view on Meta::CPAN
foreach my $id (@ARGV) {
# First try to make all deletions
if (my $users = $Options{delete}) {
foreach my $user (split(/,/, join(',', @$users))) {
$user = uri_escape_utf8($user);
gerrit_or_die(DELETE => "/changes/$id/reviewers/$user");
}
}
# Second try to make all additions
view all matches for this distribution
view release on metacpan or search on metacpan
. 'extract_ticket_id_from_branch = /^($project_prefixes\d+)/' . "\n"
. 'normalize_branch_ticket_id = s/^(.*?)/(\d+)$/\U$1-$2/' . "\n"
. 'extract_ticket_id_from_commit = /^($project_prefixes-\d+|--): /' . "\n",
files => $files,
commit_message => 'DEV-1234: Test',
expected => qr/\QERROR: Unsafe replacement pattern in 'normalize_branch_ticket_id', escape your slashes\E/,
},
];
# Bail out if Git isn't available.
test_requires_git();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GitHooks/Config.pm view on Meta::CPAN
if !defined( $value ) || $value eq '';
my ( $regex ) = $value =~ /^\s*\/(.*?)\/\s*$/;
croak "The key $name in the section $section is not a regex, use /.../ to delimit your expression"
if !defined( $regex );
croak "The key $name in the section $section does not specify a valid regex, it has unescaped '/' delimiters inside it"
if $regex =~ /(?<!\\)\//;
return $regex;
}
view all matches for this distribution
view release on metacpan or search on metacpan
bin/gitc-unpromoted view on Meta::CPAN
display($_) for @unpromoted;
sub display {
my ($changeset) = @_;
my $rx = join '|', keys %formats;
my @escapes = $format =~ m/%($rx)/g;
my %values;
for my $escape (@escapes) {
next if exists $values{$escape};
$values{$escape} = $formats{$escape}->($changeset);
}
( my $result = $format ) =~ s/%($rx)/$values{$1}/eg;
print "$result\n";
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GoogleSearchPerlIRCLogs.pm view on Meta::CPAN
# skip text/raw version
qq(-inurl:/text),
);
my $url = "https://www.google.com/search?num=100&q=".
URI::Escape::uri_escape($query);
my $res = Browser::Open::open_browser($url);
$res ? [500, "Failed"] : [200, "OK"];
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GoogleSearchPerlmonksUser.pm view on Meta::CPAN
# perlmonks.org marks some sections to be excluded by google, ref:
# http://www.perlmonks.org/?node_id=1136864
);
my $url = "https://www.google.com/search?num=100&q=".
URI::Escape::uri_escape($query);
my $res = Browser::Open::open_browser($url);
$res ? [500, "Failed"] : [200, "OK"];
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/GoogleSearchUtils.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/GoogleSearchUtils.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
- Specified min perl version 5.6.0 in metadata and code
- Added github repo to the dist metadata and doc
- Specified license type of 'perl' in dist metadata
- Put all dependencies in PREREQ_PM and TEST_REQUIRES if supported
- Removed App-Gre-0.04.tar.gz from MANIFEST
- Fixed pod warnings - needed to use escapes for < and >
(Thanks to Neil Bowers <neil@bowers.com> for these)
0.07 Wed Aug 26 11:25:56 CDT 2015
- Add links to docs
view all matches for this distribution
view release on metacpan or search on metacpan
BLOCKEND Block end mark
PROGRESS Progress status with -dnf option
In current release, `BLOCKEND` mark is colored with `E` effect
recently implemented in [Getopt::EX](https://metacpan.org/pod/Getopt%3A%3AEX) module, which allows to fill up
the line with background color. This effect uses irregular escape
sequence, and you may need to define `LESSANSIENDCHARS` environment
as "mK" to see the result with [less](https://metacpan.org/pod/less) command.
- **--colormap**=`&func`
- **--colormap**=`sub{...}`
- **option** _name_ string
Argument _name_ of **option** directive is user defined option name.
The rest are processed by `shellwords` routine defined in
Text::ParseWords module. Be sure that this module sometimes requires
escape backslashes.
Any kind of string can be used for option name but it is not combined
with other options.
option --fromcode --outside='(?s)\/\*.*?\*\/'
- **define** _name_ string
Define macro. This is similar to **option**, but argument is not
processed by _shellwords_ and treated just a simple text, so
meta-characters can be included without escape. Macro expansion is
done for option definition and other macro definition. Macro is not
evaluated in command line option. Use option directive if you want to
use in command line,
define (#kana) \p{InKatakana}
view all matches for this distribution