view release on metacpan or search on metacpan
# repair last line without \n
ok(
! ( $text =~ s{([^\x0D\x0A]) \z}{$1\x0D\x0A}xms ),
"$file_name has newline at EOF",
);
@lines = split m{\x0A}, $text;
}
my $find_line_numbers = sub {
my ($test_description, $test_reason, $regex, $regex_negation) = @_;
my $line_number = 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Object/Pad.pm view on Meta::CPAN
if( $sym eq ":experimental" ) {
carp "Enabling all Object::Pad experiments with an unqualified :experimental";
$enabled{$_}++ for @experiments;
}
elsif( $sym =~ m/^:experimental\((.*)\)$/ ) {
foreach my $tag ( split m/\s+/, $1 =~ s/^\s+|\s+$//gr ) {
if( $tag eq ":all" ) {
$enabled{$_}++ for @experiments;
}
else {
$enabled{$tag}++;
lib/Object/Pad.pm view on Meta::CPAN
my $i = 0;
while( $i < @$syms ) {
my $sym = $syms->[$i];
if( $sym =~ m/^:config\((.*)\)$/ ) {
foreach my $opt ( split m/\s+/, $1 =~ s/^\s+|\s+$//gr ) {
if( $opt =~ m/^(only_class_attrs|only_field_attrs)=(.*)$/ ) {
# Store an entire sub-hash inside the hints hash. This won't
# survive squashing into a COP for runtime but we only need it
# during compile so that's OK
my ( $name, $attrs ) = ( $1, $2 );
$^H{"Object::Pad/configure($name)"} = { map { $_ => 1 } split m/,/, $attrs };
}
else {
$^H{"Object::Pad/configure($opt)"}++
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Open/This.pm view on Meta::CPAN
sub _maybe_find_local_file {
my $text = shift;
my $possible_name = module_notional_filename($text);
my @dirs
= exists $ENV{OPEN_THIS_LIBS}
? split m{,}, $ENV{OPEN_THIS_LIBS}
: ( 'lib', 't/lib' );
for my $dir (@dirs) {
my $path = path( $dir, $possible_name );
if ( $path->is_file ) {
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
$path =~ s|/$||;
my $lib = $libs->{$key};
next if (!-e "$path/$lib");
$lib =~ s/\.dll$//i;
if ( $lib eq "freeglut" ) {
my @p = split m@[/\\]@, $Config{installsitebin};
next if $path eq join "/", @p or $path eq join "\\", @p;
}
# print " $key: $lib\n";
$found->{$key} = $lib;
last;
view all matches for this distribution
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
$path =~ s|/$||;
my $lib = $libs->{$key};
next if (!-e "$path/$lib");
$lib =~ s/\.dll$//i;
if ( $lib eq "freeglut" ) {
my @p = split m@[/\\]@, $Config{installsitebin};
next if $path eq join "/", @p or $path eq join "\\", @p;
}
# print " $key: $lib\n";
$found->{$key} = "-l$lib";
last;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/OpusVL/Text/Util.pm view on Meta::CPAN
use 5.014;
use strict;
use warnings;
our @ISA = qw/Exporter/;
our @EXPORT_OK = qw/truncate_text wrap_text string_to_id missing_array_items not_blank split_words line_split mask_text split_camel_case/;
use Array::Utils qw/intersect array_minus/;
use Scalar::Util qw/looks_like_number/;
# ABSTRACT: Simple text utilities
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Outthentic/DSL.pm view on Meta::CPAN
=over
=item *
using back slash delimiters to split multiline string to many chunks
=item *
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PAGI/App/File.pm view on Meta::CPAN
# Security: Normalize backslashes to forward slashes
$path =~ s{\\}{/}g;
# Security: Split path and validate each component
# Use -1 limit to preserve trailing empty strings
my @components = split m{/}, $path, -1;
for my $component (@components) {
# Block components with 2+ dots (.. , ..., ....)
if ($component =~ /^\.{2,}$/) {
await $self->_send_error($send, 403, 'Forbidden');
return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PAX/CodeUnitCompiler.pm view on Meta::CPAN
return $package if !defined $class || $class eq '';
return $package if !defined $package || $package eq '';
my ($root) = $package =~ m{^(.*)::([^:]+)$};
$root //= '';
my @class_parts = split m{::}, $class;
return join('::', grep { defined && $_ ne '' } $root, @class_parts);
}
sub _related_class_from_source {
my ($source, $package, $body, $class, %args) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PDF/API2/Resource/CIDFont/TrueType/FontFile.pm view on Meta::CPAN
foreach my $p (qw[bFamilyType bSerifStyle bWeight bProportion bContrast bStrokeVariation bArmStyle bLetterform bMidline bXheight]) {
$data->{'panose'} .= pack('C', $font->{'OS/2'}->{$p});
}
$data->{'apiname'} = join('', map { ucfirst(lc(substr($_, 0, 2))) } split m/[^A-Za-z0-9\s]+/, $data->{'fontname'});
$data->{'fontname'} =~ s/[\x00-\x1f\s]//g;
$data->{'altname'} = $font->{'name'}->find_name(1);
$data->{'altname'} =~ s/[\x00-\x1f\s]//g;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PDF/Builder/Resource/CIDFont/TrueType/FontFile.pm view on Meta::CPAN
$data->{'panose'} .= pack('C', $font->{'OS/2'}->{$p});
}
}
}
$data->{'apiname'} = join('', map { ucfirst(lc(substr($_, 0, 2))) } split m/[^A-Za-z0-9\s]+/, $data->{'fontname'});
$data->{'fontname'} =~ s/[\x00-\x1f\s]//og;
$data->{'altname'} = $font->{'name'}->find_name(1);
$data->{'altname'} =~ s/[\x00-\x1f\s]//og;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PDF/Collage/Template.pm view on Meta::CPAN
open my $fh, '-|', @command or croak "fc-list: $OS_ERROR";
my @candidates = map {
s{\s+\z}{}mxs;
my ($filename, $style) = m{\A (.*?): \s* :style=(.*)}mxs
or croak "fc-list: unexpected line '$_'";
my %style = map { $_ => 1 } split m{,}mxs, $style;
{filename => $filename, style => \%style};
} <$fh>;
return unless @candidates;
return $candidates[0]{filename} if @candidates == 1;
lib/PDF/Collage/Template.pm view on Meta::CPAN
} ## end sub _op_add_image
sub __parse_pages ($input) {
return $input if ref($input); # already represented as an array
my @pages = map {
my ($from, $to) = split m{-}mxs, $_, 2;
defined($to) ? ($from .. $to) : $from;
} split m{[\s,]+}mxs, $input;
return \@pages;
}
sub _op_add_page ($self, $command) {
my $opts =
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PDF/Kit.pm view on Meta::CPAN
}
$space_width = &{$opts{-compute_length}}( { %opts, -print=>0, }, $SPACE ); # must redo every time since might have changed from previous
# process the text
my @text = split m{ ( \s+ ) }msx, $text;
while( @text ){
my $word = shift @text;
if( $word =~ m{ \A \s }msx ){
$space_pending = 1;
view all matches for this distribution
view release on metacpan or search on metacpan
examples/header.pl view on Meta::CPAN
[ 'HeaderA', 'HeaderB' ],
# 1. white on red,blue underlined (page 1)
[ 'foo', 'bar Aye' ],
# 2. dk gray on light gray, underlined (page 2)
[ 'one', 'twosie' ],
# 3. light gray on dk gray, col 2 underlined, split multiple pages 3-6
[ 'two', 'four score and seven years ago our forefathers brought forth' ],
# 4. dk gray on light gray, underlined (page 7)
[ 'three', 'six pack' ],
# 5. light gray on dk gray, underlined, split multiple pages 8-9
[ 'four', 'abcdefghijklmnopqrstuvwxyz' ],
];
# build the table layout
# this will show the header and one line (row), meaning two rows will be
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PDF/Tk.pm view on Meta::CPAN
my $documentinfo;
$self->call_pdftk(\($self->{document}),\$documentinfo,"dump_data");
my @lines=split "\n",$documentinfo;
my %documentinfo;
while (my $line=shift @lines) {
my ($key,$val)=split m/\:\s*/,$line;
if ($key eq "InfoKey") {
$key=$val;
$line=shift @lines;
($val)=$line=~m/InfoValue\:\s*(.+)/;
}
view all matches for this distribution
view release on metacpan or search on metacpan
GENERATED/PDL/OpenCV.pm view on Meta::CPAN
#
# GENERATED WITH PDL::PP! Don't modify!
#
package PDL::OpenCV;
our @EXPORT_OK = qw( cubeRoot fastAtan2 borderInterpolate copyMakeBorder add subtract multiply divide divide2 scaleAdd addWeighted convertScaleAbs convertFp16 LUT sumElems countNonZero findNonZero mean meanStdDev norm norm2 PSNR batchDistance normali...
our %EXPORT_TAGS = (Func=>\@EXPORT_OK);
use PDL::Core;
use PDL::Exporter;
use DynaLoader;
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-pptest.t view on Meta::CPAN
sub hash2files {
my ($prefix, $hashref) = @_;
while(my ($file, $text) = each %$hashref) {
# Convert to a relative, native file path.
$file = File::Spec->catfile(File::Spec->curdir, $prefix, split m{\/}, $file);
my $dir = dirname($file);
mkpath $dir;
my $utf8 = ($] < 5.008 or !$Config{useperlio}) ? "" : ":utf8";
open(my $fh, ">$utf8", $file) || die "Can't create $file: $!";
print $fh $text;
view all matches for this distribution
view release on metacpan or search on metacpan
sub hash2files {
my ($prefix, $hashref) = @_;
while(my ($file, $text) = each %$hashref) {
# Convert to a relative, native file path.
$file = File::Spec->catfile(File::Spec->curdir, $prefix, split m{\/}, $file);
my $dir = dirname($file);
mkpath $dir;
my $utf8 = ($] < 5.008 or !$Config{useperlio}) ? "" : ":utf8";
open(my $fh, ">$utf8", $file) || die "Can't create $file: $!";
print $fh $text;
view all matches for this distribution
view release on metacpan or search on metacpan
sub hash2files {
my ($prefix, $hashref) = @_;
while(my ($file, $text) = each %$hashref) {
# Convert to a relative, native file path.
$file = File::Spec->catfile(File::Spec->curdir, $prefix, split m{\/}, $file);
my $dir = dirname($file);
mkpath $dir;
my $utf8 = ($] < 5.008 or !$Config{useperlio}) ? "" : ":utf8";
open(my $fh, ">$utf8", $file) || die "Can't create $file: $!";
print $fh $text;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PGXN/API/Sync.pm view on Meta::CPAN
lc $meta->{name}
);
make_path $dist_dir unless -e $dist_dir && -d _;
foreach my $member ($zip->members) {
my $fn = catfile $dist_dir, split m{/} => $member->fileName;
say " $fn\n" if $self->verbose > 2;
if ($member->isSymbolicLink) {
# Delete exsting so Archive::Zip won't fail to create it.
warn "Cannot unlink $fn: $!\n" if -e $fn && !unlink $fn;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PGXN/Site/Locale.pm view on Meta::CPAN
return ref $value eq 'CODE' ? $value->($self, @_) : ${ $value };
}
sub _find_file {
my $class = shift;
my @path = split m{/}, shift;
(my $dir = __FILE__) =~ s{[.]pm$}{};
no strict 'refs';
foreach my $super ($class, @{$class . '::ISA'}, __PACKAGE__ . '::en') {
my $file = File::Spec->catfile($dir, $super->language_tag, @path);
return $file if -e $file;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PHP/Decode/Parser.pm view on Meta::CPAN
use warnings;
use Carp 'croak';
use Config;
use PHP::Decode::Array qw(is_int_index);
use Exporter qw(import);
our @EXPORT_OK = qw(is_variable is_symbol is_null is_const is_numval is_strval is_array is_block global_var global_split inst_var inst_split method_name method_split ns_name ns_split);
our %EXPORT_TAGS = (all => \@EXPORT_OK);
our $VERSION = '0.127';
# avoid 'Deep recursion' warnings for depth > 100
lib/PHP/Decode/Parser.pm view on Meta::CPAN
my ($var) = @_;
my ($global) = $var =~ /^\$GLOBALS(\$.*)$/;
return $global;
}
# create and split method name
#
sub method_name {
my ($class, $name) = @_;
return $class . '::' . $name;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PLS/Server/Method/CompletionItem.pm view on Meta::CPAN
sub get_request
{
my ($request) = @_;
my (undef, $method) = split m{/}, $request->{method};
if ($method eq 'resolve')
{
return PLS::Server::Request::CompletionItem::Resolve->new($request);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/PMLTQ/CGI.pm view on Meta::CPAN
local $_;
while (<$af>) {
chomp if defined($_);
s{^\s*|\s*$|#.*}{}g;
next unless length;
my ($user,$passwd,$selection)=split m{\s*:\s+},$_,3;
next unless length($user) and length($passwd);
my $data = $auth_data{$user}={};
if ($selection) {
my %s; my $bool = $1 if $selection=~s{^\s*([-+])}{};
@s{ split m{\s*,\s*}, $selection } = ();
if (defined($bool) and $bool eq '-') {
$data->{deny}=\%s;
next if exists $s{ $service_id }
} else {
$data->{allow}=\%s;
lib/PMLTQ/CGI.pm view on Meta::CPAN
$abstract=~s{^ | $}{}g;
my $moreinfo = <$fh>; chomp $moreinfo;
my $featured = <$fh>; chomp $featured;
my $anonymous_access = <$fh>; chomp $anonymous_access;
if ($port) {
my (undef, $id) = split m{\.}, $file,2;
push @services, {
id => $id,
port => $port,
title => $title,
abstract => $abstract,
view all matches for this distribution
view release on metacpan or search on metacpan
FR/perlrequick.pod view on Meta::CPAN
Si vous utilisez l'expression rationnelle vide C<//>, la chaîne est découpée
en ses caractères. Si l'expression rationnelle contient des regroupements
alors la liste produite contiendra aussi les groupes S<reconnus :>
$x = "/usr/bin";
@parts = split m!(/)!, $x; # $parts[0] = ''
# $parts[1] = '/'
# $parts[2] = 'usr'
# $parts[3] = '/'
# $parts[4] = 'bin'
view all matches for this distribution
view release on metacpan or search on metacpan
IT/perlrequick.pod view on Meta::CPAN
Se viene usata la regex vuota C<//>, la stringa viene divisa in singoli caratteri.
Se la regex ha dei raggruppamenti, allora la lista prodotta contiene la sottostringa
matchata e anche gli elementi divisori:
$x = "/usr/bin";
@parts = split m!(/)!, $x; # $parts[0] = ''
# $parts[1] = '/'
# $parts[2] = 'usr'
# $parts[3] = '/'
# $parts[4] = 'bin'
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POD2/RU/perlrequick.pod view on Meta::CPAN
ÐÑли иÑполÑзÑеÑÑÑ Ð¿ÑÑÑой ÑÐµÐ³ÐµÐºÑ C<//>, ÑÑÑока ÑазбиваеÑÑÑ Ð½Ð° оÑделÑнÑе
ÑимволÑ. ÐÑли ÑÐµÐ³ÐµÐºÑ Ð¸Ð¼ÐµÐµÑ Ð³ÑÑппиÑовки, Ñо ÑезÑлÑÑиÑÑÑÑий ÑпиÑок ÑодеÑÐ¶Ð¸Ñ Ñакже
ÑовпавÑие подÑÑÑоки из гÑÑппиÑовок:
$x = "/usr/bin";
@parts = split m!(/)!, $x; # $parts[0] = ''
# $parts[1] = '/'
# $parts[2] = 'usr'
# $parts[3] = '/'
# $parts[4] = 'bin'
view all matches for this distribution
view release on metacpan or search on metacpan
}
sub attr {
my ($self, $key, $val) = @_;
my @keys = split m|/|, $key;
$key = pop @keys;
my $ref = \$self->{$PKG};
$ref = \$ref->{$_} for @keys;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/POE/Component/Client/NTP.pm view on Meta::CPAN
push @ntp_fields, qw/trans_time trans_time_fb/;
@tmp_pkt{@ntp_fields} =
unpack( "a C3 n B16 n B16 H8 N B32 N B32 N B32 N B32", $data );
$packet{hex_ref_time} = sprintf '%x.%x', $tmp_pkt{ref_time}, substr +( split m!\.!, $bin2frac->($tmp_pkt{ref_time_fb}) )[1], 0, 9;
$packet{hex_org_time} = sprintf '%x.%x', ( $tmp_pkt{org_time} + NTP_ADJ ), substr +( split m!\.!, $bin2frac->($tmp_pkt{org_time_fb}) )[1], 0, 9;
$packet{hex_trans_time} = sprintf '%x.%x', $tmp_pkt{trans_time}, substr +( split m!\.!, $bin2frac->($tmp_pkt{trans_time_fb}) )[1], 0, 9;
@packet{@ntp_packet_fields} = (
(unpack( "C", $tmp_pkt{byte1} & "\xC0" ) >> 6),
(unpack( "C", $tmp_pkt{byte1} & "\x38" ) >> 3),
(unpack( "C", $tmp_pkt{byte1} & "\x07" )),
view all matches for this distribution