Hi, .assuming is non-mutating on Code objects:
my $subref = &some_sub; my $assumed_subref = $subref.assuming(:foo<bar>); $subref =:= &some_sub; # true, $subref did not change Quoting S06: > The result of a use statement is a (compile-time) object that also > has an .assuming method, allowing the user to bind parameters in > all the module's subroutines/methods/etc. simultaneously: > > (use IO::Logging).assuming(logfile => ".log"); So, .assuming mutates the Module/whatever objects. And, given the general trend to non-mutating methods (.wrap, .assuming), and the easiness of the .= operator, I'd propose making this kind of .assuming non-mutating, too: (use IO::Logging).assuming(logfile => ".log"); # noop (use IO::Logging).=assuming(logfile => ".log"); # works Opinions? --Ingo -- Linux, the choice of a GNU | To understand recursion, you must first generation on a dual AMD | understand recursion. Athlon! |