view release on metacpan or search on metacpan
lib/EBI/FGPT/FuzzyRecogniser.pm view on Meta::CPAN
# to signal sections irrespective of actual line endings
# this is a major headache to resolve, the parser doesn't
# do this and we're not going to bother with it either
$alt =~ s/;;//g;
$alt =~ s/INCLUDED//g; # remove INCLUDED as it screws up scoring
my @synonyms = split m!\n!, $alt;
# if alt doesn't start with ;; it's an overspill from the
# title (go figure!)
if ( $alt ne ''
&& $omim_entry->alternative_titles_and_symbols() !~ /^;;/ )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/EBook/Tools/Unpack.pm view on Meta::CPAN
attribute C<opffile>, then the object attribute is updated to match.
=item * C<textfile> (optional)
The file containing the main text of the document. If specified, the
method will attempt to split metadata out of the file and add whatever
remains to the manifest of the OPF.
=item * C<mediatype> (optional)
The media type (mime type) of the document specified via C<textfile>.
view all matches for this distribution
view release on metacpan or search on metacpan
t/04_queue_group.t view on Meta::CPAN
}
close $sock;
plan tests => 3;
# Two subscribers in same queue group should split messages
my $nats;
$nats = EV::Nats->new(
host => $host,
port => $port,
on_error => sub { diag "error: @_"; EV::break },
view all matches for this distribution
view release on metacpan or search on metacpan
lib/EWS/Calendar/Item.pm view on Meta::CPAN
@{$params->{'RequiredAttendees'}->{Attendee}} ];
$params->{'Body'} = $params->{'Body'}->{'_'};
# rework semicolon separated list into array, and also remove Organizer
$params->{'DisplayTo'} = [ grep {$_ ne $params->{'Organizer'}->{'Name'}}
split m/; /, $params->{'DisplayTo'} ];
# set Perl's encoding flag on all data coming from Exchange
# also strip HTML tags from incoming data
my $hs = HTML::Strip->new(emit_spaces => 0);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/Abuse/Investigator.pm view on Meta::CPAN
# Returns 1 (true) if the IP is within the CIDR block, 0 otherwise.
sub _ip_in_cidr :Private {
my ($self, $ip, $cidr) = @_;
return $ip eq $cidr unless $cidr =~ m{/};
my ($net_addr, $prefix) = split m{/}, $cidr;
return 0 if !defined($prefix) || $prefix !~ /^\d+$/ || $prefix > 32;
# Compute the network mask and compare masked network addresses
my $mask = ~0 << (32 - $prefix);
my $net_n = unpack 'N', (inet_aton($net_addr) // return 0);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Email/MIME.pm view on Meta::CPAN
#pod =cut
sub content_type_set {
my ($self, $ct) = @_;
my $ct_header = parse_content_type($self->header('Content-Type'));
@{$ct_header}{qw[type subtype]} = split m[/], $ct;
$self->_compose_content_type($ct_header);
$self->_reset_cids;
return $ct;
}
view all matches for this distribution
view release on metacpan or search on metacpan
if (! $browser_string) {
return;
}
# Split variables.
my @browser = split m/:/ms, $browser_string;
# Run.
while (my $browser = shift @browser) {
if ($browser =~ m/%s/ms) {
$browser = sprintf $browser, $uri;
view all matches for this distribution
view release on metacpan or search on metacpan
sub DIMENSION() { 'ENVY_DIMENSION' }
sub CONTEXT() { 'ENVY_CONTEXT' }
sub VERBOSE() { 'ENVY_VERBOSE' }
if ($ENV{REGRESSION_ENVY_PATH}) {
@DefaultPath = split m/\s+/, $ENV{REGRESSION_ENVY_PATH};
@FORCEPATH = ();
} else {
@DefaultPath = #SEARCH#
;
@FORCEPATH = #FORCEPATH#
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Excel/Writer/XLSX/Worksheet.pm view on Meta::CPAN
# Handle strings and rich strings.
#
# For standard shared strings we do a reverse lookup
# from the shared string id to the actual string. For
# rich strings we use the unformatted string. We also
# split multiline strings and handle each part
# separately.
my $string;
if ( $type eq 's' ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Export/Attrs.pm view on Meta::CPAN
for my $attr (@attrs) {
($attr||=q{}) =~ s/\A Export (?: \( (.*) \) )? \z/$1||q{}/exms
or next ATTR;
my @tagsets = grep {length $_} split m/ \s+,?\s* | ,\s* /xms, $attr;
my (undef, $file, $line) = caller(1);
$file =~ s{.*/}{}xms;
if (my @bad_tags = grep {!m/\A :$IDENT \z/xms} @tagsets) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ExtUtils/CChecker.pm view on Meta::CPAN
my %args = @_;
ref( my $libs = $args{libs} ) eq "ARRAY" or croak "Expected 'libs' as ARRAY ref";
foreach my $l ( @$libs ) {
my @extra_linker_flags = map { "-l$_" } split m/\s+/, $l;
$self->try_compile_run( %args, extra_linker_flags => \@extra_linker_flags ) or next;
$self->push_extra_linker_flags( @extra_linker_flags );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ExtUtils/H2PM.pm view on Meta::CPAN
push @genblocks, [ $basename => sub {
my ( $result ) = @_;
return () unless defined $result;
my @result = split m/,/, $result;
my $curpos = 0;
my $format = "";
lib/ExtUtils/H2PM.pm view on Meta::CPAN
$output = <$runh>;
}
unlink $exename;
my %results = map { m/^(\w+)=(.*)$/ } split m/\n/, $output;
my $perl = "";
my @bodylines;
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/MakeMaker/Test/Setup/BFD.pm view on Meta::CPAN
mkdir($tmpdir) or die "Failed to create '$tmpdir': $!";
chdir($tmpdir) or die "Failed to chdir '$tmpdir': $!";
foreach my $file (sort keys %Files) {
my $text = $Files{$file};
# Convert to a relative, native file path.
$file = File::Spec->catfile(File::Spec->curdir, @_, split m{\/}, $file);
$file = File::Spec->rel2abs($file);
my $dir = dirname($file);
mkpath $dir;
open(FILE, ">$file") || die "Can't create $file: $!";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ExtUtils/MM_Win32.pm view on Meta::CPAN
my ($self) = @_;
my $make = $self->make;
$make = +( File::Spec->splitpath( $make ) )[-1];
$make =~ s!\.exe$!!i;
if ( $make =~ m![^A-Z0-9]!i ) {
($make) = grep { m!make!i } split m![^A-Z0-9]!i, $make;
}
return "$make-style";
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/FAST/Bio/SearchIO/erpin.pm view on Meta::CPAN
} elsif ( (index($line, 'FW') == 0) || (index($line, 'RC') == 0)) {
my ($str, $hn, $pos, $score, $eval) = split ' ', $line;
if ($minscore < $score) {
$self->start_element({'Name' => 'Hsp'});
my ($start, $end) = split m{\.\.}, $pos, 2;
($start, $end) = ($end, $start) if ($str eq 'RC');
$line = $self->_readline;
chomp $line;
$self->element_hash({
'Hsp_stranded' => 'HIT',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/FLV/VideoTag.pm view on Meta::CPAN
$self->{width} = $width;
$self->{height} = $height;
my $typebits = substr $bits, 33 + $offset, 2;
my @typebits = split m//xms, $typebits;
my $type = 1 + $typebits[0] * 2 + $typebits[1];
if (!defined $self->{type})
{
$self->{type} = $type;
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/glob-comparison.t view on Meta::CPAN
$root = abs_path($root);
# Helper: create a file (and parent dirs if needed)
sub touch {
my ($relpath) = @_;
my $full = File::Spec->catfile( $root, split m{/}, $relpath );
my $dir = File::Basename::dirname($full);
make_path($dir) unless -d $dir;
open my $fh, '>', $full or die "Cannot create $full: $!";
close $fh;
}
# Helper: create a directory
sub mkd {
my ($relpath) = @_;
my $full = File::Spec->catdir( $root, split m{/}, $relpath );
make_path($full) unless -d $full;
}
# Build the tree:
# root/
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Fault/Logger.pm view on Meta::CPAN
# Dale's library of primitives in Perl
#
# 20041130 Dale Amon <amon@vnl.com>
# Almost a full rewrite over the last couple days. Added
# caller callback arg; changed name of logfile method
# to delegate; added more arg checking; split methods into
# public and private parts and more. Also redocumented.
#
# 20041127 Dale Amon <amon@vnl.com>
# Lots of additions. Added callback hooks for state
# transitions and pass throughs for args needed by syslog
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Feature/Compat/Class.pm view on Meta::CPAN
I<Since version 0.07> field initialiser expressions can see earlier fields
that have already been declared, and use their values:
field $fullname :param;
field $shortname :param = ( split m/ +/, $fullname )[0];
The following field attributes are supported:
=head3 :param
view all matches for this distribution
view release on metacpan or search on metacpan
my $m = File::ANVL::anvl_recarray("foo", "dummy");
like $m, qr/an array/, 'recarray message about 2nd arg referencing an array';
#$m = anvl_recsplit("foo", "dummy");
#like $m, qr/array/, 'recsplit message about 2nd arg referencing an array';
my @elems;
#is anvl_recsplit($anvl_record, \@elems, 1), "", 'easy split, strict';
is File::ANVL::anvl_recarray($anvl_record, \@elems), "",
'easy recarray split, all defaults';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/AddInc.pm view on Meta::CPAN
File::Spec->catfile($realPrefix, map {split(m{/}, $_)} @rest);
}
# elsif (/\%s/) {
# File::Spec->catfile(split m{/}, sprintf($_, $libdir));
# }
else {
File::Spec->catfile($libdir, split(m{/}, $_));
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AptFetch.pm view on Meta::CPAN
qq|($self->{method}): (apt-config) died: ($self->{CHLD_error})|;
@{$self->{log}} or return
qq|($self->{method}): (apt-config): failed to output anything|;
my @cache;
while( my $line = shift @{$self->{log}} ) {
my( $name, $value ) = split m{ }, $line, 2;
$name !~ m{^[\w/:.+-]+$} ||
$name =~ m{(?<!:)(?:::)*:(?!:)} ||
!$value || $value !~ m{^"([^"]*)";$} and return
qq|($self->{method}): ($line): that's unparsable|;
($value = $1) eq '' and next;
lib/AptFetch.pm view on Meta::CPAN
elsif( not defined( my $flag =
$self->{me}->sysread( my $buffer, 4096 )) ) {
die qq|[sysread] ($self->{method}) $!| }
elsif( $flag ) {
$buffer = $$leftover . $buffer;
my @prelog = split m{\n}, $buffer, -1;
# WORKAROUND:202301052252:whynot: If C<chop $buffer> is C<\n> then B<split()> spews in one more trailing empty string (that empty string will break fscking everything).
## XXX:202301062317:whynot: Correctness of log entry processing lacks explicit testing. Sorry about that.
# XXX:202301070412:whynot: Here's the deal. If C<chop $buffer> is C<\n> then surprise empty string resets I<$leftover>. If C<chop> isn't then I<$leftover> is refilled. Neat :)
$$leftover = pop @prelog;
push @{$self->{log}}, @prelog;
lib/AptFetch.pm view on Meta::CPAN
File::AptFetch::ConfigData->config( q|tick| ) unless $st->{tick};
$st->{flag} = 5 unless defined $st->{flag};
$st->{tmp} = ( glob qq|$st->{filename}*| )[0] unless defined $st->{tmp};
unless( defined $st->{tmp} ) {
# TODO:201403040310:whynot: Here comes diagnostics.
# warn sprintf qq|(%s) (%i): missing, ticks left\n|, ( split m{/}, $st->{filename} )[-1], $st->{flag} - 1
}
elsif( !-f $st->{tmp} ) {
# TODO:201403040310:whynot: Here could be diagnostics too.
# warn sprintf qq|(%s): disappeared, forcing sync\n|, ( split m{/}, $st->{filename} )[-1];
undef $st->{tmp} }
else {
@$st{qw| size back |} = ( -s $st->{tmp}, $st->{size} || 0 );
$st->{factor} = $st->{size} / ( $st->{tick} * 15 * 1024 * 1024 );
$st->{factor} = 1 if 1 > $st->{factor};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/Assets.pm view on Meta::CPAN
elsif ($condition eq "*" || $condition eq "default") {
$result = $best_kind ? -1 : 1;
}
}
my ($condition_kind, $condition_signature) = split m/:/, $condition, 2;
unless (defined $result) {
# No exact match, try to find the best fit...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/DataClass/IO.pm view on Meta::CPAN
sub slurp {
my $self = shift; my $slurp = $self->all;
wantarray or return $slurp; local $RS = $self->_separator;
$self->_chomp or return split m{ (?<=\Q$RS\E) }mx, $slurp;
return map { CORE::chomp; $_ } split m{ (?<=\Q$RS\E) }mx, $slurp;
}
sub splitdir {
return File::Spec->splitdir( $_[ 0 ]->name );
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/Gettext/Storage.pm view on Meta::CPAN
# Private methods
my $_extn = sub {
my ($self, $path) = @_; $path //= NUL;
my $extn = (split m{ \. }mx, ("${path}" // NUL))[ -1 ];
return $extn ? ".${extn}" : $self->extn;
};
my $_gettext = sub {
lib/File/Gettext/Storage.pm view on Meta::CPAN
my $gettext_data = $gettext->load->{ $gettext->source_name };
for my $key (keys %{ $gettext_data }) {
my ($msgctxt, $msgid) = $gettext->storage->decompose_key( $key );
my ($element, $attr_name) = split m{ [\.] }msx, $msgctxt, 2;
($element and $attr_name and $msgid) or next;
$data->{ $element }->{ $msgid }->{ $attr_name }
= $gettext_data->{ $key }->{msgstr}->[ 0 ];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/Glob/Windows.pm view on Meta::CPAN
# split path and convert wildcard to regex
my @node;
my $re1 = Encode::encode($enc,'.*?');
my $re2 = Encode::encode($enc,'.');
if($nocase and not %alpha){ $alpha{$_}=1 for 'A'..'Z','a'..'z';}
for my $t (split m![\\/]+!,$path){
next if $t eq '';
if( not $t =~ /[*?]/ ){ push @node,Encode::encode($enc,$t); next; }
my $r='';
if($nocase){
for(split /([*?A-Za-z])/,$t){
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/Ignore.pm view on Meta::CPAN
local $_ = shift;
my $original = $_;
my $tags = "";
$tags = $1 if s/:(.*)$//;
my $specification = $_;
my @tags = split m/\s*,\s*/, $tags;
my %tag = map { $_ => 1 } @tags;
my $scope = "basename";
$scope = "path" if m/^\//;
my $prune = 0;
$prune = 1 if s/\/$//;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/MimeInfo.pm view on Meta::CPAN
binmode MAP, ':utf8' unless $] < 5.008;
while (my $line = <MAP>) {
next unless $line =~ m/\S/; # skip empty lines
next if $line =~ m/^\s*#/; # skip comment lines
chomp $line;
my ($k, $v) = split m/\s+/, $line, 2;
if ($list) {
$map{$k} = [] unless $map{$k};
push @{$map{$k}}, $v;
}
else { $map{$k} = $v }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/PathInfo.pm view on Meta::CPAN
# NON OO
sub abs_path_n {
my $absPath = shift;
return $absPath if $absPath =~ m{^/$};
my @elems = split m{/}, $absPath;
my $ptr = 1;
while($ptr <= $#elems)
{
if($elems[$ptr] eq q{})
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/File/Pid.pm view on Meta::CPAN
$pidfile->remove;
=cut
use vars qw[$VERSION];
$VERSION = sprintf "%d.%02d", split m/\./, (qw$Revision: 1.1 $)[1];
use File::Spec::Functions qw[tmpdir catfile];
use File::Basename qw[basename];
use base qw[Class::Accessor::Fast];
view all matches for this distribution