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


Apache2-WebApp-Extra-Admin

 view release on metacpan or  search on metacpan

usr/share/webapp-toolkit/extra/class/admin_users_add.tt  view on Meta::CPAN

        # list the users
        $self->_list_users($c);
    }
    else {

        $error{alert} = ERROR_FORM_INPUT;

        # errors exist, reload the form
        $self->_view_page( $c, \%param, \%error );
    }
}

 view all matches for this distribution


ApacheBench

 view release on metacpan or  search on metacpan

src/ApacheBench.xs  view on Meta::CPAN

             newSVnv(registry->total_bytes_received), 0);
    hv_store(RETVAL, "started", 7, newSViv(total_started), 0);
    hv_store(RETVAL, "good", 4, newSViv(total_good), 0);
    hv_store(RETVAL, "failed", 6, newSViv(total_failed), 0);

    OUTPUT:
    RETVAL

 view all matches for this distribution


ApacheLog-Compressor

 view release on metacpan or  search on metacpan

lib/ApacheLog/Compressor.pm  view on Meta::CPAN

=back

=cut

our %HTTP_METHOD;
our @HTTP_METHOD_LIST = qw(GET PUT HEAD POST OPTIONS DELETE TRACE CONNECT MKCOL PATCH PROPFIND PROPPATCH FILEPATCH COPY MOVE LOCK UNLOCK SIGNATURE DELTA);
{ my $idx = 0; %HTTP_METHOD = map { $_ => $idx++ } @HTTP_METHOD_LIST; }

=head1 METHODS

=cut

 view all matches for this distribution


Apigee-Edge

 view release on metacpan or  search on metacpan

lib/Apigee/Edge.pm  view on Meta::CPAN

sub update_developer {    ## no critic (ArgUnpacking)
    my $self  = shift;
    my $email = shift;
    my %args  = @_ % 2 ? %{$_[0]} : @_;
    $email or croak "email is required.";
    return $self->request('PUT', "/o/" . $self->{org} . "/developers/" . uri_escape($email), %args);
}

## Apps: Developer http://apigee.com/docs/api/apps-developer
sub change_app_status {
    my ($self, $email, $app) = @_;

lib/Apigee/Edge.pm  view on Meta::CPAN

    my $email = shift;
    my $app   = shift;
    my %args  = @_ % 2 ? %{$_[0]} : @_;
    $email or croak "email is required.";
    $app   or croak "app is required.";
    return $self->request('PUT', "/o/" . $self->{org} . "/developers/" . uri_escape($email) . "/apps/" . uri_escape($app), %args);
}

