If
you have a question on how to do something in Perl, or
you need a Perl solution to an actual real-life problem, or
you're unsure why something you've tried just isn't working...
then this section is the place to ask.
However, you might consider asking in the chatterbox first (if you're a
registered user). The response time tends to be quicker, and if it turns
out that the problem/solutions are too much for the cb to handle, the
kind monks will be sure to direct you here.
The init method does
$self->$attribute
what does that mean ? that it calls a $self->update() and a $self->password() methods?
But these do not exist in the code!They are only described in __PACKAGE__->method_documentation
Am I missing something or hasn't the openapi generator generated those two methods?
Ican build it successfully, and it works as expected.(windows 10, strawberry perl 5.32)
But if I change interpreter variable name to his_perl, it doesn't work!
It can't be build, and complains identifier "my_perl" is undefined. I notice in perl.h aTHX hard code define to my_perl, I guess that is the reason why his_perl version can't be built. But why is this name(my_perl) so important, that it should write it into perl.h? Please enlighten me.
Hoping this is an easy problem to solve as my attempts are failing miserably. Using the AI bots and Google only seem to create solutions where the output is all mungled up or the XML elements get repeated, or worse new XML elements are added.
In short, I'm creating a specific soap envelope I need to send to the endpoint web service. The reason is due to complexity and the inability for SOAP::Lite to render the output correctly. This also provides more control for changes as they occur. But when I try to make the call to the web service and send the envelope it seems to be sending the data modified, or the method call is not correct, etc.
I'll post an example below and hopefully someone has a 'duh' answer I seem to be missing.
use SOAP::Lite;
use SOAP::Lite on_action => sub {sprintf '%s/%s',@_};
$proxy = 'https://proxy.com/2.3';
$uri = 'https://uri.dataservices.training';
$method = 'methodCall';
$soap = SOAP::Lite
->proxy($proxy)
->uri($uri);
$soapenv = <<'EOF';
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope ... (bunch of NS values)>
<soap:Header>
(bunch of header settings here)
</soap:Header>
<soap:Body>
(bunch of body settings here)
</soap:Body>
</soap:Envelope>
EOF
$results = $soap->call("$uri/$method",$soapenv);
I don't want to do LCSS, because it will only give me LFGSLSIIV, although we also have HHM. What I have done is to split each string and then compare the characters in each position, increase a 'correct' counter by 1 if they are the same and then compare the number of correct characters to the length of the string (to see what % of the string was the exact match).
I was wondering if there would be any quicker solution to this, with a module or something that I might not be familiar with.
I am trying to translate some JS code into Perl.
The problem is that I think said JS code does not handle well
overflows when doing a left shift and it calculates the result
(let's say a checksum) wrongly. But this is now the result
and I must emulate that result in my Perl translation.
I can not fix the JS code, it is not mine. Question is: how?
Here is the gist of it assuming a 64bit
Linux console with node.js installed and bash:
node -e 'console.log(1<<30);'
1073741824
echo $((1<<30))
1073741824 # same result
perl -e 'print 1<<30, "\n"'
1073741824 # same result
node -e 'console.log(1<<31);'
-2147483648 # overflow in 32bit!
echo $((1<<31))
2147483648 # correct result
perl -e 'print 1<<31, "\n"'
2147483648 # same result
# to obtain the overflow in bash
echo $((1<<63))
-9223372036854775808 # overflow in 64bit
# still perl does not
perl -e 'print 1<<63, "\n"'
9223372036854775808
perl -e 'print 1<<64, "\n"'
0 # gotcha!
# this is when I realised the problem:
node -e 'console.log(1169367104<<5);'
-1234958336
echo $((1169367104<<5))
37419747328
perl -e 'print 1169367104<<5, "\n"'
37419747328 # same result
I have setup a plack psgi application tha works with cgi files. When I start starman server from the shell of the user 'starman'
the service runs fine and responds to requests.
When I try to set it up as a systemd Unit (Centos) , the client gets an error of "Server closed connection without sending any data back"
without emitting any data.OS is Centos7.
Can't find anything in the log files,expect from dmseg which has error :
I have chosen to give the package I am creating a home at Regexp::CharClasses::Thai on CPAN, so the final filename in that tree is simply "Thai.pm". However, obviously it needs to find its way past the first two levels in that tree...so I'm assuming that I should name it "Regexp-CharClasses-Thai.tar" (which contains the tarball made of the entire package and its associated files). Would this be a correct assumption? Alternatively, should it be compressed as well, i.e. "Regexp-CharClasses-Thai.tar.gz" OR "Regexp-CharClasses-Thai.tgz"?
Also, do I create the tarball to include the directories './Regexp/CharClasses/Thai/', or just the final directory (the one with the MakeFile.PL, etc., in this case /Thai/), or something else, e.g. no prior directories at all, just the one with the package files and subdirs?
Note that I have already checked, and found no specifics on how to name or structure the tarball (it's as if all the documentation assumes a root-level module) in any of these 'official' places:
I hate asking so many questions, but I'm rather stumped on this one and wishing the kind folk who have worked so hard on the documentation for how to create and submit modules to CPAN would have given some thought to the creation of the tarball once the module itself was prepared. (Or perhaps one of you might direct me to where this was done and has yet escaped my notice.)
One additional question that came up while reading the materials linked above: Can I just submit a link to CPAN and then host the module myself? If so, how would this be done?
Esteemed monks,
I am deploying an Perl/Tk application (currently using 32-bit Strawberry Perl 5.32.1.1 with a self built Tk module installed locally in directory Tk). The Perl itself is excluded and has to be installed independently.
Now, that i am prepared to integrate the new versions, I am wondering, if it might be possible to have both variants (32-bit and 64-bit) of the Tk module installed together. That would have the advantage, that the application would work with the old 32-bit Perl and also with the new 64-bit Perl. This fallback would give my clients more time to migrate to the new Perl version.
As far as I understand it the compiled module parts reside in the directory auto/Tk (which complements the Tk directory).
If I would put my 64-bit parts in new directories Tk64 and auto/Tk64, would a simple use lib 'Tk' versus use lib 'Tk64' be enough to find the corresponding binaries?
Silly question, perhaps, but I'm quite a beginner with making a CPAN-worthy module (yes, still working on that, between other real-life projects that hinder progress)--and searching online did not help me find an answer:
According to the h2xs utility, the README file should contain a list of the module's dependencies. I have a hard time thinking such things as use strict; should need to be listed, but what about require Exporter;?
If my dependencies are strictly limited to the following, which of these, if any, should be listed in the README file?
use 5.008003;
use strict;
use warnings;
require Exporter;
I would think these are all virtually taken for granted, and ubiquitous on ordinary installations of Perl. Do I still list them? If not, do I report "No dependencies"? (That doesn't seem quite accurate, either.) What is considered the best practice here?
Snippets of code should be wrapped in
<code> tags not<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).