Re: Trouble with compound regular expression matching

2004-12-07 Thread Ing. Branislav Gerzo
Jeffrey Paul Burger [JPB], on Monday, December 06, 2004 at 17:05 (-0700) typed the following: JPB> if ($file_name !~ /tif$/i) {} JPB> if ($file_name !~ m/tif\b/i) {} JPB> if ($file_name !~ m/.*.tif/i) {} what about this: print "PIC is $1" if ($file_name =~ /\.(tif?f|jpe?g)$/i); -- ...m8s, cu

Re: FW: Trouble with compound regular expression matching

2004-12-07 Thread Ing. Branislav Gerzo
Paul Ohashi [PO], on Monday, December 6, 2004 at 16:24 (-0800) made these points: PO> I did need to add the case-insensitivity to the regex: PO>/^.*\.[tj][pi][gfe].*$/i PO> That's better, I think. I'm not sure if this is good solution, because it matches also those, you won't: tpg, tpf, tpe,

RE: Trouble with compound regular expression matching

2004-12-07 Thread Stout, Joel R
I replied directly too - sorry. Why not use a module to help out? I think it's easier to read - but then again I'm no perl expert... use File::Basename; $fullname = "/usr/local/pics/sample.tiff"; #for example ($file,$dir,$_) = fileparse($fullname, qr/\..*/); if (/\.(tif|tiff|jpg|jpeg)$/) {

Re: Trouble with compound regular expression matching

2004-12-07 Thread Ing. Branislav Gerzo
Stout, Joel R [SJR], on Tuesday, December 7, 2004 at 00:55 (-) typed: SJR> use File::Basename; SJR> $fullname = "/usr/local/pics/sample.tiff"; #for example SJR> ($file,$dir,$_) = fileparse($fullname, qr/\..*/); SJR> if (/\.(tif|tiff|jpg|jpeg)$/) { SJR> print "This is an image file.\n"; SJR

How to find a file in a directory structure

2004-12-07 Thread arjun.mallik
Hi Frnds, I have to search for a file in a PATH and then once the file is found , assign that full path of the that file to an environment variable. and quit further searching.[because only full path of the first occurance of the file is required] PATH is defined like ---> /etc/oms/perl:/va

Re: How to find a file in a directory structure

2004-12-07 Thread Ing. Branislav Gerzo
[EMAIL PROTECTED] [am], on Tuesday, December 7, 2004 at 15:27 (+0530) typed the following: am> I have to search for a file in a PATH and then once the file is found is the PATH same as your ENV PATH ? Try to use $myfile = `which file`; Did you look at File::Find ? -- ...m8s, cu l8r, Brano.

Re: File generation not working

2004-12-07 Thread Jonathan Paton
Dear Anish, AFAICT this is not a perl problem, but errors in your code are hindering discovering why. The cause of the problem is VERY LIKELY to be that the script is run with minimum permissions, under a different user and possibly restricted to below a certain subdirectory. It should be "or di

Monitor Squid access.log

2004-12-07 Thread Paul Kraus
I want to write an app that starts up when squid starts that will monitor access.log. everytime a line is written out to the log file the script will parse the line and then do some "stuff to it" I don't need any help with the stuff part :) What I don't understand is to how to have a program runni

RE: [Released] [Contains offensive content] RE: Building Network

2004-12-07 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Graeme St. Clair) writes: >Does anyone know why or where the phrase [Contains o f f e n s i v e >content] is being inserted into these headers? [snip] >> tcp0 0 xxx.xxx.xxx.xxx:xxx xxx.xxx.xxx.xxx:xxx ^^^ Anyth

RE: Monitor Squid access.log

2004-12-07 Thread brian . barto
Sounds like a job for File::Tail http://search.cpan.org/~mgrabnar/File-Tail-0.99.1/Tail.pm I'm using it to monitor my auth.log file on my freebsd machine. Works like a charm! -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 07, 2004 9:24 AM To: [EMAI

Re: Should be a simple substitution?

2004-12-07 Thread John W. Krahn
Bryan R Harris wrote: I can usually figure out regexes, and this one seems simple, but it still eludes me-- I'm looking for a regex (or a couple of regexes) to do the following: blahblah{ab,abcd}blah --> blahblah(ab|abcd)blah blahblah{a,b,c}blah --> blahblah(a|b|c)blah If it's not obvious I

Re: Monitor Squid access.log

