I am attempting to access a web service using SOAP through Perl and am having issues calling the service's functions that require parameters. The XSD that dictates the SOAP call says,
<xs:complexType name="getVersion">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="getVersionResponse">
<xs:sequence>
<xs:element minOccurs="0...
I ran across an interesting issue in some of my "humanize_bytes()" code. This loop represents the issue without all the other logic. The loop needs to stop when the bytes have been truncated to a "human readable" level. It keep iterating until the final value is less than 1024 (or specifiable bytesize).
I started looking into the pro...
Here is the thing that I am trying to accomplish:
In broader sense, parse the XML data using a SAX parser and insert it into the appropriate database column in a MySQL table.
Here is sample Books.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2009 sp1 (http://www.altova.com)-->
<bks:books xsi...
I have a Perl script that does a fork/exec to start another tool in the background and monitor some file system changes while this other tool is running. This seems to work like expected.
When I start this Perl script from a shell (e.g. Bash), of course the shell prompt should be gone for as long as my Perl script is running. And it wil...
I'm just starting out with Perl (literally today) and I'm reading the free online version of Beginning Perl. Early on, the book mentioned that double quoted strings will be interpolated. However, in every example using the print function (so far... I'm around page 66), the author is passing scalar variables as a list parameter. Maybe I'm...
I currently have a Perl script that runs an external command on the system, gathers the output, and performs some action based on what was returned. Right now, here is how I run this (where $cmd is a string with the command setup):
@output = `$cmd`;
I'd like to change this so if the command hangs and does not return a value after so ...
I need to pull out all of the "NodeGroup" elements out of an XML file:
<Database>
<Get>
<Data>
<NodeGroups>
<NodeGroup>
<AssociateNode ConnID="6748763_2" />
<AssociateNode ConnID="6748763_1" />
<Data DataType="Capacity">2</Data>
<Name>Alpha</Name>
</NodeGroup>
<...
Hi everyone,
I have this old Perl script that is supposed to act as a proxy of sorts between HTTP-based clients and non-HTTP Java server: the client POSTs some data to this Perl script and the script would in turn call the Java server, get the response and return it to the client.
The Perl part calls the server like this:
$servervars ...
I admit it's been a while since I've used Perl, but this has me stumped.
Here's the issue:
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser);
use DBI;
print "Content-type: text/html\n\n";
print "<html><head><title></title></head></body>";
my $login = "[email protected]";
my $dbfile = "/var/www/shopsite-data/shopsite_db";
my $sql = qq`S...
I have a Perl script that needs to run following an annual schedule with specific dates and times of when to start and stop. I don't believe crontab can handle this. Is there a Perl module (even a non-perl implementation would be fine) that can help me with this? If it helps, I m running this on a linux box.
Also, the schedule has only ...
I have FTP Perl script and I want to make sure whether the file transfer is complete by checking the number of bytes that are transfered to the remote server is equal to the actual bytes of the file in the local server. How could i accomplish this?
Here's what I have so far:
my $ftp = Net::FTP->new($host, Debug => 1)
or die "Could no...
I copied this example from perldoc -f sort. I added the @old array and the prints of the @new arrays. Why do I get three different @new arrays? Is there something wrong with my @old?
@old = qw( =332 =43 =avxc =aed =jjj =3322 =aa44 =ssss );
say "\nold : @old\n";
# inefficiently sort by descending numeric compare using
# the first int...
I have this code:
my $orig_file_size = -s $file ;
Is throwing an error:
syntax error at ftp_4 line 33, near "$orig_file_size)"
Execution of ftp_4 aborted due to compilation errors.
Here is some more code:
my $host ='hpp411';
my $user ='sonalg';
my $pw ='Unix11!';
my $file ='ftp_example.p_1';
my $path ='/enbusers3.p411/vdx/...
How do I delete array items I'm not interested in? If I would leave themmy memory would get overflowed with unnecessary items.
I need to implement in Perl one task. One file is being continuously filled with messages containing:
"IP - URL"
I need to continuously read this file and measure if there were more than, say five, same IP -...
What would a Perl script look like that would take a directory, and then delete all .svn directories in that directory recursively?
(No shell, cross platform)
...
I have an Excel sheet and am able to convert it into .csv format using Perl. My only problem is that some of my data in the Excel sheet cells contain commas and that
has to be retained in the CSV format also, but while converting it takes as a
seperator. How can I retreive the data in the cell with commas as it is and print it in
the ...
I have an XML file in a string variable ($data), and a hash containing all the tag names and their contents (%field_list).
The tag names are to be checked so that if they are enumerated fields, their contents should be replaced with strings.
Does anybody know if it is possible to do this with search and replace? I am not having much lu...
I have different modules like Author.pm, BillingPeriod.pm, Offer.pm,PaymentMethod.pm etc. now in sax whenever I hit the end element tag I want to create object of module which is equivalent to element value.
How can I achieve this ?
For example if am parsing through XML file and sax parser hit's end element as than it should create o...
My experience is in Perl, but willing to consider other
scripting languages. Is there popular stable svn scripting
library module for Perl, Python or Ruby that we should be
considering:
Goal: write simple svn wrapper script for branching or tagging in
Perl, Python or Ruby
my requirements:
Write a simple command-line script probably u...
I inherited a legacy Perl script from an old server which is being removed. The script needs to be implemented on a new server. I've got it on the new server.
The script is pretty simple; it connects via expect & ssh to network devices and gathers data. For debugging purposes, I'm only working with the portion that gathers a list of ...