PERL TUTORIAL PART 1
Saturday, February 27, 2010 | Posted By
Edy Wardoyo |
Edit Post
BASIC PERL LEARNING WITH EXAMPLE
1.\N NEW LINE
EXAMPLE :
$string = "hello world\n";
print"string";
result :
hello world
U must type with double quote between the word or sentence because if u use single quote it will produce like this
$string = 'hello world\n';
print"string";
result :
hello world\n
2.\t horizontal tab
example
$string = "\tHello World\n";
result:
hello world
it will produce hello world with more space, u must placed "\t" before the word to make a tab,
3.\a alert (will make a beep)
example
$string = "Hello World\a\n";
print"$string";
result
Hello World
it will make one beep on ur pc, but if u want make more than one beep u can add "\a" like this
$string = "Hello World\a\a\n";
print"$string";
it will make 2 beep on ur pc. u can placed "\a" before or after word
example
$string = "\aHello World\a\a\n";
print"$string";
it will make 3 beep.
4.\e escape character
example
$string = "\eHello World";
print"$string";
result
?Hello World
u can placed before and after the word
5.\f form feed
exmaple
$string = "\fHello World";
print"$string";
result
?Hello World
== - ==== - ===== - ======
1.\N NEW LINE
EXAMPLE :
$string = "hello world\n";
print"string";
result :
hello world
U must type with double quote between the word or sentence because if u use single quote it will produce like this
$string = 'hello world\n';
print"string";
result :
hello world\n
2.\t horizontal tab
example
$string = "\tHello World\n";
result:
hello world
it will produce hello world with more space, u must placed "\t" before the word to make a tab,
3.\a alert (will make a beep)
example
$string = "Hello World\a\n";
print"$string";
result
Hello World
it will make one beep on ur pc, but if u want make more than one beep u can add "\a" like this
$string = "Hello World\a\a\n";
print"$string";
it will make 2 beep on ur pc. u can placed "\a" before or after word
example
$string = "\aHello World\a\a\n";
print"$string";
it will make 3 beep.
4.\e escape character
example
$string = "\eHello World";
print"$string";
result
?Hello World
u can placed before and after the word
5.\f form feed
exmaple
$string = "\fHello World";
print"$string";
result
?Hello World
== - ==== - ===== - ======
Related Posts :