Perl Programming

Perl was first released in 1987, it is an high-level, general-purpose, interpreted, dynamic programming language. It was created by Larry Wall. The language is influenced by a number of programming language such as Lisp, C, C++, Pascal and others.

303 Questions
Perl Programming

What is the cat command in perl?

The concatenate operator in perl is a period, ie .

707172
PHP Programming
Linux
Perl Programming

Can you generate DLL files from PHP scripts like you do in PERL?

You can make a .NET DLL for use in Visual Studio development projects with Phalanger 2.0.

616263
C Programming
Perl Programming

How do you extract function name from a c program using PERL?

What function do you mean? Any function defined in a source file? Or any function used in a source file? Be more specific.

454647
Linux
Unix
Perl Programming

How you redirect the output of the perl script into some file using perl script?

If the perl script outputs to the standard output device, use the I/O redirection operators (>, >>, |) to redirect it somewhere else.

434445
Computer Programming
Perl Programming

Is ruby slower than perl?

Yes, Ruby is slower than PERL. If you follow the attached link, you will see a benchmark result clearly saying so. Should you care? It depends. If program speed is the determining factor, as in going through millions of data lines, choose PERL (or better yet, a compiled language such as C or C++). In terms of programmer productivity, as in creating a working prototype/solving a small problem quickly, I think programming in Ruby is faster. YMMV.

== ==

394041
Acronyms & Abbreviations
Perl Programming

What is PERL acronym for?

Practical Extraction and Report Language. It is a programming language used by websites and many other things.

333435
Computer History
Perl Programming

Who created the perl programming language?

It was invented by Larry Wall in the mid-1980's (first posted to the 'comp.sources' Usenet newsgroup in late 1987). Perl has rapidly become the language of choice for writing programs quickly and robustly across a wide range of fields - ranging from systems administration, text processing, linguistic analysis, molecular biology and (most importantly of all) the creation of dynamic World Wide Web pages. It has been estimated that about 80% of dynamic webpages worldwide are being created by Perl programs.

More and more companies are realizing that setting up a glitzy Website with lots of pretty Web pages is not enough. The Web really becomes an effective tool for you and your customers when E-Commerce steps in - when your Website is linked seamlessly to your corporate information systems.

A typical example of this is using the Web to take orders from customers.

To provide these sort of service you need to create dynamic web pages based on Web forms and image maps, often retrieving information from relational database systems. Perl provides excellent support for creating dynamic web pages and connecting to databases.

303132
Computer Programming
Perl Programming

What does chomp do in perl?

Most commonly it's used to remove the newline character from the end of a string or an array of strings. If the newline character isn't there, then nothing is done to the string.

There are other details involved in what chomp does, but mostly that is what it is used for.

For instance you can change which character is considered the be the newline character. If you want to know more, I would suggest reading the documentation.

293031
PHP Programming
Perl Programming

Which is better Perl or PHP?

Every programming language has its uses; "what is better" depends on what you want to use it for.

While Perl was the "original" web programming language for creating dynamic web pages, PHP has mostly superseded it in that arena. That is, PHP is generally a much better fit for creating the content display logic (i.e. "presentation layer") for a web site that has dynamically-created HTML. This is the primary design criteria for PHP, and it is no surprise that PHP outshines Perl for anything but the simplest designs.

On the other hand, Perl retains its crown over practically anything else as the "duct tape of systems administration". Particularly on UNIX and Linux systems, where the "everything is a file" and "config files belong in ASCII text format" are the primary design philosophies, Perl's string manipulation powers are unmatched by anything else; in addition, the massive data bank of useful libraries that are hosted in the CPAN (Comprehensive Perl Archive Network) give Perl an enormous variety of pre-written (and, well-documented, too) code that allows the programmer to glue together a Perl program in a much shorter time than any other scripting language.

So, the short answer is this: it depends on what job you're looking to do. For creating anything more than very basic dynamic web sites, PHP should be your choice. For any system plumbing, text file manipulation, or network plumbing scripting, Perl is the right choice.

One word of caution: Perl well deserves its nom-de-plume of the "Swiss Army Chainsaw" of languages. It is far too easy to create "write-only code" that is obtuse, obscure, and unmaintainable for anyone (including the original creator), so extra diligence is required in Perl to adhere to Good Programming Standards. Perl is fabulous, but make sure that someone can distinguish your program text from line noise.

242526
Computers
Perl Programming

What is Perl and shell scripting?

Perl is a programming language developed by Larry Wall in the late 1980s to assist him in administering UNIX operating system environments. Perl has since been ported to other operating systems such as Microsoft Windows and Linux. Perl is widely renowned for its ease of use, power and functionality.

Perl is loosely based on the powerful 'C' programming language developed by Dennis Ritchie of Bell Labs in the early 1970s. Perl is used today for a wide variety of tasks including CGI programming, system administration and is also a favorite of both computer security professionals and so called 'hackers'.

