Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Parallel::ForkManager for any array

by toolic (Bishop)
on Oct 16, 2018 at 13:30 UTC ( [id://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]);
to:
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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-24 00:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found