Re: removing white space

2002-11-22 Thread John W. Krahn
Mariusz K wrote: > > Hi, Hello, > One part of my script ads several strings into one: > $text = $part1.$part2.$part3.(...etc) > > However, if the part3 through part10 were empty I get that many white spaces > at the end of $text. I thought the best thing would be just to remove the > spaces at

RE: eval and alarm timeout for slow process (XML post)

2002-11-22 Thread NYIMI Jose (BMB)
> -Original Message- > From: jeff loetel [mailto:[EMAIL PROTECTED]] > Sent: Friday, November 22, 2002 9:01 AM > To: Perl beginners > Subject: eval and alarm timeout for slow process (XML post) > > > Does this look correct below. I know that I should test but > due to the environment tha

random string

2002-11-22 Thread rpayal
Hi, I am not at all familar to perl. I want to write a small perl script which will print a random string of atleast 8 characters. This string I intend to use as password for my application. I don't know perl at all. perl is in /usr/local/bin/perl The script when invovked like should print, #perl

Re: random string

2002-11-22 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > Hi, Hello, > I am not at all familar to perl. I want to write a small perl script > which will print a random string of atleast 8 characters. This string I > intend to use as password for my application. > I don't know perl at all. perl is in /usr/local/bin/perl > Th

Modulus operator, unexpected results

2002-11-22 Thread Poster
Hi, I am having a little trouble with a sub that is using the modulus operator. It is called here-within a while loop: while (my $row = $sth->fetchrow_hashref()) { count++; color_rows( $count ) --some other stuff table cell value -some other stuff }

Re: Modulus operator, unexpected results

2002-11-22 Thread Sudarshan Raghavan
On Fri, 22 Nov 2002, Poster wrote: > Hi, I am having a little trouble with a sub that is using the modulus > operator. > > It is called here-within a while loop: > while (my $row = $sth->fetchrow_hashref()) { > count++; > color_rows( $count ) > --some other stuff > tab

book for perl ???

2002-11-22 Thread Sunil Sonnad
Hi all, Which book would make the gr8 reference for PERL ??? S. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: book for perl ???

2002-11-22 Thread Jerry M . Howell II
O'Riely puts out a book most of my perl friends call the cammel book. Probably becuse of the cammel on the front cover, that would be my recomendation On Fri, 22 Nov 2002 17:23:41 +0530 Sunil Sonnad <[EMAIL PROTECTED]> wrote: > Hi all, > Which book would make the gr8 reference for PERL ??? >

Re: Fwd: Re: Declare $main::scalar in begin with 'use strict'

2002-11-22 Thread Paul Johnson
Dr. Poo said: > This worked perfectly. Why the hell havn't i ever seen INIT before? You haven't read perl5005delta? INIT is still fairly new - CHECK is even newer. Their initial purpose was to help the compiler. perldoc perlmod for the gory details. > One more thing though. In my code, i *HA

Re: book for perl ???

2002-11-22 Thread papapep
Sunil Sonnad wrote: Hi all, Which book would make the gr8 reference for PERL ??? S. 1.- Programming Perl 2.- Learning Perl Personally I prefer the second. Take a look at amazon, for example. Josep Sànchez [papapep] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands

outlook

2002-11-22 Thread Javeed SAR
Hi All, I am working on win2000( outlook), i have a question,depending on the message contents i need to do some further processing , is it possible to automatically copy the contents of the mail( i.e body contents) to your local drive or is it possible to take it in an array in PERL. Regards

Re: Modulus operator, unexpected results

2002-11-22 Thread Jeff 'japhy' Pinyan
On Nov 22, Poster said: >Hi, I am having a little trouble with a sub that is using the modulus >operator. No, your function is written incorrectly, and you don't use it correctly. >while (my $row = $sth->fetchrow_hashref()) { > count++; > color_rows( $count ) > --some other

Re: book for perl ???

2002-11-22 Thread Melanie Rouette
That would be "Perl In a Nutshell". I also recommend it. Jerry M. Howell II wrote: O'Riely puts out a book most of my perl friends call the cammel book. Probably becuse of the cammel on the front cover, that would be my recomendation On Fri, 22 Nov 2002 17:23:41 +0530 Sunil Sonnad <[EMAIL PROT

RE: Can perl read a word doc

2002-11-22 Thread Kipp, James
found this in a google seach, hth.. http://www.suite101.com/article.cfm/7977/89607 > -Original Message- > From: Johnstone, Colin [mailto:[EMAIL PROTECTED]] > Sent: Friday, November 22, 2002 12:26 AM > To: '[EMAIL PROTECTED]' > Subject: Can perl read a word doc > > > Gidday all, > > Can

localtime

2002-11-22 Thread jonathan . musto
Hi all, Does anyone know how to get the last six months into an array? ive got: my $month = (split ' ', uc localtime)[1]; to get the current month and now i want to get the previous 5 months, is there any way to perform arithmetic on the month value!?? Any help would be much appreciated, che

How to find list of variables and sub routines loaded, dynamically.

2002-11-22 Thread sharan
Hello, Is there any special variable which contains list of variable and sub routines in current scope. I would like to know dynamically if any and release them, if i don't need them. (similary to %INC, which contains list of loaded modules with their path). Thanks Sharan Hiremath -- To unsu

Re: How to find list of variables and sub routines loaded, dynamically.

2002-11-22 Thread Jeff 'japhy' Pinyan
On Nov 22, sharan said: >Is there any special variable which contains list of variable and sub >routines in current scope. I would like to know dynamically if any and >release them, if i don't need them. You can look through the %main:: hash to see the variables that exist in the main:: package.

Re: localtime

2002-11-22 Thread Jeff 'japhy' Pinyan
On Nov 22, [EMAIL PROTECTED] said: >Does anyone know how to get the last six months into an array? my @mon = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ); >my $month = (split ' ', uc localtime)[1]; >to get the current month and now i want to get the previous 5 months, is >there any wa

