view release on metacpan or search on metacpan
$rv;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
exit 2;
}
sub strip
{
my $self = do { local(@ARGV,$/)=($0); <> };
my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
$copy =~ s/^(?=\S+)/ /gms;
$self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
$self =~ s/^SKIP.*(?=^__DATA__)/SKIP
if (\@ARGV && \$ARGV[0] eq '--unstrip') {
view all matches for this distribution
view release on metacpan or search on metacpan
redland/rasqal/tests/rdql/testsuite/check-rdql view on Meta::CPAN
# Argument handling
my $usage=0;
while(@ARGV && $ARGV[0] =~ /^-(.+)$/) {
local $_=shift(@ARGV);
if(/^-d/) {
$debug=1;
} elsif (/^-s$/) {
if(!@ARGV) {
$usage=1;
view all matches for this distribution
view release on metacpan or search on metacpan
$rv;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
exit 2;
}
sub strip
{
my $self = do { local(@ARGV,$/)=($0); <> };
my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
$copy =~ s/^(?=\S+)/ /gms;
$self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
$self =~ s/^SKIP.*(?=^__DATA__)/SKIP
if (\@ARGV && \$ARGV[0] eq '--unstrip') {
view all matches for this distribution
view release on metacpan or search on metacpan
print " --- hint for $func ---\n", $hint;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Regexp/Debugger.pm view on Meta::CPAN
my $FROM_START = 0;
sub rxrx {
# Handle: rxrx <filename>
if (@_) {
local @ARGV = @_;
# If file is a debugger dump, decode and step through it...
my $filetext = do { local $/; <> };
my $dumped_data = eval { $JSON_decoder->($filetext) };
if (ref($dumped_data) eq 'HASH' && defined $dumped_data->{regex_ID} ) {
view all matches for this distribution
view release on metacpan or search on metacpan
print " --- hint for $func ---\n", $hint;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
view all matches for this distribution
view release on metacpan or search on metacpan
sub run_sudoku ($file) {
#
# First, slurp in the file
#
my $test = do {local (@ARGV, $/) = ($file); <>};
my @chunks = split /\n==\n/ => $test;
#
# First one is always the sudoku.
#
view all matches for this distribution
view release on metacpan or search on metacpan
$rv;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
exit 2;
}
sub strip
{
my $self = do { local(@ARGV,$/)=($0); <> };
my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
$copy =~ s/^(?=\S+)/ /gms;
$self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
$self =~ s/^SKIP.*(?=^__DATA__)/SKIP
if (\@ARGV && \$ARGV[0] eq '--unstrip') {
view all matches for this distribution
view release on metacpan or search on metacpan
t/Renard/Curie/App.t view on Meta::CPAN
} catch {
plan skip_all => "$_";
};
my $c = CurieTestHelper->get_app_container;
my $app = $c->app;
local @ARGV = ($pdf_ref_path);
$app->process_arguments;
like $c->main_window->window->get_title, qr/\Q$pdf_ref_path\E/, "Window title contains path to file";
undef $app;
};
subtest "Process no arguments" => sub {
my $app = CurieTestHelper->get_app_container->app;
local @ARGV = ();
lives_ok {
$app->process_arguments;
} 'Processes no arguments fine';
undef $app;
};
subtest "Process arguments for non-existent file" => sub {
my $non_existent_filename = File::Temp::tmpnam();
local @ARGV = ($non_existent_filename);
my $app = CurieTestHelper->get_app_container->app;
throws_ok {
$app->process_arguments;
} 'Renard::Incunabula::Common::Error::IO::FileNotFound', "Throws exception when file not found";
undef $app;
};
subtest "Process --help flag" => sub {
my $app = CurieTestHelper->get_app_container->app;
local @ARGV = qw(--help);
trap { $app->process_arguments; };
like( $trap->stdout, qr/--help/, 'Shows usage text' );
is( $trap->exit, 0, 'Exits successfully after call' );
undef $app;
};
subtest "Process --version flag" => sub {
my $app = CurieTestHelper->get_app_container->app;
local @ARGV = qw(--version);
trap { $app->process_arguments; };
like( $trap->stdout, qr/Project Renard Curie/, 'Prints full name of application' );
is( $trap->exit, 0, 'Exits successfully after call' );
undef $app;
};
subtest "Process --short-version flag" => sub {
my $app = CurieTestHelper->get_app_container->app;
local @ARGV = qw(--short-version);
trap { $app->process_arguments; };
chomp( my $version_or_dev = $trap->stdout );
note "Got version: $version_or_dev";
if( $version_or_dev =~ qr/^dev$/ ) {
pass( 'Prints out dev as version' );
view all matches for this distribution
view release on metacpan or search on metacpan
xt/cover.pl view on Meta::CPAN
chdir '..' or die "$!";
};
do "./Build.PL";
local @ARGV = (@ARGV, 'testcover');
do "./Build";
view all matches for this distribution
view release on metacpan or search on metacpan
$rv;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
exit 2;
}
sub strip
{
my $self = do { local(@ARGV,$/)=($0); <> };
my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
$copy =~ s/^(?=\S+)/ /gms;
$self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
$self =~ s/^SKIP.*(?=^__DATA__)/SKIP
if (\@ARGV && \$ARGV[0] eq '--unstrip') {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/Apache/Build.pm view on Meta::CPAN
. ". Using current time." );
return "" . time;
}
my ($version) =
grep { $_ = $1 if $_ =~ $regex; } eval { local (@ARGV) = ($file); <>; };
return $version;
};
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/Bundle.pm view on Meta::CPAN
my $meta_file = "META.yml";
if(-f "MYMETA.yml") { $meta_file = "MYMETA.yml"; }
if(-f $meta_file) {
my $yaml = eval { local(@ARGV, $/) = ($meta_file); $_=<>; $_; };
eval {
my $struct = Load($yaml);
push(@ret, $struct->{'configure_requires'});
push(@ret, $struct->{'build_requires'});
push(@ret, $struct->{'requires'});
lib/Rex/Bundle.pm view on Meta::CPAN
if(!$found) {
if(-f "Makefile.PL") {
no strict;
no warnings 'all';
my $makefile = eval { local(@ARGV, $/) = ("Makefile.PL"); <>; };
my ($hash_string) = ($makefile =~ m/WriteMakefile\((.*?)\);/ms);
my $make_hash = eval "{$hash_string}";
if(exists $make_hash->{"PREREQ_PM"}) {
push @ret, $make_hash->{"PREREQ_PM"};
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/CMDB/TOML.pm view on Meta::CPAN
for my $file (@files) {
Rex::Logger::debug("CMDB - Opening $file");
if ( -f $file ) {
my $content = eval { local ( @ARGV, $/ ) = ($file); <>; };
my $t = Rex::Config->get_template_function();
$content .= "\n"; # for safety
$content = $t->( $content, \%template_vars );
my ( $ref, $parse_error ) = from_toml($content);
lib/Rex/CMDB/TOML.pm view on Meta::CPAN
Rex::Logger::debug( "CMDB - Processing role '" . $role . "'" );
my $role_file = File::Spec->join( $self->{roles_path}, $role . '.toml' );
# if the file exists, load it
if ( -f $role_file ) {
my $content = eval { local ( @ARGV, $/ ) = ($role_file); <>; };
my $t = Rex::Config->get_template_function();
$content .= "\n"; # for safety
$content = $t->( $content, \%template_vars );
my ( $ref, $parse_error ) = from_toml($content);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/CMDB/YAMLwithRoles.pm view on Meta::CPAN
for my $file (@files) {
Rex::Logger::debug("CMDB - Opening $file");
if ( -f $file ) {
my $content = eval { local ( @ARGV, $/ ) = ($file); <>; };
my $t = Rex::Config->get_template_function();
$content .= "\n"; # for safety
$content = $t->( $content, \%template_vars );
my $ref;
lib/Rex/CMDB/YAMLwithRoles.pm view on Meta::CPAN
my $role_file = File::Spec->join( $self->{roles_path}, $role . '.yaml' );
# if the file exists, load it
if ( -f $role_file ) {
my $content = eval { local ( @ARGV, $/ ) = ($role_file); <>; };
my $t = Rex::Config->get_template_function();
$content .= "\n"; # for safety
$content = $t->( $content, \%template_vars );
my $ref;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/Endpoint/HTTP/Interface/Fs/Base.pm view on Meta::CPAN
if(! -f $path) {
die("File not found.");
}
my $content = eval { local(@ARGV, $/) = ($path); <>; };
return $content;
}
sub ln {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/TaskList/Gearman.pm view on Meta::CPAN
my $task = $self->get_task($task_name);
my @all_server = @{ $task->server };
my $client = Gearman::Client->new;
my $conf = eval eval { local(@ARGV, $/) = ("client.conf"); <>; };
if($@) {
print "Error parsing configuration file.\n";
print $@ . "\n";
CORE::exit 1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/JobControl/Helper/Project/Job.pm view on Meta::CPAN
$self->project->app->log->error(
"This job doesn't have an output.log file.");
return "No output.log found.";
}
my @loglines = eval { local ( @ARGV, $/ ) = ($logfile); <>; };
return \@loglines;
}
sub create {
lib/Rex/JobControl/Helper/Project/Job.pm view on Meta::CPAN
STEP: for my $s ( @{ $self->steps } ) {
if ( -f $self->project->project_path . "/next_server.txt" ) {
$srv = eval {
local ( @ARGV, $/ ) =
( $self->project->project_path . "/next_server.txt" );
<>;
};
chomp $srv;
unlink $self->project->project_path . "/next_server.txt";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/Repositorio/Server/Docker/Image.pm view on Meta::CPAN
else {
$self->_auth_upstream();
my $upstream_file = File::Spec->catfile( $image_dir, "endpoint.data" );
$self->app->log->debug("Looking for upstream file: $upstream_file");
if ( -f $upstream_file ) {
my ($upstream_host) = eval { local (@ARGV) = ($upstream_file); <>; };
$orig_file_url =~ s"^(http|https)://([^/]+)/"$1://$upstream_host/";
$self->app->log->debug("Rewrite Upstream-URL: $orig_file_url");
}
$self->proxy_to(
lib/Rex/Repositorio/Server/Docker/Image.pm view on Meta::CPAN
else {
$self->_auth_upstream();
my $upstream_file = File::Spec->catfile( $image_dir, "endpoint.data" );
$self->app->log->debug("Looking for upstream file: $upstream_file");
if ( -f $upstream_file ) {
my ($upstream_host) = eval { local (@ARGV) = ($upstream_file); <>; };
$orig_file_url =~ s"^(http|https)://([^/]+)/"$1://$upstream_host/";
$self->app->log->debug("Rewrite Upstream-URL: $orig_file_url");
}
$self->proxy_to(
lib/Rex/Repositorio/Server/Docker/Image.pm view on Meta::CPAN
else {
$self->_auth_upstream();
my $upstream_file = File::Spec->catfile( $image_dir, "endpoint.data" );
$self->app->log->debug("Looking for upstream file: $upstream_file");
if ( -f $upstream_file ) {
my ($upstream_host) = eval { local (@ARGV) = ($upstream_file); <>; };
$orig_file_url =~ s"^(http|https)://([^/]+)/"$1://$upstream_host/";
$self->app->log->debug("Rewrite Upstream-URL: $orig_file_url");
}
$self->proxy_to(
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/WebUI/Model/RexInterface.pm view on Meta::CPAN
}
sub _hacky_do_rexfile
{
my $filename = shift;
my $rexfile = eval { local(@ARGV, $/) = ($filename); <>; };
eval "package Rex::CLI; use Rex -base; $rexfile";
if($@) {
die("Error loading Rexfile: $@");
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Rex/CLI.pm view on Meta::CPAN
if ( $OSNAME !~ m/^MSWin/ ) {
if ( -f "$rexfile.lock" && !exists $opts{'F'} ) {
Rex::Logger::debug("Found $rexfile.lock");
my $pid = eval {
local ( @ARGV, $INPUT_RECORD_SEPARATOR ) = ("$rexfile.lock");
<>;
};
system(
"ps aux | awk -F' ' ' { print \$2 } ' | grep $pid >/dev/null 2>&1");
if ( $CHILD_ERROR == 0 ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Riji/CLI.pm view on Meta::CPAN
use String::CamelCase ();
sub run {
my ($self, @args) = @_;
local @ARGV = @args;
my @commands;
my $p = Getopt::Long::Parser->new(
config => [ "no_ignore_case", "pass_through" ],
);
$p->getoptions(
view all matches for this distribution
view release on metacpan or search on metacpan
print " --- hint for $func ---\n", $hint;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
view all matches for this distribution
view release on metacpan or search on metacpan
print " --- hint for $func ---\n", $hint;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
view all matches for this distribution
view release on metacpan or search on metacpan
$rv;
}
sub usage
{
my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
my %M = ( 'I' => '*' );
$usage =~ s/^\s*perl\s+\S+/$^X $0/;
$usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
print <<ENDUSAGE;
exit 2;
}
sub strip
{
my $self = do { local(@ARGV,$/)=($0); <> };
my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
$copy =~ s/^(?=\S+)/ /gms;
$self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
$self =~ s/^SKIP.*(?=^__DATA__)/SKIP
if (\@ARGV && \$ARGV[0] eq '--unstrip') {
view all matches for this distribution
view release on metacpan or search on metacpan
local/lib/perl5/Module/Build/Base.pm view on Meta::CPAN
return $package->resume;
}
sub current {
# hmm, wonder what the right thing to do here is
local @ARGV;
return shift()->resume;
}
sub _construct {
my ($package, %input) = @_;
local/lib/perl5/Module/Build/Base.pm view on Meta::CPAN
push @specs, $k . (defined $v->{type} ? $v->{type} : '');
push @specs, $v->{store} if exists $v->{store};
$args->{$k} = $v->{default} if exists $v->{default};
}
local @ARGV = @argv; # No other way to dupe Getopt::Long
# Get the options values and return them.
# XXX Add option to allow users to set options?
if ( @specs ) {
Getopt::Long::Configure('pass_through');
view all matches for this distribution