Social Icons

Pages

Showing posts with label perl. Show all posts
Showing posts with label perl. Show all posts

Friday, 26 September 2014

Difference Between use and require in perl

This question is asked in many technical interviews which required knowledge of perl.

Require:

  1. Usage: require EXPR
  2. if EXPR is a numeric value, then script demands that i requires specified version of perl.
  3. if EXPR is not numeric, then i assumes that EXPR is name of file to be included in script.
  4. The included file must return true as last statement.

Perl Interview Questions

Below are some perl interview questions which will be usually asked in a technical interview:


  • Difference between my, local and our in perl.
  • Difference between use and require in perl.
  • Perl referencing and dereferencing.
  • write regular expression to test a string whether the string is proper IPv4 address or not.

Wednesday, 24 September 2014

Perl Arrays: push, pop, shift and unshift functions

Perl provides many functions to manipulate and access arrays. These functions makes it very easy to use perl arrays as stacks or queue's. Some of these functions are given below:

POP: 

pop function will remove and return last element of perl arrays. So, this can be used to remove element from stack if array is getting used as stack. pop function will return undef if array is empty