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"; } } } }
In reply to Connecting to an instance after spliting it with a regexe by jo5621
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |