Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Hung up on the Header

Posted on 2004-10-14
2
Medium Priority
?
205 Views
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?

Thanks

############################
#!/usr/local/bin/perl
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 <<**
open 19.59.28.51
cd 'pa.test.poffacng'
lcd /export/ford/eccws7/u/mso/www.86.80/fcsd/psl/namer/ftp
ascii
mget  *
bye
**

**
ftp -i <<**
open 19.91.168.247
cd w:/ftp/webtrans/downloads
lcd /export/ford/eccws7/u/mso/www.86.80/fcsd/psl/namer/ftp
ascii
mput  *.TXT *.txt
bye
**
##############
print "</body></html>\n";  
0
Comment
Question by:tmccar10
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 48

Accepted Solution

by:
Tintin earned 200 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 script.pl line 10.
Ambiguous use of -i resolved as -&i() at script.pl line 10.
Use of bare << to mean <<"" is deprecated at script.pl line 10.
Semicolon seems to be missing at script.pl line 19.
Unquoted string "ftp" may clash with future reserved word at script.pl line 20.
Ambiguous use of -i resolved as -&i() at script.pl line 20.
Use of bare << to mean <<"" is deprecated at script.pl line 20.
syntax error at script.pl line 20, near "ftp "
Can't find string terminator "" anywhere before EOF at script.pl line 20.


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

Author Comment

by:tmccar10
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
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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…
Six Sigma Control Plans

704 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