Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: Create a expression to cmpare a formal against a string

by learnP (Initiate)
on Nov 12, 2013 at 02:27 UTC ( [id://1062107]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Create a expression to cmpare a formal against a string
in thread Create a expression to cmpare a formal against a string

Updated what i am trying to achieve ; hope it explains Thanks for any help

  • Comment on Re^4: Create a expression to cmpare a formal against a string

Replies are listed 'Best First'.
Re^5: Create a expression to cmpare a formal against a string
by GrandFather (Saint) on Nov 12, 2013 at 02:52 UTC

    So at least show us samples of the two input files (or file and sample array contents), and what you expect to see as a result.

    You imply that you already have code that populates the array and maybe even a hash, so show us that code.

    As an aside, if you are so new to Perl, and I guess to programming generally, where did you learn words like hash, array, function and regex?

    True laziness is hard work

      New to perl not programming as such Anyways this is what I have written

      #!/sbin/perl -w use strict; use InCharge::session; # Input credentials for the connection to DOMAIN my $domain = 'IP'; my $user = 'admin'; my $passwd = "asdfgh"; my $broker= 'localhost:426'; my $session = ""; # Setting up the connection to console/domain manager.... $session = eval {InCharge::session->new( broker => $broker, domain => $domain, username => $user, password => $passwd) }; if($@){ print "Could not Connect to $domain \n......."; exit 2; } my $sourceDomainName=eval{$session->getServerName}; if($@){ print "Script Failed to get ServerName....Exiting the Script\n +"; exit 1; } print "Server is....... $sourceDomainName \n"; # Reading the Key Value from ini Files my @providerCloudSequence; open(my $iniFH, '<', '/tmp/user_defined_connection.ini') or die "Unabl +e to open file:$!\n"; while(<$iniFH>) { chomp; my @providerCloudClass=split('=',$_); push @providerCloudSequence,$providerCloudClass[0]; if($@){ print "Script Failed to get the Sequence....Exiting the Script +\n"; exit 1; } } my %idlcodes = map { split /=|\s+/; } <$iniFH>; if($@){ print "Script Failed to create the hash....Exiting the Script\ +n"; exit 1; } close $iniFH; <b> I get the file into hash and sequence (keys) into array as hash do +esnt follow sequence , idea is to use keys from array and get value f +rom hash and compare againt the instances i get below. Incharge sessi +on is a 3rd part API </b> my @networkAdapterInstances=$session->getInstances("NetworkAdapter"); for (my $index=0;$index<=$#networkAdapterInstances;$index++){ my $interfaceObject=$session->object("NetworkAdapter",$network +AdapterInstances[$index]); ( my $interfaceAlias,my $systemName,my $deviceID)=$interfaceOb +ject->get("InterfaceAlias","SystemName","DeviceID"); if($@){ print "Script Failed \n"; exit 1; } exit 1; print "$interfaceAlias \n"; }

        If I trim down your code to remove everything that seems peripheral to your question I'm left with ... nothing! Where is the "small (but complete) test program that just attempts the thing you are having trouble with"?

        Why are you making it so hard for us to help you? Maybe reading I know what I mean. Why don't you? will help you formulate a better question?

        True laziness is hard work

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-18 07:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found