Learn PERL Basic with Me : First Script

Script 1


#!/usr/local/bin/perl

# Type your name

print "Enter Your Name \n";

$input = ;

print "Hi $input";

print "How are you today";

break the code

1. Line 1 is a special line that tells the system that this is a Perl program.

2. Line 3 is a comment line. '#' is the comment character and any line start with # will be ignored by the Perl interpreter.

3. Line 5 print is a library function that send data to the standard output file.

4. Line 7 STDIN is stand for standard input means the data you will enter and your entered data will be stored as $input.

5. Line 9 and 11 will finally print the output.
REMEMBER : All lines in scripts are ended with ';' sign.

No comments:

Post a Comment

Have Problem ?? Drop a comments here!