Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Parallel::ForkManager for any array

by toolic (Bishop)
on Oct 16, 2018 at 13:30 UTC ( #1224108=note: print w/replies, xml ) Need Help??

in reply to Parallel::ForkManager for any array

Tip #1 from the Basic debugging checklist: use warnings

You will see a warning message

Unquoted string "i" may clash with future reserved word at ...
You should change:
system ("rm", "-fr", $files[i]);
system ("rm", "-fr", $files[$i]);
If you use Tip #6 from the Basic debugging checklist (B::Deparse), you will see how Perl interprets your code:
system 'rm', '-fr', $files[0];

Replies are listed 'Best First'.
Re^2: Parallel::ForkManager for any array
by MissPerl (Sexton) on Oct 16, 2018 at 13:51 UTC
    Oh yes, what's wrong with me forgetting those strict and warnings. thank you !

    Oh it is the $i . great thanks much !! =D

    I could not test it now. but on a side note, in this case, let's say the directories have 8 files and 2 directories, does it mean it assign 8 children for 8 files and 2 children for 2 subdirectories?

    What if i have 11 files/subdirectories in the directory with only 10 forks, does the quickest child/process get the 11th ??

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2022-01-25 15:29 GMT
Find Nodes?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:

    Results (67 votes). Check out past polls.