Re: add info to beginning of a line

2002-04-19 Thread John W. Krahn
Alfred Vahau wrote: > > I agree. As an extention, the one liner can be used to insert a period. > For example > > 011001 to 01.1001 > > perl -pi -e's/^(\d{2})/\1\./' yourfile.txt The \1 form of backreference is deprecated, you should use $1 instead. Periods in str

RE: add info to beginning of a line

2002-04-19 Thread Tucker, Ernie
I want to thank everyone for the cool and useful info. Just what the young perl jedi needed :) -Original Message- From: Alfred Vahau To: Timothy Johnson Cc: [EMAIL PROTECTED] Sent: 4/19/2002 8:35 PM Subject: RE: add info to beginning of a line I agree. As an extention, the one liner ca

Re: How to thread in Perl?

2002-04-19 Thread Ahmed Moustafa
Chas Owens wrote: > my $terminate = 0; > $SIG{TERM} = sub { $terminate = 1 }; > until ($terminate) { > #do stuff > } > > #cleanup > > > You should definitely provide some means of cleanly bring down your > daemon. Cleaning up is application specific, isn't? Or, is there a standard proce

RE: add info to beginning of a line

2002-04-19 Thread Alfred Vahau
I agree. As an extention, the one liner can be used to insert a period. For example 011001 to 01.1001 perl -pi -e's/^(\d{2})/\1\./' yourfile.txt Alfred Vahau Project Breeze UniPNG --- RE: add info to beginning of a line Date: Fri, 19 Ap

Re: B/C - Re: help parsing file (fwd)

2002-04-19 Thread Jeff 'japhy' Pinyan
-- Forwarded message -- Date: Fri, 19 Apr 2002 19:06:30 -0400 (EDT) From: Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> Reply-To: [EMAIL PROTECTED] To: drieux <[EMAIL PROTECTED]> Subject: Re: B/C - Re: help parsing file On Apr 19, drieux said: >> while () { >> next unless /^$pref

Re: help parsing file

2002-04-19 Thread drieux
On Friday, April 19, 2002, at 03:09 , Jeff 'japhy' Pinyan wrote: [..] > First, I'd use a regex trick of //g in scalar context, and /^/m. > > while () { > next unless /^$prefix/; > $_ .= while /^$prefix/gm; > print; > } I'm not sure I understand the 'exit' strategy here. assume t

Re: help parsing file

2002-04-19 Thread John W. Krahn
Timothy Johnson wrote: > > In that case, you could always change > > ###my $nextLine = ; > > to > > ###my $nextLine = unless $nextline =~ /^$prefix/; That won't work because the $nextLine in $nextLine =~ /^$prefix/ is a global variable and the $nextLine in my $nextLine

Re: help parsing file

2002-04-19 Thread Jeff 'japhy' Pinyan
On Apr 19, drieux said: >### while() { >### if( /^$prefix/ ) { >### print "$_"; >### my $nextLine = $_; >### while ( $nextLine =~ /^$prefix/ ){ >### $nextLine = ; >### print "$nextLine"; >### } >### } >### } # end while I would foll

RE: help parsing file

2002-04-19 Thread Timothy Johnson
Actually, yeah, spoke too soon. -Original Message- From: drieux [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:52 PM To: [EMAIL PROTECTED] Subject: Re: help parsing file On Friday, April 19, 2002, at 02:13 , Timothy Johnson wrote: > > In that case, you could always chang

Re: help parsing file

2002-04-19 Thread drieux
On Friday, April 19, 2002, at 02:13 , Timothy Johnson wrote: > > In that case, you could always change > > ### my $nextLine = ; > > to > > ###my $nextLine = unless $nextline =~ /^$prefix/; Contract negotiable I'm actually having problems getting that to work... "File "J

Re: help parsing file

2002-04-19 Thread drieux
On Friday, April 19, 2002, at 02:17 , Bob Showalter wrote: [..] >> On Friday, April 19, 2002, at 12:29 , Pedro A Reche Gallardo wrote: >> >>> I am trying to print only the line that contain the ">" symbol and the >>> next line. Bob, I will defer to Pedro on this - my reading had been that given

RE: help parsing file

2002-04-19 Thread Timothy Johnson
In that case, you could always change ###my $nextLine = ; to ###my $nextLine = unless $nextline =~ /^$prefix/; -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:17 PM To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Sub

RE: help parsing file

2002-04-19 Thread Bob Showalter
> -Original Message- > From: drieux [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 19, 2002 4:55 PM > To: [EMAIL PROTECTED] > Subject: Re: help parsing file > > > > On Friday, April 19, 2002, at 12:29 , Pedro A Reche Gallardo wrote: > > > HI, I have a file that it could be devided in

Re: help parsing file

2002-04-19 Thread Pedro A Reche Gallardo
Hi Drieux, thanks a lot for the help. Your program is working very well. My best wishes for you. Pedro *** PEDRO A. RECHE , pHDTL: 617 632 3824 Dana-Farber Cancer Institute, FX: 617 632 4569 Harvard Medical School,

Re: help parsing file

2002-04-19 Thread drieux
On Friday, April 19, 2002, at 12:29 , Pedro A Reche Gallardo wrote: > HI, I have a file that it could be devided in set of lines, each set > startingi with a line that has the ">" symbol. Of everyset of lines, I > am trying to print only the line that contain the ">" symbol and the > next line.

Re: stripping out quotes

2002-04-19 Thread Jeff 'japhy' Pinyan
On Apr 19, Brian Smith said: >if ($line =~ /\"/) { $line =~ s/\"//g; } That is slower, if anything, than just doing $line =~ s/"//g; which might even be slower than $line =~ tr/"//d; The backslash can be removed -- " needn't be escaped here. The problem with if ($line =~ /foo/) { $li

Re: Programming for DOS

2002-04-19 Thread A. Rivera
Look into the Term-ANSIColor module. (Term-ANSIColor [1.03] Color screen output using ANSI escape sequences) Regards, Agustin Rivera Webmaster, Pollstar.com / PollstarOnline.com - Original Message - From: "Connie Chan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, April 19, 2

Re: stripping out quotes

2002-04-19 Thread Brian Smith
- Original Message - From: "rory oconnor" <[EMAIL PROTECTED]> To: "perl" <[EMAIL PROTECTED]> Sent: Friday, April 19, 2002 4:06 PM Subject: stripping out quotes > I get a file of email addresses that is tab-delimited that i import into > a mysql database. occasionally there is an email

Re: Best module to use for Date/Time calculations?

2002-04-19 Thread Peter Scott
At 10:59 AM 4/19/02 -0400, KEVIN ZEMBOWER wrote: >What module would folks recommend to do some math on Date/Time strings? >There's so many to choose from in CPAN, I'm not sure where to start. > >I'm interested in processing a web server log, which has a data format >like: >gw243.carlson.com - - [0

stripping out quotes

2002-04-19 Thread rory oconnor
I get a file of email addresses that is tab-delimited that i import into a mysql database. occasionally there is an email address enclosed in quotes that really mucks things up. How can I handle this? thanks! Rory -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail

RE: Sudoers Regex

2002-04-19 Thread Jason Larson
> -Original Message- > From: Blackburn, David W [mailto:[EMAIL PROTECTED]] > Subject: Sudoers Regex > > Hi Hello. > > I am trying to parse a string of text from a sudoers file, > what I am trying > to get out is the HOSTCLUSTER name and the hosts. > > Host_Alias HOSTCLUSTER = h

RE: help parsing file

2002-04-19 Thread Timothy Johnson
You could try a variation of this: use strict; open(OUTFILE,">parse.log"); open(INFILE,"myfile.txt"); while(){ if($_ =~ /^>/){ #If it starts with > $_ .= ; #add the next line to $_ print OUTFILE $_; #and print it. } } -Original Message- From: Pedro A Re

Re: variable interpolation

2002-04-19 Thread bernabe diaz
Thank you very much !Now it's working! bd. Hanson, Robert wrote: >I prefer using a placeholder, you don't need to quote anything that way >which avoids mistakes. > >my $sth = $dbh->prepare('SELECT something FROM some_table WHERE some_key = >?'); >$sth->execute( CGI->param('NAME') ); > >Did you a

help parsing file

2002-04-19 Thread Pedro A Reche Gallardo
HI, I have a file that it could be devided in set of lines, each set startingi with a line that has the ">" symbol. Of everyset of lines, I am trying to print only the line that contain the ">" symbol and the next line. Please see below. Any help welcome. Regards, Example file >sptrembl|Q22966|Q2

Incr and Decr of Array Variables

2002-04-19 Thread drieux
The Coffee Break Moment REALLY Kicked ME as to what Mark Anderson was trying to point out. let f(x) denote the incrementing function let g(x) denote the decrementing function what is f(g(x)) and g(f(x)) baseline a b c x y z IncrArray b c d y z aa DecrArray ` a b w x y What About incrementing

RE: variable interpolation

2002-04-19 Thread Bob Showalter
> -Original Message- > From: bernabe diaz [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 19, 2002 10:18 AM > To: [EMAIL PROTECTED] > Subject: variable interpolation > > > Hi everyone, > could somebody help me with the following problem: > i have a code something like that > my $variab

Programming for DOS

2002-04-19 Thread Connie Chan
Hi everybody, Is there any method / pm for clear screen and GotoXY ( Point cursor at a certain XY location )? And is there anyway to make background / text / foreground color ? And is there anything for true color programming in DOS ? What exactly I want is to enlarge the resolution in DOS sh

RE: variable interpolation

2002-04-19 Thread Hanson, Robert
I prefer using a placeholder, you don't need to quote anything that way which avoids mistakes. my $sth = $dbh->prepare('SELECT something FROM some_table WHERE some_key = ?'); $sth->execute( CGI->param('NAME') ); Did you also print out the variable to prove that it does indeed contain some data?

variable interpolation

2002-04-19 Thread bernabe diaz
Thanks for help, but I tried that way too, and it does not work. BD bob ackerman wrote: > > On Friday, April 19, 2002, at 07:18 AM, bernabe diaz wrote: > >> Hi everyone, >> could somebody help me with the following problem: >> i have a code something like that >> my $variable = CGI->param('NAM

RE: TK madness

2002-04-19 Thread murphy, daniel (BMC Eng)
The successor to Walsh's "Learning Perl/Tk" (O'Reilly) is "Mastering Perl/Tk" (O'Reilly) and is much more complete. Dan Murphy [EMAIL PROTECTED] EMC Corp.508-249-3322 Hopkinton, MA 01748 EMC² where information lives

RE: add info to beginning of a line

2002-04-19 Thread Timothy Johnson
That's a neat trick. I'll have to use that. -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 10:27 AM To: [EMAIL PROTECTED] Subject: Re: add info to beginning of a line Ernie Tucker wrote: > > I have a text file that has a list of info. I

RE: How to check installed Modules in perl

2002-04-19 Thread Jaimee Spencer
Drieux, Thanks for your insight on the below code. Findmodules.pl is a find piece of art with your mods. As for as reporting back the Bug! If it is a bug, I really can't answer that one. Once again thanks for rewrite and the link to your website. I never knew about it, it will for

re: how to test -- Thanks for your answers :-)

2002-04-19 Thread Dennis Senftleben
Hey it works :o) you can see the result in a few days at http://zgal.sourceforge.net Dennis icq: #28395132 --- This message was sent by Postaci Webmail. See www.trlinux.com for details.

How to get SSL enabled pages using https?

2002-04-19 Thread Sane, Jayant
Newbie question. I am having trouble getting ssl enabled pages/uri using the user-agent/request object. I checked the documentation and it says it is supposed to work w/o requiring to do anything special/more (just as http). Here is excerpt of the test code I am trying: use LWP::UserAgent; use

Re: How do I read groups of 9 lines from a file into 1 record?

2002-04-19 Thread John W. Krahn
Cathy Gear wrote: > > I have a file of names and addresses. Each name and address is over nine > lines (including blanks). I want to use this file in a word document as an > address list. > > My attempt so far has resulted in every line being printed nine times. Help > please... > > #!/usr/con

Re: Multithread

2002-04-19 Thread Chas Owens
On Fri, 2002-04-19 at 10:53, walter valenti wrote: > Hi, > > someone has experience with multithread programmation in Perl?? > > > Thanks > > Walter Are you referring to multiprocess programming (forks and pipes) or threaded programming (many threads accessing the same variables in o

Re: add info to beginning of a line

2002-04-19 Thread John W. Krahn
Ernie Tucker wrote: > > I have a text file that has a list of info. I need to add a 00 to the > beginning of each line. What is the best way to do this? perl -pi -e's/^/00/' yourfile.txt John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

Re: How to test if a module is installed ?

2002-04-19 Thread Michael Lamertz
On Fri, Apr 19, 2002 at 06:02:32PM +0200, Dennis Senftleben wrote: > Hi ! > My perlscript uses the Image::Size module. > It works fine if it is installed, but if not I get a compilation error msg. > How can I test with perl if it is installed on my system ? > Is there something like > if ( -e Ima

Re: How to thread in Perl?

2002-04-19 Thread Chas Owens
On Fri, 2002-04-19 at 11:53, drieux wrote: > > On Friday, April 19, 2002, at 07:03 , Chas Owens wrote: > > > On Thu, 2002-04-18 at 18:28, drieux wrote: > [..] > >> you might want to have your 'main loop' in > >> > >> our $still_going = 1; > >> $SIG{TERM} = sub { $still_going = 0 }; # correcting

How to remove yourself from the list...

2002-04-19 Thread Jeff 'japhy' Pinyan
On Apr 19, [EMAIL PROTECTED] said: >Unsubscribe >Unsubscribe "*" >Unsubscribe * > >Unsubscribe me, please, from all of these lists. Each post to this list contains information on how to unsubscribe: List-Post: List-Help: List-Unsubscri

Re: variable interpolation

2002-04-19 Thread bob ackerman
On Friday, April 19, 2002, at 07:18 AM, bernabe diaz wrote: > Hi everyone, > could somebody help me with the following problem: > i have a code something like that > my $variable = CGI->param('NAME'); > #making connection to database > . > my $variable_ =$dbh->q

RE: How to test if a module is installed ?

2002-04-19 Thread Hanson, Robert
Something like this should work... if ( eval "require Image::Size" ) { Image::Size->import(); print "The module is installed!"; } else { print "It's not installed!"; } Rob -Original Message- From: Dennis Senftleben [mailto:[EMAIL PROTECTED]] Sent: Friday, April 1

RE: How to test if a module is installed ?

2002-04-19 Thread Nikola Janceski
command line: perl -e "use Image::Size" if you get an error, it's missing, else it's installed. > -Original Message- > From: Dennis Senftleben [mailto:[EMAIL PROTECTED]] > Sent: Friday, April 19, 2002 12:03 PM > To: [EMAIL PROTECTED] > Subject: How to test if a module is installed ? > >

RE: How do I read groups of 9 lines from a file into 1 r...

2002-04-19 Thread leandro
Asunto: RE: How do I read groups of 9 lines from a file into 1 record? Unsubscribe Unsubscribe "*" Unsubscribe * Unsubscribe me, please, from all of these lists. Bye, Leandro. > -Original Message- > From: <[EMAIL PROTECTED]> > Sent: Friday, April 19, 2002 4:28 PM > To: [EMAIL PROT

Incrementing the letters in an array

2002-04-19 Thread Bryan R Harris
I'm a perl infant, but I had an idea: foreach (@array) { tr/a-zA-Z/b-zaB-ZA/ } - B __ Hi, I have an array which contains letters. I need to increment these letters in the array one at a time. For example going from B to C. I was trying something like $array[$x]++; ho

How to test if a module is installed ?

2002-04-19 Thread Dennis Senftleben
Hi ! My perlscript uses the Image::Size module. It works fine if it is installed, but if not I get a compilation error msg. How can I test with perl if it is installed on my system ? Is there something like if ( -e Image::Size ) { use Image::Size ;} else { print(" module not install

Multithread

2002-04-19 Thread walter valenti
Hi, someone has experience with multithread programmation in Perl?? Thanks Walter -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

variable interpolation

2002-04-19 Thread bernabe diaz
Hi everyone, could somebody help me with the following problem: i have a code something like that my $variable = CGI->param('NAME'); #making connection to database . my $variable_ =$dbh->quote($variable); . $sth = ->$dbh->prepare(" SELECT something FROM s

Re: How do I read groups of 9 lines from a file into 1 record?

2002-04-19 Thread Jeff 'japhy' Pinyan
On Apr 19, Eric Beaudoin said: >while () { > for (my $i = 1; $i <= 9; $i++) { ># print the courent line (store in $_) >print OUTFILE; ># exit the loop if no more lines >last if eof; ># read the next line >$_ = ; > } >} This code loses a line of the file for each block

Re: How to thread in Perl?

2002-04-19 Thread drieux
On Friday, April 19, 2002, at 07:03 , Chas Owens wrote: > On Thu, 2002-04-18 at 18:28, drieux wrote: [..] >> you might want to have your 'main loop' in >> >> our $still_going = 1; >> $SIG{TERM} = sub { $still_going = 0 }; # correcting Chas's Issues... 8-) >> while ( $still_going ) { >> # th

Re: How do I read groups of 9 lines from a file into 1 record?

2002-04-19 Thread Eric Beaudoin
At 11:27 2002.04.19, [EMAIL PROTECTED] wrote: >I have a file of names and addresses. Each name and address is over nine >lines (including blanks). I want to use this file in a word document as an >address list. > >My attempt so far has resulted in every line being printed nine times. Help >please

How do I read groups of 9 lines from a file into 1 record?

2002-04-19 Thread cathy . gear
I have a file of names and addresses. Each name and address is over nine lines (including blanks). I want to use this file in a word document as an address list. My attempt so far has resulted in every line being printed nine times. Help please... #!/usr/contrib/bin/perl # open the input file

Re: add info to beginning of a line

2002-04-19 Thread A. Rivera
while() { print "00$_\n"; } ? Regards, Agustin Rivera Webmaster, Pollstar.com / PollstarOnline.com - Original Message - From: "Tucker, Ernie" <[EMAIL PROTECTED]> To: "Tucker, Ernie" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, April 19, 2002 8:14 AM Subject: add info to b

add info to beginning of a line

2002-04-19 Thread Tucker, Ernie
I have a text file that has a list of info. I need to add a 00 to the beginning of each line. What is the best way to do this?

Best module to use for Date/Time calculations?

2002-04-19 Thread KEVIN ZEMBOWER
What module would folks recommend to do some math on Date/Time strings? There's so many to choose from in CPAN, I'm not sure where to start. I'm interested in processing a web server log, which has a data format like: gw243.carlson.com - - [01/Feb/2002:17:18:54 -0500] "GET /images/line1mmc.gif HT

Re: How to thread in Perl?

2002-04-19 Thread Chas Owens
On Thu, 2002-04-18 at 18:28, drieux wrote: > > On Thursday, April 18, 2002, at 02:27 , Ahmed Moustafa wrote: > > > Chas, > > > > Thanks a lot! > > > >> #the main loop has exited, so we should check to see if there are > >> #any unreaped children > >> waitpid $_ for keys %running; > > > > My main

Re: proxy server that listens on 2 ports

2002-04-19 Thread Michael Lamertz
On Fri, Apr 19, 2002 at 07:40:35PM +1000, Conan Chai wrote: > hi all, > i'm writing a simple proxy server that listens on 2 ports, 1 for browser and another >for admin client. the admin client is for administrative tasks such as adding new >users and reseting downloaded bytes. i'm currently usin

Apache::GD::Graph font problem

2002-04-19 Thread Gary Stainburn
Hi all, I've just installed GD::Graph and Apache::GD::Graph and they look great for what I want to do. Unfortunately, I'm having a problem with fonts. I've installed the ttfonts-1.0-3.noarch.rpm rpm which has given me some truetype fonts on my syste. I've set up the various settings to point

Re: running external perl scripts

2002-04-19 Thread Michael Lamertz
On Fri, Apr 19, 2002 at 08:50:04AM +, A Taylor wrote: > So if the result of the password check is False then i want to run a perl > script called 'password.pl'. If the password is true I want to run a script > called 'page.pl' (for example). But how do i tell perl to run 'password.pl' > or

proxy server that listens on 2 ports

2002-04-19 Thread Conan Chai
hi all, i'm writing a simple proxy server that listens on 2 ports, 1 for browser and another for admin client. the admin client is for administrative tasks such as adding new users and reseting downloaded bytes. i'm currently using the IO::Select module but this mode is blocking I/O, so i inten

Re: $::MY_VARIABLE

2002-04-19 Thread Jonathan E. Paton
> what's the difference between: > > $::MY_VARIABLE Global variable - stored in main's symbol table. > and > > my $MY_VARIABLE Lexically scoped variable - not available outside the scope. > if they're both declared in main()?! You need to know the difference between local and my. :

Re: $::MY_VARIABLE

2002-04-19 Thread Felix Geerinckx
on Fri, 19 Apr 2002 00:05:58 GMT, [EMAIL PROTECTED] (Pradeep Sethi) wrote: > Obviously they're treated differently by perl because $::MY_VARIABLE > does not equal $MY_VARIABLE. $::MY_VARIABLE is a shorthand for $main::MY_VARIABLE, which is a (global) package variable. A variable declared wit

running external perl scripts

2002-04-19 Thread A Taylor
Hi all, I am trying to write some perl scripts that check a password and then, depending on whether the result is True or False, run a different perl script. So if the result of the password check is False then i want to run a perl script called 'password.pl'. If the password is true I want to ru

Re: Incrementing the letters in an array

2002-04-19 Thread Gary Stainburn
On Thursday 18 April 2002 6:57 pm, Allison Ogle wrote: > Maybe it is because I am assigning my array to a line from another document > and not assigning letters dirtectly to the array because it still doesn't > work. It could be there is something wrong with my code too. > > > $word=; #where is

$::MY_VARIABLE

2002-04-19 Thread Sethi, Pradeep
what's the difference between: $::MY_VARIABLE and my $MY_VARIABLE if they're both declared in main()?! Obviously they're treated differently by perl because $::MY_VARIABLE does not equal $MY_VARIABLE. anyone? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: TK madness

2002-04-19 Thread Felix Geerinckx
on Thu, 18 Apr 2002 23:36:16 GMT, [EMAIL PROTECTED] (James Taylor) wrote: > > For example, I would have a > program that does something like: > > for (1 .. 10) { >print "$_\n"; > } > > Well, I need to print that into the canvas in TK. How the hell do I > do this?! It seems like something