Re: regex substituting math-functions

2002-07-28 Thread Janek Schleicher
Kay Bieri wrote at Sun, 28 Jul 2002 13:21:44 +0200: > 1.) First of all, I'm unhappy with the '~' I had to plug in so $funcs{$func}~[$1] >would not be > considered as a ref to an array. Is there a better way to stop Perl from >misinterpreting this? I > need the []-braces since arguments to funct

Re: Regex Problem

2002-07-28 Thread Jeff 'japhy' Pinyan
On Jul 28, Balint, Jess said: >Hello all. I am getting an error with the following reg-exp: > > s/\$\{(\w+)\}/$$1/g; > >I am not sure exactly how to do this type of thing. Is there any way to get >around the error or must I turn off 'strict refs' for this line?? Thanks >alot. If you're try

Re: Regex Problem

2002-07-28 Thread John Francis
Jess, Try: s/\$\{(\w+)\}/\$${1}/g; if i understood your problem correctly =) - John On Sun, 28 Jul 2002, Balint, Jess wrote: > Hello all. I am getting an error with the following reg-exp: > > s/\$\{(\w+)\}/$$1/g; > > I am not sure exactly how to

Re: comparing to everything in an array?

2002-07-28 Thread Tara Calishain
At 06:51 PM 7/28/2002, you wrote: >Tara, > Try this: > foreach $elemenet(@fooarray){ > if($element eq $foo){ > things_happen; > } > } > - John Thanks John a

RE: comparing to everything in an array?

2002-07-28 Thread Timothy Johnson
Just to throw in one more way to do it with a sub: ### MAIN # my $name = "Tim"; my @names = qw(Peter Paul Mary); if( MatchAny($name,\@names) ){ print "It's in there!\n"; }else{ print "Go fish.\n"; } ### SUBS # sub MatchAny{ my( $search

Re: Regex Problem

2002-07-28 Thread Robin Norwood
"Balint, Jess" <[EMAIL PROTECTED]> writes: > Hello all. I am getting an error with the following reg-exp: > > s/\$\{(\w+)\}/$$1/g; > > I am not sure exactly how to do this type of thing. Is there any way to get > around the error or must I turn off 'strict refs' for this line?? Thanks > a

Regex Problem

2002-07-28 Thread Balint, Jess
Hello all. I am getting an error with the following reg-exp: s/\$\{(\w+)\}/$$1/g; I am not sure exactly how to do this type of thing. Is there any way to get around the error or must I turn off 'strict refs' for this line?? Thanks alot. Jess -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: re-running the module configuration script

2002-07-28 Thread Wiggins d'Anconia
~/.cpan/CPAN/MyConfig.pm?? Should be a backup named "MyConfig.pm~" if you need it. http://danconia.org Scott Wahlstrom wrote: > Upon running > > #nada> perl -MCPAN -e shell > > a configuration file was changed...whats the name of this file? > > ThanX > > -- To unsubscribe, e-mail: [EM

Re: Problem with UNPACK

2002-07-28 Thread John W. Krahn
Tin-Shan Chau wrote: > > I have run into the following problem with UNPACK: Did you try the code I posted on Thursday? John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: comparing to everything in an array?

2002-07-28 Thread John Francis
Tara, Try this: foreach $elemenet(@fooarray){ if($element eq $foo){ things_happen; } } - John On Sun, 28 Jul 2002, Tara Calishain wrote: > Gentle Perl peo

Re: comparing to everything in an array?

2002-07-28 Thread Jenda Krynicky
From: Tara Calishain <[EMAIL PROTECTED]> > I know you can compare two variables: > > if ($foo eq $otherfoo) {things happen} > > What I want to know is if you can do something that compares a > variable to every element in an array. For example, would something > like > > if ($foo eq @fooarray)

comparing to everything in an array?

2002-07-28 Thread Tara Calishain
Gentle Perl people, Sorry to bother you with this, but I can't find the answer in my Pile of Perl Books. I probably don't know enough to ask the question correctly. I know you can compare two variables: if ($foo eq $otherfoo) {things happen} What I want to know is if you can do something that

Problem with UNPACK

2002-07-28 Thread Tin-Shan Chau
I have run into the following problem with UNPACK: If I concatenate the packed values of a list to a string, when I use the unpack operation to put the values back into an array, the last element is missing. I can only get around the problem by specifying the exact number of elements to unpac

re-running the module configuration script

2002-07-28 Thread Scott Wahlstrom
Upon running #nada> perl -MCPAN -e shell a configuration file was changed...whats the name of this file? ThanX -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: What does PPM do to install a package?

2002-07-28 Thread Timothy Johnson
The one other thing that PPM does besides copy the files is to note the changes in an XML file so that it "knows" which modules have been installed. For this reason PPM will not be aware of any modules that you have installed manually, adn it will not be aware of any changes that you make, such

RE: Syntax Culture

2002-07-28 Thread Cody Art Supply LLC
Hi, I'm pretty new to perl, but I think this may help: I believe a good 'rule of thumb' test can be "can that 'whole area that I think may be an expression' be used as having some type of value?" The reason '$x = $y + 2' is an expression is because you can legally (although almost never done

Re: chris, your address is bad (was "Re: perl parser for crontab files?")

2002-07-28 Thread Todd Wade
"David T-G" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >Sorry for the interruption, everyone. > >Chris, your email address (@home.com) is dead. Would you mind fixing it? Since you are asking people to change thier user agent's configuration, how about chai

Re: fastest way to substitute

2002-07-28 Thread Janek Schleicher
Paul Tremblay wrote at Sun, 28 Jul 2002 03:38:56 +0200: > I don't understand this syntax: > > >> s[([&<>]|(?<=\\)$rx)][$rep{$1}]go; > ^^^ > > Is that another way of telling the regex that you don't want to save the value? It a zero-width positive look-behind assertion. It says

Re: Syntax Culture

2002-07-28 Thread Janek Schleicher
Connie Chan wrote at Sat, 27 Jul 2002 15:15:03 +0200: > With this, I'll have a question again =) > how about : for (my $x = 0; $x <= 100; $x++){} ? > In every loop, $x return the value to the middle, > and the middle design to roll another loop or not. It is doing something similar to >if then e

regex substituting math-functions

2002-07-28 Thread Kay Bieri
Hello all I sometimes need to convert mathematical expressions from maple to mathematica in order to compare my results with somebody else's. There are simple functions like 'cos(arg)' which must be convertet to 'Cos[arg]' and a little more involved ones like 'dilog(arg)' which goes to 'PolyLog[2