Advertisement

07.28.2007 at 12:44PM PDT, ID: 22726540
[x]
Attachment Details

Perl script - output to display via PHP in a browser

Asked by Simon336697 in PHP Scripting Language, Perl Programming Language

Tags: perl, output, display, php, script

Hi guys!

I have the following Perl script that works fine.
What Id like to do with it is:

By utilizing my current perl code, use PHP to:
1) Build a form somehow where I could manually enter the name of the computer system list (instead of hard coding into my script..currently set to list.xt)
2) Click a Run button to execute the script
3) Write the output to a browser window, maybe in a 3 column window, eg. 1 for notexist.txt, 1 for olderthan2.txt", the other for recent.txt Here is the perl code:

----------------------------------------------------------------------------------- script.pl
#!/usr/bin/perl -w
use strict;
use warnings;

open(NOTEXIST, ">notexist.txt") or die "Can not create notexist: $!\n";
open(OLD, ">olderthan2.txt") or die "Can not create olderthan2: $!\n";
open(RECENT, ">recent.txt") or die "Can not create recent: $!\n";

open(LIST,"<list.txt") or die "Can not open list: $!\n";
while (my $server=<LIST>) {
      system("net use s: \\$server\ipc\$");
      if(!-e 's:\password.txt') {
            print NOTEXIST "$server doesnt exist\n";
      }
      elsif(-M 's:\password.txt' > 2) {
            print OLD "$server " . localtime( (stat('s:\password.txt'))[9] ) . "\n";
      }
      else {
            print RECENT "$server " . localtime( (stat('s:\password.txt'))[9] ) . "\n";
      }
}
close(LIST);
close(RECENT);
close(OLD);
close(NOTEXIST);

---------------------------------------------------------------------------------------------- End of script.

So, in the above, instead of displaying the results in:
open(NOTEXIST, ">notexist.txt") or die "Can not create notexist: $!\n";
open(OLD, ">olderthan2.txt") or die "Can not create olderthan2: $!\n";
open(RECENT, ">recent.txt") or die "Can not create recent: $!\n";

the results could appear in a browser.

Any help greatly appreciated.Start Free Trial
[+][-]07.28.2007 at 06:41PM PDT, ID: 19586663

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.28.2007 at 07:25PM PDT, ID: 19586791

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.28.2007 at 08:39PM PDT, ID: 19586936

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.28.2007 at 09:26PM PDT, ID: 19587021

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.29.2007 at 07:51AM PDT, ID: 19588200

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.29.2007 at 07:48PM PDT, ID: 19589940

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.29.2007 at 08:19PM PDT, ID: 19590025

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.29.2007 at 08:22PM PDT, ID: 19590027

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 07:17AM PDT, ID: 19592564

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 09:53AM PDT, ID: 19593868

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 09:59AM PDT, ID: 19593917

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 01:37PM PDT, ID: 19595539

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 01:48PM PDT, ID: 19595609

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 01:54PM PDT, ID: 19595652

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 02:01PM PDT, ID: 19595698

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 02:04PM PDT, ID: 19595715

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 02:09PM PDT, ID: 19595759

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 02:12PM PDT, ID: 19595776

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 02:13PM PDT, ID: 19595781

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 02:16PM PDT, ID: 19595801

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 02:24PM PDT, ID: 19595839

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 02:31PM PDT, ID: 19595872

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Scripting Language, Perl Programming Language
Tags: perl, output, display, php, script
Sign Up Now!
Solution Provided By: Adam314
Participating Experts: 4
Solution Grade: A
 
 
[+][-]07.30.2007 at 03:20PM PDT, ID: 19596187

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 03:32PM PDT, ID: 19596320

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 06:30PM PDT, ID: 19597183

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.30.2007 at 07:44PM PDT, ID: 19597431

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32