Last active
December 28, 2015 21:39
-
-
Save AndrewRussellHayes/7566311 to your computer and use it in GitHub Desktop.
Code to get the value of a switch (in this case the switch is a single line file with a boolean value on it)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $switchName = "Debug Switch"; | |
open($switchFileHandle,'<',$switchFile) || warn "cant open switch file $!"; | |
$switch = <$switchFileHandle>; | |
close($switchFileHandle); | |
chomp($switch); | |
if($switch){$switch = "ON";} | |
else{$switch = "OFF";} | |
$switchString = "$switchName($switch)"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment