view release on metacpan or search on metacpan
# pack "s>" was introduced in perl-5.10, so I had to rewrite this to an
# sprintf approach to support bases systems with 5.6.x and 5.8.x
# -- H.Merijn Brand (m)'25 16-05-2025
my @inc_version_list;
my @candidates;
# XXX Redo to do opendir/readdir?
if (-d $stem) {
chdir($stem);
;@candidates = map {
[ $_, sprintf "%04d%04d%04d", (split m/[._]/, "$_.0.0")[0,1,2] ] } glob("5.*");
;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
}
else {
;@candidates = ();
}
my ($pversion, $aversion, $vsn5005) = map {
sprintf "%04d%04d%04d", (split m/[._]/, "$_.0.0")[0,1,2] } $version, $api_versionstring, "5.005";
foreach my $d (@candidates) {
if ($d->[1] lt $pversion) {
if ($d->[1] ge $aversion) {
unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
}
elsif ($d->[1] ge $vsn5005) {
unshift(@inc_version_list, grep { -d } $d->[0]);
}
}
else {
Porting/add-package.pl view on Meta::CPAN
}
: 1
} `find $BinDir -type f`
or die "Could not detect binfiles\n";
print "done\n" if $Verbose;
}
### copy over change log
my @Changes;
foreach my $cl (split m/\s+/ => $Changes) {
-f $cl or next;
push @Changes, $cl;
print "Copying $cl files to $TopDir..." if $Verbose;
system( "cp -f $CPV $cl $TopDir" )
and die "Copy of $cl failed: $?";
}
### add files where they are required
Porting/corelist.pl view on Meta::CPAN
$str =~ s/'/\\'/g;
"'${str}'";
}
sub parse_utils_lst {
require File::Spec::Unix;
my @scripts;
open my $fh, '<', 'utils.lst' or die "$!\n";
while (<$fh>) {
chomp;
my ($file,$extra) = split m!#!;
$file =~ s!\s+!!g;
push @scripts, $file;
$extra =~ s!\s+!!g if $extra;
if ( $extra and my ($link) = $extra =~ m!^link=(.+?)$! ) {
push @scripts, $link;
}
}
return map { +( File::Spec::Unix->splitpath( $_ ) )[-1] } @scripts;
}
cpan/Archive-Tar/bin/ptar view on Meta::CPAN
last if $ARGV[$i] eq '--';
splice @ARGV, $i--, 1 if $ARGV[$i] eq '--format=ustar';
splice @ARGV, $i--, 2 if $i < $#ARGV
&& $ARGV[$i] eq '--format' && $ARGV[$i + 1] eq 'ustar';
}
# Allow historic support for dashless bundled options
# tar cvf file.tar
# is valid (GNU) tar style
@ARGV && $ARGV[0] =~ m/^[DdcvzthxIC]+[fT]?$/ and
unshift @ARGV, map { "-$_" } split m// => shift @ARGV;
my $opts = {};
getopts('Ddcvzthxf:ICT:', $opts) or die usage();
### show the help message ###
die usage() if $opts->{h};
### enable debugging (undocumented feature)
local $Archive::Tar::DEBUG = 1 if $opts->{d};
### enable insecure extracting.
cpan/AutoLoader/t/02AutoSplit.t view on Meta::CPAN
open FILE, ">$file" or die "Can't open $file: $!";
print FILE $contents;
close FILE or die "Can't close $file: $!";
}
# Assumption: no characters in arguments need escaping from the shell or perl
my $com = qq($runperl -e "use AutoSplit; autosplit (qw(@_))");
print "# command: $com\n";
# There may be a way to capture STDOUT without spawning a child process, but
# it's probably worthwhile spawning, as it ensures that nothing in AutoSplit
# can load functions from split modules into this perl.
my $output = `$com`;
warn "Exit status $? from running: >>$com<<" if $?;
return $output;
}
my $i = 0;
my $dir = File::Spec->catdir($incdir, 'auto');
if ($Is_VMS_mode) {
$dir = VMS::Filespec::unixify($dir);
$dir =~ s/\/$//;
cpan/Config-Perl-V/V.pm view on Meta::CPAN
$v =~ m{^'(.*)'$} and $v = $1;
$v =~ s{\s+$} {};
$config{$k} = $v;
}
my $build = { %empty_build };
$pv =~ m{^\s+Compiled at\s+(.*)}m
and $build->{'stamp'} = $1;
$pv =~ m{^\s+Locally applied patches:(?:\s+|\n)(.*?)(?:[\s\n]+Buil[td] under)}ms
and $build->{'patches'} = [ split m{\n+\s*}, $1 ];
$pv =~ m{^\s+Compile-time options:(?:\s+|\n)(.*?)(?:[\s\n]+(?:Locally applied|Buil[td] under))}ms
and map { $build->{'options'}{$_} = 1 } split m{\s+|\n} => $1;
$build->{'osname'} = $config{'osname'};
$pv =~ m{^\s+Built under\s+(.*)}m
and $build->{'osname'} = $1;
$config{'osname'} ||= $build->{'osname'};
return _make_derived ({
'build' => $build,
'environment' => {},
'config' => \%config,
cpan/ExtUtils-Install/t/lib/MakeMaker/Test/Setup/BFD.pm view on Meta::CPAN
my @chrs = ( "A" .. "Z", 0 .. 9 );
# annoyingly we cant use File::Temp here as it drags in XS code
# and we run under blocks to prevent XS code loads. This is a minimal
# patch to fix the issue.
$tmpdir = join "", "./temp-$$-", map { $chrs[rand(@chrs)] } 1..8;
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: $!";
print FILE $text;
close FILE;
# ensure file at least 1 second old for makes that assume
# files with the same time are out of date.
cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win32.pm view on Meta::CPAN
Returns a suitable string describing the type of makefile being written.
=cut
sub make_type {
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;
__END__
=back
cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Setup/BFD.pm view on Meta::CPAN
my @chrs = ( "A" .. "Z", 0 .. 9 );
# annoyingly we cant use File::Temp here as it drags in XS code
# and we run under blocks to prevent XS code loads. This is a minimal
# patch to fix the issue.
$tmpdir = join "", "./temp-$$-", map { $chrs[rand(@chrs)] } 1..8;
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: $!";
print FILE $text;
close FILE;
# ensure file at least 1 second old for makes that assume
# files with the same time are out of date.
cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm view on Meta::CPAN
any necessary directories.
Will die if errors occur.
=cut
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;
write_file($file, $text);
# ensure file at least 1 second old for makes that assume
# files with the same time are out of date.
my $time = calibrate_mtime();
utime $time, $time - 1, $file;
}
}
cpan/Pod-Perldoc/lib/Pod/Perldoc.pm view on Meta::CPAN
$self->warn( qq("$value" isn't a good formatter option name. I'm ignoring it!\n ) );
}
return;
}
sub opt_M_with { # specify formatter class name(s)
my($self, $classes) = @_;
return unless defined $classes and length $classes;
DEBUG > 4 and print "Considering new formatter classes -M$classes\n";
my @classes_to_add;
foreach my $classname (split m/[,;]+/s, $classes) {
next unless $classname =~ m/\S/;
if( $classname =~ m/^(\w+(::\w+)+)$/s ) {
# A mildly restrictive concept of what modulenames are valid.
push @classes_to_add, $1; # untaint
} else {
$self->warn( qq("$classname" isn't a valid classname. Ignoring.\n) );
}
}
unshift @{ $self->{'formatter_classes'} }, @classes_to_add;
cpan/Pod-Simple/lib/Pod/Simple/HTML.pm view on Meta::CPAN
$url =~ s{::$}{}s; # probably never comes up anyway
$url =~ s{::}{/}g unless $self->perldoc_url_prefix =~ m/\?/s; # sane DWIM?
return undef unless length $url;
return $self->perldoc_url_prefix . $url . $self->perldoc_url_postfix;
}
sub resolve_pod_page_link_batch_mode {
my($self, $to) = @_;
DEBUG > 1 and print STDERR " During batch mode, resolving $to ...\n";
my @path = grep length($_), split m/::/s, $to, -1;
unless( @path ) { # sanity
DEBUG and print STDERR "Very odd! Splitting $to gives (nil)!\n";
return undef;
}
$self->batch_mode_rectify_path(\@path);
my $out = join('/', map $self->pagepath_url_escape($_), @path)
. $HTML_EXTENSION;
DEBUG > 1 and print STDERR " => $out\n";
return $out;
}
cpan/Pod-Simple/lib/Pod/Simple/Search.pm view on Meta::CPAN
# simplify path
$try = File::Spec->canonpath($try);
my $start_in;
my $modname_prefix;
if($self->{'dir_prefix'}) {
$start_in = File::Spec->catdir(
$try,
grep length($_), split '[\\/:]+', $self->{'dir_prefix'}
);
$modname_prefix = [grep length($_), split m{[:/\\]}, $self->{'dir_prefix'}];
$verbose and print "Appending \"$self->{'dir_prefix'}\" to $try, ",
"giving $start_in (= @$modname_prefix)\n";
} else {
$start_in = $try;
}
if( $self->{'_dirs_visited'}{$start_in} ) {
$verbose and print "Directory '$start_in' already seen, skipping.\n";
next;
} else {
cpan/Pod-Simple/t/encod02.t view on Meta::CPAN
use Test::More tests => 2;
#use Pod::Simple::Debug (5);
use Pod::Simple::DumpAsXML;
use Pod::Simple::XMLOutStream;
print "# Pod::Simple version $Pod::Simple::VERSION\n";
{
my @output_lines = split m/[\cm\cj]+/, Pod::Simple::XMLOutStream->_out( q{
=encoding koi8-r
=head1 NAME
ëÏÇÄÁ ÞÉÔÁÌÁ ÔÙ ÍÕÞÉÔÅÌØÎÙÅ ÓÔÒÏËÉ -- Fet's "When you were reading"
=cut
} );
cpan/Pod-Simple/t/encod02.t view on Meta::CPAN
ok 1;
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
print "# Now a control group, to make sure that =fishbladder DOES\n",
"# cause an 'unknown directive' error...\n";
{
my @output_lines = split m/[\cm\cj]+/, Pod::Simple::XMLOutStream->_out( q{
=fishbladder
=head1 NAME
Fet's "When you were reading"
=cut
} );
cpan/Pod-Simple/t/encod03.t view on Meta::CPAN
use Test::More tests => 2;
#use Pod::Simple::Debug (5);
use Pod::Simple::DumpAsXML;
use Pod::Simple::XMLOutStream;
print "# Pod::Simple version $Pod::Simple::VERSION\n";
{
my @output_lines = split m/[\cm\cj]+/, Pod::Simple::XMLOutStream->_out( q{
=encoding koi8-r
=head1 NAME
Bippitty Boppity Boo -- Yormp
=cut
} );
cpan/Pod-Simple/t/encod03.t view on Meta::CPAN
ok 1;
}
}
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
print "# Now a control group, to make sure that =fishbladder DOES\n",
"# cause an 'unknown directive' error...\n";
{
my @output_lines = split m/[\cm\cj]+/, Pod::Simple::XMLOutStream->_out( q{
=fishbladder
=head1 NAME
Fet's "When you were reading"
=cut
} );
cpan/Pod-Simple/t/encod04.t view on Meta::CPAN
$x97 = chr utf8::unicode_to_native(0x97);
$x91 = chr utf8::unicode_to_native(0x91);
$dash = '—';
}
else { # Tests will fail for early EBCDICs
$x97 = chr 0x97;
$x91 = chr 0x91;
$dash = '--';
}
my @output_lines = split m/[\r\n]+/, Pod::Simple::XMLOutStream->_out( qq{
=head1 NAME
Em::Dash $x97 ${x91}CAF\xC9\x92
=cut
} );
my($guess) = "@output_lines" =~ m{Non-ASCII.*?Assuming ([\w-]+)};
cpan/Pod-Simple/t/encod04.t view on Meta::CPAN
} else {
fail "parser guessed wrong encoding expected 'CP1252' got '$guess'";
}
} else {
fail "parser failed to detect non-ASCII bytes in input";
}
# Initial smart-quote character triggers CP1252 guess as expected
@output_lines = split m/[\r\n]+/, Pod::Simple::XMLOutStream->_out( qq{
=head1 NAME
Smart::Quote - ${x91}FUT\xC9\x92
=cut
} );
if (ord("A") != 65) { # ASCII-platform dependent test skipped on this platform
cpan/Pod-Simple/t/encod04.t view on Meta::CPAN
fail "parser failed to detect non-ASCII bytes in input";
}
}
# Initial accented character (E acute) followed by 'smart' apostrophe is legal
# CP1252, which should be preferred over UTF-8 because the latter
# interpretation would be "JOS" . \N{LATIN SMALL LETTER TURNED ALPHA} . "S
# PLACE", and that \N{} letter is an IPA one.
@output_lines = split m/[\r\n]+/, Pod::Simple::XMLOutStream->_out( qq{
=head1 NAME
=head2 JOS\xC9\x92S PLACE
=cut
} );
if (ord("A") != 65) { # ASCII-platform dependent test skipped on this platform
cpan/Pod-Simple/t/encod04.t view on Meta::CPAN
} else {
fail "parser failed to detect non-ASCII bytes in input";
}
}
# The previous example used a CP1252 byte sequence that also happened to be a
# valid UTF8 byte sequence. In this example we use an illegal UTF-8 sequence
# (it needs a third byte), so must be 1252
@output_lines = split m/[\r\n]+/, Pod::Simple::XMLOutStream->_out( qq{
=head1 NAME
Smart::Apostrophe::Fail - L\xE9\x92Strange
=cut
} );
if (ord("A") != 65) { # ASCII-platform dependent test skipped on this platform
cpan/Pod-Simple/t/encod04.t view on Meta::CPAN
}
} else {
fail "parser failed to detect non-ASCII bytes in input";
}
}
# The following is a real word example of something in CP1252 expressible in
# UTF-8, but doesn't make sense in UTF-8, contributed by Bo Lindbergh.
# Muvrarášša is a Sami word
@output_lines = split m/[\r\n]+/, Pod::Simple::XMLOutStream->_out( qq{
=head1 NAME
Muvrar\xE1\x9A\x9Aa is a mountain in Norway
=cut
} );
if (ord("A") != 65) { # ASCII-platform dependent test skipped on this platform
cpan/Socket/Socket.pm view on Meta::CPAN
elsif( $flag_numerichost ) {
$node = Socket::inet_ntoa( $inetaddr );
}
else {
$node = gethostbyaddr( $inetaddr, $family );
if( !defined $node ) {
return fake_makeerr( EAI_NONAME() ) if $flag_namereqd;
$node = Socket::inet_ntoa( $inetaddr );
}
elsif( $flag_nofqdn ) {
my ( $shortname ) = split m/\./, $node;
my ( $fqdn ) = gethostbyname $shortname;
$node = $shortname if defined $fqdn and $fqdn eq $node;
}
}
my $service;
if( $xflags & NIx_NOSERV ) {
$service = undef;
}
elsif( $flag_numericserv ) {
cpan/Socket/t/getaddrinfo.t view on Meta::CPAN
skip "Resolver has an answer for $missinghost", 1 if gethostbyname( $missinghost );
# Some OSes return $err == 0 but no results
( $err, @res ) = getaddrinfo( $missinghost, "ftp", { socktype => SOCK_STREAM } );
ok( $err != 0 || ( $err == 0 && @res == 0 ),
'$err != 0 or @res == 0 for host=TbK4jM2M0OS.lm57DWIyu4i/service=ftp/socktype=SOCK_STREAM' );
if( @res ) {
# Diagnostic that might help
while( my $r = shift @res ) {
diag( "family=$r->{family} socktype=$r->{socktype} protocol=$r->{protocol} addr=[" . length( $r->{addr} ) . " bytes]" );
diag( " addr=" . join( ", ", map { sprintf '0x%02x', ord $_ } split m//, $r->{addr} ) );
}
}
}
# Numeric addresses with AI_NUMERICHOST should pass (RT95758)
AI_NUMERICHOST: {
# Here we need a port that is open to the world. Not all places have all
# the ports. For example Solaris by default doesn't have http/80 in
# /etc/services, and that would fail. Let's try a couple of commonly open
# ports, and hope one of them will succeed. Conversely this means that
cpan/podlators/lib/Pod/Man.pm view on Meta::CPAN
$$self{ITEMS} = 0;
$self->output ($$self{INDENT} > 0 ? ".Sp\n" : ".PP\n")
if $$self{NEEDSPACE};
}
# Output any pending index entries, and optionally an index entry given as an
# argument. Support multiple index entries in X<> separated by slashes, and
# strip special escapes from index entries.
sub outindex {
my ($self, $section, $index) = @_;
my @entries = map { split m%\s*/\s*% } @{ $$self{INDEX} };
return unless ($section || @entries);
# We're about to output all pending entries, so clear our pending queue.
$$self{INDEX} = [];
# Build the output. Regular index entries are marked Xref, and headings
# pass in their own section. Undo some *roff formatting on headings.
my @output;
if (@entries) {
push @output, [ 'Xref', join (' ', @entries) ];
dist/I18N-LangTags/lib/I18N/LangTags/Detect.pm view on Meta::CPAN
foreach my $envname (qw( LANGUAGE LC_ALL LC_MESSAGES LANG )) {
next unless $ENV{$envname};
DEBUG and print "Noting \$$envname: $ENV{$envname}\n";
push @languages,
map locale2language_tag($_),
# if it's a lg tag, fine, pass thru (untainted)
# if it's a locale ID, try converting to a lg tag (untainted),
# otherwise nix it.
split m/[,:]/,
$ENV{$envname}
;
last; # first one wins
}
if($ENV{'IGNORE_WIN32_LOCALE'}) {
# no-op
} elsif(&_try_use('Win32::Locale')) {
# If we have that module installed...
push @languages, Win32::Locale::get_language() || ''
dist/PathTools/lib/File/Spec/OS2.pm view on Meta::CPAN
$directory = $2;
$file = $3;
}
return ($volume,$directory,$file);
}
sub splitdir {
my ($self,$directories) = @_ ;
split m|[\\/]|, $directories, -1;
}
sub catpath {
my ($self,$volume,$directory,$file) = @_;
# If it's UNC, make sure the glue separator is there, reusing
# whatever separator is first in the $volume
$volume .= $1
if ( $volume =~ m@^([\\/])[\\/][^\\/]+[\\/][^\\/]+\Z(?!\n)@s &&
dist/PathTools/lib/File/Spec/Unix.pm view on Meta::CPAN
File::Spec->splitdir( "/a/b//c/" );
Yields:
( '', 'a', 'b', '', 'c', '' )
=cut
sub splitdir {
return split m|/|, $_[1], -1; # Preserve trailing fields
}
=item catpath()
Takes volume, directory and file portions and returns an entire path. Under
Unix, $volume is ignored, and directory and file are concatenated. A '/' is
inserted if needed (though if the directory portion doesn't start with
'/' it is not added). On other OSs, $volume is significant.
dist/PathTools/t/cwd.t view on Meta::CPAN
# XXX and subsequent chdir()s can make them impossible to find
eval { fastcwd };
# Must find an external pwd (or equivalent) command.
my $pwd = $^O eq 'MSWin32' ? "cmd" : "pwd";
my $pwd_cmd =
($^O eq "NetWare") ?
"cd" :
(grep { -x && -f } map { "$_/$pwd$Config{exe_ext}" }
split m/$Config{path_sep}/, $ENV{PATH})[0];
$pwd_cmd = 'SHOW DEFAULT' if $IsVMS;
if ($^O eq 'MSWin32') {
$pwd_cmd =~ s,/,\\,g;
$pwd_cmd = "$pwd_cmd /c cd";
}
$pwd_cmd =~ s=\\=/=g if ($^O eq 'dos');
SKIP: {
skip "No native pwd command found to test against", 4 unless $pwd_cmd;
ext/Devel-Peek/t/Peek.t view on Meta::CPAN
$pattern =~ s/^\h+COW_REFCNT = .*\n//mg
if $Config{ccflags} =~
/-DPERL_(?:OLD_COPY_ON_WRITE|NO_COW)\b/
|| $] < 5.019003;
if ($Config::Config{ccflags} =~ /-DNODEFAULT_SHAREKEYS\b/) {
$pattern =~ s/,SHAREKEYS\b//g;
$pattern =~ s/\bSHAREKEYS,//g;
$pattern =~ s/\bSHAREKEYS\b//g;
}
print $pattern, "\n" if $DEBUG;
my ($dump, $dump2) = split m/\*\*\*\*\*\n/, scalar <IN>;
print $dump, "\n" if $DEBUG;
like( $dump, qr/\A$pattern\Z/ms, $_[0])
or note("line " . (caller)[2]);
local $TODO = $repeat_todo;
is($dump2, $dump, "$_[0] (unchanged by dump)")
or note("line " . (caller)[2]);
close(IN);
lib/Net/servent.pm view on Meta::CPAN
pass the C<use> an empty import list, and then access
function functions with their full qualified names.
On the other hand, the built-ins are still available
via the C<CORE::> pseudo-package.
=head1 EXAMPLES
use Net::servent qw(:FIELDS);
while (@ARGV) {
my ($service, $proto) = ((split m!/!, shift), 'tcp');
my $valet = getserv($service, $proto);
unless ($valet) {
warn "$0: No service: $service/$proto\n"
next;
}
printf "service $service/$proto is port %d\n", $valet->port;
print "alias are @s_aliases\n" if @s_aliases;
}
=head1 NOTE
lib/Unicode/UCD.pm view on Meta::CPAN
$prefix = "$property=";
# If the rhs looks like it is a number...
print STDERR __LINE__, ": table=$table\n" if DEBUG;
if ($table =~ $number) {
print STDERR __LINE__, ": table=$table\n" if DEBUG;
# Split on slash, in case it is a rational, like \p{1/5}
my @parts = split m{ \s* / \s* }x, $table, -1;
print __LINE__, ": $type\n" if @parts > 2 && DEBUG;
foreach my $part (@parts) {
print __LINE__, ": part=$part\n" if DEBUG;
$part =~ s/^\+\s*//; # Remove leading plus
$part =~ s/^-\s*/-/; # Remove blanks after unary
# minus
# Remove underscores between digits.
lib/unicore/mktables view on Meta::CPAN
# Handle a single input line from UnicodeData.txt; see comments above
# Conceptually this takes a single line from the file containing N
# properties, and converts it into N lines with one property per line,
# which is what the final handler expects. But there are
# complications due to the quirkiness of the input file, and to save
# time, it accumulates ranges where the property values don't change
# and only emits lines when necessary. This is about an order of
# magnitude fewer lines emitted.
# $_ contains the input line.
# -1 in split means retain trailing null fields
(my $cp, @fields) = split /\s*;\s*/, $_, -1;
#local $to_trace = 1 if main::DEBUG;
trace $cp, @fields , $input_field_count if main::DEBUG && $to_trace;
if (@fields > $input_field_count) {
$file->carp_bad_line('Extra fields');
$_ = "";
return;
}
lib/unicore/mktables view on Meta::CPAN
# Given $property that divides the possible code points into equivalence
# classes, this changes it to also encapsulate the criteria given by
# $splits. It does this by creating more equivalence classes based on
# intersecting $property with $splits. It returns a hash showing the new
# classes, as well as showing how the original components have been split.
#
# This function should be called just once on $property, so that the
# returned hash can be properly built up. $splits is therefore an array
# reference in case $property needs to be divided multiple times,
# Each element of $splits is independent, so that a split can be further
# split in the next iteration, but each element of $split must be
# consistent with itself, with ranges that are disjoint.
#
# Each element of $split is a a hash with two keys
# name => is the name to be applied to the split
# ranges => is a RangeList of the ranges it has, or something that a
# RangeList can be automatically extracted from using the
# overloaded operators.
#
# An example should clarify. Unicode publishes the Line Break (LB)
# property, where each possible code point is given a type, like
STATIC void
S_usage(pTHX) /* XXX move this out into a module ? */
{
/* This message really ought to be max 23 lines.
* Removed -h because the user already knows that option. Others? */
/* Grouped as 6 lines per C string literal, to keep under the ANSI C 89
minimum of 509 character string literals. */
static const char * const usage_msg[] = {
" -0[octal/hexadecimal] specify record separator (\\0, if no argument)\n"
" -a autosplit mode with -n or -p (splits $_ into @F)\n"
" -C[number/list] enables the listed Unicode features\n"
" -c check syntax only (runs BEGIN and CHECK blocks)\n"
" -d[t][:MOD] run program under debugger or module Devel::MOD\n"
" -D[number/letters] set debugging flags (argument is a bit mask or alphabets)\n",
" -e commandline one line of program (several -e's allowed, omit programfile)\n"
" -E commandline like -e, but enables all optional features\n"
" -f don't do $sitelib/sitecustomize.pl at startup\n"
" -F/pattern/ split() pattern for -a switch (//'s are optional)\n"
" -g read all input in one go (slurp), rather than line-by-line (alias for -0777)\n"
" -i[extension] edit <> files in place (makes backup if extension supplied)\n"
pod/perl5140delta.pod view on Meta::CPAN
F<README> distributed with Perl (5.12.1).
=head3 Perl 5.12.x delta files
The perldelta files for Perl 5.12.1 to 5.12.3 have been added from the
maintenance branch: L<perl5121delta>, L<perl5122delta>, L<perl5123delta>.
=head3 L<perlpodstyle>
New style guide for POD documentation,
split mostly from the NOTES section of the L<pod2man(1)> manpage.
=head3 L<perlsource>, L<perlinterp>, L<perlhacktut>, and L<perlhacktips>
See L</perlhack and perlrepository revamp>, below.
=head2 Changes to Existing Documentation
=head3 L<perlmodlib> is now complete
The L<perlmodlib> manpage that came with Perl 5.12.0 was missing several
pod/perlrequick.pod view on Meta::CPAN
$x = "1.618,2.718, 3.142";
@const = split /,\s*/, $x; # $const[0] = '1.618'
# $const[1] = '2.718'
# $const[2] = '3.142'
If the empty regex C<//> is used, the string is split into individual
characters. If the regex has groupings, then the list produced contains
the matched substrings from the groupings as well:
$x = "/usr/bin";
@parts = split m!(/)!, $x; # $parts[0] = ''
# $parts[1] = '/'
# $parts[2] = 'usr'
# $parts[3] = '/'
# $parts[4] = 'bin'
Since the first character of $x matched the regex, C<split> prepended
an empty initial element to the list.
=head2 C<use re 'strict'>