Avatar of CindyJones
CindyJones

asked on 

how to integrate perl in php

Hi .. i want to run the perl code from the php.. i've downloaded the PECL .. it all works fine .. but i dnt know how to run the above program using PECL .. it doesnt display anything in the browser ... or is there any other way of integrating perl and php...

Thank all...
use threads;
use threads::shared;
 
my $ping_output:shared = '';
 
my $ping_thread=threads->new(\&DoPing);
 
while(1) {
        sleep(1);
        print "********** ping_output:\n$ping_output\n";
}
 
 
sub DoPing {
        open(my $ping_fh, "ping 127.0.0.1|") or die "Could not start ping: $!\n";
        $ping_output .= $_ while(<$ping_fh>);
        close($ping_fh);
}

Open in new window

Perl

Avatar of undefined
Last Comment
Tobias

8/22/2022 - Mon