Ans : Easy to use and fast execution since perl script undergoes only two phases like compile phase and run phase.linux
Ans : Chop removes last character.
Chomp removes new line character.git
Ans : It is array having attributes and values.shell
Ans : By using Translation operator (tr///). Number of replacements can be obtained by assigning whole expression to scalar variable.express
Ans : open HANDLER, 「< filename」 or die $!;app
Ans : Only syntax differs.ide
Ans : List out the warnings if any in perl program.oop
Ans : "use" the controler will go to that file during run time and come back to original program at the same time if we consider the "require" the whole file will get copied at the place where it is required.ui
Ans : The variables declared with "my" can live only within the block it was defined.
The variables declared with "local" can live within the block and have its visibility in the functions called within that block.this
Ans : #! /usr/bin/perlspa
Ans : Compiler phase and Run phase.
Ans : $_
Ans : #! /usr/bin/perl -c
Ans : #! /usr/bin/perl -v
Ans : sprintf
Ans : chomp();
Ans : Ord();
Ans : QW is quote word which mainly used to avoid complexity in lists.
Ans : print ( map lc ,A,B,C);
Ans : Array is obtained by assigning list to variable.
Ans : Last index of an array.
Ans : By assigning an array to any scalar variables.
Ans : a. push = updates the values at the end of an array.
b. pop = takes out the last element of an array.
c. shift =takes out the first element of an array.
d. unshift = updates the values at the beginning of an array.
Ans : @num = (1,2,3,4,5);
@val = (6,7);
splice (@num ,4,0,@val);
Ans : Using {}
Ans : Using key words Keys and Values.
Ans : undef
Ans : delete
Ans : Bitwise and
Ans 「 =~」
Ans : a. last : used to exit from the statement block.
b. next : used to skip the rest of the statements block and start the next iteration.
c. redo : causes perl to restart the current statement block.
Ans : m// , s/// ,tr///
Ans : Through variable @_.
Ans : @_
Ans : Last successfully executed regular expression is used.
Ans : SEARCHLIST
Ans : By assigning this expression to another variable like
$count=($value=~tr/SEARCHLIST/REPLACEMENTLIST/)
Ans : Using c modofier
Ans : m/\metacharacter/
Ans : Matches any digit.
Ans : C
Ans : \s
Ans : \u changes next character to uppercase.
\U changes following characters to uppercase.
Ans : first one will look for W followed by something that is none of 'a' , 'o' , or 'i'
second one will matches at the begining of the line.
Ans : $1 = Testing, $2=T, $3=ing
Ans : Quantifiers says how many times something may match.
Ans : a
Ans : Assigning @ARGV to any scalar variables.
Ans : There we don't have a much difference between PERL and shell script.
As of my knowledge both are good in there own way of work environment.
As consern to speed & performance the PERL is a head of shell.
---Perl is very good at text processing like we have regular expressions.
---Shell scripts are mainly inteded for sys-admin tasks.
Ans : By writing linux command in `` operater.
Ans : $var = `setenv $VAR path `;
Ans : foreach (< HANDLER >) {
command1;
command2;
....... }
Ans : chdir(dir name); $var = `find . -type d -name 「*」 | tee list `;