CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
How does this work ---> $NGetopt.pl

 



kturner
Deleted

Sep 5, 2000, 5:58 AM

Post #1 of 2 (476 views)
How does this work ---> $NGetopt.pl Can't Post

Here it is in context.

# Let newgetopt handle the command line options

require 'newgetopt.pl';
$com_chk=&NGetOpt("i=s","o=s");

# Set the target directory to the one specified in the command line.

$directory = $opt_i;


Thanks


japhy
Enthusiast / Moderator

Sep 5, 2000, 7:54 AM

Post #2 of 2 (476 views)
Re: How does this work ---> $NGetopt.pl [In reply to] Can't Post

You STILL HAVE NOT SHOWN US the code to newgetopt.pl. However, I can tell you how I believe it works.

NGetOpt() gets a list of strings, such as "X=Y", where X is the name of the option, and Y is the type of value the option gets. 's' is probably "scalar". When you do

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


# program called as: myprog -foo Jeff
$ok = NGetOpt("foo=s");
</pre><HR></BLOCKQUOTE>

NGetOpt() creates the variable $opt_foo, and gives it the value 'Jeff'.

I can't tell you any more than that.

Why don't you read the documentation for the file?

------------------
Jeff "japhy" Pinyan -- accomplished author, consultant, hacker, and teacher


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives