On 2/8/10, Chris Coggins wrote:
What is the proper syntax for a comparison at the end of a subroutine to
stop the script if a certain variable is "0" or ''?
sub routine{
(get data and process it)
if $varA = '' || $varA = "0" {
(stop script, print error message to user)
}
else{
(continue with script)
}
What is the proper syntax for a comparison at the end of a subroutine to
stop the script if a certain variable is "0" or ''?
sub routine{
(get data and process it)
if $varA = '' || $varA = "0" {
(stop script, print error message to user)
}
else{
(continue with script)
}
#code
}
else { #space after 'else'
#code
}