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. -dave /*======================= House Absolute Consulting www.houseabsolute.com =======================*/