more scalar stuff with type conversion and a touch of raw variable printing

This commit is contained in:
Dan Buch 2011-01-03 22:03:08 -05:00
parent cd4a9fd937
commit 160f4b2330
2 changed files with 31 additions and 2 deletions

8
cli/raw_printing.pl Normal file
View File

@ -0,0 +1,8 @@
#!/usr/bin/perl
my $forename = "John";
my $message = "Hello ";
print $message;
print $forename;
print "\n";

View File

@ -1,9 +1,30 @@
#!/usr/bin/perl #!/usr/bin/perl
use strict;
use warnings;
my $age = 30; my $age = 30;
print "Hello $age year old.\n"; 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; 1;