On the command line one can type:
perl -e "print 42"
perl -v
perl -V
Example 4-1. examples/intro/hello_world.pl
#!/usr/bin/perl use strict; use warnings; print "Hello world\n"; print 42, "\n";
On unix you can also make it executable: chmod u+x hello_world.pl and then run like: ./hello_world.pl
A couple of notes
Strings and numbers
Strings must be quoted, you can use special characters such as "\n"
The print statement (Output) - gets comma delimitered list of things
; after every statement
| Prev | Home (Copyright Gabor Szabo) Perl Training Israel | Next |
| Editors, IDEs | Up | Safety net |