Keep in mind I am currently just working on this one. It'll be pretty basic So you decided to chose perl Perl is great for those who want to learn php since php was based off perl Part one Hello World and other intro stuff Ok so how do I code perl. Easily enough you can use notepad to code it. after you type your code click file save as select all file types and the name should be x.pl. To run the program open command prompt type cd the directory the perl script is in press enter. now type perl x.pl.(where x is the name of the pl file) After you open up notepad put this code in Code (Text): #!/usr/local/bin/perl All perl scripts need it it specifies where the perl interpreter is. After you add that type Code (Text): print 'Hello World' ; It wasn't that hard was it. Now lets try something different like accepting user input. Variables do not need to be defined before you have them equal sometime so lets have the variable $name be what the user inputs. Now lets make a whats your name Code (Text): #!/usr/local/bin/perl #comments come after a # # asks the user whats there name print 'What is your name? ' ; $name = <> ; print "Hello $name" ; As you know from before the program put on the command line what is your name. The line $name = <> meant that the variable $name is equal to what the user inputer on the command line. NOTE: I am just learning Perl so If I messed something up tell me
This looks good. I always need things to be nice and basic when I start off. I'm going to watch this so I can come back later and try some PERL for myself! What does php mean?
Hi Just a couple of things I want to point out: 1) Use warnings! Use strict! These are pragmatic modules which will slap you if you do something horribly wrong, which in the end results in better code. So really, each script should start out with: Code (Text): #!/usr/bin/perl # (Or whatever the path to perl is) use warnings; use strict; ---- PHP is another programming language, aimed primarily at making small websites.