in reply to Inexplicable uninitialized value when using (?{...}) regexp construct.

After running a number of tests ($_ vs "$_" vs global vs my for the argument. my vs our for the locals, <DATA> vs qw(), while vs foreach vs foreach var) I narrowed down when it fails: It always fails on the second and subsequent time it's called. I don't know why, though.

my $my_var = '11100000'; print bin_to_dec($my_var), "\n"; # succeeds print bin_to_dec($my_var), "\n"; # fails! __END__ 224 Use of uninitialized value in print at a line 11.

I used v5.8.0 built for i386-freebsd. $^N was only introduced in 5.8.0, btw

  • Comment on Re: Inexplicable uninitialized value when using (?{...}) regexp construct.
  • Download Code