sub get_count_of_developer_app_resource {
    my ($self, $email, $app, $entity) = @_;
    return $self->request('GET',

lib/Apigee/Edge.pm  view on Meta::CPAN

sub update_api_product {              ## no critic (ArgUnpacking)
    my $self    = shift;
    my $product = shift;
    my %args    = @_ % 2 ? %{$_[0]} : @_;
    $product or croak "product is required.";
    return $self->request('PUT', "/o/" . $self->{org} . "/apiproducts/" . uri_escape($product), %args);
}

sub delete_api_product {
    my ($self, $product) = @_;
    return $self->request('DELETE', "/o/" . $self->{org} . "/apiproducts/" . uri_escape($product));

lib/Apigee/Edge.pm  view on Meta::CPAN

The underlaying method to call Apigee when you see something is missing.

    $self->request('GET', "/o/$org_name/apps/$app_id");
    $self->request('DELETE', "/o/$org_name/developers/" . uri_escape($email));
    $self->request('POST', "/o/$org_name/developers", %args);
    $self->request('PUT', "/o/$org_name/developers/" . uri_escape($email), %args);

=head2 errstr

=head1 GITHUB

 view all matches for this distribution


App-12567834

 view release on metacpan or  search on metacpan

12567834  view on Meta::CPAN

* con = $o{','} ? sub { map { M $_ } $_[0] .. $_[1] } : sub { ( M $_[0] ) . '-' . ( M $_[1] ) } ; # 関数を定義。-でつなげるか、,でつなげるか
* con2 = sub { $p2a < $p2 ? join "," , con ($p2a,$p2)  : "$p2" } ;

if ( $o{p} ) {
  my @P ; 
  my $out = "pdftk INPUT.pdf cat " ; 
  $p=$p1-1;splice @P,@P/2,0,$p+1..($p+=4)for 1..$q;$out .= join" ",@P ;
  $out .= " output OUTPUT.pdf" ;
  say $out ; 
  print "# Page " . con2($p2a, $p2)  . " has not contained above." if $pr ; 
  say "# The above contains " . length ($out) . " characters." ;  
  $o{2}//= 0 ; 
  exit ; 

 view all matches for this distribution


App-AFNI-SiemensPhysio

 view release on metacpan or  search on metacpan

lib/bin/siemphysdat  view on Meta::CPAN


C<-t MR> is useful for testing against data/

C<-t Phys> is useful for forcing a sampling rate

=head1 OUTPUT

=over

=item C<*dat> 

 view all matches for this distribution


App-Acmeman

 view release on metacpan or  search on metacpan

lib/App/Acmeman.pm  view on Meta::CPAN

	    print $fd $response->decoded_content;
	    close $fd;
	}
    } else {
	error("error downloading certificate from $letsencrypt_root_cert_url");
	abend(EX_NOINPUT, $response->status_line);
    }
}

sub setup {
    my $self = shift;

 view all matches for this distribution


App-Adenosine

 view release on metacpan or  search on metacpan

lib/App/Adenosine.pm  view on Meta::CPAN

use Path::Class;
use Text::ParseWords;
use Scalar::Util 'blessed';
use Module::Runtime 'use_module';

our $verb_regex = '(?:HEAD|OPTIONS|GET|DELETE|PUT|POST|TRACE|PATCH)';

sub verbose { $_[0]->{verbose} }
sub plugins { @{$_[0]->{plugins}} }
sub enable_xdg {
   return $_[0]->{enable_xdg} if exists $_[0]->{enable_xdg};

lib/App/Adenosine.pm  view on Meta::CPAN

         v     => sub { $self->{verbose} = 1 },
      );

      my @extra = (@ARGV, $self->_get_extra_options);
      my $wantdata;
      $wantdata = 1 if $action =~ m/^(?:PUT|POST|TRACE|PATCH)$/;
      if ($wantdata && $interactive_edit) {
         require File::Temp;
         my ($fh, $fn) = File::Temp::tempfile();

         system($ENV{EDITOR} || 'vi', $fn);

lib/App/Adenosine.pm  view on Meta::CPAN

      print <<'SHELL';
function HEAD() { adenosine HEAD "$@"; };
function OPTIONS() { adenosine OPTIONS "$@"; };
function GET() { adenosine GET "$@"; };
function POST() { adenosine POST "$@"; };
function PUT() { adenosine PUT "$@"; };
function DELETE() { adenosine DELETE "$@"; };
function TRACE() { adenosine TRACE "$@"; };
function PATCH() { adenosine TRACE "$@"; };
SHELL
   } else {

 view all matches for this distribution


App-Alice

 view release on metacpan or  search on metacpan

share/static/alice.js  view on Meta::CPAN

  if (!methods) {
    Object.extend(Form, Form.Methods);
    Object.extend(Form.Element, Form.Element.Methods);
    Object.extend(Element.Methods.ByTag, {
      "FORM":     Object.clone(Form.Methods),
      "INPUT":    Object.clone(Form.Element.Methods),
      "SELECT":   Object.clone(Form.Element.Methods),
      "TEXTAREA": Object.clone(Form.Element.Methods)
    });
  }

share/static/alice.js  view on Meta::CPAN

      element.setStyle(originalStyles);
      this._prepared = false;
    },

    _compute: function(property) {
      var COMPUTATIONS = Element.Layout.COMPUTATIONS;
      if (!(property in COMPUTATIONS)) {
        throw "Property not found.";
      }
      return this._set(property, COMPUTATIONS[property].call(this, this.element));
    },

    toCSS: function() {
      var args = $A(arguments);
      var keys = (args.length === 0) ? Element.Layout.PROPERTIES :

share/static/alice.js  view on Meta::CPAN

  Object.extend(Element.Layout, {
    PROPERTIES: $w('height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height bord...

    COMPOSITE_PROPERTIES: $w('padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height'),

    COMPUTATIONS: {
      'height': function(element) {
        if (!this._preComputing) this._begin();

        var bHeight = this.get('border-box-height');
        if (bHeight <= 0) return 0;

share/static/alice.js  view on Meta::CPAN

      }
    }
  });

  if ('getBoundingClientRect' in document.documentElement) {
    Object.extend(Element.Layout.COMPUTATIONS, {
      'right': function(element) {
        var parent = hasLayout(element.getOffsetParent());
        var rect = element.getBoundingClientRect(),
         pRect = parent.getBoundingClientRect();

share/static/alice.js  view on Meta::CPAN

    if(!Object.isUndefined(Draggable._dragging[this.element]) &&
      Draggable._dragging[this.element]) return;
    if(Event.isLeftClick(event)) {
      var src = Event.element(event);
      if((tag_name = src.tagName.toUpperCase()) && (
        tag_name=='INPUT' ||
        tag_name=='SELECT' ||
        tag_name=='OPTION' ||
        tag_name=='BUTTON' ||
        tag_name=='TEXTAREA')) return;

share/static/alice.js  view on Meta::CPAN

				var element;
				if(e.target) element=e.target;
				else if(e.srcElement) element=e.srcElement;
				if(element.nodeType==3) element=element.parentNode;

				if(element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') return;
			}

			if (e.keyCode) code = e.keyCode;
			else if (e.which) code = e.which;
			var character = String.fromCharCode(code).toLowerCase();

 view all matches for this distribution


App-Aphra

 view release on metacpan or  search on metacpan

lib/App/Aphra.pm  view on Meta::CPAN

  return Template->new(
    LOAD_TEMPLATES => [
      Template::Provider::Pandoc->new(
        INCLUDE_PATH       => $self->include_path,
        EXTENSIONS         => $exts,
        OUTPUT_FORMAT      => $self->config->{output},
        STRIP_FRONT_MATTER => 1,
      ),
    ],
    VARIABLES    => {
      site => $self->site_vars,
    },
    INCLUDE_PATH => $self->include_path,
    OUTPUT_PATH  => $self->config->{target},
    WRAPPER      => $self->config->{wrapper},
  );
}

has uri => (

 view all matches for this distribution


App-Asciio

 view release on metacpan or  search on metacpan

setup/import_export/perl.pl  view on Meta::CPAN

my ($header, $footer) = ('', '') ;

eval "use Pod::Select ; use Pod::Text;" ;
die $@ if $@ ;

open INPUT, '<', $file_name or die "get_base64_data: Can't open '$file_name'!\n" ;
open my $out, '>', \my $all_pod or die "Can't redirect to scalar output: $!\n";

my $parser = new Pod::Select();
$parser->parse_from_filehandle(\*INPUT, $out);

$all_pod .= '=cut' ; #add the =cut taken away by above parsing

my @asciio_pods ;

 view all matches for this distribution


App-BPOMUtils-NutritionFacts

 view release on metacpan or  search on metacpan

lib/App/BPOMUtils/NutritionFacts.pm  view on Meta::CPAN

    } elsif ($output_format =~ /linear/) {
        push @rows, $code_fmttext->(                      "/Persen AKG berdasarkan kebutuhan energi 2150 kkal. Kebutuhan energi Anda mungkin lebih tinggi atau lebih rendah./");
    }


  OUTPUT:
    if ($output_format eq 'raw_table') {
        return [200, "OK", \@rows, {'table.fields'=>[qw/name_eng name_ind val_per_100g val_per_srv val_per_srv_R val_per_pkg val_per_pkg_R pct_dv pct_dv_R/]}];
    }

    my $text;

 view all matches for this distribution


App-BPOMUtils-Table-FoodIngredient

 view release on metacpan or  search on metacpan

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    746,
    "SAWI PUTIH (CHINESE CABBAGE)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    758,
    "PUREE BAWANG PUTIH (GARLIC PUREE)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    775,
    "PUTIH TELUR (EGG WHITE)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",
  ],
  [
    776,
    "PUTIH TELUR BUBUK (EGG WHITE POWDER)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",
  ],
  [
    777,
    "PUTIH TELUR PADAT (EGG WHITE SOLID)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    1029,
    "LADA PUTIH BUBUK (WHITE PEPPER POWDER)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    1149,
    "MINYAK BAWANG PUTIH (GARLIC OIL)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    1176,
    "MINYAK KAYU PUTIH (EUCALYPTUS OIL)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    1788,
    "JINTAN-JINTEN PUTIH-CUNICUM CYMINUM (CUMIN)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    1829,
    "KACANG NAVY - KACANG PUTIH (NAVY BEANS - WHITE PEA)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "NO",
    "NO",
    "YES",
  ],
  [1840, "KACANG PUTIH ", "Bahan Baku", "NO", "NO", "NO", "NO"],
  [
    1841,
    "Kacang Tanah (Peanut)",
    "Bahan Baku",
    "NO",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    2191,
    "COKELAT COMPOUND PUTIH (WHITE CHOCOLATE COMPOUND)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    2211,
    "COMPOUND PUTIH (WHITE COMPOUND)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "NO",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    2402,
    "BUMBU RASA RUMPUT LAUT (SEAWEED FLAVORED SEASONING )",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    2481,
    "BUMBU RASA BAWANG PUTIH (GARLIC FLAVORED SEASONING)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "NO",
    "NO",
    "YES",
  ],
  [2556, "ANGGUR PUTIH BUBUK", "Bahan Baku", "NO", "NO", "NO", "NO"],
  [
    2557,
    "Apel Bubuk (Apple Powder)",
    "Bahan Baku",
    "NO",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    2621,
    "BAWANG PUTIH GILING (GRINDED GARLIC)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

 view all matches for this distribution


App-BPOMUtils-Table

 view release on metacpan or  search on metacpan

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    746,
    "SAWI PUTIH (CHINESE CABBAGE)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    758,
    "PUREE BAWANG PUTIH (GARLIC PUREE)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    775,
    "PUTIH TELUR (EGG WHITE)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",
  ],
  [
    776,
    "PUTIH TELUR BUBUK (EGG WHITE POWDER)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",
  ],
  [
    777,
    "PUTIH TELUR PADAT (EGG WHITE SOLID)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    1029,
    "LADA PUTIH BUBUK (WHITE PEPPER POWDER)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    1149,
    "MINYAK BAWANG PUTIH (GARLIC OIL)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    1176,
    "MINYAK KAYU PUTIH (EUCALYPTUS OIL)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    1788,
    "JINTAN-JINTEN PUTIH-CUNICUM CYMINUM (CUMIN)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    1829,
    "KACANG NAVY - KACANG PUTIH (NAVY BEANS - WHITE PEA)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "NO",
    "NO",
    "YES",
  ],
  [1840, "KACANG PUTIH ", "Bahan Baku", "NO", "NO", "NO", "NO"],
  [
    1841,
    "Kacang Tanah (Peanut)",
    "Bahan Baku",
    "NO",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    2191,
    "COKELAT COMPOUND PUTIH (WHITE CHOCOLATE COMPOUND)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    2211,
    "COMPOUND PUTIH (WHITE COMPOUND)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "NO",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    2402,
    "BUMBU RASA RUMPUT LAUT (SEAWEED FLAVORED SEASONING )",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    2481,
    "BUMBU RASA BAWANG PUTIH (GARLIC FLAVORED SEASONING)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "NO",
    "NO",
    "YES",
  ],
  [2556, "ANGGUR PUTIH BUBUK", "Bahan Baku", "NO", "NO", "NO", "NO"],
  [
    2557,
    "Apel Bubuk (Apple Powder)",
    "Bahan Baku",
    "NO",

lib/App/BPOMUtils/Table/FoodIngredient.pm  view on Meta::CPAN

    "NO",
    "YES",
  ],
  [
    2621,
    "BAWANG PUTIH GILING (GRINDED GARLIC)",
    "Bahan Baku",
    "NO",
    "NO",
    "NO",
    "YES",

 view all matches for this distribution


App-BPOMUtils

 view release on metacpan or  search on metacpan

lib/App/BPOMUtils.pm  view on Meta::CPAN

    } elsif ($output_format =~ /linear/) {
        push @rows, $code_fmttext->(                      "/Persen AKG berdasarkan kebutuhan energi 2150 kkal. Kebutuhan energi Anda mungkin lebih tinggi atau lebih rendah./");
    }


  OUTPUT:
    if ($output_format eq 'raw_table') {
        return [200, "OK", \@rows, {'table.fields'=>[qw/name_eng name_ind val_per_100g val_per_srv val_per_srv_R val_per_pkg val_per_pkg_R pct_dv pct_dv_R/]}];
    }

    my $text;

 view all matches for this distribution


App-Basis-ConvertText2

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


# we assume that the plantuml.jar file is in the same directory as this executable
EXEC_DIR=`dirname $0`
PLANTUML="$EXEC_DIR/plantuml.jar"

INPUT=$1
OUPUT=$2
function show_usage  {
    arg=$1
    err=$2
    if [ "$err" == "" ] ; then
        err=1

README.md  view on Meta::CPAN

        echo "$arg
"
    fi
    exit $err
}
if [ "$INPUT" == "-help" ] ; then
    show_usage "" 0
fi
if [ ! -f "$INPUT" ] ; then
    show_usage "ERROR: Could not find input file $1"
fi
if [ "$OUPUT" == "" ] ; then
    show_usage "ERROR: No output file specified"
fi
# we use the pipe option to control output into the file we want
cat "$INPUT" | java -jar $PLANTUML -nbthread auto -pipe >$OUPUT
# exit 0
~~~~

The content for this code-block must be the same that you would use to with the [PlantUML] software

 view all matches for this distribution


App-Beeminder-Hook

 view release on metacpan or  search on metacpan

public/javascripts/jquery.js  view on Meta::CPAN

"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.dat...
false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&...
false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);r...
c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._...
d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var ...
g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f)...
1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){...
"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n===...
if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","padd...
this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;f...
"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments)...

 view all matches for this distribution


App-Bernard

 view release on metacpan or  search on metacpan

lib/App/Bernard/Magic/Fuzzaccept.pm  view on Meta::CPAN

sub handle {

    my ($self, $settings) = @_;

    if ($settings->{'output'}) {
	open OUTPUT, ">$settings->{'output'}"
	    or die "Can't open $settings->{'output'}: $!";
	binmode OUTPUT, ":utf8";
    }

    $settings->{'print'} = sub {
	my ($text) = @_;

	if ($settings->{'output'}) {
	    print OUTPUT $text;
	} else {
	    print $text;
	}
    };

 view all matches for this distribution


App-Bin4TSV

 view release on metacpan or  search on metacpan

scripts/csv2tsv  view on Meta::CPAN

    #exit if $o{'~'} ;
    exit if ! defined $csv ; 
    my @tmp = $csv -> error_diag () ; # ($cde, $str, $pos, $rec, $fld) = $csv->error_diag ();
    if ( $tmp[0] != 2012 ) {  # perldoc Text::CSV_XS で 2012 を参照。EOFを意味する。
      print STDERR BRIGHT_RED join (":",@tmp),"\n" ;
      print STDERR ON_BRIGHT_RED BLACK "_ERROR_INPUT at line $.: " ; 
      #use Data::Dumper ; #print STDERR UNDERLINE Dumper $csv  ; 
      print STDERR UNDERLINE BRIGHT_RED $csv ->{_ERROR_INPUT} ; 
      exit 1 ; 
    }
  }
}

 view all matches for this distribution


App-BlockWebFlooders

 view release on metacpan or  search on metacpan

script/block-web-flooders  view on Meta::CPAN

        {
            die => ($which eq 'block' ? 1:0),
            dry_run => $Opts{dry_run},
            (capture_stderr => \my $stderr) x ($which eq 'block' ? 0:1),
        },
        "iptables", ($which eq 'block' ? "-A" : "-D"), "INPUT", "-s", $ip,
        "-p", "tcp", "-m", "multiport", "--dports", "80,443",
        "-j", "DROP",
    );
    my $now = time();
    if ($which eq 'block') {

script/block-web-flooders  view on Meta::CPAN

    my $last_reload_data_time;
    my $num_lines = 0;

    _init();

    local *INPUT;
    if (defined $Opts{spanel_site}) {
        require Tie::Handle::TailSwitch;
        my $dir = "/s/$Opts{spanel_site}/syslog";
        tie *INPUT, 'Tie::Handle::TailSwitch', (
            globs => ["$dir/https_access.*.log", "$dir/http_access.*.log"],
        );
    } else {
        *INPUT = \*STDIN;
    }

  LINE:
    while (1) {
        my $line = <INPUT>;
        if (!defined($line) || !length($line)) {
            sleep 0.5;
            next;
        }

script/block-web-flooders  view on Meta::CPAN

            next;
        };
        my $ip = $1;
        next if $Blocked{$ip};

      OUTPUT:
        {
            last unless !$last_update_output_time ||
                $last_update_output_time <= $now-2;
            print "\e[2J\e[;H"; # clear screen + put cursor at top (0,0)
            printf "Blocked IPs: %s%4d%s | Log lines: %s%6d%s | Running for: %s%s%s\n",

script/block-web-flooders  view on Meta::CPAN

            $i = 0;
            for my $msg (@Messages) {
                last if $i++ >= 5;
                print "  $msg\n";
            }
        } # OUTPUT

      UNBLOCK:
        {
            last unless !$last_unblock_time ||
                $last_unblock_time <= $now-60;

script/block-web-flooders  view on Meta::CPAN

 # tail -f /s/example.com/syslog/https_access.2017-06-07.log | grep /heavy

and somethins like this in yet another terminal (monitor system load and number
of web server processes, this depends on the web server you use):

 # watch 'w | head -n1; echo -n "Blocked IPs total: "; iptables -nL INPUT | wc -l; echo -n "Apache processes: "; ps ax | grep apache | wc -l'

If your webserver is still maxed out by requests, you might want to tweak
C<--limit> and C<--period> options and restart the web server.

To see the blocked IP addresses:

 # iptables -nL INPUT

As long as the script runs, IP addresses are blocked by default temporarily for
86400 seconds (or, according to the --block-period command-line option or
block_period configuration). After that block period is exceeded, the IP is
unblocked.

To immediately clear/unblock all the IPs:

 # iptables -F INPUT

(this is assuming the default policy of input is ACCEPT; if you have a firewall
package installed, please follow the procedure for that firewall.)

To immediately unblock some IPs:

script/block-web-flooders  view on Meta::CPAN

your website. The script works by reading web access log file, considering lines
which match the specified pattern(s), then block the IP address of the requester
if the speed of request from that IP exceeds a limit. The blocking is done using
firewall (L<iptables>), by default:

 # iptables -A INPUT -s <ip-address> -p tcp -m multiport --dports 80,443 -j DROP

To use this script, see the general guide in the Synopsis.

=head1 OPTIONS

 view all matches for this distribution


App-BoolFindGrep

 view release on metacpan or  search on metacpan

lib/App/BoolFindGrep/Find.pm  view on Meta::CPAN

} ## end sub process

sub _get_made_list {
    my $self = shift;

    local $INPUT_RECORD_SEPARATOR = $self->files_delim();

    my $fh
        = $self->files_from() =~ /\A(?:-|stdin)\z/i
        ? \*STDIN
        : IO::File->new( $self->files_from(), q(r) );

 view all matches for this distribution


App-Buuilt-CLI

 view release on metacpan or  search on metacpan

lib/App/Buuilt/CLI.pm  view on Meta::CPAN

    my ( $self, $asset_relative, $asset ) = @_;

    my $config = $self->config();

    my $ua = Mojo::UserAgent->new;
    my $tx = $ua->build_tx( PUT => $config->{host} . '/api/theme/assets/' . $asset_relative => $config );
    $tx->req->content->asset( Mojo::Asset::File->new( path => $asset ) );
    my $txr = $ua->start($tx);

    Mojo::IOLoop->start unless Mojo::IOLoop->is_running;

 view all matches for this distribution


App-CPANModuleSite

 view release on metacpan or  search on metacpan

lib/App/CPANModuleSite.pm  view on Meta::CPAN

sub _build_tt_config {
  my $self = shift;

  return {
    INCLUDE_PATH => $self->include_path,
    OUTPUT_PATH => $self->output_path,
    ( $self->wrapper ? ( WRAPPER => $self->wrapper ) : () ),
    RELATIVE => 1,
    VARIABLES => {
      distribution => $self->distribution,
      release => $self->release,

 view all matches for this distribution


App-CPANtoRPM

 view release on metacpan or  search on metacpan

lib/App/CPANtoRPM.pm  view on Meta::CPAN

                         '_optimize'  => '%{optimize}',
                         '_buildroot' => '%{buildroot}',
                        }
                  );

our ($OUTPUT,@OUTPUT,%package,$MAN);
$package{'VERSION'} = $VERSION;

my $old_locale = setlocale(LC_TIME);
setlocale(LC_TIME, "C");
$package{'date'}    = POSIX::strftime("%a %b %d %Y",localtime());

lib/App/CPANtoRPM.pm  view on Meta::CPAN

   my(@print);

   METHOD:
   foreach my $method (@method) {
      my($type,@tmp)   = @$method;
      @OUTPUT          = ();

      if ($type eq 'ignore') {
         next METHOD;

      } elsif ($type eq 'module') {

lib/App/CPANtoRPM.pm  view on Meta::CPAN

                 $self->_log_message('INFO',"Failed to load module: $module"));
            $self->_log_indent(-1);
            next METHOD;
         }

         push(@OUTPUT,eval "$eval_string");

      } elsif ($type eq 'system'  ||
               $type eq 'system-null') {
         my($bin,$command,@args) = @tmp;

lib/App/CPANtoRPM.pm  view on Meta::CPAN

            $self->_log_indent(-1);
            next METHOD;
         }

         if ($type eq 'system-null') {
            @OUTPUT  = ();
         } else {
            my $in = new IO::File;
            $in->open("$TMPDIR/cmd.out");
            my @out = <$in>;
            $in->close();
            chomp(@out);
            @OUTPUT  = @out;
         }

      } elsif ($type eq 'function') {
         my($coderef,@args) = @$method;

         my @out = &$coderef(@args);
         chomp(@out);
         @OUTPUT  = @out;
      }

      if (&$testfunc(@args)) {
         $self->_log_indent(-1);
         return 1;

lib/App/CPANtoRPM.pm  view on Meta::CPAN


      $succ = $self->_multiple_methods
        ( [ sub { 1; } ],
          [ 'module', 'YAML::XS', [],
            "my \@tmp = YAML::XS::LoadFile('$file'); " .
            "\$OUTPUT = \$tmp[0]" ],
          [ 'module', 'YAML::Tiny', [],
            "my \@tmp = YAML::Tiny::LoadFile('$file'); " .
            "\$OUTPUT = \$tmp[0]" ],
          [ 'module', 'YAML', [],
            "my \@tmp = YAML::LoadFile('$file'); " .
            "\$OUTPUT = \$tmp[0]" ],
          [ 'module', 'YAML::Syck', [],
            "my \@tmp = YAML::Syck::LoadFile('$file'); " .
            "\$OUTPUT = \$tmp[0]" ],
        );

   } elsif ($file =~ /\.json$/i) {

      $succ = $self->_multiple_methods
        ( [ sub { 1; } ],
          [ 'module', 'JSON::XS', ['decode_json'],
            "my \$fh; " .
            "open \$fh,'<:utf8','$file'; " .
            "my \$json_text = do { local \$/; <\$fh> }; " .
            "\$OUTPUT = decode_json(\$json_text);" ],
          [ 'module', 'JSON', ['from_json'],
            "my \$fh; " .
            "open \$fh,'<:utf8','$file'; " .
            "my \$json_text = do { local \$/; <\$fh> }; " .
            "\$OUTPUT = from_json(\$json_text);" ],
          [ 'module', 'JSON::PP', ['decode_json'],
            "my \$fh; " .
            "open \$fh,'<:utf8','$file'; " .
            "my \$json_text = do { local \$/; <\$fh> }; " .
            "\$OUTPUT = decode_json(\$json_text);" ],
          [ 'module', 'JSON::DWIW', ['from_json'],
            "my \$fh; " .
            "open \$fh,'<:utf8','$file'; " .
            "my \$json_text = do { local \$/; <\$fh> }; " .
            "\$OUTPUT = from_json(\$json_text);" ],
        );

   } else {
      $self->_log_message('ERR',"Options file must be YAML or JSON: $file");
   }

   if (! $succ) {
      $self->_log_message('ERR',"Unable to read options file: $file");
   }

   return ()  if (! exists $OUTPUT->{$$self{'package'}});

   my @opts;

   foreach my $line (@{ $OUTPUT->{$$self{'package'}} }) {
      if ($line =~ /^(.+?)(?:\s+|=)(.+?)\s*$/) {
         push(@opts,$1,$2);
      } else {
         push(@opts,$line);
      }

lib/App/CPANtoRPM.pm  view on Meta::CPAN

   $self->_log_message('INFO',"Listing package files");

   my $succ = $self->_multiple_methods
     ( [ sub { 1; } ],
       [ 'module','File::Find',['find'],
         qq< find(sub { push(\@OUTPUT,\$File::Find::name) if (-f) },"$dir"); >
       ],
       [ 'system','find',
         "{find} '$dir' -type f" ]
     );

   my %files;
   foreach my $file (@OUTPUT) {
      $file =~ s,^$dir/,,;
      next  if (! $file);

      $files{lc($file)}{$file} = 1;
   }

lib/App/CPANtoRPM.pm  view on Meta::CPAN

         "Multiple '$tmp' files exist (with different cases).",
         "This is not supported, so they will be ignored.");
      return;
   }
   my $file = "$package{DIR}/$tmp[0]";
   $OUTPUT = '';

   $self->_log_message('INFO',"Reading META file: $tmp[0]");

   my $succ;
   if ($type eq 'json') {

      $succ = $self->_multiple_methods
        ( [ sub { 1; } ],
          [ 'module', 'Parse::CPAN::Meta', '1.41', [],
            "\$OUTPUT = Parse::CPAN::Meta->load_file('$file')" ],
          [ 'module', 'JSON', ['from_json'],
            "my \$fh; " .
            "open \$fh,'<:utf8','$file'; " .
            "my \$json_text = do { local \$/; <\$fh> }; " .
            "\$OUTPUT = from_json(\$json_text);" ],
          [ 'module', 'JSON::XS', ['decode_json'],
            "my \$fh; " .
            "open \$fh,'<:utf8','$file'; " .
            "my \$json_text = do { local \$/; <\$fh> }; " .
            "\$OUTPUT = decode_json(\$json_text);" ],
          [ 'module', 'JSON::PP', ['decode_json'],
            "my \$fh; " .
            "open \$fh,'<:utf8','$file'; " .
            "my \$json_text = do { local \$/; <\$fh> }; " .
            "\$OUTPUT = decode_json(\$json_text);" ],
          [ 'module', 'JSON::DWIW', ['from_json'],
            "my \$fh; " .
            "open \$fh,'<:utf8','$file'; " .
            "my \$json_text = do { local \$/; <\$fh> }; " .
            "\$OUTPUT = from_json(\$json_text);" ],
        );

   } else {

      $succ = $self->_multiple_methods
        ( [ sub { 1; } ],
          # [ 'module', 'Parse::CPAN::Meta', [],
          #   "\$OUTPUT = Parse::CPAN::Meta::LoadFile('$file')" ],
          # [ 'module', 'CPAN::Meta::YAML', [],
          #   "my \$fh; " .
          #   "open \$fh,'<:utf8','$file'; " .
          #   "my \$yaml_text = do { local \$/; <\$fh> }; " .
          #   "my \$tmp = CPAN::Meta::YAML->read_string(\$yaml_text);" .
          #   "\$OUTPUT = \$tmp->[0]" ],
          [ 'module', 'YAML', [],
            "my \@tmp = YAML::LoadFile('$file'); " .
            "\$OUTPUT = \$tmp[0]" ],
          [ 'module', 'YAML::Syck', [],
            "my \@tmp = YAML::Syck::LoadFile('$file'); " .
            "\$OUTPUT = \$tmp[0]" ],
          [ 'module', 'YAML::XS', [],
            "my \@tmp = YAML::XS::LoadFile('$file'); " .
            "\$OUTPUT = \$tmp[0]" ],
          [ 'module', 'YAML::Tiny', [],
            "my \@tmp = YAML::Tiny::LoadFile('$file'); " .
            "\$OUTPUT = \$tmp[0]" ],
        );
   }

   if (! $succ) {
      $self->_log_message('WARN',"Unable to read META file: $tmp[0]");
      return;
   }
   if (! $OUTPUT) {
      $self->_log_message('ERR',"META file empty or corrupt: $tmp[0]");
      return;
   }

   # Now get the meta information:

lib/App/CPANtoRPM.pm  view on Meta::CPAN


   if (! $package{'m_license'}) {

      my $lic = '';

      if ($OUTPUT->{'license'}) {
         my @lic;

         if (ref($OUTPUT->{'license'})) {
            @lic = @{ $OUTPUT->{'license'} };
         } else {
            @lic = ($OUTPUT->{'license'});
         }

         foreach my $l (@lic) {
            if ($l =~ /^perl$/i  ||
                $l =~ /^perl_5$/i) {

lib/App/CPANtoRPM.pm  view on Meta::CPAN

             }
         }

         $lic = join(', ',@lic);

      } elsif ($OUTPUT->{'resources'}  &&
               $OUTPUT->{'resources'}->{'license'}) {
         $lic = join(' ',@{ $OUTPUT->{'resources'}->{'license'} });

      } elsif ($OUTPUT->{'license_uri'}) {
         $lic = $OUTPUT->{'license_uri'};
      }


      $package{'m_license'} = $lic  if ($lic);
   }

lib/App/CPANtoRPM.pm  view on Meta::CPAN

   # (but we'll use the VERSION from the first file they're
   # found in so we'll assume that we're examining the most
   # accurate file first).

   my %requires;
   if ($OUTPUT->{'prereqs'}) {
      my %lev = ( 'configure'  => [ 'build' ],
                  'build'      => [ 'build' ],
                  'test'       => [ 'test' ],
                  'runtime'    => [ 'build', 'runtime' ],
                );

lib/App/CPANtoRPM.pm  view on Meta::CPAN

                   ($t eq 'test'     &&  $$self{'test_rec'})   ||
                   ($t eq 'runtime'  &&  $$self{'runtime_rec'}) );

            foreach my $key (@key) {

               if ($OUTPUT->{'prereqs'}->{$lev}  &&
                   $OUTPUT->{'prereqs'}->{$lev}->{$key}) {

                  foreach my $f (keys %{ $OUTPUT->{'prereqs'}->{$lev}->{$key} }) {
                     my $v = $OUTPUT->{'prereqs'}->{$lev}->{$key}->{$f};
                     $requires{$t}{$f} = $v;
                  }
               }
            }
         }

lib/App/CPANtoRPM.pm  view on Meta::CPAN

                  'build_rquires'       => [ 'build' ],
                  'requires'            => [ 'build', 'runtime' ],
                );

      foreach my $lev (keys %lev) {
         if ($OUTPUT->{$lev}) {
            foreach my $f (keys %{ $OUTPUT->{$lev} }) {
               my $v = $OUTPUT->{$lev}->{$f};
               foreach my $t (@{ $lev{$lev} }) {
                  $requires{$t}{$f} = $v;
               }
            }
         }

lib/App/CPANtoRPM.pm  view on Meta::CPAN


      %lev = ( 'recommends'          => [ 'build', 'runtime' ],
             );

      foreach my $lev (keys %lev) {
         if ($OUTPUT->{$lev}) {
            foreach my $f (keys %{ $OUTPUT->{$lev} }) {
               my $v = $OUTPUT->{$lev}->{$f};
               foreach my $t (@{ $lev{$lev} }) {

                  if ( ($t eq 'build'    &&  $$self{'build_rec'})  ||
                       ($t eq 'test'     &&  $$self{'test_rec'})   ||
                       ($t eq 'runtime'  &&  $$self{'runtime_rec'}) ) {

lib/App/CPANtoRPM.pm  view on Meta::CPAN


sub _get_meta_field {
   my($self,$meta_field,$pack_field) = @_;

   return  if ($package{$pack_field}  ||
               ! exists $OUTPUT->{$meta_field});
   $package{$pack_field} = $OUTPUT->{$meta_field};

   # Strings containing newlines in the META.* files cause problems,
   # so change them to spaces.
   $package{$pack_field} =~ tr{\n}{ }  if (! ref($OUTPUT->{$meta_field}));
}

# This will get the NAME, SUMMARY, and DESCRIPTION sections of a POD
# file.  It will return () if it is not a valid POD file.
#

lib/App/CPANtoRPM.pm  view on Meta::CPAN

      my $succ = $self->_multiple_methods( [ sub { 1; } ],
                                           ['system','pwd',
                                            "cd '$$self{file_path}'; {pwd}"],
                                         );

      if (! $succ  ||  ! @OUTPUT) {
         $self->_log_message('ERR',
                             "Unable to determine package directory: $package");
      }

      $package = $OUTPUT[0];
      $package =~ m,^(.*/)?(.*)$,;
      $dir     = $2;
   }

   my ($dist,$vers);

 view all matches for this distribution


App-CSV

 view release on metacpan or  search on metacpan

lib/App/CSV.pm  view on Meta::CPAN

sub run {
  my($self) = @_;
  $self->init;

  # L<perlsyn/"modifiers don't take loop labels">
  INPUT: { do {
    my $data;
    while (defined($data = $self->_get_line)) {
      if ($self->columns) {
        @$data = @$data[@{ $self->columns }];
      }
      
      if (!$self->_output_csv->print($self->_output_fh, $data)) {
        warn $self->format_error("Warning - Output error", diag => [$self->_input_csv->error_diag]), "\n";
        next INPUT;
      }
      $self->_output_fh->print("\n");
    }

    # Keeps us going on input errors.
    # TODO: strict errors, according to command line, blah
    if (not defined $data) {
      last INPUT if $self->_input_csv->eof;
      warn $self->format_error("Warning - Input error", line => $., diag => [$self->_input_csv->error_diag]), "\n";
    }
  } }
}

 view all matches for this distribution


App-CSVUtils-csv_mix_formulas

 view release on metacpan or  search on metacpan

lib/App/CSVUtils/csv_mix_formulas.pm  view on Meta::CPAN

=item * B<inplace> => I<true>

Output to the same file as input.

Normally, you output to a different file than input. If you try to output to the
same file (C<-o INPUT.csv -O>) you will clobber the input file; thus the utility
prevents you from doing it. However, with this C<--inplace> option, you can
output to the same file. Like perl's C<-i> option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (C<-o>) when using this option,
but you can specify backup extension with C<-b> option.

 view all matches for this distribution


App-CSVUtils

 view release on metacpan or  search on metacpan

lib/App/CSVUtils.pm  view on Meta::CPAN

        summary => 'Output to the same file as input',
        schema => 'true*',
        description => <<'_',

Normally, you output to a different file than input. If you try to output to the
same file (`-o INPUT.csv -O`) you will clobber the input file; thus the utility
prevents you from doing it. However, with this `--inplace` option, you can
output to the same file. Like perl's `-i` option, this will first output to a
temporary file in the same directory as the input file then rename to the final
file at the end. You cannot specify output file (`-o`) when using this option,
but you can specify backup extension with `-b` option.

lib/App/CSVUtils.pm  view on Meta::CPAN


To read CSV data, normally your utility would provide handler for the
`on_input_data_row` hook and sometimes additionally `on_input_header_row`.


*OUTPUTTING STRING OR RETURNING RESULT*

To output string, usually you call the provided routine `$r->{code_print}`. This
routine will open the output files for you.

You can also return enveloped result directly by setting `$r->{result}`.


*OUTPUTTING CSV DATA*

To output CSV data, usually you call the provided routine `$r->{code_print_row}`.
This routine accepts a row (arrayref or hashref). This routine will open the
output files for you when needed, as well as print header row automatically.

lib/App/CSVUtils.pm  view on Meta::CPAN

as usual. To switch to the next file, set
`$r->{wants_switch_to_next_output_file}` to true, in which case the next call to
`$r->{code_print_row}` will close the current file and open the next file.


*CHANGING THE OUTPUT FIELDS*

When calling `$r->{code_print_row}`, you can output whatever fields you want. By
convention, you can set `$r->{output_fields}` and `$r->{output_fields_idx}` to
let other handlers know about the output fields. For example, see the
implementation of <prog:csv-concat>.

lib/App/CSVUtils.pm  view on Meta::CPAN

                            @output_filenames = @{ $util_args{output_filenames} // ['-'] };
                        } else {
                            @output_filenames = ($util_args{output_filename} // '-');
                        }

                      CHECK_OUTPUT_FILENAME_SAME_AS_INPUT_FILENAME: {
                            my %seen_output_abs_path; # key = output filename
                            last unless $reads_csv && $writes_csv;
                            for my $input_filename (@{ $r->{input_filenames} }) {
                                next if $input_filename eq '-';
                                my $input_abs_path = Cwd::abs_path($input_filename);

lib/App/CSVUtils.pm  view on Meta::CPAN

                                         ($output_filename ne $output_abs_path ? "($output_abs_path) ":"").
                                         "because it is the same as input filename and input will be clobbered; use --inplace to avoid clobbering<"]
                                        if $output_abs_path eq $input_abs_path;
                                }
                            }
                        } # CHECK_OUTPUT_FILENAME_SAME_AS_INPUT_FILENAME

                        $r->{output_filenames} = \@output_filenames;
                        $r->{output_num_of_files} //= scalar(@output_filenames);
                    } # set output filenames

lib/App/CSVUtils.pm  view on Meta::CPAN

                    } else {
                        @input_filenames = ($util_args{input_filename} // '-');
                    }
                    $r->{input_filenames} //= \@input_filenames;

                  BEFORE_INPUT_FILENAME:
                    $r->{input_filenum} = 0;

                  INPUT_FILENAME:
                    for my $input_filename (@input_filenames) {
                        $r->{input_filenum}++;
                        $r->{input_filename} = $input_filename;
                        $r->{input_file_input_has_been_skipped} = 0;

lib/App/CSVUtils.pm  view on Meta::CPAN

                        if ($before_open_input_file) {
                            log_trace "[csvutil] Calling before_open_input_file handler ...";
                            $before_open_input_file->($r);
                            if (delete $r->{wants_skip_file}) {
                                log_trace "[csvutil] Handler wants to skip this file, moving on to the next file";
                                next INPUT_FILENAME;
                            } elsif (delete $r->{wants_skip_files}) {
                                log_trace "[csvutil] Handler wants to skip all files, skipping all input files";
                                last READ_CSV;
                            }
                        }

lib/App/CSVUtils.pm  view on Meta::CPAN

                                    log_trace "[csvutil] Calling on_input_header_row hook handler ...";
                                    $on_input_header_row->($r);

                                    if (delete $r->{wants_skip_file}) {
                                        log_trace "[csvutil] Handler wants to skip this file, moving on to the next file";
                                        next INPUT_FILENAME;
                                    } elsif (delete $r->{wants_skip_files}) {
                                        log_trace "[csvutil] Handler wants to skip all files, skipping all input files";
                                        last READ_CSV;
                                    }
                                }

lib/App/CSVUtils.pm  view on Meta::CPAN

                                    log_trace "[csvutil] Calling on_input_data_row hook handler (for first data row) ..." if $r->{input_rownum} <= 2;
                                    $on_input_data_row->($r);

                                    if (delete $r->{wants_skip_file}) {
                                        log_trace "[csvutil] Handler wants to skip this file, moving on to the next file";
                                        next INPUT_FILENAME;
                                    } elsif (delete $r->{wants_skip_files}) {
                                        log_trace "[csvutil] Handler wants to skip all files, skipping all input files";
                                        last READ_CSV;
                                    }
                                }

lib/App/CSVUtils.pm  view on Meta::CPAN

I<READING CSV DATA>

To read CSV data, normally your utility would provide handler for the
C<on_input_data_row> hook and sometimes additionally C<on_input_header_row>.

I<OUTPUTTING STRING OR RETURNING RESULT>

To output string, usually you call the provided routine C<< $r-E<gt>{code_print} >>. This
routine will open the output files for you.

You can also return enveloped result directly by setting C<< $r-E<gt>{result} >>.

I<OUTPUTTING CSV DATA>

To output CSV data, usually you call the provided routine C<< $r-E<gt>{code_print_row} >>.
This routine accepts a row (arrayref or hashref). This routine will open the
output files for you when needed, as well as print header row automatically.

lib/App/CSVUtils.pm  view on Meta::CPAN

Then, you can supply handler for C<on_input_header_row> and C<on_input_data_row>
as usual. To switch to the next file, set
C<< $r-E<gt>{wants_switch_to_next_output_file} >> to true, in which case the next call to
C<< $r-E<gt>{code_print_row} >> will close the current file and open the next file.

I<CHANGING THE OUTPUT FIELDS>

When calling C<< $r-E<gt>{code_print_row} >>, you can output whatever fields you want. By
convention, you can set C<< $r-E<gt>{output_fields} >> and C<< $r-E<gt>{output_fields_idx} >> to
let other handlers know about the output fields. For example, see the
implementation of L<csv-concat>.

 view all matches for this distribution


App-CamelPKI

 view release on metacpan or  search on metacpan

t/lib/App/CamelPKI/Test.pm  view on Meta::CPAN



=head1 EXPORTED FUNCTIONS

All functions described in this section factor some useful test
tactics and are exported by default.  The L</SAMPLE INPUTS> may also
be exported upon request.

=over

=cut

t/lib/App/CamelPKI/Test.pm  view on Meta::CPAN

                ("perl-Camel-PKI-Test-XXXXXX",
                 TMPDIR => 1, ($ENV{DEBUG} ? () : (CLEANUP => 1))));
    }
}

