$xml->save($filename) or die "Couldn't save my xml data to $filename: $!"; #### # ... near the top: use Carp; # THIS NEEDS TO BE ADDED # ... sub save { my $this = shift ; my $file = shift ; if (-d $file || (-e $file && !-w $file)) { # NEED TO ADD THE "carp" CALL: carp "Unusable file name passed to XML::Smart->save ($file is a directory or read-only file)\n"; return ; } my ($data,$unicode) = $this->data(@_) ; my $fh; open( $fh, ">$file" ) or return; binmode( $fh ) if $unicode; print $fh $data or return; close $fh; # save() will return true if this succeeds, false otherwise }