Hi, I need to send an HTTPS request without using LWP::UserAgent or HTTP::request? What is another method of doing so? This is the request I need to send:
POST https://payflowpro.paypal.com/
Connection: close
Host: payflowpro.paypal.com
Content-Length: 181
Content-Type: text/namevalue
X-VPS-CLIENT-TIMEOUT: 30
X-VPS-REQUEST-ID: 124940351...
I want to add a line to top and bottom of the file. I can do it following way.
open (DATA, "</usr/old") || die "cant open old\n"; #file to which line has to be added
my @body=<DATA>;
close(DATA);
open (FILE, ">/usr/new") || die "cant open new\n"; #file after stuff has been added
print FILE "9 431";
print FILE "\n";
my $body=@bod...
I want to count the number of characters after I have figured out the starting point.
__DATA__
1-thisthestartingpoint
COUNTTHENUMBEROFCHARACTERSPRESENTINTHISLINEBEFORETHENEXTSTARTINGPOINT
COUNTTHENUMBEROFCHARACTERSPRESENTINTHISLINEBEFORETHENEXTSTARTINGPOINT
COUNTTHENUMBEROFCHARACTERSPRESENTINTHISLINEBEFORETHENEXTSTARTINGPOINT
2-nextsta...
I am reading $digit from infile and want to print it to outfile. But the Perl script is giving an error saying 'Global symbol "$digit" requires explicit package name'. But, if I do declare it globally , $digit='', then the this value is printed to the outfile instead of the value extracted/read from infile. Any suggestions as to what sho...
XML::Simple documentation says to initiate the data structure with an XML file, using XMLin('[FILENAME]') ... but I have an in-memory string.
Can I use it directly, or do I need to save it to the filesystem and then load it into XMLin?
...
I was given C# code and I'm trying to generate the equivalent SHA1 using Perl.
public string GetHashedPassword(string passkey)
{
// Add a timstamp to the passkey and encrypt it using SHA1.
string passkey = passkey + DateTime.UtcNow.ToString("yyyyMMddHH0000");
using (SHA1 sha1 = new SHA1CryptoServiceProvider())
...
I have a list of functions in Perl. Example:
my @funcs = qw (a b c)
Now they all belong to this module Foo::Bar::Stix. I would like to call them iteratively in a loop:
foreach $func (@funcs) {
Foo::Bar::Stix::$func->(%args)
}
where args is a hash of arguments. However I keep getting this error: "Bad name after :: ..." at the li...
To my dismay I noticed that MooseX::Method is no longer maintained and deprecated.
The package MooseX-Method-Signatures is advertized as replacement, but its documentation says: This is ALPHA SOFTWARE. Use at your own risk. Features may change.
<whine>What should I do </whine>
...
I'm using Log::Message::Simple and error()s appear immediately. However, calls to debug() and msg() do nothing -- I have to call Log::Message::Simple->stack_as_string() to get these. How can I get this logging to appear immediately?
...
Hi,
I want to create a POD for my own custom command and display the syntax for that using pod2usage() function..
Can anyone give me a simple example for it?
Regards,
Anandan
...
I need to insert a line with specific text on the second line (thus moving the other lines down in the file) of hundreds of files in a directory. Any quick Unix tips on how that can be done?
...
I have a sql file test.sql used to run some SQL (create object / update / delete / insert) that can look like this
CREATE TABLE test_dbi1 (
test_dbi_intr_no NUMBER(15)
, test_dbi_name VARCHAR2(100);
UPDATE mytable
SET col1=1;
CREATE TABLE test_dbi2 (
test_dbi_intr_no NUMBER(15)
, test_dbi_name V...
Hi,
I need to parse and convert an entire column in a simple CSV file that has two columns.
John, 128222971326628000
Paul, 128491909317205000
Greg, 128160037933161000
Basically I need to perform some arithmetic on the second column and update the value in the column with the result of this operation while leaving the first column unt...
I was on Perlmonks and found this great listing:
http://www.perlmonks.org/?node_id=627015
But it was missing "which", the function that searches for an executable in all the directories in your PATH. (I am porting a Perl script to Windows.)
Is there a Perl module that simulates this?
...
Hi Im supposed to compare lines in a file :
KB0005 1019 T IFVATVPVI 0.691 PKC YES
KB0005 1036 T YFLQTSQQL 0.785 PKC YES
KB0005 1037 S FLQTSQQLK 0.585 DNAPK YES
KB0005 1045 S KQLESEGRS 0.669 PKC YES
KB0005 1045 S KQLESEGRS 0.880 unsp YES
KB204320 1019 T IFVATVPVI 0.699 PKC YES
KB204320 1036 T YFLQTSQQL 0.789 PKC YES
KB204320 ...
I want to run and executable ./runnable on argument input.afa. The standard input to this executable is through a file finalfile. I was earlier trying to do the same using a bash script, but that does not seem to work out. So I was wondering whether Perl provides such functionality. I know I can run the executable with its argument using...
How do I pass a function, a, to function, b, and have b call a in Perl?
...
I have a .pm file in my current directory /t, and I inserted this line of code:
use lib qw(.);
Then I inserted this line of code
use TestUtil.pm;
where TestUtil.pm is in the current directory, but I keep getting this error:
Can't locate TestUtil.pm in @INC (@INC contains: . ........ ( Note that @INC contains the current direc...
Hello
I'm trying to get a regular C compiling environment on an iPhone 3GS running OS3.0 .
So far I have been unsuccessful in finding a suitable gcc (i mean the complete
suite, gcc+headers+libc+whatever else it needs) for it.
Does anyone know if it is (yet) available and where ?
If not yet, is there any tutorial on the net on how to ...
What's a simple reference or cheat sheet for nested data structures in Perl?
...