Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^2: Script to convert HBA WWNs to lowercase and add ":"[Updated]

by perl514 (Pilgrim)
on Dec 29, 2011 at 11:25 UTC ( #945487=note: print w/replies, xml ) Need Help??

in reply to Re: Script to convert HBA WWNs to lowercase and add ":"[Updated]
in thread Script to convert HBA WWNs to lowercase and add ":"[Updated]

Respected GrandFather,

Thank you once again for the updates. I will surely follow up on the valuable suggestions you have provided. As usual, your suggestions are loaded with stuff that's completely new to me, and some stuff seems quite dense to absorb at first go for a newbie like me. But without guidance of you great folks here at PerlMonks, this would be a very difficult journey. You took time out of the Chrismas Vacations to reply to my query, this fact itself speaks volumes of the ever helping nature of the PerlMonks.

I ran the code you provided and found that certain outputs were different. But thats ok, I will work through these.

Basically, I had put the validation in the IF loop and put the actual execution in the ELSE loop because, if I dont do that and enter 10:00:00:00:c9:ab:cd:ef in prompt "a" where a user is supposed to enter WWN without ":", then I get "10::0:0::00::0:0::c9::a:b::cd::e:f". Notice the "::". I wanted the script to check in the beginning itself if the input contains ":", or if input contains non hex characters or if the input characters are less or more than the number of WWN elements.

Similarly in option "b", if user enters a non hex WWN or a WWN that has anything else than Hex or ":", I wanted to throw an error message which is again why I have entered the checking part in the IF loop and the actual execution in the ELSE Loop

I never thought that programming in Perl will be so much fun...heck, now its sort of getting a little addictive, I keep thinking of ways to make my script better. Actually, its not a big deal for you guys to write scripts like these, but for me, this script means a lot. :)

Perlpetually Indebted To PerlMonks

  • Comment on Re^2: Script to convert HBA WWNs to lowercase and add ":"[Updated]

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://945487]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2018-05-28 03:22 GMT
Find Nodes?
    Voting Booth?