Hi Guys
I was wondering if you could help me.
I have a perl program, get_ice_cream_descriptions.pl, that accepts 2
arguments
For example,
get_ice_cream_descriptions.pl 1 10
However, I would like to get ice cream descriptions for other ranges at the
same time, such as 11 - 20, 21 - 30, 31 - 40, 41 - 50 etc
I could write an external file that contains the following :
get_ice_cream_descriptions.pl 1 10 &
get_ice_cream_descriptions.pl 11 20 &
get_ice_cream_descriptions.pl 21 30 &
get_ice_cream_descriptions.pl 31 40 &
get_ice_cream_descriptions.pl 41 50 &
This way I could execute the perl code in parallel and eventually get the
descriptions.
Instead of using the above method, I would prefer to write some code in
get_ice_cream_descriptions.pl accept different number ranges and launch
itself.
I have been looking at the fork() command.
I believe fork() only creates a copy of the original process but I wasn't
quite sure how I could pass the different number ranges into the perl code
before it forks itself.
Any advice would be appreciated.
Many Thanks
Tony