Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run Net::FTP in background ? 1

Status
Not open for further replies.

MoshiachNow

IS-IT--Management
Joined
Feb 6, 2002
Messages
1,851
Location
IL
HI,

What would be the syntax (use fork ?) for running the following block of commands in backgroud :

$ftp = Net::FTP->new("$REMOTE_HOST",Debug => 0) or die "Cannot connect to $REMOTE_HOST: $@";
$ftp->login('username','password') or die "Cannot login ", $ftp->message;
$ftp->cwd("/dataVolumes/$LARGEST") or die "Cannot change working directory ", $ftp->message;
$ftp->put("100MB") or die "get failed ", $ftp->message;
$ftp->quit;


Long live king Moshiach !
 
[URL unfurl="true" said:
http://www.unix.org.ua/orelly/perl/learn/ch14_04.htm[/URL]]
Code:
if (!defined($child_pid = fork())) {
    die "cannot fork: $!";
} elsif ($child_pid) {
    # I'm the parent
} else {
    # I'm the child
}

- Andrew
Text::Highlight - A language-neutral syntax highlighting module in Perl
also on SourceForge including demo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top