Result:
found more than 877 distributions - search limited to the first 2001 files matching your query ( run in 1.019 )


Compare-Directory

 view release on metacpan or  search on metacpan

lib/Compare/Directory.pm  view on Meta::CPAN

    }

    return $self->{_status};
}

sub _cmp_directory($$) {
    my ($file1, $file2) = @_;

    croak("ERROR: Invalid file [$file1].\n") unless(defined($file1) && (-f $file1));
    croak("ERROR: Invalid file [$file2].\n") unless(defined($file2) && (-f $file2));

lib/Compare/Directory.pm  view on Meta::CPAN

    }

    return $do_FILEs_match;
}

sub _cmp_pdf($$) {
    my ($got, $exp) = @_;

    unless (blessed($got) && $got->isa('CAM::PDF')) {
        $got = CAM::PDF->new($got)
            || croak("ERROR: Couldn't create CAM::PDF instance with: [$got]\n");

 view all matches for this distribution


Compiler-Parser

 view release on metacpan or  search on metacpan

lib/Compiler/Parser/AST.pm  view on Meta::CPAN

            $parent->{$branch} = $node->next;
        }
    }
}

sub walk(&$) {
    my ($ast, $callback);
    if (ref $_[0] eq 'Compiler::Parser::AST') {
        ($ast, $callback) = @_;
    } elsif (ref $_[1] eq 'Compiler::Parser::AST') {
        ($callback, $ast) = @_;

 view all matches for this distribution


Complete-Util

 view release on metacpan or  search on metacpan

lib/Complete/Util.pm  view on Meta::CPAN

    my $ans = shift;
    return unless defined $ans;
    return ref($ans) eq 'HASH' ? (@{$ans->{words} // []} ? 1:0) : (@$ans ? 1:0);
}

sub __min(@) { ## no critic: Subroutines::ProhibitSubroutinePrototypes
    my $m = $_[0];
    for (@_) {
        $m = $_ if $_ < $m;
    }
    $m;

 view all matches for this distribution


Compress-Raw-Bzip2

 view release on metacpan or  search on metacpan

t/Test/More.pm  view on Meta::CPAN


    cmp_ok( $big_hairy_number, '==', $another_big_hairy_number );

=cut

sub cmp_ok($$$;$) {
    $Test->cmp_ok(@_);
}


=item B<can_ok>

 view all matches for this distribution


Compress-Raw-Lzma

 view release on metacpan or  search on metacpan

t/Test/More.pm  view on Meta::CPAN


    cmp_ok( $big_hairy_number, '==', $another_big_hairy_number );

=cut

sub cmp_ok($$$;$) {
    $Test->cmp_ok(@_);
}


=item B<can_ok>

 view all matches for this distribution


Compress-Raw-Zlib

 view release on metacpan or  search on metacpan

t/Test/More.pm  view on Meta::CPAN


    cmp_ok( $big_hairy_number, '==', $another_big_hairy_number );

=cut

sub cmp_ok($$$;$) {
    $Test->cmp_ok(@_);
}


=item B<can_ok>

 view all matches for this distribution


Compress-SelfExtracting

 view release on metacpan or  search on metacpan

SelfExtracting.pm  view on Meta::CPAN

sub import { }

##############################
# BWT block-sorting

sub BLKSIZE() { 16*1024 }	# unused, so this sucks for big files.
sub QSORT_SIZE() { 5 }		# when to use qsort instead of counting sort.
sub _counting_sort
{
    my ($p, $o) = @_;
    if ($::DEBUG) {
	++$calls;

 view all matches for this distribution


Compress-Stream-Zstd

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

    my $version = int_parse_version(shift);
    $version =~ s/^5\B/5./;
    return $version;
}

sub dictionary_order($$)    # Sort caselessly, ignoring punct
{
    my ($lc_a, $lc_b);
    my ($squeezed_a, $squeezed_b);
    my ($valid_a, $valid_b);    # Meaning valid for all releases

 view all matches for this distribution


Compress-Zstd

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

    my $version = int_parse_version(shift);
    $version =~ s/^5\B/5./;
    return $version;
}

sub dictionary_order($$)    # Sort caselessly, ignoring punct
{
    my ($lc_a, $lc_b);
    my ($squeezed_a, $squeezed_b);
    my ($valid_a, $valid_b);    # Meaning valid for all releases

 view all matches for this distribution


Compression-Util

 view release on metacpan or  search on metacpan

examples/bzip2_compressor.pl  view on Meta::CPAN

local $| = 1;

binmode(STDIN,  ":raw");
binmode(STDOUT, ":raw");

sub encode_mtf_alphabet($alphabet) {
    my %table;
    @table{@$alphabet} = ();

    my $populated = 0;
    my @marked;

examples/bzip2_compressor.pl  view on Meta::CPAN

    say STDERR "Marked: (@marked)";

    return ($populated, \@marked);
}

sub encode_code_lengths($dict) {
    my @lengths;

    foreach my $symbol (0 .. max(keys %$dict) // 0) {
        if (exists($dict->{$symbol})) {
            push @lengths, length($dict->{$symbol});

 view all matches for this distribution


Config-Checker

 view release on metacpan or  search on metacpan

lib/Config/YAMLMacros.pm  view on Meta::CPAN

our @EXPORT = qw(get_config);
our @EXPORT_OK = (@EXPORT, qw(listify replace));

my $max_replace_iterations = 10;

sub listify(\%@)
{
	my ($href, @keys) = @_;
	for my $k (@keys) {
		next unless exists $href->{$k};
		if (! ref($href->{$k})) {

lib/Config/YAMLMacros.pm  view on Meta::CPAN

			confess;
		}
	}
}

sub replace(\%\$)
{
	my ($href, $sref) = @_;
	my $jlist = join('|', map { "\Q$_\E" } keys %$href);
	return unless $jlist;
	my $re = qr/$jlist/;

 view all matches for this distribution


Config-ENV

 view release on metacpan or  search on metacpan

inc/Test/More.pm  view on Meta::CPAN

    return $tb->unlike(@_);
}

#line 476

sub cmp_ok($$$;$) {
    my $tb = Test::More->builder;

    return $tb->cmp_ok(@_);
}

 view all matches for this distribution


Config-File

 view release on metacpan or  search on metacpan

lib/Config/File.pm  view on Meta::CPAN

use vars qw($VERSION @ISA @EXPORT_OK);
@ISA       = qw/Exporter/;
@EXPORT_OK = qw/read_config_file/;
$VERSION   = '1.54';

sub read_config_file($) {
    my ( $conf, $file, $fh, $line_num );
    $file = shift;
    $fh = IO::File->new( $file, 'r' )
      or croak "Can't read configuration in $file: $!\n";

 view all matches for this distribution


Config-FileManager

 view release on metacpan or  search on metacpan

lib/Config/FileManager.pm  view on Meta::CPAN

  my $toolname = $cfg->toolname();
  $cfg->toolname("tool name");

=cut

sub toolname($;$) {
  my $self = shift;
  if (@_) {
    my $toolname = shift;
    $self->{toolname} = $toolname;
    $self->{full_path} = undef;

lib/Config/FileManager.pm  view on Meta::CPAN

  my $filename = $cfg->filename();
  $cfg->filename("file name");

=cut

sub filename($;$) {
  my $self = shift;
  if (@_) {
    my $filename = shift;
    $self->{filename} = basename $filename;
    $self->{full_path} = undef;

lib/Config/FileManager.pm  view on Meta::CPAN

  my @paths = $cfg->paths();
  $cfg->paths(qw(list ./of/paths));

=cut

sub paths($;@) {
  my $self = shift;
  if (@_) {
    my @p = @{$_[0]};
    @{$self->{paths}} = @p;
    $self->{full_path} = undef;

lib/Config/FileManager.pm  view on Meta::CPAN

  my $v = $cfg->interactive();
  $cfg->interactive(0); # or $cfg->interactive(1);

=cut

sub interactive($;$) {
  my $self = shift;
  if (@_) {
    my $val = shift;
    $self->{interactive} = $val;
  }

lib/Config/FileManager.pm  view on Meta::CPAN

  my $vers = $cfg->version();
  $cfg->version("0.1.2");

=cut

sub version($;$) {
  my $self = shift;
  if (@_) {
    my $version = shift;
    $self->{version} = $version;
    @{$self->{allVersions}} = ();

lib/Config/FileManager.pm  view on Meta::CPAN


  $cfg->versions();

=cut

sub versions($) {
  my $self = shift;
  if (!@{$self->{allVersions}}) {
    my $cur_ver = $self->{version};
    my $old_ver;
    do {

lib/Config/FileManager.pm  view on Meta::CPAN

  my $cfg_txt = $cfg->defaultContent();
  $cfg->defaultContent("# the default config content of the current version");

=cut

sub defaultContent($;$) {
  my $self = shift;
  if (@_) {
    my $defaultContent = shift;
    $self->{defaultContent} = $defaultContent;
  }

lib/Config/FileManager.pm  view on Meta::CPAN

  -# blablabla
  ');

=cut

sub addPatch($%) {
  my $self = shift;
  my %params = @_;
  for my $required (qw(from to diffs)) {
    croak "Required parameter '$required' not passed to addPatch method."
      unless exists $params{$required};  

lib/Config/FileManager.pm  view on Meta::CPAN


  $cfg->getPath();

=cut

sub getPath($) {
  my $self = shift;
  return $self->{full_path} if defined($self->{full_path});

  # No config file already defined
  # check all given paths in the given order

lib/Config/FileManager.pm  view on Meta::CPAN


  $cfg->update();

=cut

sub update($) {
  my $self = shift;

  # Check if config file is up-to-date
  open (CFG_FILE, "<".$self->getPath) or croak "Unable to open config file [".$self->getPath."]: $!";
  my @versions = $self->versions;

lib/Config/FileManager.pm  view on Meta::CPAN

  $cfg->getDefaultContent();
  $cfg->getDefaultContent("a given version");

=cut

sub getDefaultContent($;$) {
  my $self = shift;
  my $wanted_version = shift || $self->version;
  my $computed_version = $self->version;
  my $computed_config = $self->defaultContent;
  $computed_config =~ s/^\s+//;

 view all matches for this distribution


Config-Grammar

 view release on metacpan or  search on metacpan

lib/Config/Grammar.pm  view on Meta::CPAN

package Config::Grammar;
use strict;

$Config::Grammar::VERSION = '1.13';

sub new($$)
{
    my $proto   = shift;
    my $grammar = shift;
    my $class   = ref($proto) || $proto;

    my $self = {grammar => $grammar};
    bless($self, $class);
    return $self;
}

sub err($)
{
    my $self = shift;
    return $self->{'err'};
}

sub _make_error($$)
{
    my $self = shift;
    my $text = shift;
    $self->{'err'} = "$self->{file}, line $self->{line}: $text";
}

sub _peek($)
{
    my $a = shift;
    return $a->[$#$a];
}

sub _quotesplit($)
{
    my $line = shift;
    my @items;
    while ($line ne "") {
        if ($line =~ s/^"((?:\\.|[^"])*)"\s*//) {

lib/Config/Grammar.pm  view on Meta::CPAN

        }
    }
    return @items;
}

sub _check_mandatory($$$$)
{
    my $self    = shift;
    my $g       = shift;
    my $c       = shift;
    my $section = shift;

lib/Config/Grammar.pm  view on Meta::CPAN

}

######### SECTIONS #########

# search grammar definition of a section
sub _search_section($$)
{
    my $self = shift;
    my $name = shift;

    if (not defined $self->{grammar}{_sections}) {

lib/Config/Grammar.pm  view on Meta::CPAN

        }
    }

}

sub _next_level($$$)
{
    my $self = shift;
    my $name = shift;

    # section name

lib/Config/Grammar.pm  view on Meta::CPAN

    $self->{level}++;

    return 1;
}

sub _prev_level($)
{
    my $self = shift;

    # fill in the values from _default keywords when going up
    $self->_fill_defaults;

lib/Config/Grammar.pm  view on Meta::CPAN


    # decrease level
    $self->{level}--;
}

sub _goto_level($$$)
{
    my $self  = shift;
    my $level = shift;
    my $name  = shift;

lib/Config/Grammar.pm  view on Meta::CPAN

}

######### VARIABLES #########

# search grammar definition of a variable
sub _search_variable($$)
{
    my $self = shift;
    my $name = shift;

    if (not defined $self->{grammar}{_vars}) {

lib/Config/Grammar.pm  view on Meta::CPAN

    # no match
    $self->_make_error("unknown variable '$name'");
    return undef;
}

sub _set_variable($$$)
{
    my $self  = shift;
    my $key   = shift;
    my $value = shift;
    

lib/Config/Grammar.pm  view on Meta::CPAN

    return 1;
}

######### PARSER #########

sub _parse_table($$)
{
    my $self = shift;
    local $_ = shift;

    my $g = $self->{grammar}{_table};

lib/Config/Grammar.pm  view on Meta::CPAN

    }

    return 1;
}

sub _parse_text($$)
{
    my ($self, $line) = @_;

    $self->{cfg}{_text} .= $line;

    return 1;
}

sub _check_text($$)
{
    my ($self, $name) = @_;

    my $g = $self->{grammar}{_text};
    defined $g or return 1;

lib/Config/Grammar.pm  view on Meta::CPAN

        }
    }
    return 1;
}

sub _parse_file($$);

sub _parse_line($$$)
{
    my $self = shift;
    local $_ = shift;
    my $source = shift;

lib/Config/Grammar.pm  view on Meta::CPAN

    $self->_parse_table($_) or return 0;

    return 1;
}

sub _check_section_sub($$) {
	my $self = shift;
	my $name = shift;
	my $g = $self->{grammar};
        if (defined $g->{_sub}){
                my $error = &{$g->{_sub}}($name);

lib/Config/Grammar.pm  view on Meta::CPAN

                }
        }
	return 1;
}

sub _parse_file($$)
{
    my $self = shift;
    my $file = shift;

    unless ($file) { $self->{'err'} = "no filename given" ;

lib/Config/Grammar.pm  view on Meta::CPAN

    }
    close $fh;
    return 1;
}

sub makepod($) {
    my $pod = eval {
	require Config::Grammar::Document;
	return Config::Grammar::Document::makepod(@_);
    };
    defined $pod or die "ERROR: install Config::Grammar::Document in order to use makepod(): $@\n";

lib/Config/Grammar.pm  view on Meta::CPAN

    };
    defined $pod or die "ERROR: install Config::Grammar::Document in order to use makemintmpl()\n";
    return $pod;
}

sub parse($$$)
{
    my $self = shift;
    my $file = shift;
    my $args = shift;

 view all matches for this distribution


Config-Identity

 view release on metacpan or  search on metacpan

lib/Config/Identity.pm  view on Meta::CPAN

        require File::Which;
        $gpg = File::Which::which( $_ ) and last for qw/ gpg gpg2 /;
        $gpg;
    } ) }
}
sub GPG_ARGUMENTS() { $ENV{CI_GPG_ARGUMENTS} || '' }

# TODO Do not even need to do this, since the file is on disk already...
sub decrypt {
    my $self = shift;
    my $file = shift;

 view all matches for this distribution


Config-KingKong

 view release on metacpan or  search on metacpan

bin/kingkong  view on Meta::CPAN

use File::Basename;
use Config::KingKong::File;

use constant CONFNAME => "kingkong.conf";

sub usage() {
   print "KingKong v".$Config::KingKong::VERSION."\n";
   print "Usage: $0 [-h|--help|-?][-v|--verbose][-p|--print]
       [-i|--includedir <include_dir>] [-i|--includedir <include_dir>]...
       <conffile|dir> [<conffile|dir>...]

 view all matches for this distribution


Config-Maker

 view release on metacpan or  search on metacpan

lib/Config/Maker/Encode.pm  view on Meta::CPAN

use Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(encode decode encmode $utf8);
our @EXPORT_OK = @EXPORT;

sub encode($$;$);
sub decode($$;$);
sub encmode(*$);

our $utf8;

sub _encode_only_system($$;$) {
    my ($enc, $text, $check) = @_;
    unless($enc eq 'system') {
	if($check == 1) {
	    croak "Encoding not available. Can't convert encoding $enc";
	} else {

lib/Config/Maker/Encode.pm  view on Meta::CPAN

	}
    }
    return $text;
}

sub _binmode_only_system(*$) {
    my ($handle, $enc) = @_;
    unless($enc eq 'system') {
	carp "Encoding not available. Can't set encoding to $enc";
    }
}

sub _binmode_encoding(*$) {
    my ($handle, $enc) = @_;
    binmode $handle, ":encoding($enc)";
}

eval {

 view all matches for this distribution


Config-Model-Systemd

 view release on metacpan or  search on metacpan

contrib/parse-man.pl  view on Meta::CPAN


    say "class $config_class element $element:\n\t".join("\n\t", @log) if @log;
    return $obj;
}

sub extract_choices($choices) {
    my @choices = ($choices =~ m!C<([/\w\-+]+)>!g );
    if ($choices =~ m{possibly prefixed with (?:a )?C<([!\w]+)>} ) {
        push @choices, map { "$1$_"} @choices;
    }
    return @choices;

 view all matches for this distribution


Config-PL

 view release on metacpan or  search on metacpan

lib/Config/PL.pm  view on Meta::CPAN

        no strict 'refs';
        *{"$caller\::$func"} = \&$func;
    }
}

sub config_do($) {
    my $config_file = shift;
    my (undef, $file,) = caller;

    my ($config, $errno) = do {
        local @INC = (Cwd::getcwd, File::Basename::dirname($file));

 view all matches for this distribution


Config-PP

 view release on metacpan or  search on metacpan

inc/Test/More.pm  view on Meta::CPAN

    return $tb->unlike(@_);
}

#line 476

sub cmp_ok($$$;$) {
    my $tb = Test::More->builder;

    return $tb->cmp_ok(@_);
}

 view all matches for this distribution


Config-Pit

 view release on metacpan or  search on metacpan

inc/Test/Base.pm  view on Meta::CPAN

    $default_object ||= $default_class->new;
    return $default_object;
}

my $import_called = 0;
sub import() {
    $import_called = 1;
    my $class = (grep /^-base$/i, @_) 
    ? scalar(caller)
    : $_[0];
    if (not defined $default_class) {

inc/Test/Base.pm  view on Meta::CPAN

        $caller =~ s/.*:://;
        croak "Too late to call $caller()"
    }
}

sub find_my_self() {
    my $self = ref($_[0]) eq $default_class
    ? splice(@_, 0, 1)
    : default_object();
    return $self, @_;
}

sub blocks() {
    (my ($self), @_) = find_my_self(@_);

    croak "Invalid arguments passed to 'blocks'"
      if @_ > 1;
    croak sprintf("'%s' is invalid argument to blocks()", shift(@_))

inc/Test/Base.pm  view on Meta::CPAN

    }

    return (@blocks);
}

sub next_block() {
    (my ($self), @_) = find_my_self(@_);
    my $list = $self->_next_list;
    if (@$list == 0) {
        $list = [@{$self->block_list}, undef];
        $self->_next_list($list);

inc/Test/Base.pm  view on Meta::CPAN

        $block->run_filters;
    }
    return $block;
}

sub first_block() {
    (my ($self), @_) = find_my_self(@_);
    $self->_next_list([]);
    $self->next_block;
}

sub filters_delay() {
    (my ($self), @_) = find_my_self(@_);
    $self->_filters_delay(defined $_[0] ? shift : 1);
}

sub no_diag_on_only() {
    (my ($self), @_) = find_my_self(@_);
    $self->_no_diag_on_only(defined $_[0] ? shift : 1);
}

sub delimiters() {
    (my ($self), @_) = find_my_self(@_);
    $self->check_late;
    my ($block_delimiter, $data_delimiter) = @_;
    $block_delimiter ||= $self->block_delim_default;
    $data_delimiter ||= $self->data_delim_default;
    $self->block_delim($block_delimiter);
    $self->data_delim($data_delimiter);
    return $self;
}

sub spec_file() {
    (my ($self), @_) = find_my_self(@_);
    $self->check_late;
    $self->_spec_file(shift);
    return $self;
}

sub spec_string() {
    (my ($self), @_) = find_my_self(@_);
    $self->check_late;
    $self->_spec_string(shift);
    return $self;
}

sub filters() {
    (my ($self), @_) = find_my_self(@_);
    if (ref($_[0]) eq 'HASH') {
        $self->_filters_map(shift);
    }
    else {    

inc/Test/Base.pm  view on Meta::CPAN

        push @$filters, @_;
    }
    return $self;
}

sub filter_arguments() {
    $Test::Base::Filter::arguments;
}

sub have_text_diff {
    eval { require Text::Diff; 1 } &&
        $Text::Diff::VERSION >= 0.35 &&
        $Algorithm::Diff::VERSION >= 1.15;
}

sub is($$;$) {
    (my ($self), @_) = find_my_self(@_);
    my ($actual, $expected, $name) = @_;
    local $Test::Builder::Level = $Test::Builder::Level + 1;
    if ($ENV{TEST_SHOW_NO_DIFFS} or
         not defined $actual or

inc/Test/Base.pm  view on Meta::CPAN

        ok $actual eq $expected,
           $name . "\n" . Text::Diff::diff(\$expected, \$actual);
    }
}

sub run(&;$) {
    (my ($self), @_) = find_my_self(@_);
    my $callback = shift;
    for my $block (@{$self->block_list}) {
        $block->run_filters unless $block->is_filtered;
        &{$callback}($block);

inc/Test/Base.pm  view on Meta::CPAN


sub END {
    run_compare() unless $Have_Plan or $DIED or not $import_called;
}

sub run_compare() {
    (my ($self), @_) = find_my_self(@_);
    $self->_assert_plan;
    my ($x, $y) = $self->_section_names(@_);
    local $Test::Builder::Level = $Test::Builder::Level + 1;
    for my $block (@{$self->block_list}) {

inc/Test/Base.pm  view on Meta::CPAN

            is($block->$x, $block->$y, $block->name ? $block->name : ());
        }
    }
}

sub run_is() {
    (my ($self), @_) = find_my_self(@_);
    $self->_assert_plan;
    my ($x, $y) = $self->_section_names(@_);
    local $Test::Builder::Level = $Test::Builder::Level + 1;
    for my $block (@{$self->block_list}) {

inc/Test/Base.pm  view on Meta::CPAN

           $block->name ? $block->name : ()
          );
    }
}

sub run_is_deeply() {
    (my ($self), @_) = find_my_self(@_);
    $self->_assert_plan;
    my ($x, $y) = $self->_section_names(@_);
    for my $block (@{$self->block_list}) {
        next unless exists($block->{$x}) and exists($block->{$y});

inc/Test/Base.pm  view on Meta::CPAN

           $block->name ? $block->name : ()
          );
    }
}

sub run_like() {
    (my ($self), @_) = find_my_self(@_);
    $self->_assert_plan;
    my ($x, $y) = $self->_section_names(@_);
    for my $block (@{$self->block_list}) {
        next unless exists($block->{$x}) and defined($y);

inc/Test/Base.pm  view on Meta::CPAN

             $block->name ? $block->name : ()
            );
    }
}

sub run_unlike() {
    (my ($self), @_) = find_my_self(@_);
    $self->_assert_plan;
    my ($x, $y) = $self->_section_names(@_);
    for my $block (@{$self->block_list}) {
        next unless exists($block->{$x}) and defined($y);

inc/Test/Base.pm  view on Meta::CPAN

               $block->name ? $block->name : ()
              );
    }
}

sub skip_all_unless_require() {
    (my ($self), @_) = find_my_self(@_);
    my $module = shift;
    eval "require $module; 1"
        or Test::More::plan(
            skip_all => "$module failed to load"
        );
}

sub is_deep() {
    (my ($self), @_) = find_my_self(@_);
    require Test::Deep;
    Test::Deep::cmp_deeply(@_);
}

sub run_is_deep() {
    (my ($self), @_) = find_my_self(@_);
    $self->_assert_plan;
    my ($x, $y) = $self->_section_names(@_);
    for my $block (@{$self->block_list}) {
        next unless exists($block->{$x}) and exists($block->{$y});

inc/Test/Base.pm  view on Meta::CPAN

        };
    }
    return $spec;
}

sub _strict_warnings() {
    require Filter::Util::Call;
    my $done = 0;
    Filter::Util::Call::filter_add(
        sub {
            return 0 if $done;

inc/Test/Base.pm  view on Meta::CPAN

            $done = 1;
        }
    );
}

sub tie_output() {
    my $handle = shift;
    die "No buffer to tie" unless @_;
    tie $handle, 'Test::Base::Handle', $_[0];
}

inc/Test/Base.pm  view on Meta::CPAN

    $ENV{TEST_SHOW_NO_DIFFS} = 1;
}

package Test::Base::Handle;

sub TIEHANDLE() {
    my $class = shift;
    bless \ $_[0], $class;
}

sub PRINT {

inc/Test/Base.pm  view on Meta::CPAN


sub AUTOLOAD {
    return;
}

sub block_accessor() {
    my $accessor = shift;
    no strict 'refs';
    return if defined &$accessor;
    *$accessor = sub {
        my $self = shift;

 view all matches for this distribution


Config-ReadAndCheck

 view release on metacpan or  search on metacpan

ReadAndCheck.pm  view on Meta::CPAN

			or return;
		};
	return $NewParams;
	};

sub new($%)
	{
	my ($class, %Config) = @_;

	(!&{$CheckLoop}($Config{'Params'}))
		or return;

ReadAndCheck.pm  view on Meta::CPAN

	Reset($self);

	return bless $self => $class;
	};

sub Result($)
	{
	my ($self) = @_;
	my %Result = ();
	tie(%Result, 'Tie::IxHash', %{$self->{'Result'}});
	return (wantarray ? %Result : \%Result);
	};

sub Reset($)
	{
	my ($self) = @_;
        tie(%{$self->{'Result'}}, 'Tie::IxHash');
	$self->{'SecStack'} = [];
	unshift(@{$self->{'SecStack'}}, {'Params' => $self->{'Params'},'Result' => $self->{'Result'}});
	};

sub Params($)
	{
	my ($self) = @_;
	my $Params = &{$CheckParams}($self->{'Params'});
	return (wantarray ? %{$Params} : $Params);
	};

ReadAndCheck.pm  view on Meta::CPAN

		};

	return (wantarray ? %{$Result} : $Result);
	};

sub CheckRequired($)
	{
	my ($self);
	($self) = @_;

	my %Result = ();

ReadAndCheck.pm  view on Meta::CPAN

		or return;

	return (wantarray ? %{$self->{'Result'}} : $self->{'Result'});
	};

sub Parse($$)
	{
	my ($self, $Input) = @_;
	my $GetLine  = undef;
	my $RunIndex = 0;
	if    (!ref($Input))

ReadAndCheck.pm  view on Meta::CPAN

		or return;

	return (wantarray ? %Result : \%Result);
	};

sub ParseFile($$)
	{
	my ($self, $FileName) = @_;

	my $File = IO::File->new("< $FileName");
	if (!$File)

ReadAndCheck.pm  view on Meta::CPAN

	unshift(@{$self->{'SecStack'}}, {'Params' => $Params, 'Result' => $Result});

	return $Params;
	};

sub ParseIncremental($$)
	{
	my ($self, $Str) = @_;

	my ($Name, $P1, $P2);

 view all matches for this distribution


Config-Setting

 view release on metacpan or  search on metacpan

lib/Config/Setting/FileProvider.pm  view on Meta::CPAN

        };
        bless $self, $class;
        return $self->_init();
}

sub _init() {
        my $self  = shift;
        my @files = @{ $self->{ Paths } };

        # Allow listed files to be overridden by a hostname-specific
        # one.

 view all matches for this distribution


Config-Simple

 view release on metacpan or  search on metacpan

Simple.pm  view on Meta::CPAN



# delimiter used by Text::ParseWords::parse_line()
sub READ_DELIM () { return '\s*,\s*' }
# delimiter used by as_string()
sub WRITE_DELIM() { return ', '      }
sub DEBUG      () { 0 }


sub new {
  my $class = shift;

 view all matches for this distribution


Config-Structured

 view release on metacpan or  search on metacpan

lib/Config/Structured.pm  view on Meta::CPAN

}

###
#  CONSTRUCTOR
###
sub new($class, %args) {
  die("structure is a required parameter") unless (defined($args{structure}));
  die("config is a required parameter")    unless (defined($args{config}));

  # process %args
  my $config    = ref($args{config})    ? $args{config}    : deserialize($args{config});

 view all matches for this distribution


Config-XPath

 view release on metacpan or  search on metacpan

lib/Config/XPath.pm  view on Meta::CPAN

   }

   return shift @nodes;
}

sub get_node_attrs($)
# Get a hash of the attributes, putting the node name in "+"
{
   my ( $node ) = @_;

   my %attrs = ( '+' => $node->getName() );

 view all matches for this distribution


Config-XrmDatabase

 view release on metacpan or  search on metacpan

lib/Config/XrmDatabase/Util.pm  view on Meta::CPAN






sub normalize_key( $key ) {
    $key =~ s/[$TIGHT]?[$LOOSE][$TIGHT]?/$LOOSE/g;
    return $key;
}


lib/Config/XrmDatabase/Util.pm  view on Meta::CPAN






sub is_wildcard( $string ) {
    return $string eq TIGHT || $string eq LOOSE;
}


1;

 view all matches for this distribution


Config-apiLayers

 view release on metacpan or  search on metacpan

lib/Config/apiLayers.pm  view on Meta::CPAN

# Add a layer with @index and @data, or just @index, or add one more layer without @index
# Add more than one layer by providing the appropriate @index layer number. 
# The @data is only set into the last layer.
# @index
# @data
sub add_layer($) {
    my $self        = shift;
    my $args        = shift || {};
    if (ref $self->{$CXLDATA} ne "ARRAY") {
        $self->{$CXLDATA} = [];
    }

lib/Config/apiLayers.pm  view on Meta::CPAN

    }

    return (scalar @{$self->{$CXLDATA}} - 1);
}

sub apican(;$) {
    my $self         = shift;
    my $attr_name    = shift || undef;
    if (defined $attr_name) {
        return $self->{$CXLCFG}->{'api'}->{$attr_name} if exists $self->{$CXLCFG}->{'api'}->{$attr_name};
        return undef;
    } else {
        return wantarray ? @{$self->{$CXLCFG}->{'attributes'}} : $self->{$CXLCFG}->{'attributes'};
    }
}

sub apicall(;$){
    my $self         = shift;
    my $attr_name    = shift || return undef;
    if (defined $attr_name) {
        my $subref = $self->apican($attr_name);
        unshift(@_,$self);

lib/Config/apiLayers.pm  view on Meta::CPAN

#
# Non-Object helper functions
# To be used inside the api functions
#

sub _mendPath(@) {
    my @path = @_;
    my $path;
    foreach my $p (@path) {
        next unless defined $p;
        if ($path =~ /.+\/$/) {

lib/Config/apiLayers.pm  view on Meta::CPAN

        }
    }
    return $self->mendPath(@rootitems);
}

sub _dirFileSplit($) {
    my $path = shift;
    if (-d $path) {
        return ($path,undef);
    }
    my ($baseDir,$fileName) = $path =~ /^(.*\/)([^\/]*)$/;
    return @{[$baseDir,$fileName]};
}

sub _dirBase($) {
    my $path = shift;
    my ($baseDir,$fileName) = _DirFileSplit($path);
    $baseDir = './' unless defined $baseDir;
    return $baseDir;
}

sub _fileName($) {
    my $path = shift;
    my ($baseDir,$fileName) = _DirFileSplit($path);
    return $fileName;
}

 view all matches for this distribution


ConfigReader-Simple

 view release on metacpan or  search on metacpan

lib/ConfigReader/Simple.pm  view on Meta::CPAN

$Die       = '';

our $DEBUG = 0;
my $Error  = '';

sub SUCCESS() { 1 };
sub FAILURE() { 0 };

=encoding utf8

=head1 NAME

 view all matches for this distribution


( run in 1.019 second using v1.01-cache-2.11-cpan-65fba6d93b7 )