"Paul \"LeoNerd\" Evans" <leonerd@leonerd.org.uk> writes: > Unclear from this discussion whether it was explicitly pointed out, but > one thing I'd like to see from the "keyword" functions is that they > *not* appear in the package's symbol table. > > It's annoying enough that when you do this > > package My::Class; > use Scalar::Util 'weaken'; > ... > > Then `weaken` is visible as a method: > > My::Class->weaken( ... ) > $myobj->weaken( ... ) > > It would be great if code could enable keyword-shaped operators like > "trim(med)?" and so on without adding massively to their exposed "API" > shape. It is possible to export subs (and other symbols) to the calling lexical scope, not just to the package. There are several modules that do this on CPAN, e.g. https://metacpan.org/pod/Lexical::Var. - ilmariThread Previous | Thread Next