in reply to File operations "preview" mode?
You could generate a program.
push @ops, "rename(".text_to_perl_lit($file_from).", ".text_to_perl_li +t($file_from).");"; ... my $program = join '' map "$_\n", @ops; if ($preview) { print($program); } else { eval $program; }
Add error checking to liking. But that might make the preview unreadable. An alternative would be to provide your own operations.
sub xrename { if ($preview) { print(...); } else { rename(...); } } xrename(...);
|
|---|