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;

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

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

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, barcodes.txt) or die Argh, failed to open barcodes.txt - $!; while ( 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

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. Barcodes are

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

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 is

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 that is being

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 (IN){ chomp; @a1_s= split/\/, $_{$I]; @a2_s= split/\/,$_[$i+1]; if ($a1_s[1] =~ /HG-Stats_gi1/){ @temp = split//,

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

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

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

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

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.

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

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=~/table.+Bug.+\/tr\s*tr.+\/tr\s*tr.+?\/tr\s*tr.+?\/tr\s*\/table/; still does not work!!! On 10/12/06, Dr.Ruud [EMAIL PROTECTED] wrote: I . B . schreef: i have a task to

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 -

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 table trtdrow 1/td/tr trtdrow 2/td/tr trtdrow 3/td/tr trtdBug some word/td/tr trtdrow 4/td/tr trtdrow 5/td/tr /table shell shell cat

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 (IN){ chomp; @a1_s= split/\/,

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

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: 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

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: 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

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 !~ /xxx/;

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 -- To

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: TABLE TRTDrow 1/TD/TR TRTDrow 2/TD/TR TRTDrow 3/TD/TR TRTDBug some word/TD/TR TRTDrow 4/TD/TR TRTDrow 5/TD/TR /TABLE this is file that should not be matched:

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

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 = 0;

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 failed\n;

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 largely

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 =~