Questions tagged [perl]

Perl is a procedural, high-level, general-purpose, dynamic programming language, known for its native support of regular expressions and string parsing capabilities. Please use this tag for questions about Perl in general. For things related to the new (but related) language Raku (formerly "Perl 6"), please use the raku tag. For Perl-style regular expressions in other languages, use the regex tag, or, if they are based on the PCRE library, the pcre tag.

Perl is a highly capable, feature-rich programming language with over 25 years of development. Perl runs on over 100 platforms from portables to mainframes and is suitable for both rapid prototyping and large-scale development projects.

Perl can also refer to a family of high-level, general-purpose, interpreted, dynamic programming languages. The languages in this family include Perl and Raku (formerly known as Perl 6). For Raku-related questions, please use the tag . For "Perl-style" regular expressions in other languages, often based on the PCRE library, do not use tag , but tag or a more specific tag such as tag .

Related Resources

Perl-related Blogs and Bloggers

Free Perl Programming Books

Perl Programming Books

Related tags

Date & Time

Libraries for working with dates and times

Devices

Libraries to talk to physical devices

DevOps Tools

Libraries that help when you want to deploy software across networks on several hosts that are working across computer networks

  • Rex - Remote Execution

FAQs

Frequently ask questions

More information

67820 questions
13
votes
3 answers

What is the preferred convention for Perl Inheritance

In the example below, I have 3 different syntax/mechanisms for defining inheritance. All of them work. Can someone tell me which one is preferred and why (yes, I know "there is more than ..."). Also, why do I need "use WB" in 1 case and not the…
Manidip Sengupta
  • 3,573
  • 5
  • 25
  • 27
13
votes
8 answers

How can I tell Perl to run some code every 20 seconds?

How can I tell Perl to run some code every 20 seconds?
aks
  • 1,321
  • 5
  • 15
  • 27
13
votes
2 answers

Why doesn't Perl v5.22 find all the sentence boundaries?

This is fixed in Perl 5.22.1. I write about it in Perl v5.22 adds fancy Unicode word boundaries. Perl v5.22 added the Unicode assertions from TR #29. I've been playing with the sentence boundary assertion, but it only seems to find the start and…
brian d foy
  • 129,424
  • 31
  • 207
  • 592
13
votes
4 answers

Which Perl built-ins cannot be overridden in CORE::GLOBAL?

The Overriding Built-in Functions section of the perlsub documentation provides There is a second method that is sometimes applicable when you wish to override a built-in everywhere, without regard to namespace boundaries. This is achieved by…
Greg Bacon
  • 134,834
  • 32
  • 188
  • 245
13
votes
4 answers

Writing a macro in Perl

open $FP, '>', $outfile or die $outfile." Cannot open file for writing\n"; I have this statement a lot of times in my code. I want to keep the format same for all of those statements, so that when something is changed, it is only changed at one…
Lazer
  • 90,700
  • 113
  • 281
  • 364
13
votes
2 answers

How is "my" faster than "local" in Perl?

Quoting from PerlMonks: The difference between my and local, But in real life, they work virtually the same? Yes. Sort of. So when should you use them? Use my when you can (it's faster than local) ... I know the lexical vs dynamic scoping…
Lazer
  • 90,700
  • 113
  • 281
  • 364
13
votes
7 answers

Is there something like `last` for `map`?

In Perl, is it possible to arbitrarily end a map execution, e.g. something equivalent to last in a loop? It would be a bit like this: map { if (test == true) { last; } dosomething } @myarray
benzebuth
  • 695
  • 3
  • 11
13
votes
2 answers

Where does CPAN install Perl modules in OS X?

Just curious where CPAN installs all the Perl modules by default in OS X.
GeneQ
  • 7,485
  • 6
  • 37
  • 53
13
votes
3 answers

How do I tell CPAN.pm where to get modules?

Here is the complete install command to CPAN and the output: sudo perl -MCPAN -e "install Bundle::CPAN" CPAN: Storable loaded ok (v2.13) Going to read /home/delgreco/.cpan/Metadata Database was generated on Mon, 08 Dec 2008 03:27:10 GMT CPAN:…
Marcus
  • 5,772
  • 8
  • 35
  • 60
13
votes
2 answers

How do I capture Perl's STDOUT in a variable?

I am calling a function that writes to STDOUT using print. How can I capture this in a variable? Note that all this happens within the same process.
R.D
  • 4,781
  • 11
  • 41
  • 58
13
votes
4 answers

perl - how do you extract all elements of an array except the last?

I need to extract all elements in an array except the last and store them in a scalar for later use. At first, I thought this would be possible using array slices, but it appears that you cannot count backwards. For example: my $foo =…
Oskar Gibson
  • 133
  • 1
  • 1
  • 5
13
votes
3 answers

How are scalars stored 'under the hood' in perl?

The basic types in perl are different then most languages, with types being scalar, array, hash (but apparently not subroutines, &, which I guess are really just scalar references with syntactical sugar). What is most odd about this is that the…
dsollen
  • 6,046
  • 6
  • 43
  • 84
13
votes
3 answers

What does the Perl substitution operator act on?

I have been programming in Perl, off and on, for years now, although only sporadically is it my primary language. Because I often go months without writing any perl, I rely heavily on my dog-eared Camel Book to remind me how to do things. However,…
Ed Hyer
  • 1,385
  • 2
  • 13
  • 19
13
votes
4 answers

What is "Modern Perl"?

I have been hearing a lot about this "Modern Perl." What is it? One of the things I heard was the new open syntax: open my $FH, '<', $filename and not open FH, "<$filename"; What else is in Modern Perl?
bodacydo
  • 75,521
  • 93
  • 229
  • 319
13
votes
6 answers

Can I write a DSL in Perl?

We use Perl for GUI test automation. It has been very successful. We have written a very lightweight DSL kind of language for GUI testing. The DSL is very similar to a object model. For example, we have an Application object at the root. Each…
Krish
  • 1,053
  • 2
  • 17
  • 25
1 2 3
99
100