logo
down
shadow

PERL QUESTIONS

Can you force either a scalar or array ref to be an array in Perl?
Can you force either a scalar or array ref to be an array in Perl?
Any of those help I have a perl variable $results that gets returned from a service. The value is supposed to be an array, and $results should be an array reference. However, when the array has only one item in it, $results will be set to that value,
TAG : perl
Date : January 22 2021, 02:12 PM , By : flesk
What's the safest way to iterate through the keys of a Perl hash?
What's the safest way to iterate through the keys of a Perl hash?
This might help you The rule of thumb is to use the function most suited to your needs.If you just want the keys and do not plan to ever read any of the values, use keys():
TAG : perl
Date : January 22 2021, 02:12 PM , By : Jason Haar
Perl: Find a sum of an array recursively with tail call optimization
Perl: Find a sum of an array recursively with tail call optimization
I wish did fix the issue. Here's a TCO version using that goto feature I mentioned in a comment:
TAG : perl
Date : January 12 2021, 07:00 PM , By : Reiner
(How) can I re-create a package after having called Symbol::delete_package on it?
(How) can I re-create a package after having called Symbol::delete_package on it?
I think the issue was by ths following , The problem is that %P:: is resolved at compile-time, so it refers to the glob delete_package cleared and caused the symbol table to disown.You'll get the expected output if you force the lookup to occur at ru
TAG : perl
Date : January 12 2021, 08:33 AM , By : Vijayant Singh
How to make an output log file of the zip file you just extracted
How to make an output log file of the zip file you just extracted
may help you . Something like this should work. You extract all the files, save the names. Then go through each file looking for errors:
TAG : perl
Date : January 12 2021, 08:33 AM , By : Sonal
In Perl, how can I tell if a string is a number, but without using modules?
In Perl, how can I tell if a string is a number, but without using modules?
this will help for comments ikegami and melpomene.The reason why I want to try it because the module is a "program" as well. I want to learn how to realize it by myself. After all, we meet all kinds of data which need to handle.
TAG : perl
Date : January 11 2021, 05:14 PM , By : Brian Cupps
How can I line up columns with Perl's printf when the value might be a number or a string?
How can I line up columns with Perl's printf when the value might be a number or a string?
fixed the issue. Will look into that further The trick in these problems is to reduce the branching and duplicated code as much as possible. The printf built-in isn't that special. It takes a format argument and a list, so you just need to give it th
TAG : perl
Date : January 10 2021, 01:57 PM , By : Jim Davis
Importing Conditionally Compiled Functions From a Perl Module
Importing Conditionally Compiled Functions From a Perl Module
wish of those help If you want to keep everything in the same file, why not put the logger at the top in a file scoped lexical.
TAG : perl
Date : January 10 2021, 01:49 PM , By : Sigfrieg
Why is object destructor not called when script terminates?
Why is object destructor not called when script terminates?
wish helps you As Robert mentioned, you need a signal handler.If all you need is the object destructor call, you can use this:
TAG : perl
Date : January 10 2021, 01:47 PM , By : rusl
Archive tar files to a different location in Perl
Archive tar files to a different location in Perl
Hope that helps You've misunderstood extract_file. The first parameter is the name of a file inside the archive to extract. You're passing in the path of the archive itself. You passed that to new; you don't need to pass it in again. As the error mes
TAG : perl
Date : January 10 2021, 01:45 PM , By : Techspirit
Write asynchronously to file in perl
Write asynchronously to file in perl
wish help you to fix your issue Basically I would like to: , Asynchronously write this array data
TAG : perl
Date : January 10 2021, 01:45 PM , By : flesk
What is Perl's secret of getting small code do so much?
What is Perl's secret of getting small code do so much?
Hope that helps There are a number of factors that make Perl good for code golfing: No data typing. Values can be used interchangeably as strings and numbers. "Diagonal" syntax. Usually referred to as TMTOWTDI (There's more than one way to do it.) De
TAG : perl
Date : January 10 2021, 01:45 PM , By : kalfa
How to store output of module avail command in perl?
How to store output of module avail command in perl?
it fixes the issue The module command is a shell alias or a function. Thus it cannot be called directly via a `` or a system call.To get the output of an avail sub-command, you should call the modulecmd command which is called by the module shell ali
TAG : perl
Date : January 09 2021, 05:38 AM , By : Pip
Odd "Use of uninitialized value", regular expression error
Odd "Use of uninitialized value", regular expression error
Hope this helps Firstly, I had to fix a syntax error in your code before I could run it (the closing ) was missing from your if statement). Please cut and paste code, rather than retyping it.If Perl tells you that it's finding undefs then it's almost
TAG : perl
Date : January 08 2021, 10:52 AM , By : sadboy
Perl append a substring with in a string
Perl append a substring with in a string
this one helps. You're almost there.The .*? sequence in your regular expression stands for some characters in the original input, and you have to find a way to include those characters in the output, too.
TAG : perl
Date : January 05 2021, 11:29 AM , By : antonio
How do I collect coverage from child processes when running `cover -test`, and not otherwise? (Devel::Cover)
How do I collect coverage from child processes when running `cover -test`, and not otherwise? (Devel::Cover)
may help you . I think that this, or something similar, is probably about the best you can do.Devel::Cover is pretty much designed as a development tool and, as such, has the assumption that you will be testing one project at a time. It seems that yo
TAG : perl
Date : January 02 2021, 06:48 AM , By : Arun Thakkar
I need help regarding perl hash of array
I need help regarding perl hash of array
wish helps you I understand you want @a to hold all values but last, and $b to just hold the last value. How about:
TAG : perl
Date : January 02 2021, 06:48 AM , By : Vlad Sirenko
Is there a faster way to get floating point bits than pack/unpack in Perl?
Is there a faster way to get floating point bits than pack/unpack in Perl?
Hope that helps Your question makes no sense. You're asking for the fast way to do something the slow way. If we knew what you really wanted to do, we could provide a better solution.
TAG : perl
Date : January 02 2021, 06:48 AM , By : mobi phil
Conditions in Perl loops and performance
Conditions in Perl loops and performance
around this issue The condition is only calculated initially (before the loop starts) so I do not think it would increase the speed to precalculate the array before the loop.. Example:
TAG : perl
Date : January 02 2021, 06:48 AM , By : OlioEngr
Packing an array causes "Can't locate method" error in perl
Packing an array causes "Can't locate method" error in perl
this one helps. The Entry method returns a single object. You can find its documentation here.@filelist is an array. You can't call methods on arrays, only on scalars.
TAG : perl
Date : January 02 2021, 06:48 AM , By : Steven Weber
How do I do a case sensitive rename or move operation in perl?
How do I do a case sensitive rename or move operation in perl?
help you fix your problem I have a question about renaming a directory in perl (caveat: needs to be a case-sensitive rename). , needs to be a case-sensitive rename
TAG : perl
Date : January 02 2021, 06:48 AM , By : n3txpert
how to convert column into row in perl
how to convert column into row in perl
To fix this issue I am reading values from my sql database for a column. Now I want to convert columns values in row in comma(ex:-"abc","xyz") , Your output comes from this section of your code:
TAG : perl
Date : January 02 2021, 06:48 AM , By : akr
Comparison of Math::BigInt with scalars in Perl
Comparison of Math::BigInt with scalars in Perl
Any of those help Yes, Math::BigInt objects overload comparison operators which means that any time they are used in a comparison, the overload will handle it properly, and it won't change the native value. There's some more details here: https://per
TAG : perl
Date : January 02 2021, 06:48 AM , By : Theo
perl mismatched tag, problem = XML::Simple module?
perl mismatched tag, problem = XML::Simple module?
will help you You are getting that error because the string you pass to XMLin isn't valid XML. You will need to fix the input to be valid XML.While I strongly recommend against using XML::Simple, it's not because of problems parsing XML. The underlyi
TAG : perl
Date : January 02 2021, 06:48 AM , By : Jack
verify login+password in Perl via SAML
verify login+password in Perl via SAML
help you fix your problem Question 1: Is there a possibility to verify login+password in Perl via SAML at an Identity Provider (IdP)? If yes: how?Answer:
TAG : perl
Date : January 02 2021, 06:48 AM , By : Genipro
i want to search for a string in a file using perl
i want to search for a string in a file using perl
I hope this helps you . As people have already mentioned in comments, you have a small typo. The binding operator, =~, cannot have a space between its two characters.You might expect that adding that unwanted space would generate a syntax error. But,
TAG : perl
Date : January 02 2021, 06:48 AM , By : user183442
While running an email program on Windows ActivePerl I'm getting an error
While running an email program on Windows ActivePerl I'm getting an error
hope this fix your issue Email::Stuffer is not part of the standard Perl distribution. You need to install it before you can use it.It's possible that it's available for installation in the ActivePerl package repository so you can install it using pp
TAG : perl
Date : January 02 2021, 06:48 AM , By : Daniel Halsey
How to read a excel file using perl?
How to read a excel file using perl?
Hope that helps Enclose the path to the .xlsx file using double quotes inside ReadData function.
TAG : perl
Date : January 02 2021, 06:48 AM , By : user109285
Which http headers to suppress "This document is no longer available." on browser back button?
Which http headers to suppress "This document is no longer available." on browser back button?
wish of those help A perl script creates a download page with this URL , print $q->header(-expires => '+0s');
TAG : perl
Date : January 02 2021, 06:48 AM , By : ArmHead
Is there any way to check whether a file is an empty file using PERL program?
Is there any way to check whether a file is an empty file using PERL program?
hop of those help? The relevant file test operators are: -z: check if the file is empty. -s: check if the file has nonzero size (returns size in bytes).
TAG : perl
Date : January 02 2021, 06:48 AM , By : Janne Laine
Perl Date::Manip detects timezone wrong for EST and EDT
Perl Date::Manip detects timezone wrong for EST and EDT
Hope this helps One way to find the time zone is with DateTime::TimeZone. Used with DateTime for other needs
TAG : perl
Date : January 02 2021, 06:48 AM , By : Genipro
Why does the below Perl code show "Use of uninitialized value in concatenation (.) or string" when I try to us
Why does the below Perl code show "Use of uninitialized value in concatenation (.) or string" when I try to us
I hope this helps you . A bare readdir is only valid in a while-loop expression on Perl 5.12+. If you're on an earlier version of Perl, you'll need to use a different syntax to force scalar context:
TAG : perl
Date : January 02 2021, 06:48 AM , By : kgw
How to print part of header and string in another file in Perl
How to print part of header and string in another file in Perl
Any of those help Keep the header in a variable, print it when you encounter the pattern:
TAG : perl
Date : January 02 2021, 06:48 AM , By : Mario Tristan
Query about how to unpack a packed binary data
Query about how to unpack a packed binary data
Does that help I have a packed binary data using below code: my $binarydata .= pack ("H2" , $no); , The inverse of
TAG : perl
Date : January 02 2021, 06:48 AM , By : Joe
Can't open perl script "Build.PL": No such file or directory in response to perl Build.PL
Can't open perl script "Build.PL": No such file or directory in response to perl Build.PL
this will help I'm very new to Perl. I have tried to install BioPerl with the instructions on https://bioperl.org/INSTALL.html. Everything worked fine till the command "perl Build.PL" to which I got the error message "Can't open perl script "Build.PL
TAG : perl
Date : January 02 2021, 06:48 AM , By : S Hall
Is there a way to host a webServer in perl which should in HTTPS
Is there a way to host a webServer in perl which should in HTTPS
Hope that helps As simbabque already mentioned, check out the documentation for the module.It lists the following example:
TAG : perl
Date : January 02 2021, 06:48 AM , By : user152319
How do I concisely check warning categories up to the root of the hierarchy in my package?
How do I concisely check warning categories up to the root of the hierarchy in my package?
wish of those help The use warnings::register qw(undefined); statement introduced two new categories of warnings, 'Provider' and 'Provider::undefined'. So check for both
TAG : perl
Date : January 02 2021, 06:48 AM , By : Lathentar
Use tr with arrays
Use tr with arrays
I wish did fix the issue. I'm assuming you went with tr/// because it's faster than s///. If so, using eval each time you do a translation defies the purpose. The only way it's going to be faster if is you use eval once, but perform multiple translit
TAG : perl
Date : January 02 2021, 06:48 AM , By : nonkelhans
I'm facing problem with the email program in Perl
I'm facing problem with the email program in Perl
this will help Email::Address is for:
TAG : perl
Date : January 02 2021, 06:48 AM , By : cautionsign
How to install Filter::Crypto module for perl under ubuntu
How to install Filter::Crypto module for perl under ubuntu
help you fix your problem To install this module, the develop files of openssl are needed. Under Ubuntu, it needs to install package: libssl-dev to get develop files to be installed: so after running sudo apt-get install libssl-dev, the problem is re
TAG : perl
Date : January 02 2021, 06:48 AM , By : James Dio
Count tandem repeats in Perl
Count tandem repeats in Perl
I wish did fix the issue. Your question is a little ambiguous. I'm going to answer each interpretation separately.
TAG : perl
Date : January 02 2021, 06:48 AM , By : Hunter
Graph.pm - how to get all paths with particular length?
Graph.pm - how to get all paths with particular length?
it should still fix some issue I have following example graph with 9 edges: , You had a bug in your edge setup, compare with my correct definition.
TAG : perl
Date : January 02 2021, 06:48 AM , By : AJacques
how get the last directory using perl?
how get the last directory using perl?
To fix this issue A few things that may help: Perl has a built-in mkdir The File::Path core module has make_path to do what mkdir -vp does
TAG : perl
Date : January 02 2021, 06:48 AM , By : 3NZ0
Perl parsing email body without parts using MIME::Parser
Perl parsing email body without parts using MIME::Parser
I hope this helps . It is not fully clear for me what you are trying to achieve since you only post code but not the intention behind it in sufficient detail. But you are using parts to inspect the message which is clearly documented to return the pa
TAG : perl
Date : January 02 2021, 06:48 AM , By : Bo.
Why Perl ignores spaces between a sigil and variable name?
Why Perl ignores spaces between a sigil and variable name?
Does that help That documentation only discusses the name, not the sigil. The sigil can always be separated from the name by space characters. It is definitely underdocumented and I would not suggest ever making use of it, but it is used.
TAG : perl
Date : January 02 2021, 06:48 AM , By : Andrew Mattie
Using Perl to replace empty string with space
Using Perl to replace empty string with space
I wish this help you + is a regex metacharacter. To specify a literal + character, you need to escape it
TAG : perl
Date : January 02 2021, 06:48 AM , By : Sergio Rudenko
Displaying 12-h time in Perl using DateTime
Displaying 12-h time in Perl using DateTime
will be helpful for those in need Most date-time modules will provide access to the C function strftime or a re-implementation of it. In format specifications provided to strftime, you can use the following patterns: %I: The hour as a decimal number
TAG : perl
Date : January 02 2021, 06:48 AM , By : Search Classroom
Assign temp file from cgi and read it in .sh
Assign temp file from cgi and read it in .sh
I think the issue was by ths following , Either, as @muru said, put it into the environment:$ENV{tmpfile}= $tmpfile;
TAG : perl
Date : January 02 2021, 06:48 AM , By : Navin
why doesn't make -C change $PWD as seen through a scripting language such as Perl?
why doesn't make -C change $PWD as seen through a scripting language such as Perl?
like below fixes the issue Because the PWD environment variable doesn't hold the current working directory; it holds whatever the current working directory was the last time sh set it. Anything other than a shell starting up, or a shell executing the
TAG : perl
Date : January 02 2021, 06:48 AM , By : OlioEngr
Using Win32::Env perl module, environment variable not setting permanently in windows
Using Win32::Env perl module, environment variable not setting permanently in windows
seems to work fine When assigning/changing environment variables in Windows, the Explorer subsystem needs to be notified that the changes occurred before newly opened windows/applications see the changes. If this doesn't happen, then a reboot is nece
TAG : perl
Date : January 02 2021, 06:48 AM , By : changke
How to fetch a one table from HTML source file using lwp module?
How to fetch a one table from HTML source file using lwp module?
this one helps. You can use LWP to get the HTML source of a web page. Most easily, by using the get() function from LWP::Simple.
TAG : perl
Date : January 02 2021, 06:48 AM , By : orlandoferrer
How to process variable dimension array in Perl
How to process variable dimension array in Perl
it fixes the issue As in most dynamic languages, arrays in Perl are only one-dimensional. You usually represent a two-dimensional array by having each element of the array be a reference to another array - so you effectively have an array of arrays.
TAG : perl
Date : January 02 2021, 06:48 AM , By : user179190
perl print to a file and STDOUT which is the file
perl print to a file and STDOUT which is the file
like below fixes the issue My program is trying to print to a file which for it is the STDOUT. To say, print "text here"; prints to a file x.log , while I am also trying to print to the file x.log using file-handler method as in print FH1 "text here"
TAG : perl
Date : January 02 2021, 06:48 AM , By : woxorz
Get array in perl from json_encode
Get array in perl from json_encode
hope this fix your issue , To decode the JSON, you'd use
TAG : perl
Date : January 02 2021, 06:48 AM , By : Kristian Hofslaeter
How to get unicode code points in perl v5.24?
How to get unicode code points in perl v5.24?
should help you out It is not a problem with ord, but with encoding. Input from the commandline will usually be UTF-8 encoded, and ord only takes a single character, not a multi byte string. You can use the -CA switch to decode @ARGV automatically (o
TAG : perl
Date : January 02 2021, 06:48 AM , By : user91848
using an array as a reference is deprecated in perl
using an array as a reference is deprecated in perl
may help you . I'm not sure where you're getting this code from, but it uses a very old version of Perl syntax that you shouldn't have been using for a very long time. [Update: As ikegami points out in a comment below, this isn't very old Perl syntax
TAG : perl
Date : January 02 2021, 06:48 AM , By : smbrant
Using Perl's File::Basename to rename a file extension
Using Perl's File::Basename to rename a file extension
I think the issue was by ths following , fileparse(@mtf,qr/\.[^.]*$/); makes no sense. Since you have to ensure that @mtf contains exactly one element for this to work, it makes no sense to use an array instead of a scalar.You didn't show what @mtf c
TAG : perl
Date : January 02 2021, 06:48 AM , By : Mostapen
Unable to get page via HTTPS with LWP::Simple in Perl
Unable to get page via HTTPS with LWP::Simple in Perl
this one helps. LWP::Protocol::https is needed to make HTTPS requests with LWP. It needs to be installed separately from the rest of LWP. It looks like you installed LWP, but not LWP::Protocol::https, so simply install it now.
TAG : perl
Date : January 02 2021, 06:48 AM , By : jedameron
Perl DBI case insensitive methods
Perl DBI case insensitive methods
I wish did fix the issue. You can't. Perl doesn't have case-insensitive strings. The closest you could come would be to use NAME_lc and then pass every value through lc before trying to use it as a key name.
TAG : perl
Date : January 02 2021, 06:48 AM , By : user123284
How to resolve @INC related issue in Perl
How to resolve @INC related issue in Perl
Hope this helps File::stat has been a part of the standard Perl distribution since Perl 5.004 in 1997. There should never be a reason to install it separately. If you find yourself in that situation, then something has gone badly wrong in your Perl i
TAG : perl
Date : January 02 2021, 06:48 AM , By : helloedwin

shadow
Privacy Policy - Terms - Contact Us © scrbit.com