40 likes | 221 Views
Perl . A simple test. Test program. Download and install ActivePerl 5.14.2 (x86) Download and install notepad++ installer First perl program: hi .pl #!/ usr/bin/perl print "Hi my name is Denis and I am from CORK <br> “; print is reserved word “ “ string start and end
E N D
Perl A simple test
Testprogram • Download and install ActivePerl 5.14.2 (x86) • Download and install notepad++ installer • First perl program: hi.pl • #!/usr/bin/perl • print "Hi my name is Denis and I am from CORK \n “; • print is reserved word • “ “ string start and end • \n moves the cursor to next line • ; terminates each line (like a .) • Open notepad/notepad++ and type the above • Save file as hi.pl • Ensure that hide file extensions option is unchecked if using notepad. • Run via the command line start->cmd: opens the dos window. • Move to directory where you save the file and at the command prompt type: perl hi.pl
Output of “Hi” program Important: c:\Perlcode> is the folder I am storing my perl programs if you are storing them in a different location ensure you change the director to that location: c: (the drive) cdyourfolder
Exercise 1 • Write a perl program that will display the following: • My name is your name; e.g.Denis • I am from ; e.g. Cork • I am currently doing the DT249 course • This course is called …… • Run code (via commandline) to verify it works