2004-12-07 Thread Jonathan Paton
Dear Paul, Have a think about read and sysread: perldoc -f read perldoc -f sysread As they both return the number of bytes read, you can just loop until you get something to work with. What you get will be a string of bytes - you will need to massage them a little. If you get zero bytes, well

ip4 check

2004-12-07 Thread DBSMITH
All, Did anyone have any ideas I only received one response! Thanks I have having issues using this module I installed. The module is Net::IPv4Addr. Here is my code use strict; use warnings; use diagnostics; use Net::IPv4Addr qw( :all ); my $var = "23.23.109.103"; print "$var\n"; #if

Need Help Installing DBI-1.46

2004-12-07 Thread john williams
Hi, I am having a problem installing the DBI-1.46 module on AIX 5.1 server. I have downloaded the tar file from www.CPAN.orb and uncompressed it and first ran the "perl Makefile.PL" command and it ran successfully, next when i run "make" command I get the following error # make /usr/bi

RE: ip4 check

2004-12-07 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > if ( $var = ipv4_checkip ($var)) { Should be ipv4_chkip, not ipv4_checkip You should contact the module author to see if he's interested in improving the error handling for this kind of thing... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-m

RE: Need Help Installing DBI-1.46

2004-12-07 Thread Bob Showalter
john williams wrote: > Hi, > I am having a problem installing the DBI-1.46 module on AIX 5.1 > server. I have downloaded the tar file from www.CPAN.orb and > uncompressed it and first ran the "perl Makefile.PL" command and it > ran successfully, next when i run "make" command I get the following >

Re: ip4 check

2004-12-07 Thread Lawrence Statton
> --=_alternative 005C6D8D85256F63_= > Content-Type: text/plain; charset="us-ascii" > > All, > > Did anyone have any ideas I only received one response! Thanks > > I have having issues using this module I installed. The module is > Net::IPv4Addr. > > Here is my code > > use strict; > u

Re: ip4 check

2004-12-07 Thread DBSMITH
ok thanks! Lawrence Statton <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 12/07/2004 12:08 PM Please respond to Lawrence Statton To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject:Re: ip4 check > --=_alternative 005C6D8D85256F63_= > Content-Type:

Help optimizing script

2004-12-07 Thread JR
Greetings everyone, I'm very new to perl, so please don't laugh at my script ;-) I wrote this script to login to my work box from home and change a hosts file to reflect my home ip address. I know there is a way to do this a lot quicker and prettier. This is really just a learning experience for

Another regular expression matching quandry

2004-12-07 Thread Jeffrey Paul Burger
I've read a directory into an array called @file_list and need to remove any files that start with period from the list (".", "..", ".DS_Store", etc.). This is what I've got so far, but it's only removing "..", still leaving "." and ".DS_Store". Does the period need to be escaped somehow? Help! fo

Re: Another regular expression matching quandry

2004-12-07 Thread Chris Devers
On Tue, 7 Dec 2004, Jeffrey Paul Burger wrote: > FYI, the ultimate goal of the routine this is part of is to randomly > select a file corresponding to specified graphic file types within a > directory or subdirectory. Since the directories in question will > typically only contain graphic files

Re: Another regular expression matching quandry

2004-12-07 Thread Willy West
On Tue, 07 Dec 2004 11:07:54 -0700, Jeffrey Paul Burger <[EMAIL PROTECTED]> wrote: > I've read a directory into an array called @file_list and need to remove any > files that start with period from the list (".", "..", ".DS_Store", etc.). > This is what I've got so far, but it's only removing ".."

Re: Help optimizing script

2004-12-07 Thread JupiterHost.Net
#!/usr/bin/perl # Script to login to work machine and rewrite /$home/etc/hosts entry #there use strict; use warnings; Excellent! use Net::SSH qw(sshopen2); my $ppp0 = `/sbin/ifconfig ppp0`; $ppp0 =~ m/(\d+\.\d+\.\d+\.\d+)/; my $ip = $1; my $user = "jrak"; my $

RE: Help optimizing script

2004-12-07 Thread Ed Christian
JR wrote: > Greetings everyone, > > I'm very new to perl, so please don't laugh at my script ;-) > I wrote this script to login to my work box from home and change a > hosts > file to reflect my home ip address. I know there is a way to do this a > lot quicker and prettier. This is really just a

RE: Another regular expression matching quandry

2004-12-07 Thread Charles K. Clarkson
Chris Devers <[EMAIL PROTECTED]> wrote: : I have a similar script on my site, but I use it to select : a random stylesheet instead of a random image. Same idea : though. : : #!/usr/bin/perl -w : : use strict; : use CGI; : : my $q = new CGI; : my @sheets = <*.css>; : : use List::Uti

