view release on metacpan or search on metacpan
lib/App/Task.pm view on Meta::CPAN
);
return $rv;
}
sub _escape {
my ( $str, $leave_slashes ) = @_;
$str =~ s/\\/\\\\/g unless $leave_slashes;
$str =~ s/\n/\\n/g;
$str =~ s/\t/\\t/g;
lib/App/Task.pm view on Meta::CPAN
my $task = $code;
my $type = ref($code);
if ( $type eq 'ARRAY' ) {
my $disp = join " ", map {
my $copy = "$_";
$copy = _escape( $copy, 1 );
if ( $copy =~ m/ / ) { $copy =~ s/'/\\'/g; $copy = "'$copy'" }
$copy
} @{$code};
if ( $ENV{App_Task_DRYRUN} ) {
$task = sub { print "(DRYRUN) ï¼ï¼¿ $disp\n" };
lib/App/Task.pm view on Meta::CPAN
$task = $cmdhr->{fatal} ? sub { _sys( @{$code} ) or die "`$disp` did not exit cleanly: $?\n" } : sub { _sys( @{$code} ) };
}
}
elsif ( !$type ) {
my $disp = _escape( $code, 0 );
if ( $ENV{App_Task_DRYRUN} ) {
$task = sub { print "(DRYRUN) ï¼ï¼¿ $disp\n" };
}
else {
$task = $cmdhr->{fatal} ? sub { _sys($code) or die "`$disp` did not exit cleanly: $?\n" } : sub { _sys($code) };
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/TemplateServer.pm view on Meta::CPAN
);
};
method _render_template($req) {
my $context = $self->_mk_context($req);
my $template = uri_unescape($req->uri->path);
$template =~ s{^/}{};
my $content = $self->provider->render_template($template, $context);
return _success($content);
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Templer/Plugin/Dollar.pm view on Meta::CPAN
=for example begin
<html>
<head>
<title>${title escape="html"}</title>
<meta name='author' content='${author} ${email escape=url}'/>
</head>
<body>
</body>
</html>
lib/Templer/Plugin/Dollar.pm view on Meta::CPAN
the transformation. The third line of the example is for instance transformed
as
=for example begin
<title><tmpl_var name="title" escape="html"></title>
=for example end
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for App-Termcast
0.13 2014-09-16
- Use a less intrusive (and more easily parsable) escape sequence for
metadata. I believe terminals should just ignore this if it ends up
actually getting sent to the terminal instead of stripped out by the
termcast server, but let me know if this isn't the case.
0.12 2012-03-15
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/Test/Generator.pm view on Meta::CPAN
# q_wrap
#
# Purpose: Wrap a string in the most readable
# q{} form that does not require escaping,
# falling back to single-quoted form with
# escaped apostrophes if no delimiter is
# available.
#
# Entry: $s - the string to wrap. May be undef.
# Exit: Returns a Perl source-code fragment that
# evaluates to the original string value,
lib/App/Test/Generator.pm view on Meta::CPAN
# Must use != $INDEX_NOT_FOUND rather than > 0 since
# the delimiter may legitimately appear at position 0
return "q$d$s$d" if index($s, $d) == $INDEX_NOT_FOUND;
}
# Last resort â single-quoted string with escaped apostrophes
(my $esc = $s) =~ s/'/\\'/g;
return "'$esc'";
}
# --------------------------------------------------
lib/App/Test/Generator.pm view on Meta::CPAN
#
# Purpose: Escape a string for safe inclusion
# inside a single-quoted Perl string
# literal in generated test code.
#
# Entry: $s - the string to escape.
# Exit: Returns the escaped string, or an
# empty string if $s is undef.
#
# Side effects: None.
#
# Notes: NUL byte replacement produces the
lib/App/Test/Generator.pm view on Meta::CPAN
# Return empty string for undef â callers that need
# 'undef' literal should use perl_quote instead
return '' unless defined $s;
# Escape backslashes first so later substitutions
# don't double-escape already-escaped sequences
$s =~ s/\\/\\\\/g;
# Escape apostrophes so they don't terminate the
# surrounding single-quoted string literal
$s =~ s/'/\\'/g;
# Escape common control characters to their
# printable two-character escape sequences
$s =~ s/\n/\\n/g;
$s =~ s/\r/\\r/g;
$s =~ s/\t/\\t/g;
$s =~ s/\f/\\f/g;
view all matches for this distribution
view release on metacpan or search on metacpan
asciitable.
0.008 2022-02-18 Released-By: PERLANCAR; Urgency: medium
- [bugfix] Revert back 0.007's decision to set escape_char to '\'
because the common default is '"'.
0.007 2022-02-18 Released-By: PERLANCAR; Urgency: medium; Backward-Incompatible: yes; Broken: yes
- Allow customizing CSV's escape_char with --escape-char.
- [backward incompatible] CSV parser is instantiated with escape_char
set to '\' (backslash) to handle backslash escaping. Also, the
precedence of --tsv is increased to preced --csv-sep et al. UPDATE:
reversed in 0.008.
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/TimeTracker/Command/Gitlab.pm view on Meta::CPAN
our $VERSION = "1.004";
use Moose::Role;
use HTTP::Tiny;
use JSON::XS qw(encode_json decode_json);
use URI::Escape qw(uri_escape);
has 'issue' => (
is => 'rw',
isa => 'Str',
documentation => 'gitlab issue',
lib/App/TimeTracker/Command/Gitlab.pm view on Meta::CPAN
if (my $remove = $on_start->{remove}) {
foreach my $remove (@$remove) {
delete $l{$remove};
}
}
$self->_call('PUT','projects/'.$self->project_id.'/issues/'.$self->issue.'?labels='.uri_escape(join(',',keys %l)));
say "Labels are now: ".join(', ',sort keys %l);
}
};
#after [ 'cmd_start', 'cmd_continue', 'cmd_append' ] => sub {
view all matches for this distribution
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
Now we can pass in a log file argument to our program (otherwise it will
read input from standard input):
$ unliner log-report access.log
Note that $@ escapes whitespace like bourne shell's "$@". Actually it
just passes the argument array untouched through to the process (grep in
this case) so the arguments can contain any characters. The bourne
equivalent of unquoted $@ and $* are not supported because they cause
way too many bugs (use templates if you need to do this).
print "$1\n" if /(\d+)$/;
}
}
This def could also have been written in sh, but dealing with shell
escapes is sometimes annoying:
def body-size-extractor {
perl -e 'while(<STDIN>) { ... }'
}
view all matches for this distribution