jo5621 has asked for the wisdom of the Perl Monks concerning the following question:
I have two instance on my cfg file that I am already calling, but I want to take the second argument from my string (which is the password) decrypt it, with a variable we use within the organization and then connect into that instances to run a query which get some info, this is the piece of code I have so far and the format of the instances, user/password@instnace:
my %options=(); getopts("c:f:h",\%options); my $instance_file = $options{'f'} if defined ($options{f}); my $CollConnect=$options{'c'} if defined ($options{c}); my $CollTableName = 'CCPM_TABLE_SPACE_COLL'; my $DateOraFmt="'YYYYMMDD HH24:MI:SS'"; if (!open(INSTANCES,"$instance_file")) { Amoc::logit("Unable to open file: $instance_file"); } else { while(my $string_inst = <INSTANCES>){ chomp($string_inst); if($string_inst =~ /(.*)\/(.*)@(.*)/) { do { my $pass = (~/path DEC $2); print "$pass\n"; } } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Connecting to an instance after spliting it with a regexe
by Anonymous Monk on Jul 28, 2014 at 20:40 UTC | |
by jo5621 (Initiate) on Jul 28, 2014 at 21:18 UTC | |
by Anonymous Monk on Jul 28, 2014 at 22:02 UTC |