Shell scripting is associated with the use of a variety of 'shells' such as the 'Bourne Shell' developed by Stephen Bourne, also of Bell Labs, the 'Korn Shell' developed by David Korn, again while at Bell Labs and other widely used shells such as the ubiquitous 'BASH' shell (Bourne Again SHell) included with virtually every open source operating system such as Linux, OpenBSD, FreeBSD and some closed source ones. Shell scripting has, to some degree, more recently come to be associated with 'batch/cmd file' programming in Windows environments.

A 'Bourne Shell' script will typically begin with the line:

#!/bin/sh

while a 'Perl' script may begin with the line:

#!/usr/bin/perl

Perl has remarkably high performance for a scripting language that is compiled at

runtime. In benchmarks studies, Perl has often been found to run at approximately 90% of the speed of the very high performance C programming language.

Perl supports networking, multi-tasking and other features expected of a modern programming language and also has a considerable body of Unix/Linux administration functions built in (in keeping with it's original focus of being a scripting language designed by a Unix Systems Administrator for Unix Systems Administrators - perhaps most often meaning Linux today, though FreeBSD, OpenBSD and Mac OSX [to name but a few as Perl is ubiquitous and any list of systems supported would be FAR too long to be enumerated here] are equally well supported).

I have written Perl scripts that run in daemon mode for instance, and launch hundreds of child processes performing many varied tasks including network clients and servers.

Perl is Open Source and the CPAN (Comprehensive Perl Archive Network) body of contributed code and modules is so extensive it's enumeration would be a task nearly encyclopedic in scope - FAR TOO LARGE EVEN FOR AN ONLINE ENCYCLOPEDIA SUCH AS WIKIPEDIA.

In early 2013 if I'm not mistaken, the ISS (International Space Station) switched from Windows to Linux for the announced purpose of increased reliability and stability encompassing dozens of computers - each of which comes equipped with Perl.

And last but not least, writing Perl code is just plain fun. Few, if any programming languages are more portable as Perl has been ported to everything from Microsoft Windows to IBM AIX.

We Linux Systems Administrators are, at least philosophically, indebted to Larry Wall, Randall Schwartz, Nathan Torkington and many others for their profound contributions to the Open Source software arena in the form of Perl.

222324
Windows XP
Perl Programming

Best perl editor in windows?

The best editor for programming will depend on the preferences and quirks of the user. Editors that can do syntax-dependent colouring of the text make it easier to read code and identify problems. xemacs and textpad are possible options.

151617
Web Programming
Perl Programming

What is 'use' in Perl?

The "use" command is the way to request additional features in perl.

For example, the statement

use Date::Parse;

will include the Date/Parse.pm module which provides two functions to parse date strings.

There are thousands of modules available and you may easily write your own modules for code that you use in several programs.

This answer naturally leads on to follow-on questions:

How do I know which features have been added by a particular "use" statement?

For standard modules (such as Date::Parse) that are usually installed on your computer, try the command

perldoc Date::Parse

on the command line. This should give you the documentation of the installed module. If this fails, go on to the next question.

For non-standard modules, you have to find the file Date/Parse.pm and look into it for documentation (this is not always informative).

Which modules are available for free?

Many Perl modules are distributed as free software. Go to http://www.cpan.org/ or http://search.cpan.org/ and browse/search the CPAN (Comprehensive Perl Archive Network).

Most likely you will initially be overwhelmed by the pure number of available modules --- but in most cases you will find that somebody has already posted some code for features that you need.

Documentation is included The "use" command is the way to request additional features in perl.

For example, the statement

use Date::Parse;

will include the Date/Parse.pm module which provides two functions to parse date strings.

There are thousands of modules available and you may easily write your own modules for code that you use in several programs.

This answer naturally leads on to follow-on questions:

How do I know which features have been added by a particular "use" statement?

For standard modules (such as Date::Parse) that are usually installed on your computer, try the command

perldoc Date::Parse

on the command line. This should give you the documentation of the installed module. If this fails, go on to the next question.

For non-standard modules, you have to find the file Date/Parse.pm and look into it for documentation (this is not always informative).

Which modules are available for free?

Many Perl modules are distributed as free software. Go to http://www.cpan.org/ or http://search.cpan.org/ and browse/search the CPAN (Comprehensive Perl Archive Network).

Most likely you will initially be overwhelmed by the pure number of available modules --- but in most cases you will find that somebody has already posted some code for features that you need.

Documentation is included

151617
Health
Perl Programming

What is Perls test?

a test for hemosiderin, utilizing Perls Prussian blue stain.

131415
Technology
Perl Programming

How reliable is Perl?

This question is very nearly meaningless. Perl is a programming language; the reliability of any given Perl program depends on the talent and insight of the programmer.

111213
DIY Projects
Perl Programming

How do you install packeges in perl cpan?

`cpan Module::Name`

If you use Linux, it is better to use package manager.

More specifically, you can install package from CPAN for either use by an individual (that is, available only for the User who installs it), or, if you have root/Administrator privileges, for use by all users.

In either case, to install a module from CPAN, do this:

First, refresh your cpan local info:

machine% cpan

cpan> reload index (gets the latest info from CPAN)

cpan> install Bundle:CPAN (get the latest CPAN program)

cpan> reload cpan (updates the current session)

Now, to install something, you do:

cpan> install Module::Name

Installing modules via the 'cpan' command is the recommended method when doing development, as it allows for more flexibility with module versioning and updating than a system packaging utility.

When deploying finished Perl code to a system, it is preferred to use a pre-packaged binary module, in the format used by the system packaging utility (e.g. RPM, DEB, PKG, etc.), since that provides more rigid control and repeatability for the module in question, and simpler dependency management.

111213
C Programming
Perl Programming

Write an algorithm of calculating the average of five numbers input by the user?

Start a loop

Ask for the user for a value

Add the value to a running sum

At end of loop, divide the running sum by 5 (or the total number of numbers entered by the user).

8910
Computer Programming
Math and Arithmetic
C Programming
Perl Programming

Write a program to accept two numbers and display their sum?

#include<stdio.h>

#include<conio.h>

#include<math.h>

void main()

{

clrscr();

int a,b,sum;

printf("Enter first number ");

scanf("%d",&a);

printf("Enter second number ");

scanf("%d",&b);

sum=a+b;

printf("The sum is = %d ",sum);

getch();

}

91011
Computer Programming
Perl Programming

Is perl case sensitive?

yes.

91011
JavaScript
Perl Programming

How do you call a perl program from javascript?

You can call the Script like this,

<script type="text/javascript" src="perl_script.pl"></script>

So you just replace a regular Javascript Call ( .js ) with the .pl Script.

Inside the Perl Script you will have to use embraced Javascript Functions / Code,

f.e. like print "document.write.('Hello World');";.

91011
Computer Programming
Perl Programming

How does Perl handles exceptions?

eval {

# Insert dodgy code here

};

if ($@) {

# Insert code to recover from error

}

If the dodgy code doesn't throw an exception (for example using the "die" keyword), then Perl exits the eval block and sets the special global variable $@ to a false value - the empty string or nudef or something - and then the if block doesn't run.

If an exception is thrown, $@ becomes a nonempty string, and the if block runs. $@ is accessible from inside the if block, so you can use it to tell you what kind of error handling to do.

A word of warning: Don't forget the semicolon after the eval block. (I've missed it several times, and it's one of those hard-to-diagnose bugs if you're not used to it.)

