<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1491" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=530280600-17102008><FONT face=Arial size=2>Hi 
guys,</FONT></SPAN></DIV>
<DIV><SPAN class=530280600-17102008><FONT face=Arial size=2>&nbsp;I'm seeing 
what I consider to be odd behaviour using Net::TFTP to copy some files to a 
remote machine. The part of the code giving me problems is 
this:</FONT></SPAN></DIV>
<DIV><SPAN class=530280600-17102008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=530280600-17102008><FONT face=Arial size=2>use strict;<BR>use 
warnings;<BR>use Net::TFTP;</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=530280600-17102008><FONT face=Arial size=2>my 
$ip="1.2.3.4";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# 
Insert IP address of your TFTP server here.&nbsp;&nbsp;&nbsp;<BR>my 
$tftp=Net::TFTP-&gt;new($ip);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>$tftp-&gt;put("file1", 
"file1") or print "Problem saving file1: 
".$tftp-&gt;error()."\n";<BR>$tftp-&gt;put("file2", "file2") or print "Problem 
saving file2: ".$tftp-&gt;error()."\n";<BR>$tftp-&gt;put("file3", "file3") or 
print "Problem saving file3: ".$tftp-&gt;error()."\n";<BR>$tftp-&gt;put("file4", 
"file4") or print "Problem saving file4: 
".$tftp-&gt;error()."\n";<BR></FONT></SPAN></DIV>
<DIV><SPAN class=530280600-17102008><FONT face=Arial size=2>If all 4 files 
exist, all is OK. However, if file3 does not exist, I get the 
following:</FONT></SPAN></DIV>
<DIV><SPAN class=530280600-17102008><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=530280600-17102008><FONT face=Arial size=2>&gt;perl 
tftp_test.pl<BR>Problem saving file3: file3: No such file or 
directory<BR>Problem saving file4: file3: No such file or 
directory</FONT></SPAN></DIV>
<DIV><SPAN class=530280600-17102008><FONT face=Arial 
size=2>&nbsp;</DIV></FONT></SPAN>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><SPAN class=530280600-17102008>Now, I can 
understand that the error message reported by $tftp-&gt;error() contains the 
last error encountered, ie that file3 doesn't exist, but there is no reason why 
copying file4 should fail, because it does exist. Worse still, file4 is created 
on the TFTP server, but is empty. So the non-existence of file3 is causing the 
copy of file4 to fail.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=530280600-17102008>Anyody care to 
comment on why?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=530280600-17102008>Should I be calling 
some other method in between put()'s?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=530280600-17102008>I considered just 
DESTROYing the object after each put(), and creating a new one, but that just 
seems wrong.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=530280600-17102008>I could of course 
test for the existence of each file first, but the docs for Net::TFTP indicate 
that the above should work, and I'd like to know what I'm 
missing.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV align=left>
<DIV align=left><FONT face=Arial 
size=2>Regards,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Leigh</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Leigh Sharpe<BR>Network Systems Engineer<BR>Pacific 
Wireless<BR>Ph +61 3 9584 8966<BR>Mob 0408 009 502</FONT></DIV>
<DIV><FONT face=Arial size=2>Helpdesk 1300 300 616<BR>email <A 
title=mailto:lsharpe@pacificwireless.com.au 
href="blocked::mailto:lsharpe@pacificwireless.com.au">lsharpe@pacificwireless.com.au</A><BR>web 
<A title=http://www.pacificwireless.com.au/ 
href="blocked::http://www.pacificwireless.com.au/">www.pacificwireless.com.au</A></FONT></DIV></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>