Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Processing command line based on user input

by PeterPeiGuo (Hermit)
on Nov 20, 2010 at 04:32 UTC ( [id://872635] : note . print w/replies, xml ) Need Help??


in reply to Processing command line based on user input

Search for Getopt and Getoptions::Long

A quick sample:

use Getopt::Std; use Data::Dumper; $options={}; getopt("df",$options); print Dumper($options);

Peter (Guo) Pei

Replies are listed 'Best First'.
Re^2: Processing command line based on user input
by iphone (Beadle) on Nov 20, 2010 at 05:01 UTC

    Running the above is giving the following output.Now how do I access these options and run my exe findfile? $VAR1 = { 'd' => 'C:\', 'f' => 'file.c' };

    #!/usr/bin/perl -w use strict; use warnings; `findfile.exe <opt_f> <opt_d>`