#!/usr/bin/perl use warnings; use strict; print "Enter a for lowercase and colons. b to do it the other way around. q to quit "; my $choice = 0; my $wwn = 0; chomp ($choice = ); if ($choice eq "a") { until ( $wwn eq "q") { print "Enter the wwn or q to quit: "; chomp ($wwn=); if ($wwn=~m/:/g) { print "WWN already contains :\n"; exit; }#closing for if ($wwn=~m/:/g) elsif (length($wwn)!=16) { print "Invalid WWN Length\n"; exit; }#closing for elsif (length($wwn)!=16) else { my @wwn = unpack ("(a2)*", lc($wwn)); @wwn = join (":", @wwn); print "@wwn\n"; } #closing for lowering case and adding : in wwn. }#closing for until ( $wwn eq "q") }#closing for if choice =a elsif ($choice eq "b") { until ($wwn eq "q") { print "Enter the wwn with : or q to quit: "; chomp ($wwn=); $wwn =~ s/://g; print lc($wwn), "\n"; } #closing for until ($wwn eq "q") }#closing for if choice =b elsif ($choice eq "q") { exit; }#closing for elsif ($choice eq "q")