Re: display error

2001-12-03 Thread J-E-N
thanks for the help ... i tried system("/usr/bin/fetchmail -aK -f /tmp/$uid.rc")==0 or die "command failed: $!($?)\n"; but still, does not display the exit code ... any suggestion? > On Dec 4, J-E-N said: > > >below is my script but its not working as it should > > > >system("command") or di

Problem related to page redirection in Perl.

2001-12-03 Thread D.Gupta
Hi, I am facing the following problem. If anybody knows the answer then please let me know. Problem Description: When the perl script on WCS side receives a packet from the NRS then it redirects to a page. Depending upon whether the agent is available and wait time out is non-zero, the perl scri

Re: display error

2001-12-03 Thread Jeff 'japhy' Pinyan
On Dec 4, J-E-N said: >below is my script but its not working as it should > >system("command") or die "command failed: $?\n"; system() returns 0 on SUCCESS, not failure. system("command") == 0 or die "command failed: $! ($?)"; perldoc -f system -- Jeff "japhy" Pinyan [EMAIL PROTECTED

display error

2001-12-03 Thread J-E-N
below is my script but its not working as it should system("command") or die "command failed: $?\n"; what will i do so that my script will display an error once the system command failed? thanks :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECT

Re: Can Perl work like Expect?

2001-12-03 Thread Ahmed Moustafa
Hi Brett, Thanks a lot. Where can I find exmaples for using Expect.pm, please? Brett W. McCoy wrote: > On Mon, 3 Dec 2001, Ahmed Moustafa wrote: > > >>I used to use Expect http://expect.nist.gov/ for dealing with >>interactive programs i.e. Telnet and FTP. >> >>Expect lets you interact with r

Re: subs in while loops

2001-12-03 Thread Brett W. McCoy
On Tue, 4 Dec 2001, Daniel Falkenberg wrote: > Hi All, > > while(1) { > #Read from a sub outside of the while loop... > get_sub(); > } > > get_sub { > print $test; > } > > I understand that the above code doesn't really say much but it gives a > brief understading of my problem. Baiscally

Re: Can Perl work like Expect?

2001-12-03 Thread Brett W. McCoy
On Mon, 3 Dec 2001, Ahmed Moustafa wrote: > I used to use Expect http://expect.nist.gov/ for dealing with > interactive programs i.e. Telnet and FTP. > > Expect lets you interact with running process as if it was a file. > > Does Perl have something like that i.e. writing a Perl script which > in

subs in while loops

2001-12-03 Thread Daniel Falkenberg
Hi All, while(1) { #Read from a sub outside of the while loop... get_sub(); } get_sub { print $test; } I understand that the above code doesn't really say much but it gives a brief understading of my problem. Baiscally when I compile the script I get a compilation error saying... Name "

Re: replace char n times

2001-12-03 Thread Jeff 'japhy' Pinyan
On Dec 4, Hasanuddin Tamir said: >Taken from perlfaq4, > >s/(_)/++$c <= $count ? '' : $1/ge; Hrm, why not: s/(_)/++$c > $count && $1/ge; since it's DOCUMENTED that > returns '' for false. -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother

Can Perl work like Expect?

2001-12-03 Thread Ahmed Moustafa
Hi All, I used to use Expect http://expect.nist.gov/ for dealing with interactive programs i.e. Telnet and FTP. Expect lets you interact with running process as if it was a file. Does Perl have something like that i.e. writing a Perl script which interacts with another process? Your help wil

Re: replace char n times

2001-12-03 Thread Hasanuddin Tamir
On Mon, 3 Dec 2001, Mark Hanson <[EMAIL PROTECTED]> wrote, > Hi gurus! > > I want to use the quantifier {COUNT}? in the following program to remove the first >three underscores. I'm trying to avoid a loop. I have not been able to figure out the >syntax. > > $a = "The_quick_brown_fox_jumped_ov

replace char n times

2001-12-03 Thread Mark Hanson
Hi gurus! I want to use the quantifier {COUNT}? in the following program to remove the first three underscores. I'm trying to avoid a loop. I have not been able to figure out the syntax. $a = "The_quick_brown_fox_jumped_over_the_lazy_dog."; $count = "3"; $a =~ s/(_{$count}?)//; print "\n$a\n

Re: Need help with workweek to week dates ...

2001-12-03 Thread rich+ml
Been a while since I had to do this... you need 'zeller congruence', an arithmetic formula to convert date to day-of-week (circa late 1800's IIRC). Google says 475 hits -- Rich On Mon, 3 Dec 2001, C.E.O. wrote: > Date: Mon, 3 Dec 2001 13:25:18 -0600 > From: C.E.O. <[EMAIL PROTECTED]> > To: [EMAI

Re: getting individual lines

2001-12-03 Thread Brett W. McCoy
On Mon, 3 Dec 2001, Tyler Longren wrote: > I have a HUGE document full of very simple SQL queries. Each query only > takes up one line in the file. How could I get every individual line of SQL > and execute it? I know how to query MySQL in perl, so that's fine...I just > don't know how to get

RE: Returning a text string

2001-12-03 Thread Brett W. McCoy
On Mon, 3 Dec 2001, Dean Theophilou wrote: > I'm using Perl to set a password and a coworker of mine is using > VB to call my program. The problem is that the person who will end op > running the VB program does not have access to the directory where > passwords are stored. So, I figured,

getting individual lines

2001-12-03 Thread Tyler Longren
Hello, I have a HUGE document full of very simple SQL queries. Each query only takes up one line in the file. How could I get every individual line of SQL and execute it? I know how to query MySQL in perl, so that's fine...I just don't know how to get the individual lines to execute. Thanks e

Re: system `ls` or File::Find?

2001-12-03 Thread John W. Krahn
Thomas Wright wrote: > > Hi folks. > > I need to select a single file name from a list of filenames and assign it > to a variable. > > I currently do this in a few shell scripts using: $last_file=`ls -1r > somedata_file.dat.*.orig | head -1` If you translate this to perl it becomes: my $last_

RE: Returning a text string

2001-12-03 Thread Dean Theophilou
Hi Brett: I'm using Perl to set a password and a coworker of mine is using VB to call my program. The problem is that the person who will end op running the VB program does not have access to the directory where passwords are stored. So, I figured, I'll use Perl to do the job, since I c

Re: permanently modify a hash key?

2001-12-03 Thread John W. Krahn
Mark Hanson wrote: > > Hi! > > Yet another hash question: > > How can I permanently modify a hash key? I have the following hash: > > my %hash = ( > hygiene_products_total_amount => { > 'conditioner' => "5", > 'shampoo' => "57", > '

Re: Returning a text string

2001-12-03 Thread Brett W. McCoy
On Mon, 3 Dec 2001, Dean Theophilou wrote: > I would like to exit a perl program such that upon exiting, it will return a > text string to the calling program. How would I go about doing this? > > exit $SomeTextString; > > doesn't work, since "exit" evaluates the above scalar as an integer

RE: Returning a text string

2001-12-03 Thread Bob Showalter
> -Original Message- > From: Dean Theophilou [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 03, 2001 5:07 PM > To: Perl_beginner (E-mail) > Subject: Returning a text string > > > Hello: > > I would like to exit a perl program such that upon > exiting, it will return a > text

Returning a text string

2001-12-03 Thread Dean Theophilou
Hello: I would like to exit a perl program such that upon exiting, it will return a text string to the calling program. How would I go about doing this? exit $SomeTextString; doesn't work, since "exit" evaluates the above scalar as an integer. Thank you in advance. Dean Theophilou Ge

RE: system `ls` or File::Find?

2001-12-03 Thread Bob Showalter
> -Original Message- > From: Wright, Thomas [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 03, 2001 3:15 PM > To: Beginners (E-mail) > Subject: system `ls` or File::Find? > > > Hi folks. > > I need to select a single file name from a list of filenames > and assign it > to a variab

RE: add hash to hash of hash

2001-12-03 Thread Bob Showalter
> -Original Message- > From: Mark Hanson [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 03, 2001 4:42 PM > To: [EMAIL PROTECTED] > Subject: add hash to hash of hash > > > Hi, > > Still more hash questions: > > using the example in chapter 9 of Programming Perl: > > %HoH = ( >

RE: add hash to hash of hash

2001-12-03 Thread John . Brooking
Just off the top of my head: {'pierce'} by itself is not a hash, is it? A hash is a set of key/value pairs, so a single value cannot be a hash. > -Original Message- > From: Mark Hanson [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 03, 2001 4:42 PM > To: [EMAIL PROTECTED] > Subject:

add hash to hash of hash

2001-12-03 Thread Mark Hanson
Hi, Still more hash questions: using the example in chapter 9 of Programming Perl: %HoH = ( flintstones => { husband=>"fred", pal=>"barney", }, ); how can dynamically add another hash to %HoH? In Programming Perl, they have a hard coded example

Re: system `ls` or File::Find?

2001-12-03 Thread Daniel Gardner
Monday, December 03, 2001, 8:14:48 PM, Wright, Thomas wrote: WT> When I do this in Perl thusly: WT> $oldfile = `system "ls -1r $oldfile.\*.orig | head -1"`; you want to use system *or* backticks, not both. $oldfile = `ls|head`; should do the trick here's something that will do it just in

system `ls` or File::Find?

2001-12-03 Thread Wright, Thomas
Hi folks. I need to select a single file name from a list of filenames and assign it to a variable. I currently do this in a few shell scripts using: $last_file=`ls -1r somedata_file.dat.*.orig | head -1` The "*" represents a timestamp in the filename. This allows me to select the most recent

Need help with workweek to week dates ...

2001-12-03 Thread C.E.O.
My company uses a custom workweek that begins at Midnight on Saturday and ends on Friday at 23:59:59.99. I need a subroutine that can take as input a workweek (12, 26, 36) and take as input a year (2002, 2003, 2004) all in the same operation. Then I need the subroutine to return values as cus

Re: Separating and parsing data

2001-12-03 Thread Trap 13
On Mon, Dec 03, 2001 at 03:00:39PM +, Sean Patterson wrote: > I just started learning Perl. I need help in writing a solution for the > following: > [ ..zap.. ] > > foreach $line (@list) { > ($time, $url, $title)=split(/|/, $line); # this does not seem to work You have t

Re: perl install

2001-12-03 Thread Trap 13
On Mon, Dec 03, 2001 at 09:10:25AM -0800, tom poe wrote: > Hi: I am running SuSE7.1 with perl5.6.0 default install. Directory = > /usr/bin/perl > > I went to CPAN, and ran install::perl, or something, and now have perl5.6.1 > installed in: /usr/local/bin/perl > > Well, this has led to a lot

Re: permanently modify a hash key?

2001-12-03 Thread Peter Scott
At 12:41 PM 12/3/01 -0600, Mark Hanson wrote: >How can I permanently modify a hash key? Delete the original element and add a new one. ($newkey = $oldkey) =~ s/foo/bar/; $hash{$newkey} = delete $hash{$oldkey}; This isn't something I find myself doing at all often. Doing so *m

permanently modify a hash key?

2001-12-03 Thread Mark Hanson
Hi! Yet another hash question: How can I permanently modify a hash key? I have the following hash: my %hash = ( hygiene_products_total_amount => { 'conditioner' => "5", 'shampoo' => "57", 'soap' => "1",

Getting IP info on a Win32 platform

2001-12-03 Thread Craig S Monroe
I looked in PPM, but could not find a package that seemed to match. I am looking for a package that helps access the IP info on a windows machine. Any direction or help would be great. Thanks. Craig [EMAIL PROTECTED] Pager Numeric: 1-877-895-3558 Email pager: [EMAIL PROTECTED] ---

RE:delete all files under a directory

2001-12-03 Thread Hasanuddin Tamir
On Mon, 3 Dec 2001, Jorge Goncalvez <[EMAIL PROTECTED]> wrote, > Hi, I wonder How to delete all files under a directory in Perl > Thanks. This one does it, but not recursively, and only real files, not directories. perl -e 'unlink <*>' san -- Trabas - http://www.trabas.com -- To unsubsc

RE:delete all files under a directory

2001-12-03 Thread Jeff 'japhy' Pinyan
On Dec 3, Jorge Goncalvez said: >Hi, I wonder How to delete all files under a directory in Perl use File::Path; rmtree(["/some/directory"]); perldoc File::Path -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 http://www.perlmonks.or

RE:delete all files under a directory

2001-12-03 Thread Jorge Goncalvez
Hi, I wonder How to delete all files under a directory in Perl Thanks. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

perl install

2001-12-03 Thread tom poe
Hi: I am running SuSE7.1 with perl5.6.0 default install. Directory = /usr/bin/perl I went to CPAN, and ran install::perl, or something, and now have perl5.6.1 installed in: /usr/local/bin/perl Well, this has led to a lot of confusion for @INC. Seems like one of the options is to install e

RE:Delete all event in th even tlog

2001-12-03 Thread Jorge Goncalvez
I use the WIn32::EventLog and I wonder how to delete all event logs elements I have this code: #!/usr/local/bin/perl -w use Win32::EventLog; use File::stat; use File::Find; use strict; my ($Event, @timearray, $filename, $day, $month, $directory, $logfile, $fileage); my $retrycount = 0; #

Update: Separating and parsing data

2001-12-03 Thread Sean Patterson
I just started learning Perl. I need help in writing a solution for the following: # Write data validation routines to - # Ignore blank lines... # Ignore comments... # Ignore complete pod sections # Process the following data, as described: 792910171010163200|http://web

Separating and parsing data

2001-12-03 Thread Sean Patterson
I just started learning Perl. I need help in writing a solution for the following: # Write data validation routines to - # Ignore blank lines... # Ignore comments... # Ignore complete pod sections # Process the following data, as described: 792910171010163200|http://we

Re: Passing parameters from one cgi script to another?

2001-12-03 Thread Brett W. McCoy
On Mon, 3 Dec 2001, Mei Leng Lee wrote: > I'm trying to pass some parameters from one script to another. I know > there's some perl module which can do that. But it's not install in the > system and I don't have the permission to install it either. Is there any > other way to do it? Pass them in

child ksh script that updates %ENV

2001-12-03 Thread Michael McQuarrie
Does anyone know of a wrapper that could be put around a ksh script, run as a child of a perl script, that could update the %ENV hash with the chages made by the ksh script. Michael McQuarrie __ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo

CGI on a Novelle box

2001-12-03 Thread Purshottam Chandak
We have a Unix server for our internet applications, but I am reluctant to do development work on it, being so new to Perl and we do not have another Unix server. Can I write and test CGI applications on a Novelle server? If so, what would I need to do - just install Perl on the server and then ca

Re: Passing parameters from one cgi script to another?

2001-12-03 Thread Jenda Krynicky
> I'm trying to pass some parameters from one script to another. I know > there's some perl module which can do that. But it's not install in > the system and I don't have the permission to install it either. Is > there any other way to do it? > > Virginia You don't need access to the common li

what is a structure

2001-12-03 Thread [EMAIL PROTECTED]
hi all, i have two questions, and would appriciate if someone could tell me where i can find answers to them. 1. what is a structure and where i can find information on what a structure is (as used in the code below) 2. how does the following line work: $SummaryPerWeek+= i.e. how is th

Threads and external commands.

2001-12-03 Thread Gustavo Zambon Rozatti
Hi, I had just subscribed this list. I made a perl script that uses Threads and external command (system() function). It uses to run fine at an linux machine with 2.2.16 kernel and Perl 5.6.1. I had migrated this script to another machine with linux and 2.4.7 kernel, but st

Re: Hello, how to tell if I have perl DBI?

2001-12-03 Thread Jonathan Gardner
On Sunday 02 December 2001 11:43 am, [EMAIL PROTECTED] wrote: > I'm just trying to tell if dbi itself is installed or not. I guess I have > to go to the mysql site and download it, but do I install the DBI for perl > or since I am using mysql *just* the specified DBD for mysql? That's what > is

SafePerl

2001-12-03 Thread Jules
Our web server enables us to use 'SafePerl' for CGI scripts. I can find little information relating to this, and what subset of Perl commands are enabled (or correctly, which commands are disabled). Can anyone point me in the right direction? Julian -- To unsubscribe, e-mail: [EMAIL PROTECTED

Passing parameters from one cgi script to another?

2001-12-03 Thread Mei Leng Lee
Hi, I'm trying to pass some parameters from one script to another. I know there's some perl module which can do that. But it's not install in the system and I don't have the permission to install it either. Is there any other way to do it? Virginia -- To unsubscribe, e-mail: [EMAIL PROTECTE

Re: Mail::Mailer Bcc problem

2001-12-03 Thread Jenda Krynicky
From: Michael Fowler <[EMAIL PROTECTED]> > On Fri, Nov 30, 2001 at 10:24:24AM -0600, Kanchana Weerasinghe wrote: > > I have a problem using Mail::Mailer with a Bcc in the headerthe > > recipient (To) can see the Bcc field in the email header. > > This is a problem with your MTA (mail transpor

Re: removing underscores based on quantity

2001-12-03 Thread John W. Krahn
Hanson wrote: > > Hi! > > I need to remove the first n underscores from various > strings if there are more than two currently present in the > string. The total number of underscores will vary. For > example, if I have the following strings: > > $a = "Now_is_the_time_for_all" > $b = "The_quick