Ask a Question related to PERL Beginners, Design and Development.
-
Jeff Collins #1
How to take command line argument and use it to run an upgrade script.
I'm a perl newby.
I'm looking on taking a command line argument from
STDIN and use it for input to a script that upgrades
software. Any examples would be greatly appreciated.
Thanks
=====
Jeffrey T. Collins
[email]jtbaca@yahoo.com[/email]
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
[url]http://webhosting.yahoo.com/ps/sb/[/url]
Jeff Collins Guest
-
My Script to run a Command-Line from ASP does not work.
Hi, My Script to run a Command-Line from ASP does not work. No errors are returned either. It is on IIS. The directory where the script exists is... -
My Script to run a Command-Line from ASP does not work
Hi, My Script to run a Command-Line from ASP does not work. No errors are returned either. It is on IIS. The directory where the script exists is... -
[PHP] execute command line script from browser
Is there a way to execute a command line php script from a browser by, say clicking a button and then having the browser let go and let the script... -
How to use Command line argument --help or --debug ???
using getopts we can get the arguments like -h, -s etc... but how to get --help or --debug??? Any body knowing it...plz let me know asap Thnx... -
using a directory name as a command line argument
On Mon, 11 Aug 2003 19:31:26 -0700, Chad wrote: Check out @ARGV - Brian -
Dan Anderson #2
Re: How to take command line argument and use it to run an upgrade script.
On Thu, 2004-01-22 at 18:14, Jeff Collins wrote:
STDIN is already open when your perl script starts so you can read in> I'm a perl newby.
> I'm looking on taking a command line argument from
> STDIN and use it for input to a script that upgrades
> software. Any examples would be greatly appreciated.
from it by using:
my $variable = <STDIN>
And there are interfaces to curses, tk, and gtk if you feel like
creating a nice user interface.
Dan
Dan Anderson Guest
-
Wolf Blaum #3
Re: How to take command line argument and use it to run an upgrade script.
> I'm a perl newby.
me too:-) Right list, I assume.@ARGV holds your command line arguments.> I'm looking on taking a command line argument from
> STDIN and use it for input to a script that upgrades
> software. Any examples would be greatly appreciated.
call:
scriptname.pl Universe 42 douglas 'Zappod Beblebrox'
#! /usr/bin/perl
use strict;
use warnings;
print "You called me with ", scalar @ARGV, " Arguments.\n";
if (@ARGV) {
print " Param to script: $_\n" foreach (@ARGV);
}
Notice that there is a nice wa of processing command line args with the
getopt:: modules from CPAN.
Also take a look at perldoc perlvar for detailed info about @ARGV, ARGV and
$ARGV.
Hope that helps, Wolf
Wolf Blaum Guest
-
Drieux #4
Re: How to take command line argument and use it to run an upgrade script.
On Jan 22, 2004, at 3:39 PM, wolf blaum wrote:
[..]>
> call:
> scriptname.pl Universe 42 douglas 'Zappod Beblebrox'
>
> #! /usr/bin/perl
> use strict;
> use warnings;
> print "You called me with ", scalar @ARGV, " Arguments.\n";
> if (@ARGV) {
> print " Param to script: $_\n" foreach (@ARGV);
> }
My Compliments on a well done piece.
One of the stock modules most of us use is Getopt::Long
which is really good for the more complex command line optioning.
cf:
perldoc Getopt::Long
An Illustration:
<[url]http://www.wetware.com/drieux/pbl/perlTrick/CommandLine/[/url]
do_get_opt_long.txt>
ciao
drieux
---
Drieux Guest
-
Wolf Blaum #5
Re: How to take command line argument and use it to run an upgrade script.
OT:> My Compliments on a well done piece.
see, a logical problem I have with newsgroups is that you learn most (at least
I do) by trying to explain things you think you understood to others -
"beginning explainers" however make mistakes -
Thats of course not what you want in a newsgroup, since there is the one
asking, who is learning too, whom you dont want to confuse with "slightly
right" answers.
Nevertheless Im happy it seems this is a group were you can even learn how to
explain (and what the group-iquette is anyway).
Thanks for that,
Wolf
Wolf Blaum Guest
-
Drieux #6
The Challenge of Learning to Explain - Re: How to take command line argument and use it to run an upgrade script.
On Jan 22, 2004, at 5:56 PM, wolf blaum wrote:
[..][..]> Nevertheless Im happy it seems this is a group were
> you can even learn how to explain (and what the group-iquette is
> anyway).
Good point there.
A part of the struggle is always sort out what
the OP is really working with, and where are they
really trying to go with their idea. The only way
that a person can sort that out is by trial and error.
ciao
drieux
---
Drieux Guest



Reply With Quote