91011
Software and Applications (non-game)
Microsoft Windows
Computer Programming
Perl Programming

How do you search for phrases in file using perl?

open the file and then use the match operator (m//)

Here is how you open a file

http://perldoc.perl.org/functions/open.html

you can search this documentation for the match operator also. That should get you going

AnswerI'd like to clarify, in case anyone has followed the advice above. The match, or "regular expression" or "regex" operator, is quite a powerful string operator, and the documentation on it may be quite daunting. But if you just want to search for a particular string, then it's not so bad.

If you want to check whether the string $myString contains the substring

"foo bar"

you can simply write this:

$match = ($myString =~ m/foo bar/);

Then, the scalar $match will be a true value if $myString contains "foo bar", and a false value otherwise. There's some way to do it such that $match is actually the number of times "foo bar" appears in $myString. Possibly this:

$match = ($myString =~ m/foo bar/g);

91011
Perl Programming

Application of Perl in bioinformatics?

Go to this site: http://www.techcuriosity.com/resources/bioinformatics/scripts_library.php For advancing programming install bioperl in a UNIX system: http://www.bioperl.org/wiki/Main_Page http://www.bioperl.org/Core/Latest/bptutorial.html If you try installing Bioperl in Windows you may loose your life any way this is the link: http://bioperl.org/Core/Latest/INSTALL.WIN Good luck Your friend James Hopkins jhopkinslb@gmail.com http://jameshopkins-mysite.blogspot.com/ http://molecularbiologytutorial.blogspot.com/

91011
Perl Programming

Where can you get Perl Scripting Training?

Perl programming or Perl Scripting Training is currently being offered by SybaseTeam at reasonable charges.

You many email Training@SybaseTeam.Com or

call - US: 201-298-3267 India:+91 964 000 4747

for more details.

SybaseTeam also offers

Sybase ASE DBA Training

Sybase developer training

Sybase Performance and Tuning Training

Sybase Replication server Training

Sybase IQ Training

Unix basic and advanced Shell scripting Training

Perl Programming Training

Thanks,

Training Department

SybaseTeam - Sybase Technical support,Consulting, Training and Placement

789
PHP Programming
Perl Programming

How do you edit PHP and Perl scripts?

I am asking the question?

>>PHP ,Perl scripts can be edited with help of editors like Editplus,Notepad++ OR you can also use Zend IDE.

789
Consumer Electronics
C Programming
Perl Programming

What is fullform of perl?

perl- Practical Extraction and Report Language

456

Copyright © 2020 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.