Perl

26K

Solutions

10K

Contributors

Perl is a high-level, general-purpose, interpreted, dynamic programming languages with over 25 years of development. Perl 5 runs on over 100 platforms from portables to mainframes and is suitable for both rapid prototyping and large-scale development projects.  Perl gained widespread popularity as a Common Gateway Interface (CGI) scripting language, in part due to its regular expression and string parsing abilities. In addition to CGI, Perl is used for graphics programming, system administration, network programming, finance, bioinformatics, and other applications.

Share tech news, updates, or what's on your mind.

Sign up to Post

My shop runs a series of scripts for database tasks.  Need a Perl snippet to add to my existing script.  We want to make sure that users are not connected to the database prior to starting some maintenance task.  Believe I want to query v$session view and determine if there are users, other than the "oracle" user currently connected.  So, disregarding the "oracle" user .... I could determine if the count is greater than zero??  Please provide a perl code example.  BTW, I'm not using the Perl DBI.
0
Receive 1:1 tech help
LVL 12
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Hi, Dear Experts
I've made a simple script with two calls to the CURL command:

#!/usr/bin/perl

# open(FD_IN, "<STDIN") || die "Errore apertura standard input";

while (<STDIN>) {
	$Riga = $_;
	$Riga =~ s/\n//;
	$Riga =~ s/\r//;
	@Campi = split("\t", $Riga);

		
	system("curl -X POST  -H \"Content-Type: application/xml\" \"https://api-eu.hosted.exlibrisgroup.com/almaws/v1/bibs/".$Campi[2]."/holdings/".$Campi[1]."/items/".$Campi[0]."?op=scan&library=PETFS&department=BIB1PETFSCATFLO&work_order_type=CATFLO&done=true&apikey=xxx\"\n");
	system("curl -X POST  -H \"Content-Type: application/xml\" \"https://api-eu.hosted.exlibrisgroup.com/almaws/v1/bibs/".$Campi[2]."/holdings/".$Campi[1]."/items/".$Campi[0]."?op=scan&library=PETFS&circ_desk=DEFAULT_CIRC_DESK&done=true&apikey=xxx\"\n");

	$cntRecord++;
}

# close(FD_IN);

Open in new window



The script runs as:
perl script.pl<input.csv>output.txt
I need a quick way -inside the script- for formatting the CURL output registered on output.txt

Thanks a lot,

Fabiano
0
I am having the below parameters called in from a command line and using the param $timeparm in my script.  

my ($db, $user, $pw, $wkdir, $firstday, $lastday, $timeparm)  = @ARGV;

Open in new window


The script has a condition check based on  value of $timeparm and the outfile generated has a concatenation and writing the file to a  ooutput directory "outdir".

However, the code snippet below gives an error on Line 9 states as
"global symbol $getfilename requires explicit package name at......"

I can get past the error by using a declare of the  my$ getfilename prior to the if statement, but that will cause the filecontatenatio to be incorrect.

How do I resolve the error and get the expected answer for getfilename?


if (lc $timeparm eq 'yearly') {
		  my $filedate = substr($firstday,0,4);	#example of the value here is YYYY or 2018 	
		  my $getfilename = $timeparm.$file.$filedate.'.csv';	#getfilename expected is = 'yearly_sales_2010.csv"   
		 } else {
			my $filedate = join '',substr($firstday,4,2), substr($firstday,0,4); #example of value here is MMYYYY or 012018
			my $getfilename = $timeparm.$file.$filedate.'.csv';	#getfilename expected is "monthly_sales_012010.csv"
		}

 my $outdir = "$wkdir/$getfilename";  # the error occurs on this line..

Open in new window

0
I am migrating a website developed in PERL from one ISP to another. This is not proving to be a straight forward exercise - I think I have jumped through most of the hoops but have one that I am not getting anywhere with.

(Disclaimer: I did not write the code - I am just doing someone a favour moving their site)

In the index.pl there is this line of code
print $q->redirect('group_admin/clients.pl');

Open in new window

$q is defined as follows
#!/usr/bin/perl

