in reply to Blessing object changes array attribute into array of arrays?
It must be in how you're inspecting the object, because $self->{log_lines} should be a reference to a single array. But if that's the actual code you're posting, then the code won't do what you want anyway, because you're using references to the global variable @log_lines, and so all your objects will reference the same array instead of getting a new array.
You should be using the strict pragma and change your code to read
... local *LOG_FILE; open LOG_FILE, '<', $fullpath or die "Couldn't open logfile '$fullpath': $!"; my @log_lines = <LOG_FILE>; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Blessing object changes array attribute in array of arrays?
by mclow (Initiate) on Jul 06, 2005 at 14:07 UTC | |
by Corion (Patriarch) on Jul 06, 2005 at 14:13 UTC |