Looking for example of how to keep an FTP processing running if the Ip Address is down or unavailable

2008-03-24 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have a polling process that runs 24x7 ( internal site ) and for the most part has no problems except that they shutdown the the internal site every three or four weeks and my process then dies. I have a simple setup: $MyFtp = Net::FTP->new($GlblInfo{ipaddr}, Debug => 1); $MyFtp

RE: Looking for example of how to keep an FTP processing running if the Ip Address is down or unavailable

2008-03-24 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Chas. Owens [mailto:[EMAIL PROTECTED] > Sent: Monday, March 24, 2008 11:42 > To: Wagner, David --- Senior Programmer Analyst --- WGO > Cc: Perl Beginners > Subject: Re: Looking for example of how to keep an FTP > processing running if t

Example of FTP w/o Input file? Is it possible to do or not?

2008-04-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have a hash which contains for each entry the email which I need to ftp to a particular location with a specified name. I could write out the file and then do the ftp. But since I have the necessary data in an audittrail report, I was wondering if I can ftp from a variable using ftp comma

RE: Example of FTP w/o Input file? Is it possible to do or not?

2008-04-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Chas. Owens [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 09, 2008 12:33 > To: Wagner, David --- Senior Programmer Analyst --- WGO > Cc: beginners@perl.org > Subject: Re: Example of FTP w/o Input file? Is it possible to > do or no

RE: Example of FTP w/o Input file? Is it possible to do or not?

2008-04-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Chas. Owens [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 09, 2008 13:05 > To: Wagner, David --- Senior Programmer Analyst --- WGO > Cc: beginners@perl.org > Subject: Re: Example of FTP w/o Input file? Is it possible to > do or no

RE: CSV duplicate

2008-04-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Manoj [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 16, 2008 12:00 > To: 'Perl Beginners' > Subject: CSV duplicate > > Hello List, > > > > Scenario: > > CSV file > > Host=Nirus,TCPIP,inxcp011,connected,Serv=rxmcpp1 > > Host=Nirus,TCPIP,inxcp011,co

RE: problem using backslash on brackets in regular expressions

2008-04-22 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Daniel McClory [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 22, 2008 16:06 > To: beginners@perl.org > Subject: problem using backslash on brackets in regular expressions > > Hi, > > I have files which contain sentences, where some lines have extra > inf

RE: How do I find the key of a specific hash element?

2008-05-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: jshock [mailto:[EMAIL PROTECTED] > Sent: Monday, May 19, 2008 07:20 > To: beginners@perl.org > Subject: How do I find the key of a specific hash element? > > For example: > > my %weekdays = ( > 0 => "SUN", > 1 => "MON", > 2 => "TUE", >

RE: hash

2008-05-22 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Bobby [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 22, 2008 12:33 > To: Rob Dixon; beginners@perl.org > Cc: Bobby > Subject: Re: hash > > Rob, > > Yes the pids are unique. > > I've tried the comparison below but didn't worked, so what do > you think is

RE: Reg. Directory listing program

2008-06-04 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Gunwant Singh [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 04, 2008 10:02 > To: beginners@perl.org > Subject: Reg. Directory listing program > > Hi, > > I am new to this mailing list and I am very new to PERL. So, > please bear > with me for my question

RE: Reg. Directory listing program

2008-06-04 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Wagner, David --- Senior Programmer Analyst --- WGO > [mailto:[EMAIL PROTECTED] > Sent: Wednesday, June 04, 2008 11:08 > To: Gunwant Singh; beginners@perl.org > Subject: RE: Reg. Directory listing program > > > -Original Mes

Problems w/ MVS::JESFTP.pm

2008-07-30 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Running the following script: my $MyJES = MVS::JESFTP->open($MyHost, $MyLogonId, $MyPw) or die; printf "open to MVS completed w/o error\n"; if ( ! defined $MyJES->submit($MyJob) ) {; #$job is the absolute name of a valid jcl file printf "Problem with submission of job\n<$MyJob>\n";

RE: matching ' in regx

2008-08-26 Thread Wagner, David --- Senior Programmer Analyst --- WGO
From: Dan Baker [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2008 17:00 To: beginners@perl.org Subject: matching ' in regx I have a thing driving me NUTS trying to detect a ' in a variable with regex, and either strip it out or at least detect and error out. for instance, this just d

RE: comparing text files, in a way

2008-09-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: frazzmata [mailto:[EMAIL PROTECTED] > Sent: Monday, September 08, 2008 10:13 > To: beginners@perl.org > Subject: comparing text files, in a way > > I am writing a program where I want to be able to locate information > regarding a person in one file, if they a

RE: store first key of a hash to scalar

2008-09-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Noah [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 10, 2008 13:10 > To: Perl Beginners > Subject: store first key of a hash to scalar > > Hi there, > > What is the easiest way to store the first key of a hash to a scalar > variable? > Perl

RE: store first key of a hash to scalar

2008-09-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Noah [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 10, 2008 13:23 > To: John W. Krahn > Cc: Perl Beginners > Subject: Re: store first key of a hash to scalar > > okay that basically answers my question. I will have to > figure out to > define a ke

RE: matching lines in array - other ways to code

2008-09-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Noah [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 10, 2008 16:28 > To: Perl Beginners > Subject: matching lines in array - other ways to code > > Hi there, > > could somebody please suggest some other ways to simplify the reading > and perhaps make

Changing from FTP to Secure copy

2008-10-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I am in the middle of moving from Solaris to Linux environment. On the current Solaris box, I use Net::FTP for all the work that needs to be done. On Linux, the ftp is not available, due to security concerns. The Linux environment had Perl at 5.8.0 and so I got the okay to bring down AS

Cron environment for execution of Perl script

2008-11-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I need an environment variable from my .profile on Solaris and having troubles getting at it. I have a Perl script which executes fine outside of cron and now am trying to do via cron. I wanted to stay away from a shell script and was wondering what is the easiest way to get my .profile

RE: Cron environment for execution of Perl script

2008-11-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Chas. Owens [mailto:[EMAIL PROTECTED] > Sent: Saturday, November 08, 2008 10:14 AM > To: Wagner, David --- Senior Programmer Analyst --- WGO > Cc: Perl Beginners > Subject: Re: Cron environment for execution of Perl script > > On T

RE: Cron environment for execution of Perl script

2008-11-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Telemachus [mailto:[EMAIL PROTECTED] > Sent: Saturday, November 08, 2008 6:13 AM > To: beginners@perl.org > Subject: Re: Cron environment for execution of Perl script > > On Thu Nov 06 2008 @ 3:42, Wagner, David --- Senior > Programm

Attempting to use SFTP between Windows and Linux box

2008-11-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have a couple of processes that run one on a production box and another on a test box. The production box script checks that a particular file is never more than 40 minutes old while on the test box, this checks that the actual polling processes ( in this case three pollers ) also are

Warning that I am receiving. but not making any sense

2008-11-25 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I get the following printed out on my terminal: pl517c.pl: Gen Rpt/Email St: 08:38:48 Attempt to free unreferenced scalar: SV 0x2063c74, Perl interpreter: 0x22424c at C:\CurrWrka\00COMM~3\pl517c.pl line 1259. Attempt to free unreferenced scalar: SV 0x206984c, Perl interpreter: 0x22424c at

RE: Warning that I am receiving. but not making any sense

2008-11-25 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Rob Dixon [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 25, 2008 11:46 AM > To: Perl Beginners > Cc: Wagner, David --- Senior Programmer Analyst --- WGO > Subject: Re: Warning that I am receiving. but not making any sense > >

RE: Warning that I am receiving. but not making any sense

2008-11-26 Thread Wagner, David --- Senior Programmer Analyst --- WGO
> -Original Message- > From: Rob Dixon [mailto:[EMAIL PROTECTED] > Sent: Tuesday, November 25, 2008 5:04 PM > To: Perl Beginners > Cc: Wagner, David --- Senior Programmer Analyst --- WGO > Subject: Re: Warning that I am receiving. but not making any sense > >

RE: Any way for Perl to write RTF within email as the body of an email without attachments

2004-03-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
nda Krynicky [mailto:[EMAIL PROTECTED] Sent: Monday, March 01, 2004 02:56 To: Beginner Perl Subject: Re: Any way for Perl to write RTF within email as the body of an email without attachments From: "Wagner, David --- Senior Programmer Analyst --- WGO" <[EMAIL PROTECTED]> > I h

RE: Any way for Perl to write RTF within email as the body of an email without attachments

2004-03-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
R. Joseph Newton wrote: > "Wagner, David --- Senior Programmer Analyst --- WGO" wrote: > >> >> I have b >> een trying what you suggest, but am not getting the rich text. Here >> is the spot of code: >> >> my $sen

RE: comparing a string to elements of an array

2004-03-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Stuart White wrote: > I'm reading in lines of text, and extracting the > relevant parts of it. These relevant parts are then > being pushed onto an array. My trouble is that these > parts are a maximum of 24 unique names. However, when > pushed onto the array, there is no mechanism for > compari

RE: comparing a string to elements of an array

2004-03-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Stuart White wrote: >>> In the end, I want @SAN to have all the unique names >>> within the file. Any ideas? >> You just described a Hash. Use %hash and then >> either uppercase or lowercase the the incoming key. >> YOu could then add a count to the Hash so you know >> you are looking at all

RE: Looking at .ini files

2004-03-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Meneses, Alden wrote: > Hello, > > How do I go about looking at remote hosts .ini file? I am looking for > a particular value inside the file to the accord of "TERM=" > You would need read capabiliity (obviously) on the remote machine and I am assuming you know where that file reside

RE: Return value from system command.

2004-03-11 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Silky Manwani wrote: > Hello, > > Back with the system command but with a different problem. > > I am calling a program with the system command which has arguments. > This program returns a string and I need to capture it. > > @args("command","arg1","arg2"); > $res = system(@args); > > print $r

RE: How do I increment a alphanumeric value?

2004-03-12 Thread Wagner, David --- Senior Programmer Analyst --- WGO
James Edward Gray II wrote: > On Mar 12, 2004, at 1:39 PM, Meneses, Alden wrote: > >> Suppose I have machines that are ACME >> >> I want to go from ACME0001 to ACME > > How's this? If you have it in a variable then you only need ++ to get to the next item: my $MyMachines

RE: How do I increment a alphanumeric value?

2004-03-12 Thread Wagner, David --- Senior Programmer Analyst --- WGO
d to verify it would work as stated: my $MyIds = 'ACME0001'; for(my $MyId=0;$MyId<1300;$MyId++) { printf "%s\n", $MyIds++; } Wags ;) > print "$pcname \n"; > $pcname++; > } > > I get these results > > ACME0001 > 1 > 2 > 3 >

RE: second-level string interpolation

2004-03-12 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Michael C. Davis wrote: > Hi, Apologies if I'm bringing up a repeated topic. I searched the > list archive and the web and nothing specific has turned up so far. > > Is there a way to defer evaluation of the contents of a > here-doc-defined value such that one can embed variables in the > here-d

RE: Folder Clean-up

2004-03-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Norman Zhang wrote: > Hi, > > I've /share_folder with many user folders. > > e.g., > > /share_folder/user_a > /share_folder/user_b > ... > > I would like to scan all user folders for files that are older than 30 > days and delete them. Is this doable with Perl? Use File:Find and you can

RE: Folder Clean-up

2004-03-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Norman Zhang wrote: >>> I've /share_folder with many user folders. >>> >>> e.g., >>> >>> /share_folder/user_a >>> /share_folder/user_b >>> ... >>> >>> I would like to scan all user folders for files that are older than >>> 30 days and delete them. Is this doable with Perl? >> >> Use File:F

RE: Folder Clean-up

2004-03-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Norman Zhang wrote: > Hi, > > Randy W. Sims wrote: >> Here is a routine I wrote a while back originally for scanning >> plugins. I've pruned it down (It could probably be much simpler as >> this routine does a breadth first scan which requires more >> bookkeeping, but I'm too lazy to fix it...), a

RE: How to print like HEX string

2004-03-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
NetSnake wrote: > Hi,all: > I use Perl SNMP module to get server information, but I can not > print ethernet MAC address. > When I use snmpwalk or snmpget program, I get like this: > ifPhysAddress.2 = STRING: 0:e0:ac:b0:c2:1 . > But in Perl, I can not print this string, in consol, p

RE: Week Numbers lists

2004-03-31 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Mike Blezien wrote: > Hello, > > I need to create a dropdown list of week numbers ranging from the > current week number to week number 01. The week number would be > obtain from a MySQL database, IE: select week(curdate()); this equals > 13 > > and from this week#, then I need to generate a lis

Time off my 8 hours on WP XP Prof

2004-04-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have looked at machine and looked at two others (one running xp prof and one w2k). They both come back with the correct time. The time on the machine is correct, but for 0927 PDT I get 1627 PDT. Now I can do thie my a MKS Kornshell or MS command prompt. I have tried TZ=PDT, b

RE: Time off my 8 hours on WP XP Prof

2004-04-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
WC -Sx- Jones wrote: > Charles K. Clarkson wrote: >> Wagner, David --- Senior Programmer Analyst --- WGO >> <[EMAIL PROTECTED]> wrote: > > : 0927 PDT I get 1627 PDT. Now I can do thie my a MKS Kornshell >>> or MS command prompt. >>> >>>

RE: Determining assigned drives

2004-04-23 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Cacialli, Doug wrote: > Is there some way to determine assigned drives? I'm thinking > something like readdir. You can use Win32-DriveInfo which has a number of items that it can do. I installed and wrote a simple script to show me my drives. Can do freebytes, clusters, etc also.

RE: Extracting number from string

2004-05-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
William Black wrote: > Hello All, > > I need a regular expression to extract only the number from the below > string. How is this done? > > x=G1234v00 the number in $1 if ( /^.(\d+)/ ) { # you have a number # now if always a G then cyou could change to ^G(\d+)

RE: Module to validate credit cards

2004-05-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Mike Blezien wrote: > Hello, > > can someone recommend a decent perl module or a reliabe routine to > check credit cards and expiration dates formats... not to actual > check if the card is valid, stolen,... etc, but just the format for > the common cards used today. Go to CPAN Search and

RE: String problem

2004-05-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Werner Otto wrote: > Hi there, > > I am trying to do the following: > > $string = system ("ping -a $hostname | cut -c20-30"); Then use backticks(`ping -a $hostname | cut -c20-30`) vs system if you want to see the output. System returns either success or failure, nothing else. Wags ;) >

Rounding difference from Perl on Solaris and Windows

2004-05-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
The code is very simple(it is not that much more complicated in the real processing, but wanted to see if it failed in this case), but I don't understand why the Unix is not rounding as I would expect. All the machines tested were under 5.8.3. $_ = 11700; printf "%6d %7.1f %7.2f\n",

RE: hour -1 routine

2004-05-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Anthony J Segelhorst wrote: > "Wiggins d Anconia" <[EMAIL PROTECTED]> wrote on 05/28/2004 > 12:37:56 PM: > >>> >>> I am trying to set up a script that will do the do a current time >>> -1 routine. >>> >>> Examples: >>> >>> Current Time: >>> mmddyy:hhss >>> 052804:1030 >>> >>> Output: >>> 0528

RE: Regexp

2004-05-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > I have the following lines: > > g00:~> perl -e ' > $a = "aa** a"; Since you have * which in a regex stands for zero or more occurances, then you must turn this off as part of the processing. You use \Q and \E as in /^\Q$b\E/ would take the aa** a as just that.

How to emulate a startup command from within a Perl script?

2004-06-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have a Perl process which runs on solaris under 5.8.3. It is started with the following command: su - prlusr -c "/usr/bin/perl -w /d/src/plpoll.pl >> /d/audit/`date '+%y%m%d'`.out 2>&1 &" I would like to a daily basis at time switchover and after I have complete

RE: Reading the Array line

2004-06-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > Greetings, > > I have an array with multiple rows. Each row is a record with several > elements. > > I wish to do two things: > > Read each line and print out some of the data. > Find multiple related lines in a second array, and print out some of > the data. >

RE: cut and substitute

2004-06-22 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Virmani, Amit (GMI Debt Technology) wrote: > Problem: > I have a field $cusip that has to change from ABC123-XX-7 (9 > characters with '-') to ABC123XX (first 8 characters only without > '-') If the field is truly a constant as you state, then two substr would be just as good: $c

RE: regexp needed

2004-06-22 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Goncalves, Jorge (Ext) wrote: > Hi List , I have this to print: > 1 > 2 > 3 > > with this script but it didn't work: > #!/usr/bin/perl > use strict; > use warnings; > > { > local $/; > my $file = ; > while ($file =~ /^\s+(\d+).(.+)$/) { > print $1\n if $2 =~ /extractStat/

RE: Hash of an array with colon and comma separator

2004-07-06 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Edward Wijaya wrote: > Hi, > > I have a file that contain this: > > GCTTGACGG: GCTTGACGA,GCTTGACCG,GCTTGACGA > CTTGAAGAG: CTTGACGAG,CTTGACGAG,CTTGACGAG,CTTGACGAG,CTTGAAGAA > CTTGACGAA: CTTGACGAG,CTTGACGAG,CTTGACGAG,CTTGACGAG > > My problem is that I want to create hash of and array. > Where the

RE: Creating or renaming a file with the creation date included......

2004-07-07 Thread Wagner, David --- Senior Programmer Analyst --- WGO
jason corbett wrote: > How can i rename a file or create a file with the date included? For > example, I want to automate and run reports and save the reports > under the date of when they were created i.e. JC07082004. Whats the > easiest way to do this? > > Thanks, > JC Using localtim

How to install when no c compiler allowed?

2004-07-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
How do you move what is necessary from one machine to another machine of like architecture and operating system when NO c compiler allowed? We see the make install modules and the packaging list. Is there a module which will do this? If not would using the list from the make be the way o

RE: directory and files

2004-07-12 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Thomas Browner wrote: > Can someone help me with this scrip that I am writing. I am trying to > get file and directory create date and if it is 7 days old then delete > it. I hoping someone can point me to a starting point. > > Thanks > > *Thomas > > * You should be able to use File::Fi

RE: Date module

2004-07-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Pam Derks wrote: > Hi all, > > I'm in search of a module that will give me the day of a week for a > particular date. > So for example, July 21 would return Wed > > I checked CPAN but nothing jumped out at me. > There are a number of modules, but for what you want, it would be just as ea

RE: Breaking up a large text stirng

2004-07-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
David Clarke wrote: > Hi, I have a string of text that is thousands of characters in > length. And I want to break it up into smaller records of say 500 or > 600 characters. Is there a Perl command to help to do this or am I > stuck with looping through the large input record and counting field > p

RE: getting list of all .html files in a directory and its directories

2004-07-30 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Andrew Gaffney wrote: > I need to get a list of all the files that end with '.html' in a > directory and all of its subdirectories. I then want to search > through each file and remove the ones from the list that contain > '<%perl>' or '<%init>'. How can I do this? Thanks for any help. Use

RE: pattern extraction

2004-08-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
JupiterHost.Net wrote: > Fontenot, Paul wrote: > >> Ugh, I thought I was done. >> >> Why would this show the MS?-??? in either upper or lowercase > href="http://www.microsoft.com/technet/security/bulletin/MS03-051.asp"; >> target="_default">Microsoft Security Bulletin MS03-051 >> >> And this one

RE: pattern extraction

2004-08-16 Thread Wagner, David --- Senior Programmer Analyst --- WGO
;_default">Microsoft Security Bulletin > MS02-045 > > I wouldn't think it would matter using the following regex > my ($mso) = $row[2] =~ /(MS\d\d-\d\d\d)/i; > > -Original Message- > From: Wagner, David --- Senior Programmer Analyst --- WGO > [mailto

RE: config from file

2004-08-17 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > Hi all, newbie question: I've got this .pl that has variables hard > coded in it, and I need to draw these form a file instead... Here's > roughly what I've got, how can I get the variables from a file in > stead? > > my %ldap_hosts =("SOME_ENVIRONMENT_NAME" => "serv

RE: is possible start some actions with Perl without Cron?

2004-08-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Maxipoint Rep Office wrote: > is possible start some actions with Perl without Cron? > > for example send email to users from database after 3 days or delete > something from database automaticaly after 3 day with Perl but > without Cron? Yes. You would write the Perl as a daemon and have

RE: is possible start some actions with Perl without Cron?

2004-08-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
to do, then attmept to do a portion of it. Run into problems, then show the snippet of code to the list and usually someone will be able to give some help. Wags ;) > -Original Message- > From: Wagner, David --- Senior Programmer Analyst --- WGO > [mailto:[EMAIL PROTECTED] > Sent

RE: grabbing programs output for logfile

2004-08-31 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Gavin Henry wrote: > Hi again, > > I thought I would make a new one for this: > > my $backup = system( $rdiff, @args); > system returns I believe success or failure. If you want the output, then use backticks to collect the output back to your variable. Wags ;) > Could I write $backup

RE: building substrings

2004-09-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
David Gilden wrote: > Hello, > > I am building a primary key for a database, and I guess the first > question would be > how safe is a key made from the last 4 digits of a social security > num and the first 3 letters of the last name. Now for the PERL > question, I have substr. line working cor

RE: help on comparing lines in a text file

2004-10-12 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Alden Meneses wrote: > so i have a text file that looks like this > > 10/04/2004 UPL TZOO CME CRDN WIBC PETD SMF > 10/11/2004 UPL TZOO CME WIBC PETD VNBC AMED > > anyway each line has 1 date field and 100 stock symbols and they are > in order. I am trying to compare the different lines to see wha

RE: global matching

2004-10-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Vladimir Lemberg wrote: > Hi, > > Could you help me to solve this problem? > > > > I have this file: > > foobar-45whatever-37hello16goodbye9#!!! > > snafu23skidoo---+30-50 > > > > I need to store all digits into list. As you can see there is no any > obvious delimiter, so I'm usin

RE: hash. removing duplicates

2004-10-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Vladimir Lemberg wrote: > Hi All, > > Could you help me resolve following problem. > > > > I have file: > > John Creamer: 123 345 123 678 345 > > Erick Morillo: 123 432 876 123 432 > > Cris Fortier: 678 123 987 123 345 > > > > I need to remove duplicated numbers from each line. The output

Trying to use regex to make multiple change with a code segment

2004-10-19 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Trying to make a subject line change for a number of scripts, but having no luck. The original code will have something like: $MySubject = sprintf "%-s%-s%-s [descriptive Subject] for %-s\n", $GlblInfo{subjectprefix}, $

RE: Why wont this read my file?

2004-10-20 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Dave Kettmann wrote: > Hi list, I'm trying to read a file and I cant see why it wont.. Here > is a spot of code I used for debugging. It should print out the file > (right?): > > *snip* > open MSTROCN, ">>/tmp/ocndir/master-ocn.txt"; This opening file in append mode. Either remove the >>

RE: How to get name of script

2004-11-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Zielfelder, Robert wrote: > How do I get the name of the current PERL script I am running? The > answer to this question may be very obvious but I can't seem to > locate it in my books or other resources. > > Thanks in advance, > > Rob Zielfelder $0 holds the info. Wags ;) **

Mutliple Regexs within the same block, but seems to be bypassing when I can see the data there

2004-11-23 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have been working on thie script to take MVS JCl/Proc's and bring them together in a single output. I parsing out the DSN ( data file name ) and then attempting to determine if input, output or delete. Here is the code ( quite large unforunately ). I have the data in

RE: Multiple Regexs within the same block, but seems to be bypassing when I can see the data there

2004-11-24 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Charles K. Clarkson wrote: > From: Wagner, David --- Senior Programmer Analyst --- WGO <> wrote: > >> I have been working on thie script to take MVS >> JCl/Proc's and bring them together in a single output. I >> parsing out the DSN ( data file name ) and

RE: Perl regrp 101

2004-12-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
David Gilden wrote: > Greetings, > > ## This Does what _not_ do what I would expect -- return the first 3 > characters of type '\w' > > $tmp ="Joe Smore1qazxswedcvfrtgbnhytujmkilptyot5000"; > $tmp =~ s/(^\w{3})(.*)/$1/; > print "$tmp\n"; I ran it and it displayed Joe. What version o

Dynamic Splice

2004-12-17 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I have the following line of code: $MyPrtLine = join( ",", (split (/ *\t */, $_))[9,10,11,15,25,28,31,32,34] ); Is there a way to build splice portion: [9,10,11,15,25,28,31,32,34] so I could place as a variable either like: $MyPrtLine = join( ",", (split (/ *\t

RE: renaming a file

2005-01-14 Thread Wagner, David --- Senior Programmer Analyst --- WGO
S E wrote: > Hello, > > I've been trying to apply my fledgling PERL skills to this task which > I have encountered a bit of a roadblock. What I want to do is rename > 20-100 files in two different directories that are created every > morning. They come in a name format such as these: > > 1st

RE: Create list of variables to be printed?

2005-02-02 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Kevin Horton wrote: > I'm a perl newbie working on a script to log data from a device that > sends more variables than I need to log. I have a working prototype > script, with the list of variables to be logged hard-coded, which > means I need to edit the script any time I need to change the items

RE: Create list of variables to be printed?

2005-02-02 Thread Wagner, David --- Senior Programmer Analyst --- WGO
On 2-Feb-05, at 1:09 PM, Wagner, David --- Senior Programmer Analyst --- WGO wrote: > Kevin Horton wrote: >> I'm a perl newbie working on a script to log data from a device that >> sends more variables than I need to log. I have a working prototype >> script, with t

RE: Loops & regexps

2005-02-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Larsen, Errin M HMMA/IT wrote: > Hi everyone, > > I've got a command (if you're familiar with EMC and PowerPath, you'll > recognize the output) that outputs a long list of information like > this: > > # powermt display dev=all > Pseudo name=emcpower0a > Symmetrix ID=000187720658 > Logica

Regex not working as expected when doing multiple checks and updates

2005-02-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Here is a watered down version, but unclear what I am missing. You should be able to cut and past. It is self contained and I am running on XP Pro, using AS 5.8.4. What am I trying to do? Well I have to implement a new setup. So I pull the reports I use for the emails from one s

RE: Start reading from a specific line

2005-02-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: > you are correct, you do not need " " around $. > thank you! > I was using strict and warnings, but must of had another error. > I am unfamiliar with the variable $.? I tried playing with it, but > was unsuccessful. I could not find it in cookbook nor in programming > pe

RE: Request for regex: Strip last dash in a record

2005-02-15 Thread Wagner, David --- Senior Programmer Analyst --- WGO
[EMAIL PROTECTED] wrote: >> [EMAIL PROTECTED] wrote: >> >>> Hi All, >>> >>> The code below does what I want to do, but it takes 3 lines and a >>> temporary array (yuck). I can't come up with a one line regex >>> substitution. Anyone got one? >>> >>> my $tmp = reverse split //, $_; >>> $tmp =~

RE: Diamond Operator and Filenames

2005-02-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Larsen, Errin M HMMA/IT wrote: > Hi Perl-Crunchers, > > I've got the following code: > > #!/usr/bin/perl > > use warnings; > use strict; > > my $logdir = '/some/application/logs'; > my @logs = <$logdir/*>; > > push @ARGV, @logs; > while( <> ) { > print "$filename:\n$_" if( /with errors

RE: Diamond Operator and Filenames

2005-02-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Larsen, Errin M HMMA/IT wrote: >> Larsen, Errin M HMMA/IT wrote: >>> Hi Perl-Crunchers, >>> >>> I've got the following code: >>> > > <> > >>> push @ARGV, @logs; >>> while( <> ) { >>> print "$filename:\n$_" if( /with errors/ ); >>> } >>> >>> Of course, my problem is that I'm not filling

RE: Diamond Operator and Filenames

2005-02-18 Thread Wagner, David --- Senior Programmer Analyst --- WGO
John W. Krahn wrote: > Wagner, David --- Senior Programmer Analyst --- WGO wrote: >> Larsen, Errin M HMMA/IT wrote: >> >>> Hi Perl-Crunchers, >>> >>> I've got the following code: >>> >>> #!/usr/bin/perl >>> >&

RE: Delete an element in an array

2005-02-21 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Oliver Fuchs wrote: > Hi, > > I want to save names from to an array. > Afterwards I want to delete a single name in the array received again > from . > > This is what I have: > > #!/usr/bin/perl > > use warnings; > > print "Some names please: \n"; > @names = ; > print "Delete one name? \n"; >

RE: read a directory

2005-02-28 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Carl Johnson wrote: > Hello group, > > I'm trying to read the directory "C:\GIS\wrapped_data" and write > record. My scripts is erroring with "can't open directory: no such > file or directory. What am I missing? > > $outfile = "$infile.txt"; > my $dir = "C:\GIS\wrapped_data"; With dou

RE: Perl program to convert system date to yymmdd

2005-03-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Nishi Prafull wrote: > HI: > > I want to write a perl script that would compute the date in the > format yymmdd(050303) and subsitute it for a variable in the perl > script. This variable is thereafter subsituted in a command that will > be run inside the script. > > myTest.pl > > var aDate;

RE: Perl program to convert system date to yymmdd

2005-03-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Nishi Prafull wrote: > On Thu, 3 Mar 2005 12:12:35 -0800, Wagner, David --- Senior Programmer > Analyst --- WGO <[EMAIL PROTECTED]> wrote: >> Nishi Prafull wrote: >>> HI: >>> >>> I want to write a perl script that would compute the date in the >

RE: RE : Perl program to convert system date to yymmdd

2005-03-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Jose Nyimi wrote: >> -Message d'origine----- >> De : Wagner, David --- Senior Programmer Analyst --- WGO >> [mailto:[EMAIL PROTECTED] >> Envoyé : jeudi 3 mars 2005 21:40 >> À : Nishi Prafull >> Cc : beginners@perl.org >> Objet : RE: Perl progra

RE: Running exe files in Perl

2005-03-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Julius Eric Abe wrote: > Hi, > > Is there a way in Perl or a function that has the capabilities of > calling or running executable files, let say i want the calculator in > windows run and I would call it through perl, is this possible. > Here is a simple shot. I use the editor scite an

RE: RE : Perl program to convert system date to yymmdd

2005-03-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
gt; i need to convert the time format to > 1356 > > Please let me know how I can do this. > Thanks. > > On Thu, 3 Mar 2005 13:01:24 -0800, Wagner, David --- Senior Programmer > Analyst --- WGO <[EMAIL PROTECTED]> wrote: >> Jose Nyimi wrote: >>>> -M

RE: call a Perl script within another Perl script

2005-03-03 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Nishi Prafull wrote: > Hi: > Apparently I noticed that when I put both the commands I need to run > in one script using the system call, the second command does not get > executed ( I cannot figure out the cause). They would have to be two separate calls. I used to start 10 to 15 processe

RE: Interpolation Problem with Matching

2005-03-08 Thread Wagner, David --- Senior Programmer Analyst --- WGO
RICHARDS, JIM wrote: > I am trying to compare files names listed in a file to the actual > files in a directory. My code is as follows: > > > > Opendir(DIR,"name"); > > @files=readdir(DIR); > > > > Open(IN," > > > While() { > > If(/^pattern/) { > >

RE: execute >1 actions after die

2005-03-09 Thread Wagner, David --- Senior Programmer Analyst --- WGO
susan lam wrote: > Is it possible to execute two actions such as a print > statement and a subroutine after die? No. What you should do, is the other actions first and then the die or one way: if ( ! open(FILE, $file) ) { sub1(); sub2();

RE: regular expression help

2005-03-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
CM Analyst wrote: > I am quite new to programming and Perl, so please bear > with me. > > I have a requirement to check the format of a field > before a record can be saved. The format of the field > needs to be double digit value separated by a . > (period) like "00.00.00". This I managed to do u

RE: regular expression help

2005-03-10 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Peter Rabbitson wrote: >> Simplest is change the {2} to {1,2} for all your entries. Now you >> mush have from 1 to 2 digits. Wags ;) > > > I think what he really wants is to throw a fit when there is a > leading zero for which your solution won't cut it. Here is how I see > it: > > $field =~ /^

RE: regexp help

2005-03-11 Thread Wagner, David --- Senior Programmer Analyst --- WGO
radhika wrote: > Hi, > I need to parse this string: 2005-03-11 13:49:41.19 > to just get the hour and minute. > > my program has: > > if( $string = /([\d]+)-([\d]+)-([\d]+)\s([\d\d):(\d\d):(\w+)/ ) > { >print("Hour:Minute = $4:$5\n"); > } I doubt that you are running under strict and

RE: Multiple variable initialization

2005-03-11 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Peter Rabbitson wrote: > Is there a quick way to initialize a number of variables at once? > Something like > > my ($var1, $var2, $var3); my ($var1, $var2, $var3) = ( 1,1,1 ); Wags ;) > > but instead of having undef in all of them, let's say I want to have > 1 in each. Any takers? > > Pe

  1   2   3   4   5   6   >