Advertisement

250 organizations, including eBay, Ericsson and Lockheed Martin, now work smarter with Corporate Accounts. Save up to 42%

 

Welcome! If you have any general questions about Experts Exchange, feel free to ask me.

 
Time Tested Perl Solutions: 1 - 25 of 1164
 
Hi, i would like to convert a date format into unix timestamp. I searched the whole web but did not find anythin yet. Any sollutions?? tnahx a lot
I have a 4 byte string which I would like to convert to a integer. I'm reading the data from a file and the file contains 4 bytes for the ID number. So I've extracted the 4 bytes as text into ...
Anyone able to help me? i've got a function in perl which trims spaces (all of them) in a given string(=argument) which looks like : sub trim {    my($string)=@_;    for ($string) {      ...
I saw something about switch statements, so I tried one.  But it's not working.  Do you know what's wrong? chomp( my $score = <STDIN> ); switch( $score ) {     case [90..100] { print "...
I'm trying to return an array of "shared" members between two arrays (strings). Now my subroutine seems to work, but I can't read the return array. I suspect I'm passing a pointer to an ...
I want to pre-configure a software package that people download from a webserver. For this I'd like to preset some strings inside a binairy application file. Basically what I need is a Perl...
Let say I have "12345" store in $str. How do I tell how many chars are in $str ?
I have a perl script running on a solaris 9 box that if a mail queue hits 5000 a alarm goes off and send out a e-mail and text page. What i want to do is when this number is detected I want...
While reading STDIN I need to be able to break out of the while loop and stop the STDIN from reading the rest of the file if a condition is met. This has to be done from an if statment imbedde...
Hi, I need some help with writting a perl script. Here is what I need to do: 1. I need to pull down a bunch of files from an ftp server on a schedulable basis (mainly daily). The file name...
Hi, I am using the Net::Telnet module and calling $telnet->cmd($command) to invoke a process on a remote 2K machine, from a shell script on linux. The process is invoked fine but the 'cmd' co...
I have this type of data repeated over 100 times that I need to extract and write to a .csv file. (Just the numbers not the headers)         CAUCPSCT               KEY (CELL_NUMBER)     ...
I need to read the contents of a text or xml file and convert all lower case letters in the contents of the file to upper case. Is there a simple way using Perl that I could accomplish this.
I am a total newbie to PERL and could use some help.  I am using ActiveState PERL on XP.  I have files that are being ftp'ed/downloaded to c:\infilesA with names like b20031223.dat, c20031223...
I have the following perl code that copies and renames files with the current date appended to the file name.  I need to modify it to move  and rename the files with the date appended to the f...
I am getting the error message Spooler SubSystem App has encountered a problem and needs to close.  We are sorry for the inconvenience. while trying to print
This is close, but it deletes everything =). $BACKUP_DIR = "/var/www/backup"; # Read directory (ignoring . and ..) opendir(DIR,"$BACKUP_DIR") || die "opendir $BACKUP_DIR failed"; @file...
if I have a perl script for example test.pl in Windows XP, how do I run the script by just typing "test.pl <arg1> <arg2>" in the command line instead of having to type "perl test.pl <arg1> <ar...
There is a perl script which takes two command line parameters as input. This script (myscript.pl) has been encrypted using GnuPG tool (i.e. pgp) resulting myscript.pl.asc. When this perl scri...
Hello, Briefly, i have a list of comme files types i accept for upload with: @fichiers_permis      = ('tar\.gz','zip','tar');   then i generate my regular expression: foreach $type (@fich...
Using samba I mounted a UNIX folder into windows folder. Now I am trying to get a perl script that copied files from C:\ to this mounted drive which is called - S: Following is the script ...
I use the following regex to make every word in a string to make all words have first character uppercase. $str="JB morGan & CO"; $str=uc($str); $str=~ s/(\w+)/\u\L$1/g; in this exampl...
I'm trying to get this part of a perl script to work. $excludezone = "com\.ru"; if($domain2=~ m/\\$exclude_zone/ ) {    print "sorry $exclude_zone tld is not allowed"; } I basically...
I'm using a perl script to time things with code like $startmain=time; at the beginning and at the end of what I want to time.  Time seems to be limited to a minimum value of seconds, while I ...
Given two dates like the following Feb-14-07 18:20:11 Mar-03-07 20:32:19 how can I calculate the number of days (with decimals!) between the first an d the second?