in reply to Re^4: Use of uninitialized value $pic
in thread Use of uninitialized value $pic

Moving onto my next problem.

As this question is unrelated to the rest of the thread, it'd have been better to post it in a new thread.

You don't need to construct a new Image::Magick over the argument passed to the subroutine. The normal way to handle arguments is (see perlsub):

sub ImageNotDark { my ($iutImage,$arg2,$arg3,...) = @_; # --OR-- my $iutImage = shift; my $arg2 = shift; ...

Or, if your intention were to work with a copy of the image in the subroutine, you could simply do my $imgCopy = $_[0]->Clone(); inside the subroutine.

Replies are listed 'Best First'.
Re^6: Use of uninitialized value $pic
by dazz (Beadle) on Apr 25, 2017 at 10:57 UTC
    Hello
    That is diamond advice.
    My Google search results had not found the perlsub doc and I found conflicting or/and confusing advice around handling objects passed to subs.
    I am sure this will be helpful to others. I will raise this as a separate question and include your answer for the benefit of others who hit the same problem.