in reply to Re^3: Is require still required?
in thread Is require still required?
If it would be unreliable, it should fail sometimes - but it doesn't, ....
I am pretty sure that Toby meant "unreliable" as in "the return value depends on whether that file had already been required before".
Let me expand his example a bit:
use strict; use warnings; use autodie; use File::Temp qw/ tempfile /; use Data::Dump; my ($fh, $filename) = tempfile(); print $fh qq('Hello, world';\n); close $fh; my $first = require $filename; dd $first; my $second = require $filename; dd $second;
Output:
"Hello, world" 1
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^5: Is require still required?
by shmem (Chancellor) on Feb 03, 2024 at 11:07 UTC | |
by choroba (Cardinal) on Feb 03, 2024 at 20:04 UTC | |
by LanX (Saint) on Feb 03, 2024 at 21:29 UTC |