parkprimus has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use CGI qw(:standard); my $cgi = new CGI; $i = 0; $connect = 0; make_connection(); cut_connection(); sub make_html { use Spreadsheet::ParseExcel::Simple; print $cgi->header(); print $cgi->start_html('7513 Interface Descriptions'); print "<H1><center>7513 Interface Descriptions</H1>\n"; print "<Table border = 1>\n"; $xls = Spreadsheet::ParseExcel::Simple->read('/root/FLA_DHRS/S +HRHZ006/7513.xls'); foreach $sheet ($xls->sheets) { while ($sheet->has_data) { @data = $sheet->next_row; print " <tr>\n"; #print "@data\n"; foreach $element (@data) { if ($i <= 2) { print "<td><b><center>$element</td></b></cent +er>\n"; $i++; } else { print "<td><center>$element</t +d></ceneter>\n"; } } print " </tr>\n"; } } print end_html; } sub make_connection { if($connect eq 0) { system("/usr/local/bin/ncpmount -S server -A ip address -V /vol2/ISPSNC/PortAssignments -U username -P password /root/FLA_DHRS/SHRHZ006"); $connect = 1; } else { $connect = 0; error(); } if($connect eq 1) { make_html(); } } sub cut_connection { if ($connect eq 1) { system('ncpumount -S server'); } } sub error { print $cgi->header(); print $cgi->start('Error'); print "<center>"; print "<H2> Error: Could not connect to server </H2>"; print "Please Try again later"; print "<HR></center>"; print end_html; }
Retitled from "Racking My Brain!" by Chady
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: permission problems between commandline and CGI
by Abigail-II (Bishop) on Jan 27, 2004 at 22:54 UTC | |
|
Re: permission problems between commandline and CGI
by b10m (Vicar) on Jan 27, 2004 at 22:54 UTC | |
|
Re: permission problems between commandline and CGI
by borisz (Canon) on Jan 27, 2004 at 23:02 UTC | |
|
subtle details
by Anonymous Monk on Jan 28, 2004 at 01:26 UTC | |
|
Re: permission problems between commandline and CGI
by eoin (Monk) on Jan 27, 2004 at 23:12 UTC |