my $dir = $vars{to_images}; ... my $err = $image->ReadImage("$dir/$_"); warn "$err" if $err;