in reply to Foreach/While - Why does this run AFTER that?
open $hddfile, '<whateverfile'; binmode it; my $length = -s $hddfile; my $chunks = $length/ #divided by how ever many chunks you want my $num = #make this to the amount you divided the file into my $counter = 0; my $name = whatever; foreach (1 .. $num){ open $temp, '>', "$name$counter"; #should split up file based on +whatever size you want read $hddfile, my $buf, $chunks; #someone correct me it im wrong + haha print $temp, $buf; $counter++; } open $cmpfile, '<file to compare it with'; binmode it; my $length = -s $cmpfile; my $chunks = $length/ #divided by how ever many chunks you want my $num = #match to the division number my $counter = 0; my $name = whatever; foreach (1 .. $num){ open $temp, '>', "$name$counter"; #should split up file based on +whatever size you want read $hddfile, my $buf, $chunks; #someone correct me it im wrong + haha print $temp, $buf; $counter++ }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Foreach/While - Why does this run AFTER that?
by AnomalousMonk (Archbishop) on Oct 06, 2014 at 13:35 UTC | |
by james28909 (Deacon) on Oct 06, 2014 at 23:07 UTC | |
|
Re^2: Foreach/While - Why does this run AFTER that?
by CalebH (Acolyte) on Oct 06, 2014 at 12:42 UTC |