Sara has asked for the wisdom of the Perl Monks concerning the following question:
I am taking the -x and -e as optional , if the user provide them then I will copy a file to the location they provide otherwise nothing ,, but it seems not to work weather I provide or not the -x and -e ,, it always gives me#set the command line to accept a filename. my $ret = GetOptions ("u|updated:s", "x|XMLfile:s", "e|XLSfile:s"); my $update = $opt_u || die "Usage: $0 -u update_ID\n"; my $xmllocation = $opt_x || print ".xml report will be stored where th +e cxx is.\nuse -x location to choose a different location\n"; my $xlslocation = $opt_e || print ".xls sheet will be stored under $te +mpDir.\nuse -e location to choose a different location\n"; sub checkOption { if ( $xmllocation ne "" ) { system (qq(cp /nbsssbs/$subDir6/src/$dummyforexcel $xmllocation)); + } if ( $xlslocation ne "" ) { system (qq(cp $tempDir/$dummyforexcel.xls $xlslocation)); } } # check the user option for saving in different location checkOption(); }
what is it .. thankscp: cannot stat `/nbs/ppl/src/erls.cxx': No such file or directory cp: cannot stat `d:\\Profiles\\sara\\LOCALS~1\\Temp/erls.cxx.xml.xls': + N o such file or directory
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getopt problem
by Abigail-II (Bishop) on Jul 30, 2002 at 13:56 UTC | |
|
Re: Getopt problem
by fruiture (Curate) on Jul 30, 2002 at 14:18 UTC |