Quiet mode does nothing. It does not set anything or emit anything. So, one should use a combination of croak and try/catch.
$! _might_ be set by a failed open(), sysopen(), read(), rename() etc., but that does not guarantee you that any error causing a failure of write_file() will set any value whatsoever to $!. The value in $! in those cases would be whatever came from the failed call itself and wouldn't have any debug or other info from the File::Slurp module.
I explain Exceptions here:
https://metacpan.org/pod/Exceptions
Thanks,
Chase
On Wed May 06 10:47:30 2020, JSF wrote:
Show quoted text> Hello Chase,
>
> The hints regarding other modules like Path::Tiny, File::Slurper, and
> Mojo::File are valuable, but the main question has still remained
> without reply so I have a feeling that you overlooked it.
> That's why once again:
>
> If we want to avoid croak (for whatever reason) and thus call
> write_file in the quiet mode, can we be sure that the variable $!
> contains a proper error code / description in case of an I/O error?
>
> If yes, an additionla brief remark in the module description would be
> greatly appreciated!
>
> Thanks and Regards,
> JSF