Hi,
I have a problem where I was asked to find if a particular directory exists in a filesystem. For example we have SunOS unix operating system which has /uXX filesystems. I need a perl scri...
Hello,
I'm trying to make a SNMP walking script that will save the results to a database. Here is a example of what i'm trying to do...
The Access Point i'm trying to poll using SNMP use...
Where can I find documentation on the "write()" command in perl? The code snippet shows the method "init_app" that shows two dotted lines and a title.
I am using a lot of variables in my Perl script. When loop thru an array and connect to the database and retreive 2 values and store them in variables and for the next value in the array if th...
How do I find the time difference between two times which are in this format using Perl ?
00:05 00:30 ie. 00:30 - 00:005.
Hi there,
I have a two-part question.
1) Ozo recently pointed me to the excellent Date::Manip module. I have that working fine now, but I'd ideally like to set it up to incorporate holi...
Hi guys,
I like to know what do i write in my perl or shell script so that the script can locate any files that contain a particular string for example "Mr. Cool" and it will output the lis...
I am attempting to scan through large log files and get a count of the various error responses.
To do this I need to see if the current response is already in my 2D array (as the first elem...
I'm trying to upload a file from my local computer to the server and then store it as a longblob on the server database. When I upload I get the error: use of uninitialized value in <HANDLE...
I am using IPC::Open2 to create a shell that I can communicate with in Perl on a *nix machine. I create the shell using the following code:
open2(\*READER, \*WRITER, "ksh");
and it crea...
I am reading a simple ASCII string from /dev/ttyS0 continuously from a backgrounded perl script.
The device is sending a small "ALOHA" string every ~0.5 seconds. After a really long time, the...
Hi,
Does anyone know how to delete one or more spaces at the start or the end of a string?
For example I use:-
$variable =~ tr/@//d; # to delete @ sign
However, if I have a string
$va...
I am attempting to update a simple database with a Perl script, but I am not having much luck. Is there anything wrong with the following script?
When I try running the client on a different machine from the server, the IO::Socket new method returns 'connection refused'. Here is the server:
use IO::Socket::INET;
my $s = IO::Socke...
I have a perl ftp download script that throws stuff into the day that its being downloaded on.
The format is
2008-03-19
2008-03-20
and so on.
However I only want to keep 7 days. So what ...
I have a sample file
10/03/2003 john smith california 10.00
12/2/2008 jane henry new jersey new york 20.20 32.12
I need to parse this file such that when I encounter the first decimal ...
I have a complex issue, where a scripted job is failing when it is compressing a zip file, because it gets over 2Mb in size and cannot zip up more than that. the client we work with will not a...
Hi Experts, Using Perl, I need to find and take the last 100 lines from a red.log file and add them to the top of green.log file if and when red.log => 500 lines. Any ideas? thanks
how do I make the database connection to Oracle using here document in Perl?
I'm doing a table-wide search and replace in Mysql using Perl. I just started getting DBD::Mysql errors on some of the content I mean to be removed entirely.
Here is the error:
DBD::mysql:...
I run up against a number of situations where I want to replace one of many possible finds with that find plus some changes.
Example:
I want to replace any of these letters [abc] with th...
Here is an example of the input file:
0,2007,A,MassLd,7,106,212,314,81,y,
0,2008,B,MassLd,8,107,213,315,82,x,
0,2009,C,MassLd,9,108,214,316,83,z,
0,2006,D,MassLd,6,109,215,317,84,u...
Please see the attached code snippet. Using an example form a previous solution, I'm trying to use the following if statements in the script:
substr($_, 7, 1, "B") if substr($_, 7, 1) eq "0...
dos2unix does not work for me, so I like to try do this inside perl.
I need to remove the "^M" at end of each line.
how could I do this in perl?
Hey Guys, I am working on a project for school and I cannot figure out what is wrong with my code. I have an Access .mdb we are supposed to connect to with a ODBC DSN. I created the DSN and h...