On 7/27/10 Tue Jul 27, 2010 7:28 AM, "Sooraj S" <soorajspadmanab...@gmail.com> scribbled:
> I have a script which copies files from local machine to remote > machine. > parameteres : "-d" for directories, "-f" for files.. > > GetOptions ('d=s{,}' => \...@dir, > 'f=s{,}' => \...@fil); > > I want one more rename option "-r" which should be used only if "-d" > is specified ie only for directories... Please help me.. > Which Getopt module are you using? (there are 91 on CPAN). The syntax looks like Getopt::Long, but it is better to be sure. What is the logic for combining the -d and -r arguments? Can you give some examples? Obviously, the following will parse a -r option: GetOptions ('d=s{,}' => \...@dir, 'f=s{,}' => \...@fil, 'r=s{,}' => \...@rename, ); It is then up to you to apply the logic for combining the elements of @dir and @rename, taking into account the possible presence of -f arguments. To help further, we would need to know the logic involved. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/