develooper Front page | perl.perl5.porters | Postings from November 2011

Re: RFC: Autoloading charnames

Thread Previous | Thread Next
Karl Williamson
November 23, 2011 06:52
Re: RFC: Autoloading charnames
Message ID:
On 11/23/2011 06:39 AM, Jesse Luehrs wrote:
> On Wed, Nov 23, 2011 at 01:17:20PM +0100, Johan Vromans wrote:
>> Jesse Luehrs<>  writes:
>>> I don't see why using a \N{} sequence should have any impact on what
>>> functions are available to use in my code.
>> Compare:
>>   $ perl -wE 'binmode STDOUT; warn File::Spec->catfile("foo","bar")'
>>   Can't locate object method "catfile" via package "File::Spec" (perhaps you forgot to load "File::Spec"?) at -e line 1.
>> with:
>>   $ perl -wE 'STDOUT->binmode; warn File::Spec->catfile("foo","bar")'
>>   foo/bar at -e line 1.
> Sure, I think that's confusing too.
> -doy

FWIW, I find this confusing as well, yet this is how things work today:

$ blead -E '
print charnames::viacode(0x41), "\n";

package foo {
     use charnames();

Loading charnames in a different scope, even package, enables use of the 
functions at a distance.

Does this fact change anyone's opinion?

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About