=head1 SAMPLE INPUTS

I<App::CamelPKI::Test> also provides a couple of constants and
class methods to serve as inputs for tests.  All such symbols are
exportable, but not exported by default (see L</SYNOPSIS>) and they
start with I<test_>, so as to be clearly identified as sample data in

 view all matches for this distribution


App-Caoliu

 view release on metacpan or  search on metacpan

lib/App/Caoliu/Downloader.pm  view on Meta::CPAN

    # get refvalue and reffvalue for post_form
    my $ua = Mojo::UserAgent->new( max_redirects => 5 );
    my $tx = $ua->get( $url => $headers );
    if ( my $res = $tx->success ) {
        my $html = $res->body;
        if ( $html =~ m/(<INPUT.+?name=['"]?ref['"]?.*?>)/gi ) {
            my $tmp = $1;
            $post_form->{ref} = $1
              if ( $tmp =~ m/(?<=value=)["']?([^\s>'"]+)/gi );
        }
        if ( $html =~ m/(<INPUT.+?name=['"]?ref['"]?.*?>)/gi ) {
            my $tmp = $1;
            $post_form->{reff} = $1
              if ( $tmp =~ m/(?<=value=)["']?([^\s>'"]+)/gi );
        }
    }

 view all matches for this distribution


App-Changelog2x

 view release on metacpan or  search on metacpan

lib/App/Changelog2x.pm  view on Meta::CPAN


This method is not generally intended for end-user utilization. It is bound
to the ChangeLogML namespace URI with the name C<credits> for use by the
XSLT processor.

=item transform_changelog INPUT, OUTPUT, STYLE [, PARAMS]

This method performs the actual transformation of ChangeLogML content. There
are three required parameters and one optional parameter:

=over 8

=item INPUT

This parameter must be either an open filehandle or a string containing the
ChangeLogML XML content to be transformed. If the value is not a reference,
it is assumed to be XML content.

=item OUTPUT

This parameter must be an open filehandle, to which the transformed XML
content is written. This may be any object that acts like a filehandle;
an B<IO::File> instance, the result of an C<open> call, etc.

 view all matches for this distribution


( run in 0.666 second using v1.01-cache-2.11-cpan-4e96b696675 )