Re: Starter of a script

2002-11-22 Thread Chris Browning
On Thursday 21 November 2002 03:21 am, cedric gross wrote: > Hello every body, > > How to know what task have run a perl script ? > I mean is possible to get within the code which process Id have start the > script. If you're running Linux or Unix, perl holds your environment variables in a hash;

Re: Starter of a script

2002-11-22 Thread Jeff 'japhy' Pinyan
On Nov 22, Chris Browning said: >On Thursday 21 November 2002 03:21 am, cedric gross wrote: >> Hello every body, >> >> How to know what task have run a perl script ? >> I mean is possible to get within the code which process Id have start the >> script. > >If you're running Linux or Unix, perl hol

Re: localtime

2002-11-22 Thread John W. Krahn
Jonathan Musto wrote: > > Hi all, Hello, > Does anyone know how to get the last six months into an array? > > ive got: > my $month = (split ' ', uc localtime)[1]; > to get the current month and now i want to get the previous 5 months, is > there any way to perform arithmetic on the month value!

file not found : stat problem

2002-11-22 Thread Ben Crane
Hi list, I've got a silly problem that for some reason I can't work out..the following program goes through a txt file that contain folder structures, e.g. j:\temp\ex\ I want the program too loop through the array, and give me all the files within those directories and their size...but sometimes i

Re: localtime

2002-11-22 Thread Jeff 'japhy' Pinyan
On Nov 22, John W. Krahn said: >@mons = ( qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec/ ) x 2; >$mon = (localtime)[4] + 12; >print "@mons[$mon - 5 .. $mon]" Why the double array? (-5 .. 0) works just as well as (6 .. 11). -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobo

Re: How to find list of variables and sub routines loaded, dynamically.

