perl Questions

4

I have just started with Perl today and installed ActivePerl 5.24.1 and everything went well. I was able to create my test program testPerl.pl with simple a print command and run it through console...
Korikorie asked 19/1, 2017 at 5:55

3

Solved

This question comes from a need to ensure that changes I've made to code doesn't affect the values it outputs to text file. Ideally, I'd roll a sub to take in two filenames and return 1or return 0 ...
Conquistador asked 17/5, 2010 at 9:30

6

On Windows, how can I check whether my Perl installation is 32 or 64 bit?
Pardoes asked 2/10, 2014 at 20:4

3

Solved

I'm trying to sort lists of names with Perl with a specific letter order to perform some special features. The sorting would be working the same way as sort { $a cmp $b } but with a different succe...
Reathareave asked 13/4, 2015 at 18:0

8

Solved

Is there a regex to match "all characters including newlines"? For example, in the regex below, there is no output from $2 because (.+?) doesn't include new lines when matching. $string = "START...
Alizaalizarin asked 28/11, 2011 at 22:47

7

Solved

For (mainly) pedagogical reasons, I'm trying to run this workflow in GitHub actions: name: "We 🎔 Perl" on: issues: types: [opened, edited, milestoned] jobs: seasonal_greetings: runs-on: wind...
Katharyn asked 4/12, 2019 at 11:47

3

Solved

I am reading through a massive file to store data in a very large hash. I am trying to keep the RAM use as small as possible. I have a MWE that shows strange behavior in Perl: #!/usr/bin/env perl ...
Wenzel asked 18/1 at 15:54

4

Solved

I am using LWP to download content from web pages, and I would like to limit the amount of time it waits for a page. This is accomplished in LWP like this: my $ua = LWP::UserAgent->new; $ua->...
Leisure asked 12/6, 2012 at 2:13

6

Solved

How can I get the name of the script? For example, I have a Perl script with the name XXX.pl. This file contains: $name = #some function that obtains the script's own name print $name; Output: ...
Excreta asked 5/1, 2011 at 1:56

5

Solved

I have this file: m64071_220512_054244/12584899/ccs rev pet047-10055 ACGTGCGACCTTGTGA TTGAGGGTTCAAACGTGCGACCTTGTGA m64071_220512_054244/128321000/ccs rev pet047-10055 ACGTGCGACCTTGTGA TTGAGGGTTCAAA...
Nerta asked 21/12, 2023 at 19:24

6

Solved

I'm looking for an easy way to check for a correct number of command line parameters, displaying a usage message if an error occurs and then immediately exit. I thought of something like if (@ARGV ...
Isbell asked 16/2, 2011 at 21:30

3

The following prints ac | a | bbb | c #!/usr/bin/env perl use strict; use warnings; # use re 'debug'; my $str = 'aacbbbcac'; if ($str =~ m/((a+)?(b+)?(c))*/) { print "$1 | $2 | $3 | $4\n&...
Cestoid asked 28/10, 2013 at 18:16

2

I'm trying to compute eigenvectors of symmetric matrices with the great eigens_sym function of the great PDL Perl module. use strict; # Be pessimistic and careful with interpretations in the compil...
Taima asked 2/12, 2023 at 17:41

7

Solved

How do I sleep for shorter than a second in Perl?
Outrun asked 22/5, 2009 at 8:38

4

Solved

I don't think the question needs any explanation. I'm writing a software that can boot virtual machines to simulate a network. I would like to disable this feature if the software is already runnin...
Valise asked 13/10, 2012 at 14:59

4

Solved

What's the best practice for implementing Singletons in Perl?
Osteitis asked 22/2, 2010 at 10:47

3

Solved

In this example script: #perl 5.26.1 $foo = "batcathat"; if ($foo =~ /cat/g) { print "yes\n"; } else { print "no\n"; } if ($foo =~ /cat/g) { print "yes\n&qu...
Pronucleus asked 20/11, 2023 at 14:54

1

Written a new recipe for libmoose module of perl and found the following error, Can anyone please help to fix it. | x86_64-poky-linux-ld: unrecognized option '-Wl,-O1' | x86_64-poky-linux-ld: use t...
Diaster asked 17/8, 2021 at 13:20

5

Solved

I'm currently trying to extract a substring and version number from a filename using bash. There are two formats the filenames will be in: example-substring-1.1.0.tgz example-substring-1.1.0-branch...
Churchyard asked 10/11, 2023 at 16:59

3

Solved

I'm playing around with Perl prototypes to learn more about them; I understand that they don't work like most other languages. I don't want them to. I'm specifically looking to get a wrapper functi...
Protect asked 8/11, 2023 at 13:22

3

I'm getting Can't locate Config/YAML.pm in @INC (you may need to install the Config::YAML module) while running a perl script. Can't locate Config/YAML.pm in @INC (you may need to install the C...
Therewith asked 17/1, 2020 at 9:35

10

Solved

I have tried: $var = false; $var = FALSE; $var = False; None of these work. I get the error message Bareword "false" not allowed while "strict subs" is in use.
Shallop asked 24/6, 2009 at 4:8

3

Solved

I have a lot perl code that does different things in test and production, and I want to lock my code to specific versions of CPAN modules in case there are some changes to some of them in the futur...
Fingernail asked 15/1, 2013 at 6:29

3

Solved

Suppose I have a piece of Perl code like: foreach my $x (@x) { foreach my $y (@z) { foreach my $z (@z) { if (something()) { # I want to break free! } # do stuff } # do stuff } # do stuf...
Endres asked 14/9, 2010 at 11:45

5

Solved

I am trying to install DBD::Oracle using the CPAN shell in Strawberry Perl. I initially experienced an error because the Makefile could not locate an OCI library, so I installed the instant client ...
Librium asked 4/12, 2009 at 18:29

© 2022 - 2024 — McMap. All rights reserved.