Re: Another regular expression matching quandry

2004-12-07 Thread John W. Krahn
Jeffrey Paul Burger wrote: I've read a directory into an array called @file_list and need to remove any files that start with period from the list (".", "..", ".DS_Store", etc.). This is what I've got so far, but it's only removing "..", still leaving "." and ".DS_Store". Does the period need to be

Re: Help optimizing script

2004-12-07 Thread Jonathan Paton
On Tue, 7 Dec 2004 13:54:41 -0500, Ed Christian <[EMAIL PROTECTED]> wrote: > [SNIP] > I'm certainly far from a Perl expert, but one suggestion I do have is to > be careful to test that your regular expression does have a match before > using $1. I believe $1 contains the first match from the last >

Need help with Curses

2004-12-07 Thread Jason.Price
I am attempting to use the Curses module for the first time, and really have no idea how to use it. Every example I've been able to find uses a variety of different keywords, but I haven't been able to locate any documentation of the available routines. If someone could help get me started, I'd a

Re: Need help with Curses

2004-12-07 Thread Jonathan Paton
Dear Jason, The Curses module is a wrapper around the curses library. Why not use the examples (use google) in C and documentation provided with the curses library. man ncurses # Depends on version of curses you have With the C examples, try turning them in to the equivilent Perl versions. I h

RE: Need help with Curses

2004-12-07 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > I am attempting to use the Curses module for the first time, and > really have no idea how to use it. Every example I've been able to > find uses a variety of different keywords, but I haven't been able to > locate any documentation of the available routines. If someone

Re: Should be a simple substitution?

2004-12-07 Thread John W. Krahn
John W. Krahn wrote: Bryan R Harris wrote: I can usually figure out regexes, and this one seems simple, but it still eludes me-- I'm looking for a regex (or a couple of regexes) to do the following: blahblah{ab,abcd}blah --> blahblah(ab|abcd)blah blahblah{a,b,c}blah --> blahblah(a|b|c)blah

!

2004-12-07 Thread Hawkes, Mick I
All, I use HTML::Template to drive my web pages I just spent 2 frustrating hours chasing down a fault in my HTML code which turned out to be the tag. I had encapsulated my input type hidden and submit code lines with this (for some reason, I think dreamweaver did it!) The returned data from "

RE: Another regular expression matching quandry

2004-12-07 Thread Chris Devers
On Tue, 7 Dec 2004, Charles K. Clarkson wrote: > Chris Devers <[EMAIL PROTECTED]> wrote: > > : I have a similar script on my site, but I use it to select > : a random stylesheet instead of a random image. Same idea > : though. > : > : #!/usr/bin/perl -w > : > : use strict; > : use CGI; >

Merge two files

2004-12-07 Thread Li, Aiguo (NIH/NCI)
Hello, all. I need to merge two files according a id list in each file. What I am trying to do is to have a sub routine that get the id from data file 1 as key for a hash, a second sub routine to put the value from data file 1 into the hash, then while reading in the data file 2 using the while

RE: !

2004-12-07 Thread Charles K. Clarkson
Hawkes, Mick I <[EMAIL PROTECTED]> wrote: : When I removed the tags it worked. : : All very strange. : Does anyone know why the tag would do this? Show us a complete example which duplicates the error. Show both code and the template. Charles K. Clarkson -- Mobile Homes Specialist 254 9

RE: Merge two files

2004-12-07 Thread Charles K. Clarkson
Li, Aiguo (NIH/NCI) <[EMAIL PROTECTED]> wrote: : Hello, all. : : I need to merge two files according a id list in each file. : What I am trying to do is to have a sub routine that get : the id from data file 1 as key for a hash, a second sub : routine to put the value from data file 1 into the ha

Re: Monitor Squid access.log

2004-12-07 Thread Brian McG
Paul Kraus wrote: What I don't understand is to how to have a program running the monitors a text file for changes? It needs to be in real time because these machines are dhcp that being the case I need to get the mac address of the ip being used the very instance that it is used. Well, you coul

Re: Monitor Squid access.log

2004-12-07 Thread Brian McG
Paul Kraus wrote: > What I don't understand is to how to have a program running the > monitors a text file for changes? > It needs to be in real time because these machines are dhcp that being > the case I need to get the mac address of the ip being used the very > instance that it is used. Well,

Re: Monitor Squid access.log

