in reply to Sending items to the windows recycle bin

I don't use MS Windows so can't judge the effectiveness of your script. This is just a comment on a couple of lines of your code.

my $paths = join "\0", @_; $paths .= "\0\0";

They could be condensed into one statement.

my $paths = join "\0", @_, "\0";

An example

johngg@aleatico:~$ perl -Mstrict -Mwarnings -E ' my @p = qw{ a b c }; my $p = join "\0", @p, "\0"; print $p;' | hexdump -C 00000000 61 00 62 00 63 00 00 |a.b.c..| 00000007

I hope this is of interest.

Update: Corrected typo slash to backslash, thanks to all who pointed it out.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: Sending items to the windows recycle bin
by CrashBlossom (Beadle) on Aug 11, 2023 at 20:53 UTC

    Thanks!