Subject: | truncate() function with bare filehandle fails |
Date: | Mon, 4 May 2020 11:23:03 +0000 (UTC) |
To: | bug-autodie [...] rt.cpan.org |
From: | Lata BL <lbennettleaver [...] yahoo.co.uk> |
Dear autodie maintainers,
Firstly, thank you very much for autodie - I use it a lot.
There is a problem when using autodie with truncate() with a bare filehandle name.
Here is some sample code
<< CODE
#!/usr/bin/env perl
use strict; use warnings;
use autodie;
open FH, '+<', './truncate-test-file';
seek FH, 0, 0;
truncate FH, 0;
close FH;
CODE >>
Generates this error...
Bareword "FH" not allowed while "strict subs" in use at ./truncate-test line 7.
Execution of ./truncate-test aborted due to compilation errors.
It works fine with a scalar (my $fh) filehandle.
uname -a output...
Linux 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:08:14 UTC 2014 i686 i686 i686 GNU/Linux
I've tried it with v5.18.2 (bundled with Lubuntu) and v5.30.2 (built under perlbrew).
best regards, mark