Quote:
Originally posted by Xris718
Hi
I need to know how to do string comparisons in perl just like shell does. How do you convert the following into perl?
ie:
if [-n "$string"]; then
statement.....
if [-z "$string"]; then
statement...
if [$var -gt 0]; then
statement...
|
use to see if a string is empty or not
if ($string) { # string contains something
statement...
}
if (! $sting) { # string is emtpy
statement...
}
if ($var > 0 ) { #if variable is greater than 0, assuming is not a string
statement...
}