Re: storing values non-globally

2003-10-05 Thread Jeff 'japhy' Pinyan
On Oct 6, Kevin Pfeiffer said: >I have several types of user input values I am storing in %history, similar >to the way the shell maintains a history of previous command line commands. >These are only used by a sub-routine, but they need to remain valid for the >life of the program. I see no reaso

storing values non-globally

2003-10-05 Thread Kevin Pfeiffer
Hi all, Sorry about subject line, it's the best I could do. Two (somewhat realted) questions... I have several types of user input values I am storing in %history, similar to the way the shell maintains a history of previous command line commands. These are only used by a sub-routine, but they ne

Re: Should loops return a value?

2003-10-05 Thread Ville Jungman
I think it's better to keep this discussion on the list because i suppose there are other interested people, too. So, I put Your mail and my comments below: [EMAIL PROTECTED] wrote: I was thinking over your idea this morning, in the context of Perl's automatic context handling. I was wondering

Re: testing for substrings

2003-10-05 Thread John W. Krahn
Dan Langille wrote: > > Hi, Hello, > I have a perl regex to test if a file resides under a particular > directory. The test looks like this: > > if ($filename =~ $directory) { ># yes, this filename resides under directory > } > > This is working for most cases. However, it fails is the d

testing for substrings

2003-10-05 Thread Dan Langille
Hi, I have a perl regex to test if a file resides under a particular directory. The test looks like this: if ($filename =~ $directory) { # yes, this filename resides under directory } This is working for most cases. However, it fails is the directory contains a +. For example: $filename =

RE: Pattern Matching Operators

2003-10-05 Thread TN
>Is there a similar operator in Perl for ${variable##pattern} as there is in korn shell. As far as I can tell, no. However, from http://wwwcgi.rdg.ac.uk:8081/cgi-bin/cgiwrap/wsi14/poplog/man/1/ksh : ${parameter##word} Remove Largest Prefix Pattern. The word will be expanded to produce a

Re: Pattern Matching Operators

2003-10-05 Thread Zanardi2k3
[EMAIL PROTECTED] (Prasad Karpur) wrote: > Is there a similar operator in Perl for ${variable##pattern} as there > is in korn shell. Not knowing korn shell, i'm not sure if this is what you want, but there is a Pattern Matching Operator in perl, and it is the "m//" operator. Look at perldoc pe

Re: is it possiale to regex this

2003-10-05 Thread Zanardi2k3
[EMAIL PROTECTED] (Jerry Preston) wrote: > I am trying to figure out a way to remove the c pointers from the > following: > > *ci = *ci * (1.0 + ((gi/(w * *ci)) * (gi/(w * *ci; > > so that it will end ou as the following: > > ci = ci * (1.0 + ((gi/(w * ci)) * (gi/(w * ci; Not really d

is it possiale to regex this

2003-10-05 Thread Jerry Preston
Hi! I am trying to figure out a way to remove the c pointers from the following: *ci = *ci * (1.0 + ((gi/(w * *ci)) * (gi/(w * *ci; so that it will end ou as the following: ci = ci * (1.0 + ((gi/(w * ci)) * (gi/(w * ci; I am converting a c program with perl. Thanks, Jerry -- To u

Re: Group list elements

2003-10-05 Thread Götz Verdieck
Hi, Cris Charley posted me the following tip: I did this with the code below, but there are even better solutions in the attachment to this post. They are from MJD quiz of the week #6. However, they don't meet the requirement that only 2 numbers in sequence should be reported seperately :-) I ma