Join Our Email Alerts-Subscribe
Important Note:Login & Check Your Email Inbox and Activate Confirmation Link


Enter Your Email :

Copyright Disclaimer:
Section 107 of the Copyright Act Fair Use Contents .
We are forwarding content link(s) from our website to content website & We are not serving any contents.
Main Source:Google.com.All the Content PDF link(s) is/are obtained from GoogleSearch
for the purpose of Education & Teaching Intention. Not for commercial purpose.
Technicalsymposium.com is not liable/responsible for any copyright issues.

Perl Materials-Free Download



• Question 35. Which Has The Highest Precedence, List Or Terms? Explain?

Answer :

Terms have the highest precedence in perl. Terms include variables, quotes, expressions in parenthesis etc. List operators have the same level of precedence as terms. Specifically, these operators have very strong left word precedence. 

• Question 36. What Is Perl Scripting?

Answer :

Perl Scripting is one of the robust scripting languages in the IT market which is being used in “n” of fields. Perl is rich in finding Regular expressions and stands unique in all fields of application. 

PERL is a scripting language. Since all scripting languages are interpreter based languages but not compiler based languages, we use for optimization of code in all application. 

• Question 37. Why Do We Use Perl Scripting?

Answer :

We use PERL scripting because it is rich in all regular expressions and functional concepts, we can create our own rules to find out particular generalized pattern by using regular expression. PERL supports or compatible in almost 76+ Operating systems and supports more than 3000 modules, called as CPAN (Comprehensive Perl Archive Network) modules. 

• Question 38. What Is A Subroutine?

Answer :

Subroutine is perl is a block of code specially combined/grouped to perform a particular task.Which can be called at any point of time in a perl program. 

Advantage using Subroutine

a) helps in modular programming making it easier to understand and maintain.

b)eliminates duplication by reusing the same code/calling the subroutine.

• Question 39. Name An Instance You Used In Cpan Module?

Answer :

CGI, DBI etc are very common packages used from CPAN. there are thousands of other useful modules. 

• Question 40. I Have A Variable Named $objref Which Is Defined In Main Package. I Want To Make It As A Object Of Class Xyz. How Could I Do It? 

Answer :

use XYZ;

my $objref= XYZ->new();

• Question 41. What Is Meant 'die' In A Perl Program?

Answer :

If the condition defined before the DIE statement is NOT met, the script will stop execution at that point, printing out the default error, if a custom error message is not defined. 

• Question 42. What Is Hash In Perl?

Answer :

Hash in basically used to comment the script line.

A hash is and unordered set of key/value pairs that you access using strings (keys) as subscripts, to look up the scalar value corresponding to a given key. 

• Question 43. What Does This Mean : '$_' ?

Answer :

Default variable in Perl. 

Its an Default variable in Perl, where the input from the user will be taken into this variable if the variable is not defined by the user. 

• Question 44. What Is A Datahash(). What Does It Mean? And For What Purpose It Is Used??

Answer :

In Win32::ODBC, DataHash() function is used to get the data fetched through the sql statement in a hash format.

• Question 45. Explain About Returning Values From Subroutines (functions)?

Answer :

The return value of the subroutine is the value of the last expression evaluated or you can explicitly use a return statement to exit the subroutine specifying the return value. That return value is evaluated in the appropriate content depending on the content of the subroutine call. 

• Question 46. What Is Meant By A 'pack' In Perl?

Answer :

• Pack Converts a list into a binary representation

• Takes an array or list of values and packs it into a binary structure, returning the string containing the structure

• Hope that kills the problem

• Question 47. How Do You Connect To Database In Perl

Answer :

There is DBI module. use DBI;my $dbh = DBI->connect('dbi:Oracle:orcl', 'username', 'password',)where username and password is yours. This is example for oracle database. 

For Sybase: 

use DBI;

my $dbh = DBI->connect('dbi:Sybase:server=$SERVER', 'username', 'password')

• Question 48. What Is A Short Circuit Operator?

Answer :

The C-Style operator, ll, performs a logical (or) operation and you can use it to tie logical clauses together, returning an overall value of true if either clause is true. This operator is called a short-circuit operator because if the left operand is true the right operand is not checked or evaluated. 

• Question 49. How To Connect With Sqlserver From Perl And How To Display Database Table Info? 

Answer :

There is a module in perl named DBI - Database independent interface which will be used to connect to any database by using same code. Along with DBI we should use database specific module here it is SQL server. for MSaccess it is DBD::ODBC, for MySQL it is DBD::mysql driver, for integrating oracle with perl use DBD::oracle driver is used. IIy for SQL server there are available many custom defined ppm( perl package manager) like Win32::ODBC, mssql::oleDB etc.so, together with DBI, mssql::oleDB we can access SQL server database from perl. The commands to access database is same for any database. 

• Question 50. What Value Is Returned By A Lone Return; Statement?

Answer :

The undefined value in scalar context, and the empty list value () in list context. This way functions that wish to return failure can just use a simple return without worrying about the context in which they were called. 

• Question 51. How To Turn On Perl Warnings? Why Is That Important?

Answer :

Perl is very forgiving of strange and sometimes wrong code, which can mean hours spent searching for bugs and weird results. Turning on warnings helps uncover common mistakes and strange places and save a lot of debugging time in the long run. There are various ways of turning on Perlwarnings: * For Perl one-liner, use -w option on the command line. 

* On Unix or Windows, use the -w option in the shebang line (The first # line in the script). Note: Windows Perl interpreter may not require it. 

* For other systems, choose compiler warnings, or check compiler documentation.

• Question 52. Write A Script To Reverse A String Without Using Perl's Built In Functions?

Answer :

my $txt = 'Hello World';

my $len= length($txt);

my $rev;

while($len > 0){

$len--;

$rev .= substr($txt,$len,1);

}

print $txt, ' - Reversed = ' , $rev;

• Question 53. What Is Perl One-liner?

Answer :

There are two ways a Perl script can be run:

--from a command line, called one-liner, that means you type and execute immediately on the command line. You'll need the -e option to start like "C: %gt perl -e "print "Hello";". One-liner doesn't mean one Perl statement. One-liner may contain many statements in one line. 

--from a script file, called Perl program.

Source: Contents are provided by Technicalsymposium Google Group Members. 
Disclaimer: All the above contents are provided by technicalsymposium.com Google Group members. 
Further, this content is not intended to be used for commercial purpose. Technicalsymposium.com is not liable/responsible for any copyright issues.

Copyright Disclaimer:Section 107 of the Copyright Act Fair Use Contents .
We are forwarding content link(s) from our website to content website & We are not serving any contents. Main Source:Google.com.All the Content PDF link(s) is/are obtained from GoogleSearch for the purpose of Education & Teaching Intention. Not for commercial purpose. Technicalsymposium.com is not liable/responsible for any copyright issues.