Re: How to speed up two arrays compare.

2009-02-11 Thread Raymond Wan
Hi Kevin and all, John W. Krahn wrote: As to whether the algorithm Rob presented is the "best" algorithm, that depends on the data being used and how often this operation needs to be preformed. For example, the algorithm I presented above has a best case of O( 1 ) while the one Rob present

Re: what does this match for?

2009-02-11 Thread John W. Krahn
practicalp...@gmail.com wrote: I saw a Regex: (?i:(j?sessionid|(php)?sessid|(asp|jserv|jw)?session[-_]?(id)?|cf(id|token)|sid)) I especially didn't know what the leading "?i:" means. Please help, thanks! The /i option means that everything inside the parentheses is a case insensitive patter

what does this match for?

2009-02-11 Thread practicalperl
I saw a Regex: (?i:(j?sessionid|(php)?sessid|(asp|jserv|jw)?session[-_]?(id)?|cf(id|token)|sid)) I especially didn't know what the leading "?i:" means. Please help, thanks! -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http:/

Re: How to speed up two arrays compare.

2009-02-11 Thread Chas. Owens
On Wed, Feb 11, 2009 at 11:07, kevin liu wrote: snip >> But this will still take O( n * m ) if all the elements of @nwarray0 are in >> @nwarray1. >> >> If the elements of @nwarray1 are sorted then you could a binary search on >> it and reduce your worst case to O( n * log m ). > > But how coul

Re: How to speed up two arrays compare.

2009-02-11 Thread John W. Krahn
kevin liu wrote: On Wed, Feb 11, 2009 at 11:22 PM, John W. Krahn wrote: The best you can do with two arrays is exit as soon as an element of @nwarray0 is not found in @nwarray1: my $found = 1; SEARCH: foreach my $srctemp ( @nwarray0 ) { foreach my $tgttemp ( @nwarray1 ) { if ( $tgtt

Re: Running perl scripts on remote machine

2009-02-11 Thread vijaya R
Hi, why can't you compile an exe of the scripts such that all can be executed from the respective machines without any dependencies? Regards, Vijaya

Re: Running perl scripts on remote machine

2009-02-11 Thread Dermot
2009/2/11 Sarsamkar, Paryushan : > Hi All, Hi > Can I install perl on a common machine and keep all of our scripts > there? Then can any team mate run those scripts remotely on that > machine? Or is there any other way to handle this situation? I think you should be looking at ssh. Not sure how

Re: How to speed up two arrays compare.

2009-02-11 Thread kevin liu
On Wed, Feb 11, 2009 at 11:22 PM, John W. Krahn wrote: > kevin liu wrote: > >> Hi everybody: >> > > Hello, > > > I have two arrays(@nwarray0 and @nwarray1) in my program and i want >> to make sure that >> all the elements in @nwarray0 could be found in @nwarray1. >>Here is my implementat

Re: How to speed up two arrays compare.

2009-02-11 Thread kevin liu
:) Rob Thank you very much for your help. Finally, I got this figured out. [?] On Wed, Feb 11, 2009 at 9:47 PM, Rob Dixon wrote: > kevin liu wrote: > > Hi everybody: > > > > I have two arrays(@nwarray0 and @nwarray1) in my program and i > want > > to make sure that > > all the

Re: How to speed up two arrays compare.

2009-02-11 Thread John W. Krahn
kevin liu wrote: Hi everybody: Hello, I have two arrays(@nwarray0 and @nwarray1) in my program and i want to make sure that all the elements in @nwarray0 could be found in @nwarray1. Here is my implementation: --- for

Re: rsh shell command hangs and does not return

2009-02-11 Thread Chas. Owens
On Wed, Feb 11, 2009 at 09:31, Rob Dixon wrote: snip > This is one of the reasons why I deplore command-line Perl - because the > format > depends enormously on the command shell being used. The example was for a Unix > shell, but with Windows command prompt only double-quotes will suffice to > d

Re: rsh shell command hangs and does not return

2009-02-11 Thread Rob Dixon
Bob McConnell wrote: > From: Rob Dixon >> Chas. Owens wrote: >>> >>> perl -MIPC::Open2 -le 'print ok' >> >> That will be >> >> perl -MIPC::Open2 -le 'print "ok"' >> > > Fascinating. I have been trying out Camelbox > on a new system with WinXP Pro SP2. > When

Running perl scripts on remote machine

2009-02-11 Thread Sarsamkar, Paryushan
Hi All, I have a team of 4 people, and have some perl scripts written to make our life easy J Now if my team mates want to run the scripts, then they have to install perl on their machine (also the modules required for the scripts), then download perl scripts on their machine and then run those

RE: rsh shell command hangs and does not return

2009-02-11 Thread Bob McConnell
From: Rob Dixon > Chas. Owens wrote: >> >> perl -MIPC::Open2 -le 'print ok' > > That will be > > perl -MIPC::Open2 -le 'print "ok"' > Fascinating. I have been trying out Camelbox on a new system with WinXP Pro SP2. When I paste that line into a console wi

Re: How to speed up two arrays compare.

2009-02-11 Thread Rob Dixon
kevin liu wrote: > Hi everybody: > > I have two arrays(@nwarray0 and @nwarray1) in my program and i want > to make sure that > all the elements in @nwarray0 could be found in @nwarray1. > Here is my implementation: > --- >

Re: How to speed up two arrays compare.

2009-02-11 Thread Telemachus
On Wed Feb 11 2009 @ 4:04, kevin liu wrote: > Hi everybody: > > I have two arrays(@nwarray0 and @nwarray1) in my program and i want > to make sure that all the elements in @nwarray0 could be found in @nwarray1. Check 'perldoc -q array' - two or three of the FAQ answers touch on different

Re: how to delay printing without over working perl

2009-02-11 Thread itshardtogetone
- Original Message - From: "Chas. Owens" To: "itshardtogetone" Cc: beginners@perl.org If you absolutely must avoid outputting data until after the loops are finished, you should probably write your output to a file and then display the file after the loop. Yes, for sequential reasons,

Re: bash in perl

2009-02-11 Thread Nikhil Babu
I agree and i accept my folly. Thanks [?] I guess being a novice clearly shows. Forever Nikhil Babu On Tue, Feb 10, 2009 at 7:50 PM, Chas. Owens wrote: > On Tue, Feb 10, 2009 at 04:03, Nikhil Babu wrote: > > Hi, > > > > you can very well try the following > > > > $x = ENV{'PWD'}; > > > >

Re: How to speed up two arrays compare.

2009-02-11 Thread Raymond Wan
Hi Kevin, kevin liu wrote: I have two arrays(@nwarray0 and @nwarray1) in my program and i want to make sure that all the elements in @nwarray0 could be found in @nwarray1. Your problem is a common problem that is not specific to Perl. A common solution is to place one of the arra

Re: Making regex's

2009-02-11 Thread Dermot
2009/2/10 Gunnar Hjalmarsson : > Dermot wrote: >> >> I am trying to create a regex to match a directory name in path string >> >> my $dir = dirname(shift); >> (my $code) = ($dir =~ m|track.(\w{3}).|); >> return $code; > > An unescaped . in a regex matches any character except a newline. I suppos

How to speed up two arrays compare.

2009-02-11 Thread kevin liu
Hi everybody: I have two arrays(@nwarray0 and @nwarray1) in my program and i want to make sure that all the elements in @nwarray0 could be found in @nwarray1. Here is my implementation: --- foreach my $srctemp ( @n