perl Questions
8
Solved
I am using Perl to convert some XML to JSON. If the XML attribute is a number, I don't want to put quotes around it so that JSON will treat it as a number and not a string. How can I tell if a Perl...
Olivares asked 11/7, 2009 at 4:50
8
Solved
If I have a hash
my %h = (
secret => 1;
);
and I know that is only is one key in the hash, but I don't know what it is called.
Do I then have to iterate through that hash
my $key;
foreach ...
8
How to get number of CPU or Cores in Perl. I want this, to decide, creating number of threads dynamically. Below I have created 3 threads. But I want to create threads based on number of cores in t...
Elviselvish asked 21/8, 2013 at 14:36
2
Solved
I have to display different medical forms according to which state the user is in. There is also a default form that many of the states share. These medical forms are all written in Template Toolki...
Krall asked 27/8, 2010 at 5:47
5
Solved
Exists in the Perl world any template system with template inheritance?
Just checked in the wikipedia Comparison_of_web_template_engines (really incomplete list) - and here isn't listed any.
In...
Avril asked 9/1, 2014 at 10:58
3
Solved
I'm having a problem with a perl script. In my script, I call another program with a system() call, but I got this error:
Can't exec "./Classificador/svm_classify": No such file or direct...
Chaparro asked 25/12, 2012 at 17:39
9
Solved
What would be an example of how I can call a shell command, say 'ls -a' in a Perl script and the way to retrieve the output of the command as well?
Helminthiasis asked 8/7, 2010 at 5:7
1
Solved
The following route definition works nicely
sub load_routes {
my($self) = @_;
my $root = $self->routes;
$root->get('/')->to( controller=>'Snipgen', action=>'indexPage');
$root-...
Retributive asked 23/4 at 16:3
5
Solved
I am writing Perl classes to remove redundancies from scripts and since Perl has a lot of ways to make classes I keep having trouble making the classes properly. So does anyone have a best practice...
7
Solved
I have a shell script, pretty big one. Now my boss says I must rewrite it in Perl.
Is there any way to write a Perl script and use the existing shell code as is in my Perl script. Something similar...
2
Solved
To my horror I've just found out that chr doesn't work with Unicode, although it does something. The man page is all but clear
Returns the character represented by that NUMBER in the character s...
10
I am trying to extract text from PDF files using Perl. I have been using pdftotext.exe from command line (i.e using Perl system function) for extracting text from PDF files, this method works fine....
5
Solved
Given pairs of string like this.
my $s1 = "ACTGGA";
my $s2 = "AGTG-A";
# Note the string can be longer than this.
I would like to find position and character in in $s1 where it differs with...
3
All Perl modules and 'cpan' stopped working after an upgrade of Ubuntu 16.04 LTS to 18.04 LTS. Every time I run my script it leads to the error
threads.c: loadable library and Perl binaries are mi...
We asked 21/5, 2018 at 5:25
3
Solved
I've attempted installing with brew:
brew install imagemagick
The installation seems to have completed successfully. However, when attempting to:
use Image::Magick;
I get the following error ...
Perish asked 4/6, 2013 at 19:46
6
I'm trying to use a perl one-liner to update some code that spans multiple lines and am seeing some strange behavior. Here's a simple text file that shows the problem I'm seeing:
ABCD START
STOP ...
1
Solved
My boss believes that perl program without explicit exit(0) at the end may return some other value, e. g. that one returned by the last function call in the program, or may be last system call. Per...
Karolyn asked 18/3 at 17:7
7
Solved
How do I create or test for NaN or infinite values in Perl?
2
According to Perl Critic we should "Export symbols via @EXPORT_OK or %EXPORT_TAGS instead of @EXPORT"
Following this advice I am transitioning my module to @EXPORT_OK from @EXPORT, but I ...
3
Solved
Using the Perl code
#!/usr/bin/perl
use strict;
use warnings;
use CGI ":all";
use Encode;
my $cgi = new CGI;
$cgi->charset('utf-8');
print $cgi->header(-type => 'text/html',
-charset...
Insociable asked 17/4, 2012 at 19:12
3
I’m converting a table to a human-readable form, and I need to treat the content with zero-length Unicode characters “in a distinctive way”.
The only way to recognize them seems to be (even with Pe...
1
Solved
How does Perl's interpreter do if-statements? I wanted to try to implement a simple Lazy-Basic-Block-Versioning for if-statements that use ref as a predicate, and maybe subsequently for sub-routine...
5
Solved
Does perl6/Rakudo have something equivalent to perl5's __DATA__ or __END__ sections?
6
I wanted to get system time in nano seconds in Perl. I tried Time::HiRes module and it's supporting only until micro seconds.
2
I am using Mojolicious for a web app that requires an encrypted connection, but I don't know how to add SSL support to Mojolicious.
My coworker sent me these: files domain.key, domain-bundle.crt,...
Rancidity asked 9/12, 2015 at 1:45
© 2022 - 2024 — McMap. All rights reserved.