programming-examples/perl/Statement/A program containing a simple example of an if statement.pl

9 lines
211 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/local/bin/perl
print ("Enter a number:\n");
$number = <STDIN>;
chop ($number);
if ($number) {
print ("The number is not zero.\n");
}
print ("This is the last line of the program.\n");