view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
31323334353637383940414243444546474849my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
64656667686970717273747576777879808182@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
282930313233343536373839404142my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
and not
eval
{ blib->VERSION(
'1.01'
) };
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
545556575859606162636465666768my
$line
= <
$fh
>;
close
$fh
and skip(
"$file isn't perl"
, 1)
unless
$line
=~ /^
#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/;
my
@flags
= $1 ?
split
(
' '
, $1) : ();
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
@flags
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
and not
eval
{ blib->VERSION(
'1.01'
) };
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
44454647484950515253545556575859606162my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
77787980818283848586878889909192939495@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/01-commands.t view on Meta::CPAN
view all matches for this distribution
9101112131415161718
$result
->stdout,
qr{list the application's commands}
,
'default commands outputs'
);
is(
$result
->stderr,
''
,
'nothing sent to sderr'
);
is(
$result
->error,
undef
,
'threw no exceptions'
);
done_testing(3);
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
35363738394041424344454647484950515253my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
68697071727374757677787980818283848586@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
30313233343536373839404142434445464748my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
63646566676869707172737475767778798081@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
30313233343536373839404142434445464748my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
63646566676869707172737475767778798081@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
30313233343536373839404142434445464748my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
63646566676869707172737475767778798081@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
scripts/dex view on Meta::CPAN
251252253254255256257258259260261
run3 \
@cmd
, \
$in
, \
$out
, \
$err
;
=head1 DESCRIPTION
This module allows you to run a subprocess and redirect stdin, stdout,
and/or stderr to files and perl data structures. It aims to satisfy 99% of the
need for using C<system>, C<qx>, and C<open3>
with a simple, extremely Perlish API.
Speed, simplicity, and portability are paramount. (That's speed of Perl code;
which is often much slower than the kind of buffered I/O that this module uses
scripts/dex view on Meta::CPAN
537538539540541542543544545546547sub
run3 {
$run_call_time
= gettimeofday()
if
profiling;
my
$options
=
@_
&&
ref
$_
[-1] eq
"HASH"
?
pop
: {};
my
(
$cmd
,
$stdin
,
$stdout
,
$stderr
) =
@_
;
STDERR
"run3(): running "
,
join
(
" "
,
map
"'$_'"
,
ref
$cmd
?
@$cmd
:
$cmd
),
"\n"
if
debugging;
scripts/dex view on Meta::CPAN
554555556557558559560561562563564565566567568569570571572573
croak
"run3(): missing command"
unless
@_
;
croak
"run3(): undefined command"
unless
defined
$cmd
;
croak
"run3(): command ('')"
unless
length
$cmd
;
}
foreach
(
qw/binmode_stdin binmode_stdout binmode_stderr/
) {
if
(
my
$mode
=
$options
->{
$_
}) {
croak
qq[option $_ must be a number or a proper layer string: "$mode"]
unless
$mode
=~ /^(:|\d+$)/;
}
}
my
$in_type
= _type
$stdin
;
my
$out_type
= _type
$stdout
;
my
$err_type
= _type
$stderr
;
if
(
$fh_cache_pid
!= $$) {
# fork detected, close all cached filehandles and clear the cache
close
$_
foreach
values
%fh_cache
;
%fh_cache
= ();
scripts/dex view on Meta::CPAN
583584585586587588589590591592593594595596597598
my
$out_fh
= _fh_for_child_output
"stdout"
,
$out_type
,
$stdout
,
$options
if
defined
$stdout
;
my
$tie_err_to_out
=
defined
$stderr
&&
defined
$stdout
&&
$stderr
eq
$stdout
;
my
$err_fh
=
$tie_err_to_out
?
$out_fh
: _fh_for_child_output
"stderr"
,
$err_type
,
$stderr
,
$options
if
defined
$stderr
;
# this should make perl close these on exceptions
# local *STDIN_SAVE;
local
*STDOUT_SAVE
;
local
*STDERR_SAVE
;
scripts/dex view on Meta::CPAN
674675676677678679680681682683684die
$x
unless
$ok
;
_read_child_output_fh
"stdout"
,
$out_type
,
$stdout
,
$out_fh
,
$options
if
defined
$out_fh
&&
$out_type
&&
$out_type
ne
"FH"
;
_read_child_output_fh
"stderr"
,
$err_type
,
$stderr
,
$err_fh
,
$options
if
defined
$err_fh
&&
$err_type
&&
$err_type
ne
"FH"
&& !
$tie_err_to_out
;
$profiler
->run_exit(
$cmd
,
$run_call_time
,
$sys_call_time
,
scripts/dex view on Meta::CPAN
6936946956966976986997007017027037047057067071;
__END__
=head2 C<< run3($cmd, $stdin, $stdout, $stderr, \%options) >>
All parameters after C<$cmd> are optional.
The parameters C<$stdin>, C<$stdout> and C<$stderr> indicate how the child's
corresponding filehandle (C<STDIN>, C<STDOUT> and C<STDERR>, resp.) will be
redirected. Because the redirects come last, this allows C<STDOUT> and
C<STDERR> to default to the parent's by just not specifying them -- a common
use case.
scripts/dex view on Meta::CPAN
726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755
system
$cmd
;
(cf. L<perlfunc/
system
>
for
the difference and the pitfalls of using
the latter form).
=head3 C<$stdin>, C<$stdout>, C<$stderr>
The parameters C<$stdin>, C<$stdout> and C<$stderr> can take one of the
following forms:
=over 4
=item C<undef> (or not specified at all)
The child inherits the corresponding filehandle from the parent.
run3 \@cmd, $stdin; # child writes to same STDOUT and STDERR as parent
run3 \@cmd, undef, $stdout, $stderr; # child reads from same STDIN as parent
=item C<\undef>
The child's filehandle is redirected from or to the local equivalent of
C</dev/null> (as returned by C<< File::Spec->devnull() >>).
run3 \@cmd, \undef, $stdout, $stderr; # child reads from /dev/null
=item a simple scalar
The parameter is taken to be the name of a file to read from
or write to. In the latter case, the file will be opened via
scripts/dex view on Meta::CPAN
790791792793794795796797798799800801802=item an ARRAY reference
For C<$stdin>, the elements of C<@$stdin> are simply spooled to the child.
For C<$stdout> or C<$stderr>, the child's corresponding file descriptor
is read line by line (as determined by the current setting of C<$/>)
into C<@$stdout> or C<@$stderr>, resp. The previous content of the array
is overwritten.
my @lines;
run3 \@cmd, \undef, \@lines; # child writes into array
scripts/dex view on Meta::CPAN
804805806807808809810811812813814815816For C<
$stdin
>, C<
&$stdin
> will be called repeatedly (
with
no
arguments) and
the
return
values
are spooled to the child. C<
&$stdin
> must signal the end of
input by returning C<
undef
>.
For C<
$stdout
> or C<
$stderr
>, the child's corresponding file descriptor
is
read
line by line (as determined by the current setting of C<$/>)
and C<
&$stdout
> or C<
&$stderr
>, resp., is called
with
the contents of the line.
Note that there's
no
end-of-file indication.
my
$i
= 0;
sub
producer {
return
$i
< 10 ?
"line"
.
$i
++.
"\n"
:
undef
;
scripts/dex view on Meta::CPAN
822823824825826827828829830831832any form of concurrency between parent and child - run3()'s method of
operation is the same
no
matter which form of redirection you specify.
=back
If the same value is passed for C<$stdout> and C<$stderr>, then the child
will write both C<STDOUT> and C<STDERR> to the same filehandle.
In general, this means that
run3 \@cmd, \undef, "foo.txt", "foo.txt";
run3 \@cmd, \undef, \$both, \$both;
scripts/dex view on Meta::CPAN
840841842843844845846847848849850851852853854855856857858859860861862863864865866Currently the following
keys
are supported:
=over 4
=item C<binmode_stdin>, C<binmode_stdout>, C<binmode_stderr>
The value must a "layer" as described in L<perlfunc/binmode>. If specified the
corresponding parameter C<$stdin>, C<$stdout> or C<$stderr>, resp., operates
with the given layer.
For backward compatibility, a true value that doesn't start with ":"
(e.g. a number) is interpreted as ":raw". If the value is false
or not specified, the default is ":crlf" on Windows and ":raw" otherwise.
Don't expect that values other than the built-in layers ":raw", ":crlf",
and (on newer Perls) ":bytes", ":utf8", ":encoding(...)" will work.
=item C<append_stdout>, C<append_stderr>
If their value is true then the corresponding parameter C<$stdout> or
C<$stderr>, resp., will append the child's output to the existing "contents" of
the redirector. This only makes sense if the redirector is a simple scalar (the
corresponding file is opened in append mode), a SCALAR reference (the output is
appended to the previous contents of the string) or an ARRAY reference (the
output is C<push>ed onto the previous contents of the array).
scripts/dex view on Meta::CPAN
877878879880881882883884885886887=over 4
=item (1)
For each redirector C<$stdin>, C<$stdout>, and C<$stderr>, C<run3()> furnishes
a filehandle:
=over 4
=item *
scripts/dex view on Meta::CPAN
view all matches for this distribution
921922923924925926927928929930931C<run3()> restores the parent's C<STDIN>, C<STDOUT> and C<STDERR> saved in step (3).
=item (6)
If C<run3()> opened a temporary file for C<$stdout> or C<$stderr> in step (1),
it rewinds it and reads back its contents using the specified method (either to
a string, an array or by calling a function).
=item (7)
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
282930313233343536373839404142my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
545556575859606162636465666768my
$line
= <
$fh
>;
close
$fh
and skip(
"$file isn't perl"
, 1)
unless
$line
=~ /^
#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/;
my
@flags
= $1 ?
split
(
' '
, $1) : ();
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
@flags
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
33343536373839404142434445464748495051my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
63646566676869707172737475767778798081my
$line
= <
$fh
>;
close
$fh
and skip(
"$file isn't perl"
, 1)
unless
$line
=~ /^
#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/;
@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
31323334353637383940414243444546474849my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
64656667686970717273747576777879808182@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
31323334353637383940414243444546474849my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
64656667686970717273747576777879808182@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
30313233343536373839404142434445464748my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
63646566676869707172737475767778798081@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
31323334353637383940414243444546474849my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
64656667686970717273747576777879808182@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
lib/App/Diskd.pm view on Meta::CPAN
202203204205206207208209210211212die
"DiskWatcher needs info => ref argument\n"
unless
defined
(
$args
{info});
# by using package_states, POE event names will eq package methods
my
@events
=
qw(
_start start_child child_timeout got_child_stdout got_child_stderr
child_cleanup
)
;
my
$session
= POE::Session->create
(
package_states
=> [
$class
=> \
@events
],
lib/App/Diskd.pm view on Meta::CPAN
245246247248249250251252253254255$heap
->{child} = POE::Wheel::Run->new(
Program
=> [
$heap
->{program}],
StdioFilter
=> POE::Filter::Line->new(),
StderrFilter
=> POE::Filter::Line->new(),
StdoutEvent
=>
"got_child_stdout"
,
StderrEvent
=>
"got_child_stderr"
,
CloseEvent
=>
"child_cleanup"
,
);
$kernel
->sig_child(
$heap
->{child}->PID,
"child_cleanup"
);
# queue up the next run of this event
lib/App/Diskd.pm view on Meta::CPAN
view all matches for this distribution
313314315316317318319320321322323324325326327328
$info
->add_our_disk_info(
$uuid
,
$label
,
$device
);
# print "STDOUT: $_\n";
}
# Echo any stderr from the child
sub
got_child_stderr {
my
(
$heap
,
$stderr
,
$wheel
) =
@_
[HEAP, ARG0, ARG1];
my
$child
=
$heap
->{child};
my
$pid
=
$child
->PID;
warn
"blkid $pid> $stderr\n"
;
}
##
## The MountWatcher package will be responsible for periodically
## running mount to determine which of the known disks are actually
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
303132333435363738394041424344my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
565758596061626364656667686970my
$line
= <
$fh
>;
close
$fh
and skip(
"$file isn't perl"
, 1)
unless
$line
=~ /^
#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/;
my
@flags
= $1 ?
split
(
' '
, $1) : ();
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
@flags
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
44454647484950515253545556575859606162my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
77787980818283848586878889909192939495@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
303132333435363738394041424344my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
and not
eval
{ blib->VERSION(
'1.01'
) };
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
565758596061626364656667686970my
$line
= <
$fh
>;
close
$fh
and skip(
"$file isn't perl"
, 1)
unless
$line
=~ /^
#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/;
my
@flags
= $1 ?
split
(
' '
, $1) : ();
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
@flags
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
and not
eval
{ blib->VERSION(
'1.01'
) };
view release on metacpan or search on metacpan
t/cli/spin.t view on Meta::CPAN
view all matches for this distribution
69707172737475767778798081828384my
$count
= is_spin_output_tree(
$tempdir
,
$expected
,
'spin'
);
# Spin a file with warnings. The specific warnings are checked in
# t/spin/errors.t; here, we just check the rewrite of the warning.
my
$errors
=
$datadir
->child(
'errors'
,
'errors.th'
)->realpath();
my
$stderr
;
(
$stdout
,
$stderr
) = capture {
$docknot
->run(
'spin-thread'
,
"$errors"
);
};
like(
$stderr
,
qr{ \A \Q$0\E [ ] spin-thread : \Q$errors\E : 1 : }
xms,
'warnings are properly rewritten'
,
);
# Report the end of testing.
done_testing(
$count
+ 6);
view release on metacpan or search on metacpan
lib/App/Docker/Client.pm view on Meta::CPAN
view all matches for this distribution
402403404405406407408409410411*STDOUT
->autoflush(1);
my
$cv
=
$client
->attach(
'/containers/<container_id>/attach'
,
{
stream
=> 1,
logs
=> 1,
stdin
=> 1,
stderr
=> 1,
stdout
=> 1,
tail
=> 50 },
\
*STDIN
,
\
*STDOUT
);
$cv
->
recv
;
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
293031323334353637383940414243my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
if
(
@_warnings
)
{
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
525354555657585960616263646566my
$line
= <
$fh
>;
close
$fh
and skip(
"$file isn't perl"
, 1)
unless
$line
=~ /^
#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/;
my
@flags
= $1 ?
split
(
' '
, $1) : ();
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
@flags
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
# in older perls, -c output is simply the file portion of the path being tested
if
(
@_warnings
=
grep
{ !/\bsyntax OK$/ }
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
42434445464748495051525354555657585960my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
75767778798081828384858687888990919293@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
30313233343536373839404142434445464748my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
63646566676869707172737475767778798081@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
31323334353637383940414243444546474849my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
64656667686970717273747576777879808182@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
30313233343536373839404142434445464748my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
63646566676869707172737475767778798081@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
30313233343536373839404142434445464748my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
63646566676869707172737475767778798081@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
282930313233343536373839404142my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
545556575859606162636465666768my
$line
= <
$fh
>;
close
$fh
and skip(
"$file isn't perl"
, 1)
unless
$line
=~ /^
#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/;
my
@flags
= $1 ?
split
(
' '
, $1) : ();
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
@flags
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
282930313233343536373839404142my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
545556575859606162636465666768my
$line
= <
$fh
>;
close
$fh
and skip(
"$file isn't perl"
, 1)
unless
$line
=~ /^
#!\s*(?:\S*perl\S*)((?:\s+-\w*)*)(?:\s*#.*)?$/;
my
@flags
= $1 ?
split
(
' '
, $1) : ();
my
$stderr
= IO::Handle->new;
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
$inc_switch
,
@flags
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
view release on metacpan or search on metacpan
t/00-compile.t view on Meta::CPAN
30313233343536373839404142434445464748my
@warnings
;
for
my
$lib
(
@module_files
)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-e'
,
"require q[$lib]"
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-e'
,
"require q[$lib]"
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$lib loaded ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/
t/00-compile.t view on Meta::CPAN
view all matches for this distribution
63646566676869707172737475767778798081@switches
= (
@switches
,
split
(
' '
, $1))
if
$1;
close
$fh
and skip(
"$file uses -T; not testable with PERL5LIB"
, 1)
if
grep
{
$_
eq
'-T'
}
@switches
and
$ENV
{PERL5LIB};
my
$stderr
= IO::Handle->new;
diag(
'Running: '
,
join
(
', '
,
map
{
my
$str
=
$_
;
$str
=~ s/
'/\\'
/g;
q{'}
.
$str
.
q{'}
}
$^X,
@switches
,
'-c'
,
$file
))
if
$ENV
{PERL_COMPILE_TEST_DEBUG};
my
$pid
= open3(
$stdin
,
'>&STDERR'
,
$stderr
, $^X,
@switches
,
'-c'
,
$file
);
binmode
$stderr
,
':crlf'
if
$^O eq
'MSWin32'
;
my
@_warnings
= <
$stderr
>;
waitpid
(
$pid
, 0);
is($?, 0,
"$file compiled ok"
);
shift
@_warnings
if
@_warnings
and
$_warnings
[0] =~ /^Using .*\bblib/