--- lib/PXElator/file.pm 2009/09/20 15:47:54 437 +++ lib/PXElator/file.pm 2009/09/20 16:11:16 438 @@ -6,7 +6,7 @@ use File::Path qw//; use Data::Dump qw/dump/; -my $debug = 1; +my $debug = 0; sub mkpath { my $file = shift; @@ -39,17 +39,19 @@ # $content =~ s{[\n\r]*$}{\n}s; if ( $on_disk =~ s{([\s+]exit[\s\d]*)$}{\n$content\n$1}s ) { -# warn "# insert $file\n$on_disk"; + warn "# insert $file\n$on_disk" if $debug; write_file $file, $on_disk; } else { -# warn "# append $file\n$content\n"; + warn "# append $file\n$content\n" if $debug; open($fh, '>>', $file); print $fh $content; close($fh); } - carp "## append to $file"; + carp "## append to $file" if $debug; return -s $file; + } else { + warn "## $file not modified" if $debug; } }