Dave Rolsky wrote:
> On Sat, 31 May 2003, Richard Evans wrote:
>
>> > No need to use if.pm really. Just do this:
>> >
>> > BEGIN {
>> > eval 'use utf8' if $] >= 5.006;
>> > }
>>
>> Yeah, I thought that should work, but I knocked up a quick test:
>>
>>
>> BEGIN
>> {
>> eval 'use warnings' if $] >= 5.006;
>> }
>>
>> use if $] >= 5.006, "warnings";
>>
>> print "Unitialised: ", $a, "\n";
>>
>>
>> If I comment out the 'use if' line, I don't get the expected "Use of
>> uninitialized value in print" warning, so I'm guessing the eval won't
>> work for the utf8 pragma either (scoping issue?).
>
> Yeah, it might be scoping. Easy enough to test. Just do:
>
> {
> use warnings;
> }
>
> print "uninit ", $a, "\n";
>
> And indeed, no warning. Guess you have to use if.pm. I wish it had a
> less ridiculous version number. I guarantee someone will balk at
> installing it because "the version number is too low" or something dumb
> like that. At least it comes with 5.8.0.
Having checked it a bit further, looks like it was just a case of manually
importing:
BEGIN
{
return unless $] >= 5.006;
use warnings;
warnings->import;
}
print "unitialised", $a, "\n";
And more interestingly, I just downloaded parrot and guess what - all the
ICU code and locales are there, so I'm guessing perl6 will use ICU as the
basis for its i18n.
That's great for the end user, but it's probably not worth me continuing
with my locale framework :(
Anyway, I'll continue with DateTime::Locale - at some point in the near
future I'd like to donate it to DateTime, would that be OK Dave?
Cheers,
Rich
--
Richard Evans
[EMAIL PROTECTED]