box-o-sand/PracticingPerl/cli/scalar_numbers.pl

31 lines
353 B
Perl
Raw Normal View History

2011-01-04 02:58:26 +00:00
#!/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";
2011-01-04 02:58:26 +00:00
1;