use strict;

use CGI::Carp qw(fatalsToBrowser);
require '/home/domain/public_html/myconfig.conf';
&start();

sub start() {
	my $q = new CGI;
	my $e = new MyConfig($q);

	if( $e->manage_session() ) {
		&display($q, $e);
	}
	return 1;
}

sub display() {
  print $q->redirect('group_admin/clients.pl');
  ....
}

Open in new window

The effect of the above is to output the following to the browser
Status: 302 Found Location: group_admin/clients.pl

Open in new window

In the response these are over two lines
Status: 302 Found
Location: group_admin/clients.pl

Open in new window

In other words the page does not redirect.
If I manually enter the URL to group-admin/clients.pl the correct page loads.

What have I missed that is causing the redirect to fail?

NB: This code base works as is on the current server.
0
In reference to https://www.experts-exchange.com/questions/29079671/How-to-generate-multiple-files-from-a-perl-script.html
The related question was assisted by wilcoxon and his expertise on Perl!



For the files from the do_dataset, how would I append the below to the end of the files generated from the do_dataset?  

For files 1 - 4: append  "_MonYY" to filename (example Detail_ESIID --> Detail_ESIID_Dec17)
For file 5: append "MonYY" to the filename (example RecLoad --> RecLoadDec17 )


For files 1 - 4: append "_YYYY" to filename (example Detail_ESIID --> Detail_ESIID_2017)
For file 5: append "YYYY" to the filename (Recload --> RecLoad2017)

The year and MonYY would be derived from firstday and lastday

For (example firstday = 20100101 for Jan 1, 2010, lastday = 20101231 for Dec 31, 2010)
The YYYY would be 2010 and MonYY would be Jan10 for firstday

Here's the code snippet:

use strict;
use warnings;
use DBI;
use Date::Manip;

Date_Init('TZ=US/Central','Internal=1');

$| = 1;

my $nodata = 0;
my ($db, $user, $pw, $wkdir, $firstday, $lastday)  = @ARGV;

# Display parameter values passed by the appworx

print("\n");
print("Database Instance  : $db \n");
print("Connected as User  : $user \n");
print("Output Directory is : $wkdir \n");
print("First Day : $firstday \n");
print("Last Day : $lastday \n\n");


#Check to see if required parameters are received by appworx
die("\n\n  - ERROR:  The Required number of arguments were not received...\n\n") 

Open in new window

0
A question to you - wilcoxon,

