I set up a configuration file (example)
#do something
#(1=yes do something, 0=no don't)
#---------------------------------------
$varSomething = "0";
if ($varSomething) {big fun}
else {no fun at all}
Now, when I run this script it gives an error when the value is set to "0".
"...file did not return a true value at line blah"
Of course, I thought that was the whole point of 1 or 0. Any pointers?
In the mean time I simply changed the instructions to use 1=yes and 2=no and then used
if ($varSomething == "1") { } else { }
Any help is much appreciated...
Also, how do I do a "timer" for input? I have $inPut = <STDIN>; (and then what to do if yes or no, etc) but I'd like someway to kill the program if no input for 60 seconds or so.
#do something
#(1=yes do something, 0=no don't)
#---------------------------------------
$varSomething = "0";
if ($varSomething) {big fun}
else {no fun at all}
Now, when I run this script it gives an error when the value is set to "0".
"...file did not return a true value at line blah"
Of course, I thought that was the whole point of 1 or 0. Any pointers?
In the mean time I simply changed the instructions to use 1=yes and 2=no and then used
if ($varSomething == "1") { } else { }
Any help is much appreciated...
Also, how do I do a "timer" for input? I have $inPut = <STDIN>; (and then what to do if yes or no, etc) but I'd like someway to kill the program if no input for 60 seconds or so.