[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



I am getting the error "use of uninitialized value" in line 29.

I include the source as an attachment.

I'm assuming coding subroutines and calling them with the necessary 
variables would work, but am hoping for something quicker and certainly 
dirtier. I'm not interested in being a Perl programmer, rather burning 
some CDs and have merely shot in the dark hoping for a hit, and have 
failed, of course   :-)

But, hopefully a competent programmer can take these scattered bones and 
quickly suggest a more painless remedy than learning Perl, for which I 
don't have time.

Appreciatively,
Courtney
-- 
s/v Mutiny
Rhodes Bounty II
lying Oriental, NC
WDB5619
-------------- next part --------------
#!/usr/bin/perl -w
# The purpose of this program is to assemble an optimally sized block
# [prescribed] of files for burning on a RomBurner, by traversing a 
# prescribed directory and sequentially moving files to another 
# prescribed directory until the prescribed block size is assembled 
# in the newly filled directory.
#
use File::Copy;
use File::stat;
use FileHandle;
use DirHandle;
$file="";	#1st file in source dir
$dir="";	#source dir
$mvdir="";	#new aggregated dir
$size=0;	#source file size
$chunk=0;	#file block size to be burned
$counter=0;	#cumulative total block size in aggregated dir
print ("Dir from which to Copy Files ?\n");
chomp ($dir=<STDIN>);
print ("Dir to which Files are Copied ?\n");
chomp ($mvdir=<STDIN>);
print ("What size [in bytes] File Block is to be Assembled ?\n");
chomp ($chunk=<STDIN>);
$dh=new DirHandle $dir;
opendir $dh, $dir; 
while($counter < $chunk)		{
	readdir($dir);
	($size)=(stat("$dir/$file"))[7];
	$counter = $counter + $size;
	if ($counter<$chunk)		{
		copy "$file","$mvdir/$file";
		unlink "$dir/$file";
	}
	else				{	
		print ("The cut-point is $file/$dir \n");
		closedir $dh;
	}
}


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00895.html">[ale] Squid setup</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00897.html">[ale] quick way to raise DTR on serial port?</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00970.html">[ale] Re: Squid setup</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00898.html">[SPAM] - [ale] &quot;use of uninitialized value&quot; error in Perl program	? - Bayesian Filter detected spam</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00896"><strong>Date</strong></a></li>
<li><a href="threads.html#00896"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>