diff --git a/lib/Lacuna/CaptchaFactory.pm b/lib/Lacuna/CaptchaFactory.pm index 9ab82a6d..879b6137 100644 --- a/lib/Lacuna/CaptchaFactory.pm +++ b/lib/Lacuna/CaptchaFactory.pm @@ -256,9 +256,8 @@ sub construct { compress=> 1, ); - my $dir = '/home/lacuna/server/public/captcha/'; - open my $file, '>', $dir.'/'.$self->guid.'.png' or - die "Can't write to $dir/".$self->guid.".png: $!"; + my $filepath = '/home/lacuna/server/public/captcha/'.$self->guid.'.png'; + open my $file, '>', $filepath or die "Can't write to $filepath: $!"; print {$file} $image; close $file; $captchas->create({