in reply to Use of uninitialized value in open second time but not first.
The issue seems real. Consider:
use strict; use warnings; wibble (); wibble (); sub wibble { my $unicode16Str; open my $UTF, '>:encoding(UTF-16LE)', \$unicode16Str; print $UTF "Wibble"; close $UTF; }
Generates:
Use of uninitialized value in open at noname1.pl line 10.
for the second call. However changing my $unicode16Str; to my $unicode16Str = '';
runs clean. Making $unicode16Str global to the sub is also fine. A closure issue perhaps?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Use of uninitialized value in open second time but not first.
by blazar (Canon) on Jun 05, 2007 at 09:26 UTC | |
by GrandFather (Saint) on Jun 05, 2007 at 10:17 UTC |