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
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,
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)$/) {
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
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
[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.
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
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
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
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
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
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
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
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
[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
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
>
> --=_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
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:
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
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
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
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 ".."
#!/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 $
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
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
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
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
>
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
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
[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
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
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 "
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;
>
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
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
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
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
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,
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,
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
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
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
>>> 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
> --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
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."
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
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
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
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
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
50 matches
Mail list logo