|
Search:
Advanced search
|
Browse by category:
|
Glossary | Contact Us |
Processing Command Line Options with PERL |
|||||
--- CODE #!/usr/bin/perl use Getopt::Long; # set default value for option $debug = 0; # get value of debug flag $result = GetOptions ("debug" => $debug); # print value print "Debug flag is $debug"; ---END CODE Now, try running this code as is: $ ./script.pl Debug flag is 0 And then try running it after adding a "--debug" command-line option: $ ./script.pl --debug Debug flag is 1 |
|||||
Comments
|
24 Apr, 2009
|
ProFessor
|
|
Мде, интересно... |
|
15 Apr, 2009
|
Компьютерщик
|
|
Спасибо за информацию. Успехов Вам! |
|
21 Jan, 2009
|
sz
|
|
Может ты и прав, но это как блкнот у меня, только для идей... |
|
25 Dec, 2008
|
Саша
|
|
Не хватает "use strict;use warnings;" - лучше поощрать хороший стиль. |
Powered by
KBPublisher (Knowledge base software)