1. Computing

Comparing two values in Perl

By December 30, 2011

Unless you know in advance exactly what values your Perl programs are going to deal with, then at some point you're going to need to test one value against another. For instance, you might want to display a simple "Continue? (Y/N)" message to your user. If they enter 'Y' you will perform some processing. If they enter 'N' your program should exit.

Perl uses comparison operators to achieve this. In this simple beginner tutorial Comparing Values in Perl we look at how you compare two values and direct program flow accordingly.

Comments are closed for this post.
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.