Changes

Jump to navigation Jump to search
no edit summary
Perl is a free and open language, with a rich history, so you will find a wealth of information on the web to help you learn and use it.
 
==Sample Perl Code==
 
We wrote a couple of simple scripts together to get to grips with Perl.
 
The first was (save it in a file called Script1.pl in the root of your R drive):
 
print "Hello World";
 
To execute the script we can either open a command prompt and run the script:
Start->Run->"cmd.exe"
R:
perl Script1.pl
 
Or we can run it in command by going:
Debug->Go
 
(Under Preferences->Debugger tick the box to avoid being prompted by the debug dialog each time)
 
Or we can shell on to Bear and run it there:
Use PuTTY to connect to bear.haas.berkeley.edu (see [[Research Computing At Haas| here]].
perl Script1.pl
 
==Modules==
One of the joys of Perl is [http://www.cpan.org/ CPAN - The Comprehensive Perl Archive Network] which acts as repository for perl modules (as well as scripts, distros and much else). There are modules written by people from all over the world for almost every conceivable purpose. There is usually no need to reinvent the wheel in Perl - just grab a module (e.g. Wheel::Base)!
Anonymous user

Navigation menu