TechFly has asked for the wisdom of the Perl Monks concerning the following question:
my @listaccountlocked = split("=", $accountlocked); if (chomp($listaccountlocked[1]) eq "True") { system("chuser account_locked='false' $username"); print(`lsuser -a account_locked $username`); } else { print("\nThe account $username is not locked\n\n"); }
In the code above (second line), I would like to use uc() and "TRUE" instead of relying on the OS to always respond in the correct case. Is there a way to do so without adding another variable? Whenever I try to add uc() in I get compilation errors, or I get the result of comping the variable. Probably a very simple thing, but I am at a loss.
Thanks be to the Monks who know.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Upper case and chomp
by wind (Priest) on Feb 09, 2011 at 20:58 UTC | |
|
Re: Upper case and chomp
by kennethk (Abbot) on Feb 09, 2011 at 21:01 UTC | |
by roboticus (Chancellor) on Feb 10, 2011 at 15:22 UTC | |
by kennethk (Abbot) on Feb 10, 2011 at 17:09 UTC | |
by ikegami (Patriarch) on Feb 10, 2011 at 19:12 UTC | |
by roboticus (Chancellor) on Feb 10, 2011 at 22:57 UTC | |
by hbm (Hermit) on Feb 10, 2011 at 16:12 UTC | |
by ikegami (Patriarch) on Feb 10, 2011 at 19:02 UTC | |
|
Re: Upper case and chomp
by TechFly (Scribe) on Feb 09, 2011 at 21:09 UTC |