Re: grouppin in the regular expressions

2006-10-13 Thread John W. Krahn
I.B. wrote: > sorry, I didn't fraze my question correctly. ^ phrase > example : > $line="abcxabcxxabcxxxabc"; > > how to match everything beofre "xxx" but not xxx itself? > the answer i got is to use lookaheads: > > my $line = "abcxxabcxxxabc"; > if ($line =

Re: Optimisation of loops

2006-10-13 Thread John W. Krahn
Paul Johnson wrote: > On Fri, Oct 13, 2006 at 01:04:01AM +1300, Robin Sheat wrote: > >>Hmm, when i started looking on the net, that was one of the first things that >>came up. Also this: >>http://www-128.ibm.com/developerworks/library/l-optperl.html >>They're helpful, but unfortunately not large

Re: grouppin in the regular expressions

2006-10-13 Thread I . B .
sorry, I didn't fraze my question correctly. example : $line="abcxabcxxabcxxxabc"; how to match everything beofre "xxx" but not xxx itself? the answer i got is to use lookaheads: my $line = "abcxxabcxxxabc"; if ($line =~ m{(.*?(?:(?!xxx).))xxx}){ print "matched: $1\n"; } else{ print "f

Re: Optimisation of loops

2006-10-13 Thread John W. Krahn
Robin Sheat wrote: > On Thursday 12 October 2006 23:52, John W. Krahn wrote: >> >>my $users = get_all_users(); >>for ( my $i = 0; $i < @$users; ++$i ) { >>my $details = get_user_details( $users->[ $i ] ); >>my $sum = 0; >>my $count

Can't locate object method "driver"

2006-10-13 Thread Bret Goodfellow
I have implemented Nagios, and wanted to run this perl script to interrogate my Oracle systems. This really isn't a coding question, but rather a setup or execution question. I would like to understand why I am getting the following error when I run check_oracle_instance.pl natively from the linu

Re: nice regular expression

2006-10-13 Thread I . B .
got it! very nice, not complicated at all. I didn't know about lookahead feature. very useful. this file that should be matched: row 1 row 2 row 3 Bug some word row 4 row 5 this is file that should not be matched: row 1 row 2 row 3 Bug some word row 4 row 5 row 6 this is soluti

Re: nice regular expression

2006-10-13 Thread Paul Johnson
On Fri, Oct 13, 2006 at 12:36:33PM -0500, Charles K. Clarkson wrote: > I.B. wrote: > > : unfortunately I have to use regex to solve this problem. > > Why do you have to use a regex? Because that is what the question stipulates. -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net --

Re: grouppin in the regular expressions

2006-10-13 Thread John W. Krahn
I.B. wrote: > Hi nice people, Hello, > how to specify using regular expressions: match everything but string (xxx) > > i would do this : > > $line =~ /[^(xxx)]+/; > > but, as it was mentioned before () inside character class is not working. > what is solution here? Perhaps you want: $line !~

RE: grouppin in the regular expressions

2006-10-13 Thread Wagner, David --- Senior Programmer Analyst --- WGO
use !~ vs =~ which is if not so if ( $line !~ /\(xxx\)/ ) { # does not contain (xxx) }else { # does contain } If you have any problems or questions, please let me know. Thanks. Wags ;) David R Wagner Senior Program

Re: nice regular expression

2006-10-13 Thread Mumia W.
On 10/13/2006 12:14 PM, I.B. wrote: this is the problem: use regular expressions to prove that word "Bug" is in the 3 row from the end of table in the html tagged file: shell> cat file1.txt [...] Don't use regular expressions to parse HTML. Use an HTML parsing module to parse HTML. Now to

Re: http to https

2006-10-13 Thread Mumia W.
On 10/13/2006 11:50 AM, Andrew Kennard wrote: Hello all We have recently moved to a new hosting company that also provides us with an SSL service. The scenario: I have a form located at url http://www.mydomain.co.uk/myfolder/page1.htm which on submission, uses a sub routine that opens the f

grouppin in the regular expressions

2006-10-13 Thread I . B .
Hi nice people, how to specify using regular expressions: match everything but string (xxx) i would do this : $line =~ /[^(xxx)]+/; but, as it was mentioned before () inside character class is not working. what is solution here? thank you! ~i

RE: nice regular expression

2006-10-13 Thread Charles K. Clarkson
I.B. wrote: : unfortunately I have to use regex to solve this problem. Why do you have to use a regex? Charles K. Clarkson -- Mobile Homes Specialist Free Market Advocate Web Programmer 254 968-8328 Don't tread on my bandwidth. Trim your posts. -- To unsubscribe, e-mail: [EMAIL PROTE

Re: consecutive lines in a file

2006-10-13 Thread Mumia W.
On 10/13/2006 07:57 AM, Luba Pardo wrote: Dear sir/madam: I am trying to write a script to process to consecutive lines at a time and compare elements of between two consecutive lines. I don't understand this sentence. I tried something like: $i=0; while (){ chomp; @a1_s= split/\/, $a1_s[1];

Re: nice regular expression

2006-10-13 Thread I . B .
this is the problem: use regular expressions to prove that word "Bug" is in the 3 row from the end of table in the html tagged file: shell> cat file1.txt row 1 row 2 row 3 Bug some word row 4 row 5 shell> shell> cat file2.txt row 1 row 2 row 3 Bug some word row 4 row 5 row 6

http to https

2006-10-13 Thread Andrew Kennard
Hello all We have recently moved to a new hosting company that also provides us with an SSL service. The scenario: I have a form located at url http://www.mydomain.co.uk/myfolder/page1.htm which on submission, uses a sub routine that opens the file that is being passed to it (a .htm file - th

Re: nice regular expression

2006-10-13 Thread I . B .
thank you for reponse! unfortunately I have to use regex to solve this problem. I was trying to simplify: $file=~/.+Bug.+<\/tr>\s*.+<\/tr>\s*.+?<\/tr>\s*.+?<\/tr>\s*<\/table>/; still does not work!!! On 10/12/06, Dr.Ruud <[EMAIL PROTECTED]> wrote: I . B . schreef: > i have a task to ve

RE: consecutive lines in a file

2006-10-13 Thread Krishnakumar K P
-Original Message- From: Luba Pardo [mailto:[EMAIL PROTECTED] Sent: Friday, October 13, 2006 6:27 PM To: beginners@perl.org Subject: consecutive lines in a file Dear sir/madam: I am trying to write a script to process to consecutive lines at a time and compare elements of between two c

Re: consecutive lines in a file

2006-10-13 Thread Tom Phoenix
On 10/13/06, Luba Pardo <[EMAIL PROTECTED]> wrote: I am trying to write a script to process to consecutive lines at a time and compare elements of between two consecutive lines. It might be easiest to read the file into an array. Of course, that's only practical if it's not a large file. @a1

Uploading source and binaries to CPAN

2006-10-13 Thread Prashanth Meka
Hi, I tried uploading the source and binaries of my module to CPAN yesterday. I first uploaded the source and then the binaries and now, probably due to the timestamp, the download link on CPAN search points to the binaries rather than the source. What I really wanted to do was to have the downl

Re: Why is Perl a SHE

2006-10-13 Thread Robert Hicks
@ Rocteur CC wrote: Hi, I was just reading The State of the Onion 10 http://www.perl.com/pub/a/2006/09/21/onion.html by Larry, and if you have not read it I think you will enjoy it. I really ROFL when I saw that Randal was our own Evil Brother Damian ;-) Anyway, Larry refers to Perl as SHE.

Re: Optimisation of loops

2006-10-13 Thread OROSZI Balázs
Robin Sheat wrote: yeah, I understand Perl references, but you can't (afaik) do C-style pointer arithmetic with them. Luckily! Without pointer arithmetic, this access: $details->[ $j ] is something akin to (in C/Perl/psuedocode mishmash): address_of($details) + sizeof(void *) * $j That mult

Re: Newbie

2006-10-13 Thread Romeo Theriault
Perl is cross-platform, extremely useful for working with large amounts of text, using regular expressions, it has a great repository of modules for you to use for just about any task you can think of (CPAN), it's open source, it's got a great community, the list goes on and on. I would r

consecutive lines in a file

2006-10-13 Thread Luba Pardo
Dear sir/madam: I am trying to write a script to process to consecutive lines at a time and compare elements of between two consecutive lines. I tried something like: $i=0; while (){ chomp; @a1_s= split/\/, $a1_s[1]; @temp1 = split/>/, $a2_s[1]; print " line is $i, array is @a1_s, array

Re: logfile rotation

2006-10-13 Thread Bjørge Solli
On Friday 13 October 2006 14:37, Tim Wolak wrote: > On Fri, 2006-10-13 at 14:35 +0200, Thomas Bätzler wrote: > > Tim Wolak <[EMAIL PROTECTED]> asked: > > > I'm working on rotating log files and am using the > > > logfile::rotate module. What I need to do is add the date to > > > the file name tha

RE: logfile rotation

2006-10-13 Thread Tim Wolak
I want them rotated but marked with dates in their file names, instead of file.1, file.2 etc. Tim On Fri, 2006-10-13 at 14:35 +0200, Thomas Bätzler wrote: > Tim Wolak <[EMAIL PROTECTED]> asked: > > I'm working on rotating log files and am using the > > logfile::rotate module. What I need to do

RE: logfile rotation

2006-10-13 Thread Thomas Bätzler
Tim Wolak <[EMAIL PROTECTED]> asked: > I'm working on rotating log files and am using the > logfile::rotate module. What I need to do is add the date to > the file name that is being created. What exactly are you trying to achieve? If you add dates to the filenames, you're not rotating them a

RE: Extract barcodes from text file

2006-10-13 Thread Thomas Bätzler
Jack Daniels (Butch) <[EMAIL PROTECTED]> wrote: > Have spent the last couple hours searching Internet, reading > my perl books, but I just can't figure it out. > > Problem: > Our barcodes are 14 digits, however not all employees have a > scanner when associating the barcode with an item. > Barco

Re: Extract barcodes from text file

2006-10-13 Thread Rob Coops
So what your are looking for is something to read the file: open (IN, " ) { # Clean it up a little bit chomp; # lets just keep the digits $_ =~ s/\D*//g; # Replace anything that is not a digit with nothing # Print anything that is not 14 characters in length if ( length($_) <> 14 ) { print $_ . "

logfile rotation

2006-10-13 Thread Tim Wolak
Hi all, I'm working on rotating log files and am using the logfile::rotate module. What I need to do is add the date to the file name that is being created. Would I use the post function and move the file and append it to the file? If so could you proved an example? Thanks, Tim #!/usr/bin/pe

Extract barcodes from text file

2006-10-13 Thread Jack Daniels (Butch)
Have spent the last couple hours searching Internet, reading my perl books, but I just can't figure it out. Problem: Our barcodes are 14 digits, however not all employees have a scanner when associating the barcode with an item. Barcodes are then manually entered and are not always entered correct

Thread problem

2006-10-13 Thread ppp ppp
Hi All , I installed perl 5.8.8 . and now trying to use Thread but it's Giving me error like Undefiend subroutine &thread::new called at C:/Perl/lib/Thread.pm line 291 I am using the follwing code use Thread qw(yield async); async { my $foo = 50;