Re: A basic question about arrays

2002-07-27 Thread Steve Grazzini
Eric Preece <[EMAIL PROTECTED]> wrote: > Yet another newbie question. I have a file, each line > is a pipe delimited list (user name and password). I > want to open the file, search through each line using > the first entry as a key (so this may turn into a > question about hashes, but I am no

Re: How to throw 1 more hash or array to a sub ?

2002-07-27 Thread Steve Grazzini
Connie Chan <[EMAIL PROTECTED]> wrote: > > Sorry everybody... I know scalar(@array) and $#array's > different... I do this just normally, I like to count > from 0 as well.. so I treat the elems like this... > > What I am trying to ask is when this happen... > > sub something > {my ($hash, $

Re: filehandles and while loops

2002-07-27 Thread Yupapa
open(COUNT,") { chomp; if($_ =~ /BC0012/) { my($key,$count) = split('=',$_); $count++; print "$count\n"; } } close(COUNT); "David Gerler" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > okay... see

Advice

2002-07-27 Thread Yupapa
Hi, I have a script that allows my users to login. The script checks for valid username and password. After that, it will then redirect to a url containing the valid username and password and those variables are converted to hexadecimal. The problem is that if the user gives out the url to som

Fw: Advice

2002-07-27 Thread Connie Chan
Of cause, Cookies can help, if you want some modules can deal with cookies, look at : http://search.cpan.org/search?mode=module&query=Cookies But how to let the cookies becomes a reliable issue, that depends how you design on it. But the concept on using cookies is somewhat talking about GET some

Re: filehandles and while loops

2002-07-27 Thread Connie Chan
> > sub count { > > open (COUNT, "+>./count.dat") or die "cannot open countfile: $!"; > > flock(COUNT, 2); > > > > while (){ > > if (m/BC0012/i){ > > ($key, $count) = split('=',$_); > > $found = 1; > > $count++; > > } else { > >

Re: Syntax Culture

2002-07-27 Thread Jenda Krynicky
From: drieux <[EMAIL PROTECTED]> > On Friday, July 26, 2002, at 07:58 , Connie Chan wrote: > > And one more quick question. What are the meanings of > > "Expression" and "Block" , what are there difference ? > > an 'expression' is something that can be resolved, > > my $val =

Re: Syntax Culture

2002-07-27 Thread Connie Chan
> > These are all expressions: > 1 > 1 + 2 > $x * 2 > foo(1,2,3) + 49 > (1,2) x 2 > $x == $y > $x < 5 > $x > 1 && $x < 5 > but even this is an expression: > $x = $y + 2 > > Basicaly "expression" is something that creates a value that you can > assign to a variable, pass to a function or use as

RE: filehandles and while loops

2002-07-27 Thread David Gerler
I thought that was the applicable part. :-) Guess I needed more After the while loop, I would write the output to Count according to whether it was found or not. If it was found it should substitute the new cont for the old. If not found, it adds it to the end. After getting your email a

Re: fastest way to substitute

2002-07-27 Thread Jeff 'japhy' Pinyan
On Jul 27, Paul Tremblay said: >I ran a benchmark on your method, and it actually proved slower. I ran a >test line 10,000 times. Directly substituting each line took 38 wall >seconds. Using your method took 60. That's because my method requires creating a hash each time. If you were to take th

Re: filehandles and while loops

2002-07-27 Thread Connie Chan
Sorry, still can't get your logic... But there's a better approach here : open COUNT,"count.dat"; # ./ mean current dir, so, it's not nessary open TEMP, "temp.dat" ; Then , for the entire loop, you can read from COUNT, and write to TEMP. At last, unlink the COUNT file, then rename the temp.dat

Re: Stupid question time!

2002-07-27 Thread Wiggins d'Anconia
Janek Schleicher wrote: > Drieux wrote at Fri, 26 Jul 2002 18:07:51 +0200: > > >>p2: but I will religiously stand by the driving thesis: >> >> "would you really want to maintain that code?" >> >>having come back and 'blanched' at code that was no longer as 'readable' as it had >once been

Re: Stupid question time!

2002-07-27 Thread drieux
On Saturday, July 27, 2002, at 08:33 , Wiggins d'Anconia wrote: > Janek Schleicher wrote: >> Drieux wrote at Fri, 26 Jul 2002 18:07:51 +0200: >>> p2: but I will religiously stand by the driving thesis: >>> >>> "would you really want to maintain that code?" >>> >>> having come back and 'blanch

RE:regex question - Thanks

2002-07-27 Thread Steve
Thanks to John Krahn and Mark Anderson. I have the numbers I need now. From: "John W. Krahn" <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Steve wrote: > > From what I have read from The Camel $1 should contain the matched text. > From that matched text I want to then search for an additional stri

Re: fastest way to substitute

2002-07-27 Thread Paul Tremblay
On Sat, Jul 27, 2002 at 11:23:59AM -0400, Jeff 'japhy' Pinyan wrote: > > That's because my method requires creating a hash each time. If you were > to take that out of the function, it would run faster. Right. This makes perfect sense. I followed your advice and put the hash outside of the su

Re: fastest way to substitute

2002-07-27 Thread Jeff 'japhy' Pinyan
On Jul 27, Paul Tremblay said: >The only problem is how I should replace "&", ">", and "<". I think I'll >do single line subs for this text. Even with huge files it shouldn't >take more than 1/2 a second or so, and that allows me to use your >original method to speed things up. > >Or this just oc

Re: fastest way to substitute

2002-07-27 Thread John W. Krahn
Jeff 'Japhy' Pinyan wrote: > > On Jul 27, Paul Tremblay said: > > >The only problem is how I should replace "&", ">", and "<". I think I'll > >do single line subs for this text. Even with huge files it shouldn't > >take more than 1/2 a second or so, and that allows me to use your > >original met

Re: fastest way to substitute

2002-07-27 Thread Jeff 'japhy' Pinyan
On Jul 27, John W. Krahn said: >> No, $1 is either "&" or undef. Perhaps you want: >> >> s[([&<>])|\\($rx)][<$rep{$+}/>]go; >> >> That $+ means "the last () that matched". But that still replaces & with >> <&/>. So you'd need to make the '<' and '/>' part of the %rep hash's >> values. I wou

What does PPM do to install a package?

2002-07-27 Thread chris
I have two perl distribution on the same computer. The ActiveState distribution has PPM. I used this to install Win32::TaskScheduler package and all is well. For my other perl distribution, I thought I would just copy the files in the two packing lists to the appropriate directories but perl i

Re: What does PPM do to install a package?

2002-07-27 Thread chris
I did some more experimenting and discovered that the culprit was perl56.dll. For some reason, the perl56.dll is not compatible with TaskScheduler.dll in this distribution. If I simply replace this one file from ActiveState, it works but I cannot live with this fix. Anyways, PPM seems to have jus

perl parser for crontab files?

2002-07-27 Thread chris
Before I re-invent the wheel. Is there a perl parser routine for crontab format files? I have cron.pl written by Scott McMahan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: fastest way to substitute

2002-07-27 Thread Paul Tremblay
On Sat, Jul 27, 2002 at 02:40:52PM -0700, John W. Krahn wrote: > > I thought '<' and '/>' were already in the hash values? If so, wouldn't > this work? > > s[([&<>]|(?<=\\)$rx)][$rep{$1}]go; > > > I don't understand this syntax: > s[([&<>]|(?<=\\)$rx)][$rep{$1}]go; ^^^

Re: perl parser for crontab files?

2002-07-27 Thread David T-G
Chris -- ...and then chris said... % % Before I re-invent the wheel. Is there a perl parser routine for % crontab format files? Have you taken a look at http://search.cpan.org/search?mode=module&query=cron yet? HTH & HAND :-D -- David T-G * It's easier to fight for

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

2002-07-27 Thread David T-G
Sorry for the interruption, everyone. Chris, your email address (@home.com) is dead. Would you mind fixing it? HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED]