note
ultranerds
Damn it - won't work :(
<code>#!/usr/bin/perl
# example paths can be:
# apachectl
# apache2ctl
# httpd
my $path = 'httpd';
print "Content-Type: text/html \n\n";
print "Perl: " . $] . "<br />";
my $output = `$path -v`;
my $output2 = system(qq|$path -v|);
print "OUTPUT: ($path -v) " . $output . "<br />";
print "OUTPUT 2: ($path -v, as system()) " . $output2 . "<br />";
my @split = split /:/, $output;
if ($split[1] !~ /\d\.\d\.\d/) {
print qq|Cant find Apache version <br />|;
} else {
print qq|$split[1] <br />|;
}
</code>
..yet all that gives is:
<code>Perl: 5.008004
OUTPUT: (httpd -v)
OUTPUT 2: (httpd -v, as system()) -1
Cant find Apache version
</code>
Seems that it doesn't like giving the results with `` or system().
Any suggestions?
TIA
Andy
721721
721915