2004-12-07 Thread Brian McG
Paul Kraus wrote: > What I don't understand is to how to have a program running the > monitors a text file for changes? > It needs to be in real time because these machines are dhcp that being > the case I need to get the mac address of the ip being used the very > instance that it is used. Well,

Re: Monitor Squid access.log

2004-12-07 Thread Brian McG
Paul Kraus wrote: I want to write an app that starts up when squid starts that will monitor access.log. everytime a line is written out to the log file the script will parse the line and then do some "stuff to it" I don't need any help with the stuff part :) What I don't understand is to how to hav

LWP::UserAgent::FramesReady

2004-12-07 Thread diogo . senai
Hi you all, I'm trying to write a script that sends a code to a website, filling in a form-field, and get the result. Just using LWP module isn't possible, because this module doesn't support frames. So I found at cpan.org that LWP::UserAgent::FramesReady may help me, but I don't understand how to

XML::RSS::Parser - ns_qualify failure

2004-12-07 Thread Craig Moynes
I installed XML::RSS:Parser from CPAN. When I try to run a simple script I get (from the sample code): Can't locate object method "ns_qualify" via package "XML::RSS::Parser" at testrss3.pl line 11 (#1) (F) You called a method correctly, and it correctly indicated a package functioni

Re: Should be a simple substitution?

2004-12-07 Thread Bryan R Harris
>>> I can usually figure out regexes, and this one seems simple, but it still >>> eludes me-- >>> >>> I'm looking for a regex (or a couple of regexes) to do the following: >>> >>> blahblah{ab,abcd}blah --> blahblah(ab|abcd)blah >>> blahblah{a,b,c}blah --> blahblah(a|b|c)blah >>> >>> I

Re: Need Help Installing DBI-1.46

2004-12-07 Thread Lawrence Statton
> --0-187969792-1102438542=:46404 > Content-Type: text/plain; charset=us-ascii > > Hi, > I am having a problem installing the DBI-1.46 module on AIX 5.1 server. I hav > e downloaded the tar file from www.CPAN.orb and uncompressed it and first ran > the "perl Makefile.PL" command and it ran succes

Re: Another regular expression matching quandry

2004-12-07 Thread Jeffrey Paul Burger
Many thanks! Both of your snips provided the necessary clues. Best, Jeffrey Paul Burger 2675 W. Hwy. 89A - PMB 455 Sedona, AZ 86336 928-203-0170 "There are only two ways to live your life. One is as though nothing is a miracle. The other is as if everything is."

I am looking for a free perl compiler.

2004-12-07 Thread Xun Yu
Hi, guys, I am looking for a free perl compiler. I tried PDK-Pro-6.0 from ActiveState. It works pretty well. But it's not free. Where can I get a free perl compiler, as powerful as PDK-Pro-6.0 from ActiveState? Thanks in advance. Best wishes, Xun -- Best wishes, Xun -- To unsubscribe, e-mai

Re: I am looking for a free perl compiler.

2004-12-07 Thread JupiterHost.Net
Xun Yu wrote: Hi, guys, hello, I am looking for a free perl compiler. My /usr/bin/perl was free :) I tried PDK-Pro-6.0 from ActiveState. It works pretty well. But it's not free. Where can I get a free perl compiler, as powerful as PDK-Pro-6.0 from ActiveState? My /usr/bin/perl is pretty powerful t

Re: I am looking for a free perl compiler.

2004-12-07 Thread Chris Devers
On Tue, 7 Dec 2004, JupiterHost.Net wrote: > Xun Yu wrote: > > > I am looking for a free perl compiler. > > My /usr/bin/perl was free :) I suspect he wants something for Windows. By "compiler", I further suspect that he wants something that will generate .exe files that can be run without a p

Re: I am looking for a free perl compiler.

2004-12-07 Thread Xun Yu
I am going to compile a perl script to binary on linux, I tried perlcc, I doesn't always works well. I tried the same script with perlapp from PDK-Pro-6.0 from ActiveState? It works. The problem is I can only get a evaluate license for PDK-Pro-6.0, so what I am looking for is a compiler more po

'Can't call method "bPrivateData" on unblessed reference line 4144'

2004-12-07 Thread Siegfried Heintze
I have a large perl cgi program that works (1) On my desktop computer with Apache HTTPD v2.0.49/XP 2003 server/perl 5.8.4.810 and 5.6 (2) On my notebook computer with IIS6/XP PRO/perl 5.8.4.810 (3) On a remote hosting service's server (nodename=osprey) on win2000/IIS 5/ perl 5.6 (4) On a second hos