Hung up on the Header

Posted on 2004-10-14
Last Modified: 2008-03-10
I don't even know if this will work this way (the FTP parts work OK), from the web. But I can't get past a 'Valid Header' message and I can't figure out why. I've messed at it for well over an hour.

Any help?


use CGI qw(:standard :shortcuts);

print "Content-type: text/html\n\n";
print "<head><title>Approve Page</title></head>\n";  
print "<html>\n";          
print "<body bgcolor=\"#FFFFFF\">\n";  
print "FTPing \n";  

ftp -i <<**
cd 'pa.test.poffacng'
lcd /export/ford/eccws7/u/mso/www.86.80/fcsd/psl/namer/ftp
mget  *

ftp -i <<**
cd w:/ftp/webtrans/downloads
lcd /export/ford/eccws7/u/mso/www.86.80/fcsd/psl/namer/ftp
mput  *.TXT *.txt
print "</body></html>\n";  
Question by:tmccar10
LVL 48

Accepted Solution

Tintin earned 50 total points
ID: 12312302
You can't just plonk random ftp commands in a Perl script, as you probably know by the errors you get, ie:

Unquoted string "ftp" may clash with future reserved word at line 10.
Ambiguous use of -i resolved as -&i() at line 10.
Use of bare << to mean <<"" is deprecated at line 10.
Semicolon seems to be missing at line 19.
Unquoted string "ftp" may clash with future reserved word at line 20.
Ambiguous use of -i resolved as -&i() at line 20.
Use of bare << to mean <<"" is deprecated at line 20.
syntax error at line 20, near "ftp "
Can't find string terminator "" anywhere before EOF at line 20.

To call FTP from a Perl script, either call a shell script with your ftp commands or use the Net::FTP module.

Author Comment

ID: 12312934
Thanks, as usual, Tintin-

Got plenty to think about.

I'm a learn-as-I go guy with perl. More go then learn, most times. I really didn't (don't) know what's possible and what's not because my knowledge is so spotty.  This'll be a help onseveral levels.

Got myself a hobby for a while.

Thanks again

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Perl - Mawk 2 96
git fat pull happens nothing in centos 6.3 python 2.6.6 33 217
rename outfile before writing 2 72
perl to convert excel to csv 3 210
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question