Perl:Simple Tests

From Progzoo
Jump to: navigation, search

A condition is a true/false value. You can use a condition in an if statement or a while statement. For numbers you can test using operators such as

==      Equal
!=      Not Equal
>       Greater than
<       Less than
>=      Greater than or Equal to
<=      Less than or Equal to

For strings you can test using operators such as

eq      Equal
ne      Not Equal
gt      Greater than
lt      Less than
ge      Greater than or Equal to
le      Less than or Equal to