PHP - Php/perl
Hey Guys,
is it possible to embed a .pl script in php Similar TutorialsHello dear Community, hello dear Andy I want to parse a site that is called the foundation-finder: My Perl knowledge is pretty small! I have tried various tutorials (examples of Mecha - that i have found on the CPAN) not oll of them work - some of them are broken! Now i try t o get some real-world-task! the Foundation-Finder-task has several steps: Especially interesting for me as a PHP/Perl-beginner is this site in Switzerland: http://www.edi.admin.ch/esv/00475/00698/index.html?lang=de&webgrab_path=http://esv2000.edi.admin.ch/d/entry.asp?Id=3221 which has a dataset of 2700 foundations. All the data are free to use - with no limitations copyrights on it. i mused about a starting-point: ould i use a Perl-module from CPAN and do the job with Perl.I guess that Mechanize or LWP could do a great job. Or HTML::Parser well - i am just musing which is the best way to do the job. Guess that i am in front of a nice learning curve. This task will give me some nice PHP or Perl lessions. Or can we do this with Python either!? I guess so! So here i am! So here is a sample-page for the real-world-task a governmental site in Switzerland: more than 2'700 foundations in http://www.edi.admin.ch/esv/00475/00698/index.html?lang=de&webgrab_path=http://esv2000.edi.admin.ch/d/entry.asp?Id=3221 can i do this with mecha!? love to get a hint thanks matz I'm not much of a perl person but this is troublesome.. I have a PHP script that I need to pass a variable to a perl script.. The perl script will generate something in a variable.. i then need to retrieve that generated variable to continue the rest of my PHP script. How to convert following perl scripts to php....
my ( $ServiceSet, $Service ); eval { $ServiceSet = Win32::OLE->GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\.\\root\\cimv2")-> ExecQuery("SELECT * FROM Win32_Service WHERE State=\"Running\""); }; unless ($@) { print "\n"; foreach $Service (in $ServiceSet) { print $Service->{Name}, "\n"; if( $Service->{Description} ) { print " $Service->{Description}\n"; } else { print " <No description>\n"; } print " Process ID: ", $Service->{ProcessId}, "\n"; print " Start Mode: ", $Service->{StartMode}, "\n"; print "\n"; } }Above code shows running services from win32_service that i`m taken from http://msdn.microsof...=vs.85).aspx... Please help.. i want to display running services and display it in table form??? Thank You... Hi. I've tried just about everything I can think of, but no success. Here's the perl I'm trying to convert: $socket = new IO::Socket::INET ( PeerAddr => 'localhost', PeerPort => 1500, Proto => 'tcp'); if ($socket->send("$token\n")) { $data = <$socket>; } Here's what I've currently got in PHP: $socket = fsockopen('localhost', 1500, $errno, $errstr); fwrite($socket, "$token\n"); $data = fread($socket, 1024); fclose($socket); I've confirmed the socket descriptor is populated and the fwrite is working. The fread just hangs. I've tried fputs/fgets in various combinations, but the read/get always hangs. Any ideas? Thanks very much, Rick I have done some googling, and am surprised that I cannot find any scripts anywhere that will convert a perl script to php! I have inherited a perl script that is quite large, but everything else on the site is php and I don't have time to either learn perl or go thru it line by line and convert it. At least if it was converted to php I could then fix the bugs for everything that did not work correctly! Anybody know of any scripts that will do this conversion? Thanks This topic has been moved to Other Programming Languages. http://www.phpfreaks.com/forums/index.php?topic=312147.0 |