2007/10/4, Ruprecht Helms <[EMAIL PROTECTED]>: > Hi, > > I get an errormessage that the global symbol ftp requires explicit > package name. This is my little script: > > #!/usr/bin/perl > > use strict; > use warnings; > > use Net::FTP; > $ftp = NET::FTP->new("<server>"); > $ftp->login("<user>","<password>"); > $ftp->cwd("/html"); > $ftp->get("wir_neu.html"); > > > > What have I todo? >
Hi, When you enable 'use strict' in script,all variables need to be declared before they're first used. Since you don't declare the variable $ftp before use it,you got that error. Just add a 'my' before the variable (where you first use it) to resolve the problem, my $ftp = NET::FTP->new("<server>"); -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/