Category Archives: Perl

Perl function to remove any element using value validation

rajeshkumar created the topic: perl function to remove any element using value validation perl function to remove any element using value validation Not Working – my @items = (rajesh1, rajesh2,rajesh3,rajes4,rajesh5,rajesh7) my $index = 0; for my $value (@items) { print “testing $value\n”; if ( $value == “rajesh1” or $value == “rajesh2” or $value == “rajesh3”)… Read More »

Foreach Vs for Vs while in perl

rajeshkumar created the topic: foreach Vs for Vs while in perl Definition 1: In the while loop, Perl reads a line of input, puts it into a variable, and runs the body of the loop. Then, it goes back to find another line of input. But in the foreach loop, the line-input operator is being… Read More »

Commonly Used Sign- Punctuation and their Name in Perl

Commonly Used Sign- Punctuation and their Name in Perl ( => ) Comma Arrow  ( ‘ ’, “ ”, ‘ ‘, ” “ ) à Quotation marks ( $ ) àDollar sign ( ~ ) à Tilde ( % ) àPercent sign (  ,  ) à Comma ( @ ) à At Sign ( ; ) à Semicolon (… Read More »

How to Execute external commands by using perl?

There are many ways to execute external commands from Perl. The most commons are: system function exec function backticks (“) operator open function All of these methods have different behaviour, so you should choose which one to use depending of your particular need. In brief, these are the recommendations: method use if … system() you… Read More »

Difference between use and require in Perl – use Vs require in perl

|| use Vs require in perl || What is the difference between use and require? Except of course that use is evaluated at compile time where as require is evaluated at run time in other word, A use anywhere in the code will be evaluated when the code is run compiled, but require – import’s… Read More »

How to Check File Attributes in Perl ? Perl File Attributes explained

Checking File Attributes in Perl I have been using perl for quite some time now. I have also been using the file handling logic in my scripts. However, what I did not know till now is that you can quickly check for certain file properties in perl. Here is an example: #!/usr/bin/perl my (@description,$size); if (-e… Read More »

Introduction of Perl – Complete Overview

What is Perl Perl is a programming language, It’s Object Oriented, simple to learn and very powerful. Perl stand for: “Practical Extraction and Reporting Language”. Perl is an Interpreted language, so you don’t have to compile it like you do Java, C, C++ etc. For fast development work, that’s a godsend. Perl is a versatile,… Read More »