perl Questions
6
Solved
I want to know how to check whether is program running and run this program if not.
Becnel asked 30/6, 2012 at 11:15
4
Solved
I just upgraded to Perl 5.26.1, now I get
Smartmatch is experimental at check_tr.pl line 67.
where the code in question is
my @patterns = (qr/summary:\s+(.+?) in\s+(.+?) - average of\s+(.+?)$/,...
6
Install information:
Using DBI 1.608 (for perl 5.008009 on x86_64-linux) installed in /usr/local/lib/perl5/site_perl/5.8.9/x86_64-linux/auto/DBI/
error information:
[root@datacenterETL DBD-...
Nardoo asked 17/6, 2013 at 9:43
7
Solved
Recently I reinstalled macOS Catalina 10.15.4. After I installed Command_Line_Tools_11.4.1, it told me svn is no longer working with Xcode. Then I installed both git and svn by brew, hopefully git-...
6
Solved
I'm sort of new to Perl and I'm wondering if there a prefered unit testing framework?
Google is showing me some nice results, but since I'm new to this, I don't know if there is a clear preference...
Lint asked 20/5, 2010 at 17:4
2
Solved
With the following code:
use strict;
use warnings;
use utf8;
use IO::Pty;
use Data::Dump qw(pp);
my $pty = IO::Pty->new;
open *STDOUT, '>&', $pty->slave;
if ( my $pid = open *STDOUT...
2
What is best way to format a number to 2 decimal places in Perl?
For example:
10 -> 10.00
10.1 -> 10.10
10.11 -> 10.11
10.111 -> 10.11
10.1111 -> 10.11
Roughhew asked 27/1, 2016 at 17:16
9
Solved
I am using use strict; in perl and with that I use the following statement.
unless(defined($x)){
print "Not defined";
}
Where $x is not declared anywhere. So I expect it to print "Not defined" ...
Livvi asked 21/8, 2010 at 11:0
5
Solved
I am trying to get the list of files sorted by modification date. I modified the sample program from Sort Directory and list files based on date and time and tried to run it.
sub get_sorted_files ...
5
Solved
My server is having unusually high CPU usage, and I can see Apache is using way too much memory.
I have a feeling, I'm being DOS'd by a single IP - maybe you can help me find the attacker?
I've use...
48
Solved
When I run perl, I get the warning:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are s...
9
Solved
I am trying to get the names of all first level directories under given path.
I tried to use File::Find but had problems.
Can someone help me with that?
Asyndeton asked 7/11, 2009 at 9:3
8
Solved
Many sites (including various SO articles) talk about using "rename" using Perl expressions to rename files.
This would be perfect, but apparently this is not the rename utility I have, and ...
Harrar asked 22/3, 2014 at 12:44
4
Solved
Can someone explain exactly the usage recomandations regarding the 4 perl imports: do, import, use and require?
I'm looking for practical recommendations and keeping in mind possible issues that m...
7
Solved
I would like to remove a broken symlink in a directory using Perl.
In my mind I just had to list the file of a directory and test is this a symlink (-l) and if it returns false just unlink it.
But ...
3
I'm trying to install "nipe" on my Windows Machine but i get this error code all the time. I have installed Strawberry Perl.
This is the error code:
Can't locate CPAN/Author.pm in @INC (y...
1
Solved
According to PerlDoc you can direct a file open to a scalar variable https://perldoc.perl.org/functions/open#Opening-a-filehandle-into-an-in-memory-scalar
I am trying to establish if I can use this...
Carhart asked 23/1, 2023 at 20:44
2
Solved
In a nutshell:
Within a Perl-Script: How do I connect to MySQL in a way that allows to transmit the four-byte unicode character U+1F61C ("😜") from the perl script to a MySQL-Table where this char...
7
Solved
I noticed that when I use backticks in perl the commands are executed using sh, not bash, giving me some problems.
How can I change that behavior so perl will use bash?
PS. The command that I'm t...
4
I am writing an editor using Scintilla.
I am already using a lexer to do automatic syntax highlighting but now I would like to mark search results. If I want to mark only one hit I can set the sel...
6
Solved
In perl regex we can extract the matched variables, ex below.
# extract hours, minutes, seconds
$time =~ /(\d\d):(\d\d):(\d\d)/; # match hh:mm:ss format
$hours = $1;
$minutes = $2;
$seconds ...
8
Solved
I have a varsValues.txt file
cat varsValues.txt
aa=13.7
something=20.6
countries=205
world=1
languages=2014
people=7.2
oceans=3.4
And I would like to create 2 arrays, vars and values. It should ...
6
Solved
I'm trying to run this script on Mac OS 10.7 (Lion) and I'm getting the error:
$ bbcolors
-bash: /usr/local/bin/bbcolors: /usr/bin/env: bad interpreter: Operation not permitted
I've successfully...
2
Solved
Consider the following Perl code:
use strict;
use warnings;
use feature qw(say);
package A;
our $x = 1;
package B;
our $x = 2;
package A;
say $x;
package B;
say $x;
The output is:
2
2
However...
Tourer asked 29/12, 2022 at 16:57
3
The perl recommend me to install ExtUtils::Manifest when I install ExtUtils::Manifest.
The os is Win10, and version of perl is strawberry-perl-5.24.4.1-64bit.msi.
The detail information I get is ...
Rosenwald asked 2/4, 2020 at 6:17
© 2022 - 2024 — McMap. All rights reserved.