$| = 1; # set autoflush
sub processPics(){
$newDat='';
# read image dir to set @pics array
for (my $p=0; $p<@pics; $p++){
print "$pics[$p]
";
$img->read(file=>$baseURL.$type.'/'.$pics[$p],type=>'jpeg') or die $img->errstr();
$img->copy()->scale(xpixels=>750, qtype=>'preview')->write(file=>$baseURL.$type.'/medium/'.$pics[$p]) or die $image->errstr; # Write out an image as medium
$img->scale(ypixels=>150, qtype=>'preview')->write(file=>$baseURL.$type.'/thumbs/'.$pics[$p]) or die $image->errstr; # Resizes the medium before write out as thumbs
my $rot90 = $img->rotate(degrees=>-90);
$rot90->write(file=>$baseURL.$type.'/upright/'.$pics[$p]) or die $image->errstr; # Write out an image as medium
my @pic=split(/\./,$pics[$p]);
$newDat.=$pic[0].'|'; The dat data is stored as one continuous string separated with pipe (ie "amazing|beaver|biggus")
}
unless ($_ % 10){ print "
" }
}