box-o-sand/perl-practice/cli/scalar_numbers.pl

31 lines
353 B
Perl

#!/usr/bin/perl
my $age = 30;
print "Hello $age year old.\n";
my $x = 10;
my $y = $x + 1;
print "Using a number $x + 1 = $y.\n";
$x = "10";
$y = $x + 1;
print "Using a string $x + 1 = $y.\n";
$x = "ten";
$y = $x + 1;
print "Using an English word, $x + 1 = $y.\n";
$x = "2ten";
$y = $x + 1;
print "Using a funny string, $x + 1 = $y.\n";
1;