App-sh2p
view release on metacpan or search on metacpan
lib/App/sh2p/Here.pm view on Meta::CPAN
package App::sh2p::Here;
# I expect only one active here doc at a time,
# but I guess they could be in nested loops
# while read var1
# do
# while read var2
# do
# ...
# done << HERE
# ...
# HERE
# done << HERE
# ...
lib/App/sh2p/Parser.pm view on Meta::CPAN
error_out "Pipeline '@args' detected";
#my @caller = caller();
#print STDERR "analyse_pipeline: <@args><@caller>\n";
# Get commands, sometimes the | is separate, sometimes not
@args = split /\|/, "@args";
App::sh2p::Handlers::no_semi_colon();
# Let's make a guess. echo or print at the front usually means
# that the command which follows wants a string
if ($args[0] =~ s/^(echo |print )//) {
$end_value = shift @args;
}
for (my $i = 0; $i < @args; $i++) {
$args[$i] =~ s/^\s+//; # Strip leading whitespace
$args[$i] =~ s/\s+$//; # Strip trailing whitespace
if (! $args[$i] ) {
( run in 0.564 second using v1.01-cache-2.11-cpan-748bfb374f4 )