Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: (2) Waiting for an SQL script to finish

by monktim (Friar)
on Aug 26, 2003 at 20:34 UTC ( [id://286852]=note: print w/replies, xml ) Need Help??


in reply to Re: Waiting for an SQL script to finish
in thread Waiting for an SQL script to finish

Adding to Abigail-II'suggestion (and other monk's intuituon), you can also call your system's command line ftp program from perl the same way. Depending on what you're doing and what command line tools you have available, you may be able to do this in 4 lines. Abigail-II's system command executes shell stuff. I put backticks just to show another way to do it :)

I don't know about other dB's but MS SQL Server can do FTP and you won't even need Perl. If you happen to be using MS SQL Server, check out Data Transformation Services. Good luck.

use strict; use warnings; `isql -S server_name -U login_id -P password -d database -i file` `ftp -s:file ftp://user:password@ftp.site.com/`

Tim

Replies are listed 'Best First'.
Re: Waiting for an SQL script to finish
by Abigail-II (Bishop) on Aug 26, 2003 at 20:42 UTC
    I put backticks just to show another way to do it.

    You shouldn't have done that; it's bad advice. Backticks make Perl collect the output of programs run (which then gets discarded because you aren't doing anything with it). Furthermore, you aren't checking for any failures, just like with system, it's a good thing to test the value of $? after using backticks.

    In short, while you could use backticks instead of system, in most cases either system is the right approach, or backticks. There might be a rare case where both are correct, but I can't think of any.

    Abigail

      I agree. I just wanted to show TMTOWTDI :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://286852]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-28 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found