2002-11-22 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Jeff 'Japhy' Pinyan) writes: >On Nov 22, sharan said: > >>Is there any special variable which contains list of variable and sub >>routines in current scope. I would like to know dynamically if any and >>release them, if i don't need them. > >You

Re: Starter of a script

2002-11-22 Thread Paul Johnson
Jeff japhy Pinyan said: > On Nov 22, Chris Browning said: > >>On Thursday 21 November 2002 03:21 am, cedric gross wrote: >>> Hello every body, >>> >>> How to know what task have run a perl script ? >>> I mean is possible to get within the code which process Id have start >>> the script. >> >>If yo

modification of stat problem

2002-11-22 Thread Ben Crane
Hi, Sorry, I forgot to add this: using file::find::name...what happens with folders that have a space in them, e.g. f:\special information\? Is there a special way of dealing with that? Ben __ Do you Yahoo!? Yahoo! Mail Plus – Powerful. Affordabl

perl dbi

2002-11-22 Thread Christopher Burger
Hello, I using the perl dbi and mysql and I was wondering if their was a load command with this. The following statement works with php LOAD DATA LOCAL INFILE '$file_location' INTO TABLE $table FIELDS TERMINATED BY ',' However I can not get the same command to work in perl. Any answers woul

Re: removing white space

2002-11-22 Thread Mariusz
Thank you for your response. I went to perldoc on the net and couldn't find any examples or more info on "-q space" Mariusz - Original Message - From: "Sudarshan Raghavan" <[EMAIL PROTECTED]> To: "Perl beginners" <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 1:29 AM Subject: Re: re

Re: removing white space

