Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Sending items to the windows recycle bin

by johngg (Canon)
on Aug 11, 2023 at 20:32 UTC ( [id://11153834]=note: print w/replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11153834]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2025-11-11 14:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (68 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.