in reply to CMD says files is closed when It should be open
choroba's file handle name advice is excellent. However, since you're wanting to place a file's entire contents into a string, you can use File::Slurp; to do this while avoiding file handles in the process. When using File::Slurp, you can replace this code segment:
open (DATA, $data); my @secdata = <DATA>; my ($str) = join "",@secdata; close(DATA);
With the following:
my $str = read_file $data;
Hope this helps!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CMD says files is closed when It should be open
by doctordoctor (Initiate) on Aug 21, 2012 at 20:57 UTC | |
by choroba (Cardinal) on Aug 21, 2012 at 21:21 UTC | |
by Kenosis (Priest) on Aug 21, 2012 at 21:45 UTC |