Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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>`

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2024-04-23 16:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found