Perl Program
Interpreted – program is a text filePortable – Unix, Mac OS X, Windows...
#!/usr/bin/perl -w
print "Hello world!\n";
Scalar Variables
Scalar: a number or stringSyntax: start with a $
Do not need to pre-declare variables
$x = 42;
$y = $x + 13;
$z = "hello";
undef and defined()
Variables are the value undef at first, use the defined() test
if (defined($z)) { ...
No comments:
Post a Comment