more scalar stuff with type conversion and a touch of raw variable printing
This commit is contained in:
parent
cd4a9fd937
commit
160f4b2330
8
cli/raw_printing.pl
Normal file
8
cli/raw_printing.pl
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
|
||||||
|
my $forename = "John";
|
||||||
|
my $message = "Hello ";
|
||||||
|
|
||||||
|
print $message;
|
||||||
|
print $forename;
|
||||||
|
print "\n";
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user