2002-11-22 Thread Mariusz
Thanks for replying. My text data comes from text fields so I read them through param and then in one instance I combine them into one string. Therefore, I don't need to remove all white spaces - only the ones at the end. I tried to lookup the "perldoc -q" on the net but couldn't find anything? (w

Last Wednesday of Month

2002-11-22 Thread Johnson, Shaunn
Howdy: Can someone clue me in as to how I can get the last Wednesday (or whatever) of the month? I have an example of what *might* work, but I'm not sure how I can use it if, say, there are five Wednesdays in the Month. [snip from code] #!/usr/bin/perl -w use strict; use warnings; use Dat

Re: random string

2002-11-22 Thread rpayal
Hi, Thanks for the mails all. But I haven't got a sentence or even a word. Please, I am looking for a *script* which will print a random string. Please someone take trouble of putting the info. in a file so that I can cut-paste it. As, I said I know *nothing* of perl, nothing at all so all those my

RE: Last Wednesday of Month

2002-11-22 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I took at the doc and it states that it comes back empty if not valid. So you could do something like: @last_wednesday = Nth_Weekday_of_Month_Year($new_year,$month,3,5); # start w/ 5th wed of month if (scalar(@last_wednesday)) { # if a value, then 5th wed exists }else { @last_wednesd

RE: Last Wednesday of Month

2002-11-22 Thread Johnson, Shaunn
--Looks great! --Thanks! -X -Original Message- From: Wagner, David --- Senior Programmer Analyst --- WGO [mailto:[EMAIL PROTECTED]] Sent: Friday, November 22, 2002 12:40 PM To: Johnson, Shaunn; [EMAIL PROTECTED] Subject: RE: Last Wednesday of Month I took at the doc and it stat

RE: Last Wednesday of Month

2002-11-22 Thread Satya_Devarakonda
Hi, In one of my scripts I am trying to grep lines from a list that doesn't have the word HOLD @temp_str = grep ( {$_ ne /HOLD/}, @temp_str); Can anybody help me on this. Satya Devarakonda IS - EDI Tufts Health Plan Tel: 617-923-5587 X 3413 Fax: 617-923- -- To unsubscribe, e-mail: [

avoid grepping a string

2002-11-22 Thread Satya_Devarakonda
Hi, In one of my scripts I am trying to grep lines from a list that doesn't have the word HOLD @temp_str = grep ( {$_ ne /HOLD/}, @temp_str); Can anybody help me on this. Satya Devarakonda IS - EDI Tufts Health Plan Tel: 617-923-5587 X 3413 Fax: 617-923- -- To unsubscribe, e-mail: [

Re: avoid grepping a string

2002-11-22 Thread Tanton Gibbs
I think you want @temp_str = grep { $_ !~ /HOLD/ }, @temp_str; or @temp_str = grep { !/HOLD/ }, @temp_str; - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 1:02 PM Subject: avoid grepping a string > Hi, > > In one of my scripts I

Re: avoid grepping a string

2002-11-22 Thread Jeff 'japhy' Pinyan
On Nov 22, Tanton Gibbs said: >@temp_str = grep { $_ !~ /HOLD/ }, @temp_str; >@temp_str = grep { !/HOLD/ }, @temp_str; No comma after the block. grep BLOCK LIST or grep EXPR, LIST -- Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/ RPI Acacia brother #734 ht

Perl & MySQL (SELECT)

2002-11-22 Thread Mariusz
A while ago I asked for help on the following: > I would like to be able to select records from the a table where record_id > and $record_id from my @record_ids matches. I know I could go through a loop > and send a SELECT query for each element in the array but is there a better > way? How can I

RE: Perl & MySQL (SELECT)

2002-11-22 Thread wiggins
On Fri, 22 Nov 2002 11:56:44 -0600, "Mariusz" <[EMAIL PROTECTED]> wrote: > A while ago I asked for help on the following: > > > I would like to be able to select records from the a table where record_id > > and $record_id from my @record_ids match

Re: exporting Constants

2002-11-22 Thread david
Tom Allison wrote: > How do I export a Constant from a module? > > Test.pm: > > package Test; > > @EXPORT_OK = qw(__what__); > use constant FOO => 123; > name the following Test.pm: #!/usr/bin/perl -w use strict; package Test; use Exporter; our @EXPORT_OK = qw(HI); use constant HI => 'Hi

Re: exporting Constants

2002-11-22 Thread Tanton Gibbs
Will print HI; not work...you would think you wouldn't have to qualify it if you import it into your namespace? - Original Message - From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 3:32 PM Subject: Re: exporting Constants > Tom Allison wrote: > >

RE: Hi all, question about caracter detection

2002-11-22 Thread Miguel Angelo
Hi All, thankx for the help (Sudarshan Raghavan and Beau E. Cox), i have found a generic solution here is the sample script... # #!/usr/bin/perl -wT ## # modules ## use strict ; ##

Re: Hi all, question about caracter detection

2002-11-22 Thread Tanton Gibbs
You could also use return $_[0] !~ m/[^a-zA-Z0-9]/; or return $_[0] =~ m/^[a-zA-Z0-9]+\Z/; the last one is clearer to me because you eliminate all of the negatives. - Original Message - From: "Miguel Angelo" <[EMAIL PROTECTED]> To: "Perl beginners" <[EMAIL PROTECTED]> Sent: Friday, Nov

howto: array index inside a foreach loop

2002-11-22 Thread Ken Lehman
Say I have a foreach loop that I used to modify elements when they match a pattern that I am searching for, but there is one special case where I get a match and I need the index for that element. Can I get that index or do I have to go with a for() loop. If this can be done how would I use it? Tha

Re: removing white space

2002-11-22 Thread david
Mariusz wrote: > Thank you for your response. I went to perldoc on the net and couldn't > find any examples or more info on "-q space" > > Mariusz > > on your machine, try the following in the command line: perldoc -q space david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

Re: howto: array index inside a foreach loop

2002-11-22 Thread Tanton Gibbs
You need to use a for loop for this. - Original Message - From: "Ken Lehman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 3:42 PM Subject: howto: array index inside a foreach loop > Say I have a foreach loop that I used to modify elements when they match a >

Re: random string

2002-11-22 Thread david
[EMAIL PROTECTED] wrote: > Hi, > Thanks for the mails all. > But I haven't got a sentence or even a word. > Please, I am looking for a *script* which will print a random string. > Please someone take trouble of putting the info. in a file so that I can > cut-paste it. > As, I said I know *nothing*

Re: exporting Constants

2002-11-22 Thread david
Tanton Gibbs wrote: > Will print HI; not work...you would think you wouldn't have to qualify it > if you import it into your namespace? the statement: print HI; won't work. it's: print Test::HI,"\n"; that i have in the code. Otherwise, Perl thinks that you want to print $_ to the HI file ha

Re: exporting Constants

2002-11-22 Thread Tanton Gibbs
Ah, then what about print HI, "\n"; the comma should disambiguate from a filehandle, right? - Original Message - From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 4:02 PM Subject: Re: exporting Constants > Tanton Gibbs wrote: > > > Will print HI; n

Re: exporting Constants

2002-11-22 Thread david
Tanton Gibbs wrote: > Ah, then what about > print HI, "\n"; > no. sorry! :-( in that case, Perl probably thinks that you want to call the function HI and than print whatever that function return to STDOUT. no such HI function so Perl will panic! :-) david -- To unsubscribe, e-mail: [EMAIL

Re: exporting Constants

2002-11-22 Thread Tanton Gibbs
Huh? I thought constants were implemented as functions? In other words, HI and HI() should both refer to the same entity. - Original Message - From: "david" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 4:06 PM Subject: Re: exporting Constants > Tanton Gibb

Re: howto: array index inside a foreach loop

2002-11-22 Thread david
Ken Lehman wrote: > Say I have a foreach loop that I used to modify elements when they match a > pattern that I am searching for, but there is one special case where I get > a match and I need the index for that element. Can I get that index or do > I have to go with a for() loop. If this can be d

Re: exporting Constants

2002-11-22 Thread david
Tanton Gibbs wrote: > Huh? I thought constants were implemented as functions? In other words, > HI and HI() should both refer to the same entity. true. but not in the your current namespace. david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: upgrading PPM

2002-11-22 Thread Clinton
Afraid of breaking something. Clinton http://www.mediamas.com.au/salesmine/default.htm - Original Message - From: "Timothy Johnson" <[EMAIL PROTECTED]> To: "'Clinton '" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 6:42 PM Subject: RE: upgrading PPM > > Why no

RE: howto: array index inside a foreach loop

2002-11-22 Thread Ken Lehman
yeah sorry, my problem is not quite as simple as the example. I just put that in to try and illustrate my point. I'm not trying to do a straight replace, I need to replace an element only if I find a certain string somewhere else. -Original Message- From: david [mailto:[EMAIL PROTECTED]] S

Re: exporting Constants

2002-11-22 Thread Tanton Gibbs
Sure it is, because you imported it from Test...I tried the following example and it worked fine #In file THGTest.pm package THGTest; use Exporter; our @ISA=qw(Exporter); our @EXPORT_OK=qw(HI); use constant HI => 'Hi, I am a constant.' #in file test.pl use THGTest qw(HI); print HI, "\n"; Two

Re: exporting Constants

2002-11-22 Thread Tanton Gibbs
oops, left off a ; and a 1; corrections below. - Original Message - From: "Tanton Gibbs" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 22, 2002 4:44 PM Subject: Re: exporting Constants > Sure it is, because you imported it from Test...I tried the following > example

Re: removing white space

2002-11-22 Thread John W. Krahn
Mariusz wrote: > > From: "John W. Krahn" <[EMAIL PROTECTED]> > > > > How to remove whitespace at the end (or beginning) of a string is a > > Frequently Asked Question. > > > > perldoc -q "How do I strip blank space from the beginning/end of a > > string" > > Thanks for replying. > My text data co

Re: exporting Constants

2002-11-22 Thread david
Tanton Gibbs wrote: > Sure it is, because you imported it from Test...I tried the following No, you can call (or use the constant) it without full qualifying it doens't mean the function or the constant is in your namespace. as you said below, Perl has way of finding it from the Exporter interf

Re: exporting Constants

2002-11-22 Thread Tanton Gibbs
Ah, I see the difference now. I didn't realize that you could still do the export without being an exporter. With that distinction I understand. HI is actually put into the namespace if you are an exporter...if you are not, then HI remains in the THGTest namespace. Thanks for all you help in cl

RE: removing white space

2002-11-22 Thread Mark Anderson
>I tried to lookup the "perldoc -q" on the net but couldn't find anything? >(www.perldoc.com right?) perldoc is software that generally is installed with perl. perldoc.com has the same information, but doesn't have a way to use the flags that the software version has. The -q flag to perldoc sear

How to tally money datatype?

2002-11-22 Thread chris
I am retrieving rows with a money datatype from a database. These are written to a file with 2 decimal places. I also keep a running total. My problem is the total does not equal to the sum of details. I have tried using $amount = sprintf('%.2f', $amount); $total += $amount; # do this after all

Re: Last Wednesday of Month

2002-11-22 Thread Randal L. Schwartz
> "Shaunn" == Shaunn Johnson <[EMAIL PROTECTED]> writes: Shaunn> Can someone clue me in as to how I Shaunn> can get the last Wednesday (or whatever) Shaunn> of the month? use Date::Manip; print UnixDate(ParseDateString("last wed of oct 2002"), "%m/%d/%Y\n"); => "10/30/2002\n" -- Randal L

Re: random string

2002-11-22 Thread rpayal
Hi, > why would you want to use Perl in the first place? no other alternatives? Maybe, But I am not a coder at all. > your problem is straight forward and if you are not familiar with Perl, you > might want to go with another language. i don't think it will be that hard > right? c/c++? java? shel

Re: extra characters return plus 0 in script

2002-11-22 Thread mike
On Fri, 2002-11-22 at 05:44, John W. Krahn wrote: > Mike wrote: > > > > I'm getting confused - I have the following script > > > > open(DESK,"gtkdoclist") or die "cant open"; > > @desk1=; > > foreach $desk1 (@desk1){ > > chomp $desk1; > > print "$desk1\n"; > > $gtkdoc1=system("grep -h gtk_doc_min

Re: random string

2002-11-22 Thread Tanton Gibbs
You should look at the rand function perldoc -f rand also, perldoc perlop and look for the . operator and .= operator as well as the .. range operator. If that doesn't work, try asking your professor for help. Tanton - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED

Re: extra characters return plus 0 in script

2002-11-22 Thread John W. Krahn
Mike wrote: > > On Fri, 2002-11-22 at 05:44, John W. Krahn wrote: > > Mike wrote: > > > > > > I'm getting confused - I have the following script > > > > > > open(DESK,"gtkdoclist") or die "cant open"; > > > @desk1=; > > > foreach $desk1 (@desk1){ > > > chomp $desk1; > > > print "$desk1\n"; > > > $

Re: How to tally money datatype?

2002-11-22 Thread John W. Krahn
Chris wrote: > > I am retrieving rows with a money datatype from a database. These are > written to a file with 2 decimal places. I also keep a running total. > My problem is the total does not equal to the sum of details. > > I have tried using > $amount = sprintf('%.2f', $amount); > $total += $

Re: extra characters return plus 0 in script

2002-11-22 Thread mike
On Sat, 2002-11-23 at 04:50, John W. Krahn wrote: > Mike wrote: > > > > On Fri, 2002-11-22 at 05:44, John W. Krahn wrote: > > > Mike wrote: > > > > > > > > I'm getting confused - I have the following script > > > > > > > > open(DESK,"gtkdoclist") or die "cant open"; > > > > @desk1=; > > > > foreac