http://www.perlmonks.org?node_id=1008061


in reply to error in printing output of Data::Dumper to file

It worked for me also (Perl v5.16.2). It would be helpful if you could post some of the surrounding code.

Lexical variables are preferred to bareword filehandles.

open my $fh5, ">>", "tagfile1" or die "Error: $!\n";

You may want to take a look at perldebtut and use the debugger to make sure your code is actually reaching the open / print statements as suggested by quester.

And as always,

use strict; use warnings;

Replies are listed 'Best First'.
Re^2: error in printing output of Data::Dumper to file
by prlusr (Initiate) on Dec 10, 2012 at 08:05 UTC
    Thanks , it worked after I changed my file handler from bareword to my $FH5