in reply to $File::Fetch::WARN = 0; not working?

carp'd (which outputs to STDOUT, no?)

No, by default warn and Carp messages go to STDERR.

my code emits an error message

What error message exactly? That would help in grepping where in File::Fetch it's being generated.

the eval was added in as a suggestion to suppress the warning

eval only catches fatal errors, it does not stop things from being printed, including warnings.

First, I'd investigate where in the module the message is being generated and why the WARN flag isn't suppressing it. If the module doesn't provide a way to turn this message off, there may be some trickery necessary with a local $SIG{__WARN__} or other monkey patching. If the case were to be that I can't do anything about it, as a last resort one can use Capture::Tiny to catch any output from a block of code.

Replies are listed 'Best First'.
Re^2: $File::Fetch::WARN = 0; not working?
by jamroll (Beadle) on Sep 12, 2019 at 20:25 UTC
    okay, if $DEBUG_OP_ADD_COVER_PHOTO = 0, my server returns status: 500 and apache2 error log says: malformed header from script 'index.pl': Bad header: <br><br><br>

    the above error doesn't make sense, because nothing is being printed to STDOUT at this point

    if $DEBUG_OP_ADD_COVER_PHOTO = 1, I can then print the error given by File::Fetch: could not retrieve file: Command failed:

    this one just lacks information

    EDIT: Oh, i think i figured it out. omg, i feel so dumb. body of an if statement much further on is missing $output .= starthtml(); and thus, negates this whole issue. face palm with both hands, does walk of shame.
    I was pondering why the ball was getting bigger, and then...it hit me!