view release on metacpan or search on metacpan
inc/Test/Base/Filter.pm view on Meta::CPAN
local $Data::Dumper::Indent = 1;
local $Data::Dumper::Terse = 1;
Data::Dumper::Dumper(@_);
}
sub escape {
$self->assert_scalar(@_);
my $text = shift;
$text =~ s/(\\.)/eval "qq{$1}"/ge;
return $text;
}
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Test/Base/Filter.pm view on Meta::CPAN
local $Data::Dumper::Indent = 1;
local $Data::Dumper::Terse = 1;
Data::Dumper::Dumper(@_);
}
sub escape {
$self->assert_scalar(@_);
my $text = shift;
$text =~ s/(\\.)/eval "qq{$1}"/ge;
return $text;
}
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
lib/App/CPANtoRPM.pm view on Meta::CPAN
# The values where this can occur are:
# args : this is already taken care of (< was turned to \<)
# packager : a single value
# author : multiple values
#
# We need to escape the brackets in the unhandled cases.
#
foreach my $val ($package{'packager'},@{ $package{'author'} }) {
$val =~ s/</\\</g;
$val =~ s/>/\\>/g;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/CSV.pm view on Meta::CPAN
# Text::CSV options, straight from the manpage.
# We override Text::CSV's default here... because it's WRONG.
our %TextCSVOptions = (
# name => [type, default, alias, @extra_opts]
quote_char => ['Str', '"', 'q'],
escape_char => ['Str', '"', 'e'],
sep_char => ['Str', ',', 's', is => 'rw'],
eol => ['Any', ''],
always_quote => ['Int', 0],
binary => ['Int', 1, 'b'],
keep_meta_info => ['Int', 0, 'k'],
allow_loose_quotes => ['Int', 0],
allow_loose_escapes => ['Int', 0],
allow_whitespace => ['Int', 0, 'w'],
verbatim => ['Int', 0],
);
# output CSV processor options default to whatever the input option is.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/CSVUtils/csv_mix_formulas.pm view on Meta::CPAN
In inplace mode (C<--inplace>), if this option is set to a non-empty string, will
rename the input file using this extension as a backup. The old existing backup
will be overwritten, if any.
=item * B<input_escape_char> => I<str>
Specify character to escape value in field in input CSV, will be passed to Text::CSV_XS.
Defaults to C<\\> (backslash). Overrides C<--input-tsv> option.
=item * B<input_filenames> => I<array[filename]> (default: ["-"])
lib/App/CSVUtils/csv_mix_formulas.pm view on Meta::CPAN
=item * B<input_tsv> => I<true>
Inform that input file is in TSV (tab-separated) format instead of CSV.
Overriden by C<--input-sep-char>, C<--input-quote-char>, C<--input-escape-char>
options. If one of those options is specified, then C<--input-tsv> will be
ignored.
=item * B<output_always_quote> => I<bool> (default: 0)
lib/App/CSVUtils/csv_mix_formulas.pm view on Meta::CPAN
When set to true, then all values will be quoted:
"field1","field2","field three contains comma (,)","field4"
=item * B<output_escape_char> => I<str>
Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS.
This is like C<--input-escape-char> option but for output instead of input.
Defaults to C<\\> (backslash). Overrides C<--output-tsv> option.
=item * B<output_filename> => I<filename>
lib/App/CSVUtils/csv_mix_formulas.pm view on Meta::CPAN
Inform that output file is TSV (tab-separated) format instead of CSV.
This is like C<--input-tsv> option but for output instead of input.
Overriden by C<--output-sep-char>, C<--output-quote-char>, C<--output-escape-char>
options. If one of those options is specified, then C<--output-tsv> will be
ignored.
=item * B<overwrite> => I<bool>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/CSVUtils.pm view on Meta::CPAN
$prefix //= '';
my %tcsv_opts = (binary=>1);
if (defined $args->{"${prefix}sep_char"} ||
defined $args->{"${prefix}quote_char"} ||
defined $args->{"${prefix}escape_char"}) {
$tcsv_opts{"sep_char"} = $args->{"${prefix}sep_char"} if defined $args->{"${prefix}sep_char"};
$tcsv_opts{"quote_char"} = $args->{"${prefix}quote_char"} if defined $args->{"${prefix}quote_char"};
$tcsv_opts{"escape_char"} = $args->{"${prefix}escape_char"} if defined $args->{"${prefix}escape_char"};
} elsif ($args->{"${prefix}tsv"}) {
$tcsv_opts{"sep_char"} = "\t";
$tcsv_opts{"quote_char"} = undef;
$tcsv_opts{"escape_char"} = undef;
}
$tcsv_opts{always_quote} = 1 if $args->{"${prefix}always_quote"};
$tcsv_opts{quote_empty} = 1 if $args->{"${prefix}quote_empty"};
Text::CSV_XS->new(\%tcsv_opts);
lib/App/CSVUtils.pm view on Meta::CPAN
input_tsv => {
summary => "Inform that input file is in TSV (tab-separated) format instead of CSV",
schema => 'true*',
description => <<'_',
Overriden by `--input-sep-char`, `--input-quote-char`, `--input-escape-char`
options. If one of those options is specified, then `--input-tsv` will be
ignored.
_
tags => ['category:input'],
lib/App/CSVUtils.pm view on Meta::CPAN
Defaults to `"` (double quote). Overrides `--input-tsv` option.
_
tags => ['category:input'],
},
input_escape_char => {
summary => 'Specify character to escape value in field in input CSV, will be passed to Text::CSV_XS',
schema => ['str*', len=>1],
description => <<'_',
Defaults to `\\` (backslash). Overrides `--input-tsv` option.
lib/App/CSVUtils.pm view on Meta::CPAN
schema => 'bool*',
description => <<'_',
This is like `--input-tsv` option but for output instead of input.
Overriden by `--output-sep-char`, `--output-quote-char`, `--output-escape-char`
options. If one of those options is specified, then `--output-tsv` will be
ignored.
_
tags => ['category:output'],
lib/App/CSVUtils.pm view on Meta::CPAN
Defaults to `"` (double quote). Overrides `--output-tsv` option.
_
tags => ['category:output'],
},
output_escape_char => {
summary => 'Specify character to escape value in field in output CSV, will be passed to Text::CSV_XS',
schema => ['str*', len=>1],
description => <<'_',
This is like `--input-escape-char` option but for output instead of input.
Defaults to `\\` (backslash). Overrides `--output-tsv` option.
_
tags => ['category:output'],
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/CamelPKI/CADB.pm view on Meta::CPAN
derivation of the L<DBIx::Class> API; However there is no reason to
return directly an instance of I<DBIx::Class> in L</search> because
it will violate the encapsulation of I<App::CamelPKI::CADB>. Consequence
could be a induced coupling (it should be impossible to refactor the
scheme without breaking the whole calling code), and worse, a
privilege escape leading to a security breach (because it's also
possible to write with a I<DBIx::Class> cursor).
=cut
package App::CamelPKI::CADB::Cursor;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/CekBpom.pm view on Meta::CPAN
unless (defined $search_type_num) {
return [400, "Unknown search_type '$search_type'"];
}
require URI::Escape;
my $query_enc = URI::Escape::uri_escape($query);
my @rows;
my $page_num = 0;
my $num_results = 100;
my ($result_start, $result_end);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Cerberus/Client.pm view on Meta::CPAN
#===================================
my $self = shift;
my %params = @_;
my %failed;
my $qs = '?' . join '&',
map { uri_escape($_) . '=' . uri_escape( $params{$_} ) }
keys %params;
my $servers = $self->{servers};
while (1) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Changelog2x.pm view on Meta::CPAN
$xsltc = $self->resolve_template($style)
or die "Could not resolve style '$style' to a file";
$style = $xsltc;
}
# First copy over and properly setup/escape the parameters, so that XSLT
# understands them.
%params = map { XML::LibXSLT::xpath_to_string($_ => $params->{$_}) }
(keys %$params);
# Do the steps of parsing XML documents, creating stylesheet engine and
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Chart/Barchart.pm view on Meta::CPAN
(__x('Barchart quote {symbol} ({barchart_commodity})',
symbol => "$commodity$suffix",
barchart_commodity => $barchart_commodity));
my $url = 'http://www2.barchart.com/ifutpage.asp?code=BSTK&sym='
. URI::Escape::uri_escape ($barchart_commodity);
my $resp = App::Chart::Download->get ($url,
cookie_jar => cookie_jar(),
referer => $url);
my $h = ifutpage_parse ($commodity, $suffix, $resp);
lib/App/Chart/Barchart.pm view on Meta::CPAN
(__x('Barchart five day {symbol} ({barchart_symbol})',
symbol => $symbol,
barchart_symbol => $barchart_symbol));
}
my $url = FIVEDAY_URL_BASE . URI::Escape::uri_escape ($barchart_symbol);
my $resp = App::Chart::Download->get ($url,
cookie_jar => cookie_jar(),
referer => $url);
my $h = fiveday_parse ($symbol, $resp);
lib/App/Chart/Barchart.pm view on Meta::CPAN
App::Chart::Download::status
(__x('Barchart intraday page {symbol} {mode}',
symbol => $symbol,
mode => $mode));
my $url = 'http://www.barchart.com/chart.php?sym='
. URI::Escape::uri_escape (symbol_to_barchart ($symbol))
. $intraday_mode_to_data{$mode};
App::Chart::Download::verbose_message ("Intraday page", $url);
my $jar = cookie_jar();
my $resp = App::Chart::Download->get ($url,
view all matches for this distribution
view release on metacpan or search on metacpan
# Cpp std::string for const char *
string myStr;
myStr.c_str();
# Raw string in CPP. Do not need to escape characters.
# R"ABC(TEXT)ABC";
#
R"sql(CREATE TABLE IF NOT EXISTS version (
version INTEGER
);)sql"
#############################################################
## Linux Commands - stty
#############################################################
# View the control character escapes
stty -a
# Fix terminal after doing a hard exit in a script (control-C).
reset
tset
YELLOW='\033[00;33m'
VIOLET='\033[00;35m'
TEAL='\033[00;36m'
GREY='\033[00;37m'
# View color ansi escapes with less (like Vim)
less -R file
# Make xterm text color bold
BOLD='\033[1m'
#
# IFS=$'\n': This sets the Internal Field Separator (IFS) to newline (\n).
This ensures that spaces in the output of _my_function won't cause
word splitting.
# read -r -d '' -a v: This command reads input into the array variable v.
# -r: Prevents backslash escapes from being interpreted.
# -d '': Delimiter option set to an empty string. This ensures that
read reads until it encounters a null byte (this effectively
reads the whole output as a single line).
# -a v: Assigns the input to the array variable v.
# < <(_my_function): This redirects the output of _my_function to the
#############################################################
## Perl Modules - Term::ANSIColor
#############################################################
# Proper way to color text in perl instead of hardcoding
# escape codes (which are not all the same on all devices).
perl -MTerm::ANSIColor -E 'say colored ($_,$_) for qw( RED YELLOW GREEN ON_BRIGHT_BLACK )'
# Color an remote color (uncolor).
perl -MTerm::ANSIColor=colored,colorstrip -E 'say length colorstrip(colored("HEY", "YELLOW"))'
3
# View man page (Vim,help)
:h
# Search for spaces (Vim)
/\s\+
# \+ since all are taken literally unless escaped
# If accidentally pressed <Control> + s (Vim)
# that will freeze the terminal. This is due to "flow control"
# Do this to undo the effect:
<Control> + q
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Chronicle/Plugin/Generate/LowerCase.pm view on Meta::CPAN
mode => oct("755"),
} );
}
my $out =
$config->{ 'output' } . "/" . $entry->{ 'link' }->unescaped;
$config->{ 'verbose' } &&
print "Writing redirection to $out for mixed-case post " .
lc( $entry->{ 'link' } ) . "\n";
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/Codeowners/Formatter/CSV.pm view on Meta::CPAN
$self->{text_csv} ||= do {
eval { require Text::CSV } or die "Missing dependency: Text::CSV\n";
my %options;
$options{escape_char} = $self->escape_char if $self->escape_char;
$options{quote} = $self->quote if $self->quote;
$options{sep} = $self->sep if $self->sep;
if ($options{sep} && $options{sep} eq ($options{quote} || '"')) {
die "Invalid separator value for CSV format.\n";
}
lib/App/Codeowners/Formatter/CSV.pm view on Meta::CPAN
}
sub sep { $_[0]->{sep} || $_[0]->format }
sub quote { $_[0]->{quote} }
sub escape_char { $_[0]->{escape_char} }
1;
__END__
lib/App/Codeowners/Formatter/CSV.pm view on Meta::CPAN
=head2 quote
Get the value used for L<Text::CSV/quote>.
=head2 escape_char
Get the value used for L<Text::CSV/escape_char>.
=head1 BUGS
Please report any bugs or feature requests on the bugtracker website
L<https://github.com/chazmcgarvey/git-codeowners/issues>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Colorist/Colorizer.pm view on Meta::CPAN
Checks to see if the ruleset file has changed since it's last load and calls L<load_ruleset_file> to reload the configuration if it has.
=head2 print_reset_line
Prints the escape code to reset everything to the terminal default.
=head2 get_fg
my $code = $c->get_fg(10);
Returns the escape code required to change the foreground color to the given color number.
=head2 get_bg
my $code = $self->get_bg(10);
Returns the escape code that will change the background color to the given color code.
=head2 gray
my $number = $c->gray(10);
lib/App/Colorist/Colorizer.pm view on Meta::CPAN
my $code = $c->fg('blue');
my $code = $c->fg(10);
my $code = $c->fg([ 8 ]);
my $code = $c->fg([ 1, 2, 3 ]);
Returns the escape code for changing the foreground color to the given color identifier.
=head2 bg
my $code = $c->bg('blue');
my $code = $c->bg(10);
my $code = $c->bg([ 8 ]);
my $code = $c->bg([ 1, 2, 3 ]);
Returns the escape code for changing the background color to the given color identifier.
=head2 c
my $code = $c->c('rufus');
Given the name of a color defined in the colorset, returns the escape codes defined for that color to change the background and foreground as configured.
=head2 run
Runs the colorization process to colorize input and send that to the output.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/perlstyle.pod view on Meta::CPAN
Example: Eudora 3.0.6 wraps a solid, single line of 80 non-whitespace
characters (i.e. ######...#####) at character 76. If there are
spaces in the line, it allows lines up to character 78 before wrapping
the last words down to the next line. If sources have no more than
77 characters in a line, a "diff -u" patch will add a column, and the
lines will escape being folded.
=head2 Blank Space
No space before a semicolon that closes a statement.
lib/App/perlstyle.pod view on Meta::CPAN
I like it. I don't need to worry about messing
with lots of print statements and lining them up.
EOT
Just remember that unless you put single quotes around your here-doc
token (<<'EOT'), the text will be interpolated, so escape any "$" or "@"
as needed.
=head1 REQUIREMENTS RFC AND CODING PROCEDURE
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/Critique/Command/process.pm view on Meta::CPAN
);
if ( $what_now eq 'c' ) {
info(HR_LIGHT);
$commit_msg = prompt_str( BOLD('Please write a commit message') );
$commit_msg =~ s/\\n/\n/g; # un-escape any newlines ...
goto CHOOSE;
}
elsif ( $what_now eq 'a' ) {
info(HR_LIGHT);
$commit_msg .= "\n\n" . prompt_str( BOLD('Please append the commit message') );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/CryptoCurrencyUtils.pm view on Meta::CPAN
next CURRENCY;
}
require Browser::Open;
my $url = "https://masternodes.online/currencies/" .
URI::Escape::uri_escape($cur->{code})."/";
my $err = Browser::Open::open_browser($url);
return [500, "Can't open browser for '$url'"] if $err;
}
[200];
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/DBBrowser/GetContent/Parse.pm view on Meta::CPAN
use Encode qw( decode );
use Encode::Locale qw();
#use Spreadsheet::Read qw( ReadData rows ); # required
#use String::Unescape qw( unescape ); # required
#use Text::CSV_XS qw(); # required
use Term::Choose qw();
use Term::Choose::LineFold qw( line_fold );
use Term::Choose::Screen qw( clear_screen );
lib/App/DBBrowser/GetContent/Parse.pm view on Meta::CPAN
my ( $sf, $sql, $fh ) = @_;
my $ax = App::DBBrowser::Auxil->new( $sf->{i}, $sf->{o}, $sf->{d} );
my $tc = Term::Choose->new( $sf->{i}{tc_default} );
$sf->__print_waiting_str;
seek $fh, 0, 0;
require String::Unescape;
my $options = {
map { $_ => String::Unescape::unescape( $sf->{o}{csv_in}{$_} ) }
# grep length: keep the default value if the option is set to ''
grep { length $sf->{o}{csv_in}{$_} }
keys %{$sf->{o}{csv_in}}
};
require Text::CSV_XS;
lib/App/DBBrowser/GetContent/Parse.pm view on Meta::CPAN
if ( $menu->[$idx] eq $reparse ) {
my $opt_set = App::DBBrowser::Opt::Set->new( $sf->{i}, $sf->{o} );
$sf->{o} = $opt_set->set_options( 'import' );
return -1;
}
require String::Unescape;
$/ = String::Unescape::unescape( $irs[$idx-@pre] );
$sf->__print_waiting_str;
seek $fh, 0, 0;
my @rows = grep { ! /^\s+\z/ } <$fh>;
chomp @rows;
my $fields_set = [ [ 'Col count', ], [ 'Sep width', ], ];
view all matches for this distribution
view release on metacpan or search on metacpan
0.022 2019-09-03 14:24:05-05:00 America/Chicago
- require perl v5.14 for development
- fill out more authoring and development dependencies metadata
- remove perlbrew release tests
- add release tests for changelog and features for perl v5.12
- escape possible infinite recursion if neither DSN nor schema are specified
0.021 2014-12-18 04:52:22+00:00 UTC (TRIAL RELEASE)
- #9 remove experimental smartmatch operators (HAARG++, SREZIC++)
- #11 fix POD encoding (SROMANV++)
0.020 2011-09-15 15:32:37 America/New_York
- rename to App-DBCritic
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/DBI/Loader.pm view on Meta::CPAN
use Getopt::Std;
use Getopt::Config::FromPod;
use Pod::Usage;
use DBI;
use String::Unescape;
sub run
{
shift if @_ && eval { $_[0]->isa(__PACKAGE__) };
local (@ARGV) = @_;
lib/App/DBI/Loader.pm view on Meta::CPAN
pod2usage(-verbose => 2) if exists $opts{h};
pod2usage(-msg => 'At least 2 arguments MUST be specified', -verbose => 0, -exitval => 1) if @ARGV < 2;
push @ARGV, '-' if @ARGV == 2;
$opts{t} ||= '';
my $sep = String::Unescape->unescape($opts{t}) || ',';
my $dbstr = shift @ARGV;
my $table = shift @ARGV;
my $dbh = DBI->connect($dbstr, $opts{u} || '', $opts{p} || '') or die;
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/Dapper.pm view on Meta::CPAN
INCLUDE_PATH => $self->{layout},
ANYCASE => 1,
ENCODING => 'utf8',
#STRICT => 1,
FILTERS => {
'xml_escape' => \&App::Dapper::Filters::xml_escape,
'date_to_xmlschema' => \&App::Dapper::Filters::date_to_xmlschema,
'replace_last' => \&App::Dapper::Filters::replace_last,
'smart' => \&App::Dapper::Filters::smart,
'json' => \&App::Dapper::Filters::json,
},
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/dex view on Meta::CPAN
favourite language: Perl
--- # Document two is a sequence
- plain string
- 'in single quotes'
- "in double quotes we have escapes! like \t and \n"
- | # a literal block scalar
line1
line2
- > # a folded block scalar
this is all one
scripts/dex view on Meta::CPAN
"\x85" => '\N',
"\xa0" => '\_',
);
my $control_re = '\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x84\x86-\x9f\x{d800}-\x{dfff}\x{fffe}\x{ffff}\x{2028}\x{2029}\x85\xa0';
my %to_escape = (
"\n" => '\n',
"\t" => '\t',
"\r" => '\r',
'\\' => '\\\\',
'"' => '\\"',
%control,
);
my $escape_re = $control_re . '\n\t\r';
my $escape_re_without_lb = $control_re . '\t\r';
sub scalar_event {
DEBUG and warn __PACKAGE__.':'.__LINE__.": +++ scalar_event\n";
my ($self, $info) = @_;
scripts/dex view on Meta::CPAN
}
}
elsif ($style == YAML_PLAIN_SCALAR_STYLE) {
if (not length $value) {
}
elsif ($value =~ m/[$escape_re_without_lb]/) {
$style = YAML_DOUBLE_QUOTED_SCALAR_STYLE;
}
elsif ($value eq "\n") {
$style = YAML_DOUBLE_QUOTED_SCALAR_STYLE;
}
scripts/dex view on Meta::CPAN
$value .= "\n";
}
}
}
else {
$value =~ s/([$escape_re"\\])/$to_escape{ $1 } || sprintf '\\u%04x', ord($1)/eg;
$value = '"' . $value . '"';
}
DEBUG and warn __PACKAGE__.':'.__LINE__.": (@$stack)\n";
my $yaml = '';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/DistSync.pm view on Meta::CPAN
unless (($file, $args) = /^'(\\[\\']|.+)+'\s*(.*)/) {
($file, $args) = /^(^\s*\!\!perl\/regexp\s*\S+)\s*(.*)/;
}
} else {
# filename may contain spaces if enclosed in ''
# (in which case, \\ and \' are escapes)
if (($file, $args) = /^'(\\[\\']|.+)+'\s*(.*)/) {
$file =~ s/\\([\\'])/$1/g;
} else {
($file, $args) = /^(\S+)\s*(.*)/;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/App/DocKnot/Generate.pm view on Meta::CPAN
sub _code_for_to_text {
my ($self) = @_;
my $to_text = sub {
my ($text) = @_;
# Remove triple backticks but escape all backticks inside them.
$text =~ s{ ``` \w* (\s .*?) ``` }{
my $text = $1;
$text =~ s{ [\`] }{``}xmsg;
$text;
}xmsge;
lib/App/DocKnot/Generate.pm view on Meta::CPAN
my ($text) = @_;
# Escape all backslashes.
$text =~ s{ \\ }{\\\\}xmsg;
# Rewrite triple backticks to \pre blocks and escape backticks inside
# them so that they're not turned into \code blocks.
$text =~ s{ ``` \w* (\s .*?) ``` }{
my $text = $1;
$text =~ s{ [\`] }{``}xmsg;
'\pre[' . $1 . ']';
view all matches for this distribution