Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Actually Your program runs, but is does not print anything.</p> <p>Example:</p> <pre><code>#!/usr/bin/perl use strict; use warnings; my $cmd = "cat"; `$cmd $0 | grep warning`; </code></pre> <p>Output: (nothing)</p> <hr> <hr> <p>Easiest to fix. Last line </p> <pre><code>print `$cmd $0 | grep warning` </code></pre> <p>Output:</p> <hr> <pre><code>use warnings; print `$cmd $0 | grep warning`; </code></pre> <hr> <p>If You need the exit code, replace last line with</p> <pre><code>my $exit = system("$cmd $0 | grep warning"); print $exit; </code></pre> <p>Output:</p> <hr> <pre><code>use warnings; my $exit = system("$cmd $0 | grep warning"); 0 </code></pre> <hr> <p>Or use open to process output:</p> <pre><code>open my $fh, "$cmd $0 | grep warning|" or die; while (&lt;$fh&gt;) { print $_; } close $fh; </code></pre> <p>Output:</p> <hr> <pre><code>use warnings; open my $fh, "$cmd $0 | grep warning|" or die; </code></pre> <hr> <p>But I could suggest something like bellow. Using AUTOLOAD the clearcase commands can be used as internal perl commands. </p> <pre><code>#!/usr/bin/perl use strict; use warnings; sub AUTOLOAD { (my $sub = $::AUTOLOAD) =~ s/.*:://; print "---\n"; system("time $sub @_"); print "---\n"; } my $cmd = "cat"; eval "$cmd($0)"; </code></pre> <p>Output:</p> <hr> <pre><code>--- #!/usr/bin/perl use strict; use warnings; sub AUTOLOAD { (my $sub = $::AUTOLOAD) =~ s/.*:://; print "---\n"; system("time $sub @_"); print "---\n"; } cat($0); 0.00user 0.00system 0:00.00elapsed 400%CPU (0avgtext+0avgdata 2112maxresident)k 0inputs+0outputs (0major+174minor)pagefaults 0swaps --- </code></pre> <hr>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload