1. Difference between the variables in which chomp function work?
Scalar: It is denoted by $ symbol. Variable can be a number or a string.Array: Denoted by @ symbol prefix. Arrays are indexed by numbers. The namespace for these types of variables is different. For Example: @add, $add. The scalar variables are in one table of names or namespace and it can hold single specific information at a time and array variables are in another table of names or namespace. Scalar variables can be even a number or a string
2. In Perl we can show the warnings using some options in order to reduce or avoid the errors. What are that options?
The -w Command-line option: It will shows the list if warning messages about the code.Strict pragma: It forces the user to declare all variables before they can be used using the () function.
Using the built-in debugger: It permits the user to scroll through the entire program line by line.
3. Can we load binary extension dynamically?
By statically assemble the extension or through system we can load binary extension dynamically.4. In Perl, there are some arguments that are used frequently. What are that arguments and what do they mean?
We can also use combination of these like:-wd
5. Which functions in Perl allows you to include a module file or a module and what is the difference between them?
“use”“require”
suppose we have a module file as “Module.pm” use Module; or require “Module.pm”; (Will do the same)
6. Which guidelines by Perl modules must be followed?
Below are guidelines and are not mandatory7. For a situation in programming, how can you determine that Perl is a suitable?
When we need faster execution, then Perl will provide us that requirement. There a lot of flexibility in programming if we want to develop a web based application. We do not need to buy the license for Perl because it is free. We can use Comprehensive Perl Archive Network, which is one of the largest depot of free code in the world.8. How many types of operators are used in the Perl?
Arithmetic operators +, – ,* Assignment operators: += , -+, *= Increment/ decrement operators: ++, — String concatenation: ‘.’ operator comparison operators: ==, !=, >, < , >= Logical operators: &&, ||, !
9. What is the use of -w, -t and strict in Perl?
The use –w is, it shows warnings about the possible interpretation errors in the script.Strict tells Perl to force checks on the meaning and usage of variables, which made the use strict command. If there are any unsafe commands in the script, this pragma stops the performance of the script instead of giving notice.
The use –t is, it switches on taint checking and forces Perl to check the origin of variables where outside variables cannot be used in sub shell executions and system calls