This question is in reference to (https://www.experts-exchange.com/questions/29079671/How-to-generate-multiple-files-from-a-perl-script.html)

This question is related to related to a question you helped resolve lately.  So Am addressing this to you as you may be able to easily identify the issue.

The script below writes contents to the cmd screen when run.  For some reason, the data in not getting written to a out file. I can see the data dump  from the database table on the cmd screen but the outfile generated is only listing out the column headers, but no data is generated to the file?


use strict;
use warnings;
use DBI;
use Date::Manip;

Date_Init('TZ=US/Central','Internal=1');

$| = 1;

my $nodata = 0;
my ($db, $user, $pw, $wkdir, $firstday, $lastday)  = @ARGV;

# Display parameter values passed by the appworx

print("\n");
print("Database Instance  : $db \n");
print("Connected as User  : $user \n");
print("Output Directory is : $wkdir \n");
print("First Day : $firstday \n");
print("Last Day : $lastday \n\n");

#Check to see if required parameters are received by appworx
die("\n\n  - ERROR:  The Required number of arguments were not received, PROCESS ABORTING!!!\n\n") unless $lastday;

#The condition below checks to see if the month for first/last are the same and if not the same then checks to see if the years are the same.

my ($fyr, $fmon, $fday, $lyr, $lmon, $lday);
if ($firstday =~ /^(\d\d\d\d)(\d\d)(\d\d)$/) {
    

Open in new window

0
Hello,
I must "execute" some commands on some books (scan-in of the items) using POST API and I've tought at a call to the CURL command via system.
Say we have a input.csv with all the books data.
The script is called via:
perl script.pl<input.csv>output.txt

Open in new window

the simple script is the following:

#!/usr/bin/perl

# open(FD_IN, "<STDIN") || die "Errore apertura standard input";

while (<STDIN>) {
	$Riga = $_;
	$Riga =~ s/\n//;
	$Riga =~ s/\r//;
	@Campi = split("\t", $Riga);

		
	system("curl -X POST  -H \"Content-Type: application/xml\" \"https://api-eu.hosted.exlibrisgroup.com/almaws/v1/bibs/".$Campi[2]."/holdings/".$Campi[1]."/items/".$Campi[0]."?op=scan&library=PETFS&circ_desk=DEFAULT_CIRC_DESK&done=true&apikey=xxxxxxxxxx\"\n");

	$cntRecord++;
}

# close(FD_IN);

Open in new window


In output.txt I've some interesting data returned by the server at EVERY CURL call.
The question is simple: my I add a bit of format to output.txt (I.E. separe the output of every CURL call with something like "***BEGIN NEW OUTPUT****)?

Thanks,
Fabiano
0
Hi, I need some help installing Test::More and Text::Template Perl modules. These modules are required by OpenSSH 7.6p1 and OpenSSL 1.1.0g installations.

I'm running Red Hat Enterprise Linux Server 7.4 (Maipo)‬ and Perl 5.16.3.

I checked the installed modules and those two modules are not listed and I don't think they are available from the repos on my system.

I need to make sure they are properly installed so that I can proceed to install OpensSSH 7.6p1 on my server.

Thanks,

Jorge Batres.
0
Hi I'm trying to Capitalize First Letter of Each Word in a file name but keep the file extension lower case
I'm already removing the rubbish from the  name and I would like the results to look like this

"The.Best.TV.Show.S01E01.720p.Mkv"

my $Ext = "\.mp4|\.mkv|\.avi|\.srt";
while (my $file = <DATA>){

    my $new =  $file;
    $new =~ s/^(.+?(720|1080)p).+($Ext)$/$1$3/i;
    $new =~ s/\b(\w).*(?<=$Ext)/\U$1/g;
    print "new = $new\n";
    
}

__DATA__
the.best.TV.show.s01e01.720p.crap.here.mkv
the.best.TV.show.s01e02.1080p.mp4
the.best.TV.show.s01e03.720p.mpg
the.best.TV.show.s01e04.720p.avi
the.best.tv.show.jpg

Open in new window

0
I am moving some scripts I have from a Windows to a Linux system and so need to replace the MSXSL exe.

Currently I make calls like the following to reference my XSLT scripts and pass the needed parameters.

sub run {
  my $Command = $_[0];
  print "Running Command : $Command\n";
  system($Command);
}

sub ProduceSingleFile($;$)
{
  my $file = $_[0];
  my $outputPrefix = $_[1];
  my $input_file = basename($file);

  #croak "Can't cd to working directory: $!\n" unless chdir $nzrb_process_dir;

  if ($input_file =~ /(.*)\.xml$/)
   {
   	run("MSXSL $file Produce_People_Names.xsl -o $people_file");

     $temp_file = $outputPrefix.'output/'.$1.'.tmp';
     print("$file => $temp_file\n");

     run("MSXSL $file APNZ_Main.xsl -o $temp_file people_file=$people_file nzpa_testing=$nzpa_testing");
 
   unlink $temp_file
    }
}

Open in new window


I have attempted using XML::XSLT in the following way
    
        my $xslt = XML::XSLT->new ("Produce_People_Names.xsl");
        # transform XML file and print output
        print $xslt->serve($input_file);
        # free up some memory
       $xslt->dispose();

Open in new window


But get an error "Can't locate object method "new" via package "XML::XSLT". My XML::XSLT version is 0.31

What would be the best method for achieving my goal. My XSL scripts do not contain any "extras" and just use the basic commands.
0
Keep up with what's happening at Experts Exchange!
LVL 12
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

MT DV MySQL
MySQLTuner is a script written in Perl that allows you to review a MySQL installation quickly and make adjustments to increase performance and stability. The current configuration variables and status data is retrieved and presented in a brief format along with some basic performance suggestions.
0
The below perl script reads a database table generates output to a csv file.

use strict;
use warnings;
use DBI;
use Date::Manip;

Date_Init('TZ=US/Central','Internal=1');

$| = 1;

my $nodata = 0;
my ($db, $user, $pw, $wkdir, $firstday, $lastday)  = @ARGV;

# Display parameter values passed by the appworx

print("\n");
print("Database Instance  : $db \n");
print("Connected as User  : $user \n");
print("Output Directory is : $wkdir \n");
print("First Day : $firstday \n");
print("Last Day : $lastday \n\n");

#Check to see if required parameters are received by appworx
unless($db && $user && $pw && $wkdir && $firstday && $lastday) {
	
  die("\n\n  - ERROR:  The Required number of arguments were not received...\n\n");
  
}

# Connectivity check to the database else display failed connectivity
my $dbh = DBI->connect("dbi:Oracle:$db", $user, $pw, { AutoCommit => 0, RaiseError => 1 }) or die("Cannot connect to Database '$db' " . DBI->errstr());

# Capture counts for distinct partitions for given firstday and lastday dates
my $partition_key = join '', $firstday ,'_',$lastday;
print("Partition Key : $partition_key \n\n");

my $sthcounts = $dbh->prepare(qq(select count(distinct r.execution_id) from REGION r where r.partition_key = ? AND r.status = 'N'));
# Values of partition key will be passed on by appworx will be parameterized in the script
$sthcounts -> execute($partition_key);

# Get value of rowcount returned from Count of partition keys from REGION table
my $rowcount = 

Open in new window

0
Hi,

We have an Apache webserver running Perl + Template Toolkit and a MySQL database for user access on a VM running Windows 2012 R2.

We have recently made some tweaks to the Perl code, nothing big, just a few edits and extra templates and some design changes (CSS etc). this was tested for several months on an identical dev server and we didn't see any issues.

We went live with the changes and everything was fine for about a week but now we are seeing an odd issue where the site hangs when navigating between pages then works fine for a bit and then hangs again. No pattern to this at all. Sometimes its fine for a few minutes, other times its seconds before it hangs again.

CPU usage is about 15%, Ram is at 80% but always as been as we only have 2GB on here. Neither of them peak or change when the browser hangs.

The issue we are seeing is if we browse the website using the local IP then we see this issue.

If we browse the site using localhost in the same browser (different tab) we never see this issue.

So we can be sat with the site hanging on the IP tab but still able to browse about in the other tab on localhost.

Our db is tiny (only about 200 users, the site isn't hugely busy and nothing else has changed.

Before we go rolling the system back, should we be looking anywhere in particular that could cause this disparity between browsing using the local IP and localhost?

We've:

Reset the IP stack, reinstalled VMtool drivers and reset up the …
0
Hi

Given the code and html snippet bellow I'm trying to extract the name from the img alt tag

I can isolate the alt tag but can't get just the  name!

I want $name = "trevor OBT tumblr_ozxualLdb1who6_540.jpg"

As this is html I've no idea if each line of the alt ends in "\n" and my split isn't working

use strict; use warnings;
use HTML::TreeBuilder;
use HTML::Element;


my $body =HTML::TreeBuilder->new_from_file(*DATA);
  my @A = $body -> look_down('_tag', 'a');
  for my $a (@A){
    my $url = $a->attr('href'); 
    if((defined($url)) && ($url=~m/attachment/)  ){
        print  $url ."\n";
        my $img = $a -> look_down('_tag', 'img');
        my $alt = $img->attr('alt'); 
        print "alt [" . $alt . "]\n";  ##  works to here
        my @altBits = split(/nbsp/,$alt);
        foreach my $line (@altBits){
            if ($line =~ m/Name:\s.*(.*)\&/i){
                my $name =$1;
                print "name [$name]\n";                
                }
            }

         
        }
     else   {
                    print $url ."\n";
        }
    }# end for $A
print "Finished \n";

__DATA__
<div class="postbody">
			<div class="postrow">
				<div class="content">
					<div id="post_message_180">
						<blockquote class="postcontent restore ">
							Trevor <br>
<a href="http://www.example.com/vboard/attachment.php?s=b31c60a8e6f7c723&amp;attachmentid=104&amp;d=623527" 
id="attachment1040762" rel="Lightbox_1804154">
<img 

Open in new window

0
Hi

I have a xml file and I need to sort some of the elements in it and can't figure out how to do it.

My structure is

<job>
      <OUTCOND NAME="AAP10151_AAP10221_AAP10151_AAP10122" ODATE="ODAT" SIGN="-"/>
      <OUTCOND NAME="AAP10151_AAP10224_AAP10151_AAP10122" ODATE="ODAT" SIGN="-"/>
      <OUTCOND NAME="AAP10151_AAP10223_AAP10151_AAP10122" ODATE="ODAT" SIGN="-"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AAB10021" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AAP10931" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AA020931" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10181_AAP10181" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_SINGLES_CY300035" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_LP408397_LP408725" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AAB10021" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AAP10931" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AA020931" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10181_AAP10181" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_SINGLES_CY300035" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_LP408397_LP408725" ODATE="ODAT" SIGN="+"/>
      <OUTCOND NAME="AAP10151_AAP10122_AAP10151_AAB10021" ODATE="ODAT" SIGN="+"/>
      <OUTCOND …
0
When I write a program in Perl 6, is it visible to the user, like JavaScript? Or is it compiled into an interim format that is not accessible to the user?

I am considering using Perl for a public facing web page but also for downloadable tool they would run locally.

I hear there is a bin folder, but what exactly goes into this? Is it the .pl file?

Thanks
1
I have version 5 currently...

My-MBP-2:~ newbieweb$ perl -v

This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)

Copyright 1987-2013, Larry Wall

and I run El Capitan

I need to instal Perl 6 but be sure in no way that it impacts the current installation of Perl 5, which is used by my system.

Thanks.
0
I am new to the Perl syntax but have used OOP from Pascal, to C++ to C#.

Can you give me an example of the syntax for using OOP in Perl?

Thanks.
0
I understand Perl is part of my Mac OS, but I hear I would be best served to ensure any programming (learning) in Perl should be isolated so as not to upset the functioning of my El Capitan system.

What kind of installation shall I make to ensure the Perl I access from Mac Terminal does not touch any system files?

Thanks.
0
Free Tool: Site Down Detector
LVL 12
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Years ago, I learned Sed and Awk to complete a project in telecom. Today, I do not recall any aspect of those languages. But am about to learn Perl and have been told that Perl is based on Sed and Awk.

Is that true?

And how are they similar?

Once I start hearing these details, I suspect I will recall a few things about how and why I used Sed and Awk.

Thanks.
0
I have no experience with Perl and suspect it may be the best choice of technology for a financial analysis and reporting website I am making. I expect to allow users to upload PDF's or CSV files to my website, which my site will then parse, summarize and generate new reports.

There will be times when my logic needs to access published national standards tables for a specific record with names like:

CPS Retail 2 Max (Developing Markets only)
CPS Retail Key Entered

from a list of thousands of items

So, this is the reason I suspect Perl is a good choice.

Can someone please confirm that and show me why Perl is so good for pattern matching?

Is it a front end or a back end technology? What other technologies often work well with Perl? It is compiled? Or is it a script?



Thanks.
0
Hi

From the Image-Grab page on cpan

  use Image::Grab;
  my $url ='http://www.example.com/FileName.html'
                      my $pic = Image::Grab->new(SEARCH_URL=>$url,
                                    REGEXP    =>'.*\.jpg');
                  $pic->grab;
                  my $File = basename($url);
                      $File =~ s/html/jpg/i;
                    # Now to save the image to disk
                    open(IMAGE, ">$File") || die"$File: $!";
                    binmode IMAGE;  # for MSDOS derivations.
                    print IMAGE $pic->image;
                    close IMAGE;

Open in new window


I'm getting the error "Couldn't determine an absolute URL!" because the html page I'm searching uses upper case 'JPG' so the regex fails

How do I make the REGEX non case sensitive?

Also can you determine the File name of the image from the REGEX?
" my $File = $pic->name;" causes another error
Can't access `name' field in class Image::Grab
0
I have the script to extract rows and output to a csv file. But, the file is appending each row to resulting in a concatenated output.
I want to output each row to a single line (see present and expected output below)

use strict;
use warnings;
use DBI;
use Date::Manip;
use Getopt::Std;

Date_Init('TZ=US/Central','Internal=1');

$| = 1;

my %opts;
getopts('d', \%opts);

my $date    = UnixDate(($opts{'d'} || 'today'), '%q');
my $nodata = 0;
my ($db, $user, $pw, $wkdir, $firstday, $lastday)  = @ARGV;

#Check to see if required parameters are received by appworx

unless($db && $user && $pw && $wkdir && $firstday && $lastday) 
{
	print("args = $date, $db, $user, $pw, $wkdir, $firstday, $lastday\n\n");
    die("\n\n  - ERROR:  The Required number of arguments were not received.  Verify that the AppWorx prompts are correct and reset the module..\n\n");
} 

# Display parameter values passed by the appworx

print("\n");
print("Database Instance  : $db \n\n");
print("Connected as User  :	$user \n\n");
print("Output Directory is : $wkdir \n\n");

# Connectivity check to the database else display failed connectivity

my $dbh = DBI->connect("dbi:Oracle:$db", $user, $pw) or die("Cannot connect to Database '$db' " . DBI->errstr());

# Capture counts for distinct partitions for given firstday and lastday dates
my $sthcounts = $dbh->prepare(qq(select /*+ full(r) parallel(r,4) */ count(distinct r.partition_key) from region r where r.status = 'N' and r.firstday = 

Open in new window

0
I have installed Site Recovery Manager and the Storage Replication Adapter at both my production and recovery sites.  After pairing my production and DR sites I am trying to setup storage replication (NetApp in my case).  When I select the production or DR site and select the SRA tab the status shows a warning of "Unable to find SRA at the paired site", because of this error I cannot pair the SRA's.  I haven't found much information on this error, but I did come across this article:



The article talks about setting the environment variable for PERL but doesn't give any examples of what that variable should be.  Could the PERL variable be the cause of my problem? and if so how do I correctly set the variable path?  Any other suggestions on what might be causing this issue would be appreciated.  Thanks.
0
I am trying to reference the value of query in a subsequent query and get an error "not an array reference "on line 11.

I am extracting the partkey and assigning it to dataextract. I would like to use this value of partkey in subsequent prepare statement in the script.  I am not sure why the assignment fails.

my $dataextract = $dbh -> prepare(qq(select distinct partkey from table_A where firstvar = ? and secvar2 = ?)))
												 or die("Could not get data from $_ ".DBI->errstr);											 
 
$dataextract -> bind_param(1,$firstvar);
$dataextract -> bind_param(2,$secvar);
$dataextract -> execute();
												 
if ($dataextract) 
 {
	my $genextract = $dbh->prepare(qq(SELECT COL1, COL2, COL3  FROM table_A WHERE partkey = @$dataextract))	-- line 11															
                 or die("Could not get data from $_ ".DBI->errstr);
   ..
  ..
  ..                								
  } 
 else
   exit(1);

Open in new window

0

Perl

26K

Solutions

10K

Contributors

Perl is a high-level, general-purpose, interpreted, dynamic programming languages with over 25 years of development. Perl 5 runs on over 100 platforms from portables to mainframes and is suitable for both rapid prototyping and large-scale development projects.  Perl gained widespread popularity as a Common Gateway Interface (CGI) scripting language, in part due to its regular expression and string parsing abilities. In addition to CGI, Perl is used for graphics programming, system administration, network programming, finance, bioinformatics, and other applications.