in reply to Re^2: A directory diff
in thread A directory diff
Btw, I just noticed that if you happen to pass neither decoration nor directory, $prefix will be undefined and you'll get warnings. Also, the sub is testing definedness of $dir, but the main program is passing an empty string in the last call — doesn't match up. All that considered, the sub should probably read
sub print_diff { my ( $decor, $dir, @filename ) = @_; my $prefix = ''; $prefix .= "$decor " if $opt_plain; $prefix .= "$dir " if defined $dir and length $dir; # awkward :-( print map "$prefix$_\n", @filename; }
That's what I get for not testing my code. :-)
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: A directory diff
by hsmyers (Canon) on Aug 27, 2004 at 14:29 UTC |