Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Regex for matching URLs with username/password and token

by jdporter (Paladin)
on Mar 10, 2025 at 20:22 UTC ( [id://11164217]=note: print w/replies, xml ) Need Help??


in reply to Re: Regex for matching URLs with username/password and token
in thread Regex for matching URLs with username/password and token

use Getopt::Long; for ( '--server api.blr-ocp1.lab.rbbn.com --username mgore --password ab +c123', '--server api.blr-ocp1.lab.rbbn.com --token kfjshdssahdvkbvjkbj', ) { local @ARGV = split; my( $server, $username, $password, $token ); GetOptions( 'server=s' => \$server, 'username=s' => \$username, 'password=s' => \$password, 'token=s' => \$token, ) or die; $server or die "--server is required\n"; $token && ($username || $password) and die "cannot provide --usern +ame or --password with --token\n"; ($username xor $password) and die "--username and --password must +be provided together\n"; $token || $username or die "must provide either --token or --usern +ame plus --password.\n"; if ($token) { } else # username+password { } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11164217]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2025-06-22 17:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.