Thank you for the reference, hippo, I was able to do a couple things that move my aspirations forward. I use a bash script to set the envelope conditions, wrap the perl upload, and wrap the output with monastery tags. It doesn't quite work but I get enough output to move forward.
---------env vars---- ... PATH=/kunden/homepages/9/d349337426/htdocs/perl5/bin::/usr/local/sbin: +/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin PERL5LIB=/kunden/homepages/9/d349337426/htdocs/perl5/lib/perl5:/home/b +ob/perl5/lib/perl5 PERL_LOCAL_LIB_ROOT=/kunden/homepages/9/d349337426/htdocs/perl5:/home/ +bob/perl5 PERL_MB_OPT=--install_base "/kunden/homepages/9/d349337426/htdocs/perl +5" PERL_MM_OPT=INSTALL_BASE=/kunden/homepages/9/d349337426/htdocs/perl5 PWD=/home/bob/1.scripts/pages XDG_SESSION_DESKTOP=ubuntu ---------bash driver---- #!/bin/bash # ... cd "perlmonks" cd "scripts" cd "cgi" echo "-------executing upload" | tee -a "$out" perl 2.sftp1.pl $1 | tee -a "$out" echo "-------cat uploaded file" | tee -a "$out" cat $1 | tee -a "$out" chmod 0755 $1 | tee -a "$out" echo "-------executing $1" | tee -a "$out" $1 | tee -a "$out" base_url="http://merrillpjensen.com/perlmonks/scripts/cgi" new_link= "$base_url/$1" echo "$new_link" | tee -a "$out" firefox $new_link & | tee -a "$out" exit $SUCCESS
Here is a listing of the uploaded file:
remote dir is /perlmonks/scripts/cgi . .. 1.color.cgi -------cat uploaded file #!/usr/bin/perl -wT use 5.011; use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); # declare the colors hash: my %colors = ( red => "#ff0000", green=> "#00ff00", blue => "#0000ff", black => "#000000", white => "#ffffff" ); # print the html headers print header; print start_html("Colors"); foreach my $color (keys %colors) { print "<font color=\"$colors{$color}\">$color</font>\n"; } print end_html; __END__
This is the result of the filename as a command:
-------executing 1.color.cgi Content-Type: text/html; charset=ISO-8859-1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-U +S"> <head> <title>Colors</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1 +" /> </head> <body> <font color="#000000">black</font> <font color="#ffffff">white</font> <font color="#00ff00">green</font> <font color="#0000ff">blue</font> <font color="#ff0000">red</font> </body> </html>
And this completes the goal I had for this thread, to upload and execute a perl CGI script. Thanks all for comments,
In reply to Re^4: using perl on server side for secure connections
by Aldebaran
in thread using perl on server side for secure connections
by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |