Warning using copy from File::Copy 
Author Message
 Warning using copy from File::Copy

Hi all

I do a foreach loop in an array with file names, for each one i have
to copy to some other place, but after the 2nd interarion of the loop
i get the following message :

Use of uninitialized value at /usr/lpp/ssp/perl5/lib/File/Copy.pm line
84.

However, all files get copied with no major problems...

But how can i avoid that message ????
I dont want users buggin me, etc....

This is the code line to copy :

copy ($it_file, $dest_dir) || die "Nao foi possivel copiar o arquivo
$it_file : $!" ;

thnx in adv

Nomade



Sat, 07 Feb 2004 01:14:00 GMT  
 Warning using copy from File::Copy

Quote:

> Hi all

> I do a foreach loop in an array with file names, for each one i have
> to copy to some other place, but after the 2nd interarion of the loop
> i get the following message :

> Use of uninitialized value at /usr/lpp/ssp/perl5/lib/File/Copy.pm line
> 84.

> However, all files get copied with no major problems...

> But how can i avoid that message ????

It is a warning hence you could add a signalhandler for that.

$SIG{__WARN__} = sub { }; # will make them vanish

see 'perldoc -q undefined.*variables' for a bit on that.

Tassilo

--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->

(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108


ord(chr($h->{$_}))))};



Sat, 07 Feb 2004 07:10:26 GMT  
 Warning using copy from File::Copy

Quote:

> > Hi all

> > I do a foreach loop in an array with file names, for each one i have
> > to copy to some other place, but after the 2nd interarion of the loop
> > i get the following message :

> > Use of uninitialized value at /usr/lpp/ssp/perl5/lib/File/Copy.pm line
> > 84.

> > However, all files get copied with no major problems...

> > But how can i avoid that message ????

> It is a warning hence you could add a signalhandler for that.

> $SIG{__WARN__} = sub { }; # will make them vanish

> see 'perldoc -q undefined.*variables' for a bit on that.

> Tassilo

Thnx Tassilo,

It worked with no problems..
I think i get this message bcoz the old version of perl im usin...

Nomade



Sun, 08 Feb 2004 14:09:10 GMT  
 Warning using copy from File::Copy

Quote:

> It worked with no problems..
> I think i get this message bcoz the old version of perl im usin...

Not sure. I heard that 5.6.0 was throwing particularly many warnings.
Allegedly this got better with 5.6.1.

By the way: If your script is not supposed to be portable, you could use
system instead of File::Copy. I guess it would be quicker than the
File::Copy module.

system "cp $file $destination" && warn "Something did not work";
Tassilo

--
$a=[(74,116)];$b=[($a->[1]-1,$a->[1]++,0x20)];$c=[(97,110)];$d=[($c->

(chr($_)):print;}}$c=sub{$l=shift;[(0x20+$l-1,0x50,0x65,0x73-0x01,108


ord(chr($h->{$_}))))};



Sun, 08 Feb 2004 14:18:08 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Using File::Copy and Sockets to copy public files from http addresses

2. File::Copy, copying files problem.

3. Semantics of File::Copy::copy(,)

4. File::Copy warning

5. File::Copy warning

6. warning from File::Copy

7. unwanted UNIX file permissions after using File::Copy::syscopy

8. proposal : Data::Copy for copying perl variables

9. how to copy values from a file into a oracle-table using DBI

10. File::Copy from NT to Unix using UNC

11. How to copy files using system( ) in a Perl script

12. Using system( ) command to copy files

 

 
Powered by phpBB® Forum Software