Now you can do this:#!/usr/bin/perl -w use strict; use Getopt::Long; my ($username, $password); my $result = GetOptions("username=s" => \$username, "password=s" => \$password);
% myscript --username=foo --password=barAs a note, putting the password in the command line on a system which is not 100% your own is a really bad idea since this password will show up in the process listing table. Some programs actually mangle the $0 variable to hide this:
$0 =~ s/password=\S+/password=xxx/;But there still is a narrow window of opportunity where they might see it.
In reply to Re: Taking Input And Running In Script
by tadman
in thread Taking Input And Running In Script
by hostux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |