Re: Search Modules

2002-08-20 Thread Felix Geerinckx
on Tue, 20 Aug 2002 22:32:00 GMT, [EMAIL PROTECTED] (Rasoul Hajikhani) wrote: > Can anyone recommend a good string search module? I want to be > able to get possible combinations, permutations, sounds like, > etc... for a given string which will be someone's name. > Thanks in advance. Did you

RE: newbie question

2002-08-20 Thread Dharmendra Rai
hi , that's correct . $| can have only 2 values. either 1 or 0. its undocumented but the behaviour is same everywhere. - Get a bigger mailbox -- choose a size that fits your needs. http://uk.docs.yahoo.com/mail_storage.html

Search Modules

2002-08-20 Thread Rasoul Hajikhani
Hello people, Can anyone recommend a good string search module? I want to be able to get possible combinations, permutations, sounds like, etc... for a given string which will be someone's name. Thanks in advance. -r -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: (Question about a script)

2002-08-20 Thread Ashutosh Jog
Hi David, I tried to test run the script without the @server and ran it on one server with 2 files in there, it gave me the desired output but also a few errors. The errors are: Use of uninitialized value in numeric gt (>) at /usr/local/lib/perl5/5.6.1/Time/Local.pm line 91. Use of uninitialize

Re: (Question about a script)

2002-08-20 Thread Ashutosh Jog
Hi David, This looks fantastic to start with, I apreciate your help. Let me give it a shot and see what happens. -Thanks David wrote: > the following should get you started: > > #!/usr/bin/perl; > > use Time::Local; > > @servers = ('server1','server2','server3'); > @users = ('user1','user2','

Re: newbie question

2002-08-20 Thread Steve Grazzini
David <[EMAIL PROTECTED]> wrote: > i agree. the part that make people confuse is that most people > think $| is a variable holding a number. that's not necessary > the case. Perl could have(easily) implmented $| to be a bit > (save memory and faster access and manipulation etc) position > of a

Re: regular exp

2002-08-20 Thread David Richardson
Perl has a file globbing operator for situations like this. try @projectFilesExist = <$ja\{*.dsp,*.vbp}>; print "proj already exist\n" if @projectFilesExist; < > returns an array of files matching the pattern between the angle brackets. The @projectFilesExist will be convert to scala

Re: newbie question

2002-08-20 Thread Steve Grazzini
John W. Krahn <[EMAIL PROTECTED]> wrote: > Kevin Meltzer wrote: [ back and forth ] >> >>> > This is actually a bug. It just seems that nobody seems to >> >>> > care :) It would break too many JAPHs which use this. >> >>> > >> >>> > So, don't depend on it, in case it is ever fixed. >> >>> >> >>>

regular exp

2002-08-20 Thread Javeed SAR
Hi, I am getting a path from variable $ja,if i print $ja i get: M:\jav_test\ADT\View_Controller_VB\SDKComponents\ADTModel Note: this path varies everytime. $file=`ls $ja`; If i excute above statement ,In the directory ADTModel, i get a list of files,i have to grep for files with extensio

Re: browser redirect

2002-08-20 Thread Wiggins d'Anconia
Dave Smith wrote: > > Howdy, > > I'm trying to write a program that will redirect people looking at a > site using Netscape 4. (I have a header that looks good in Mozilla, > Netscape 6, and IE, but looks pretty crappy in Netscape 4). > > I'm new at programming, and am still reading Elements

How to find all modules CPAN alternates

2002-08-20 Thread dizzy74
Hi All Im wondering how does one know what modules are available? Is there a master list with accompanying methods? Or is CPAN the only source? http://cpan.org/ Sometimes CPAN seems much too cryptic for a beginner(at least from my view). So basically Im asking is there a more (beginner) fr

Re: Regex to split router ifDescr up

2002-08-20 Thread Janek Schleicher
Janek Schleicher wrote at Wed, 21 Aug 2002 00:45:57 +0200: > m!^(\w+?) ?([\d/]+)$/ [untested] ^ Really untested, should be of course a !. Cheerio, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Perl mailing list script

2002-08-20 Thread dizzy74
http://cgi.resourceindex.com/Programs_and_Scripts/Perl/Mailing_Lists/ Gary Hawkins wrote: >Before I write one, is there already a mailing list script that would >handle subscribe/unsubscribe with emails for confirmation? User enters >email address on a web page and clicks subscribe or unsubscri

Re: Regex to split router ifDescr up

2002-08-20 Thread Janek Schleicher
John W. Krahn wrote at Tue, 20 Aug 2002 22:43:55 +0200: > Shawn wrote: >> I have two goals I would like help with: >> 1. Optimize/simplify the regex >> 2. Recognize where the regex would produce false positives on some >> ifDescrs which don't actually have a real hardware path More impo

Re: Help!! Retrieving Image File

2002-08-20 Thread david
not sure if you already have the answer to this one but you: binmode IMAGE; print "Content-type: image/jpeg\n\n"; while(){ print; } should probably be: print "Content-type: image/jpeg\n\n"; binmode IMAGE; while(){ print; } you need to print the text header first and than print the bin

Re: Global variables

2002-08-20 Thread david
use package. example: name the following DBString.pm: #!/usr/bin/perl; package DBString; @EXPORT = qw($db $user $psw); $db = 'db'; $user = 'user'; $psw = 'psw'; 1; then in another test script: #!/usr/bin/perl use DBString; print $DBString::db,"\n"; #-- prints db print $DBString::user,"\n"; #--

Global variables

2002-08-20 Thread Dan Fish
What would be the preferred method of creating global variables that can be used in several different cgi scripts. For example, I'd like to create the variables $database, $user, $pass that I only have to change in one place, but can use in many different scripts. In C of course I'd just use #IN

browser redirect

2002-08-20 Thread Dave Smith
Howdy, I'm trying to write a program that will redirect people looking at a site using Netscape 4. (I have a header that looks good in Mozilla, Netscape 6, and IE, but looks pretty crappy in Netscape 4). I'm new at programming, and am still reading Elements of Programming with Perl, so pleas

Re: newbie question

2002-08-20 Thread Kevin Meltzer
Show me that $| can have a value other than 1 or 0 :) Same with $^W, which has the same behavior. I can see that, in a way, it makes sense.. since $|-- would make it -1, which is a true value and since $| can only be 1|0 it becomes 1, since that is a true value. But, I still don't like it :) Espec

RE: newbie question

2002-08-20 Thread david
i agree. the part that make people confuse is that most people think $| is a variable holding a number. that's not necessary the case. Perl could have(easily) implmented $| to be a bit(save memory and faster access and manipulation etc) position of a number. many c functions does that. when yo

RE: newbie question

2002-08-20 Thread Nikola Janceski
It's not a bug as I see it. You gurus must have told the compiler that $| can only hold a 0 or 1 for whatever reason; Just because something isn't documented, doesn't make it a bug. But even in the docs it tells you, "The following names have special meaning to Perl." Translation: "Don't do crap

Re: Regex to split router ifDescr up

2002-08-20 Thread John W. Krahn
Shawn wrote: > > So, I have an interesting question and a bit of code. I didn't really > know whether this was the right forum or not, but here goes. > > I have two goals I would like help with: > 1. Optimize/simplify the regex > 2. Recognize where the regex would produce false positives on

RE: SQL question

2002-08-20 Thread shawn_milochik
No. If you want to get the fields in a certain order from an SQL query, you MUST do: select fieldname, fieldname, fieldname from table As long as you're doing: select * from table You're always going to get the fields in the order in which they exist in the table. Shawn

RE: SQL question

2002-08-20 Thread Felix Geerinckx
on Tue, 20 Aug 2002 19:16:16 GMT, Learn Perl wrote: > Yes I want to have the columns come out in a sorted order without > specifying them like "select col1, col2, col3 from database" because > I have too many columns (close to 80). Is there ways to select a > table w/o specifically telling the S

RE: (Question about a script)

2002-08-20 Thread Felix Geerinckx
on Tue, 20 Aug 2002 18:26:57 GMT, David Zhuo wrote: > -M will not give you a file's last modified time. it gives you > the script's start time minus the last modified time That shouldn't be too much a problem for programs that are completed quicky. And remember, for long running programs, like

RE: SQL question

2002-08-20 Thread learn perl
Yes I want to have the columns come out in a sorted order without specifying them like "select col1, col2, col3 from database" because I have too many columns (close to 80). Is there ways to select a table w/o specifically telling the SQL server which ones I want? Thanks! Eric On Tue, 20 Aug 2

RE: Manipulating files in a directory

2002-08-20 Thread Leon, Yanet I,,DMDCWEST
Thank you everybody. Your help was EXCELLENT. I have been learning a lot from this list. -Original Message- From: Leon, Yanet I,,DMDCWEST [SMTP:[EMAIL PROTECTED]] Sent: Monday, August 19, 2002 3:54 PM To: Perl beginners Subject:Ma

RE: SQL question

2002-08-20 Thread Bob Showalter
> -Original Message- > From: learn perl [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 20, 2002 3:16 PM > To: Bob Showalter > Cc: [EMAIL PROTECTED] > Subject: RE: SQL question > > > Yes I want to have the columns come out in a sorted order without > specifying them like "select col1,

RE: (Question about a script)

2002-08-20 Thread Bob Showalter
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 20, 2002 2:54 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Subject: RE: (Question about a script) > > > This will be fine if it is not a continously running

RE: SQL question

2002-08-20 Thread Bob Showalter
> -Original Message- > From: learn perl [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 20, 2002 3:51 PM > To: Bob Showalter > Cc: [EMAIL PROTECTED] > Subject: RE: SQL question > > > For example, my column names are [1], [3], [5], [2] in the > table. I want > to know if there are st

RE: SQL question

2002-08-20 Thread learn perl
For example, my column names are [1], [3], [5], [2] in the table. I want to know if there are statements that would sort these column names and display them in [1], [2], [3], [5] instead of the original order. besides DBI, is there ways of achieving this with SELECT statement? Thank you so much

Perl on the AS/400

2002-08-20 Thread shawn_milochik
We have an AS/400 here at work, and we use IBM's Net.Data macro language for server-side scripting. I've done some searching in the Net.Data forum, but I can't find documentation on how to set up Perl so that it can be called from Net.Data. A Net.Data function is written like this: %MACRO_FUNCT

RE: need help extracting words from a string - Thanks and need more help

2002-08-20 Thread Mark Anderson
I would point you to perldoc -f exists perldoc -f defined and you will end up with either if (exists $hashname{$variable}) if (defined $hashname{$variable}) depending on your definition of 'set'. Notice the {} around the variable instead of []. /\/\ark -Original Message--

Re: need help extracting words from a string

2002-08-20 Thread david
bottom... Felix Geerinckx wrote: > on Tue, 20 Aug 2002 16:22:31 GMT, Jessica wrote: > >> I am attempting to extract a two words or fields from every line of a >> tab delimited file. Sometimes the words that I need are in fields 1 & >> 2 and other time they are in 2 & 3. The lines look something

Re: how to make a regex for a ip address

2002-08-20 Thread david
Zentara wrote: > On Mon, 19 Aug 2002 12:07:21 -0700, [EMAIL PROTECTED] (Root) wrote: >>for a one liner: >> >>$_ = '12.34.56.78'; >>map {$_ < 256} /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g || warn("not valid ip: >>$_\n"); >> > > I tried this with $_ = '1234.2345.56.78'; and received no warning. > That's n

SQL question

2002-08-20 Thread learn perl
Hi guys, just wondering how to sort the columns in order using SQL. Does anybody have any clue? for instance, my column headings are [1] [3] [2] [4] [2], is there a way to SELECT the table with the columns sorted in order? thanks! Eric -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

Re: Passing Hashes into a function

2002-08-20 Thread david
John Ross wrote: > Thank you to all of you who responded to my question about pasing hashes > into a function. The -> operator did the trick. > My problem was that I thought once I passed the hash in, I could > dereference it That doesn't appear to work like I expected. > > sub mod_hash { >

Re: comparing file dates from different servers

2002-08-20 Thread david
Shawn Milochik wrote: > Hi. I'm new to Perl (just a couple of weeks). > > I'm trying to write a script which will check the date of a local file, > compare it to a remote file (on another server on the same network), and > copy the local over if it is newer. I'm currently using the 'stat' > fu

Re: need help extracting words from a string

2002-08-20 Thread Felix Geerinckx
on Tue, 20 Aug 2002 16:22:31 GMT, Jessica wrote: > I am attempting to extract a two words or fields from every line of a > tab delimited file. Sometimes the words that I need are in fields 1 & > 2 and other time they are in 2 & 3. The lines look something like > this: > > TypeOfAppApplicati

RE: need help extracting words from a string

2002-08-20 Thread Mark Anderson
bottom posted... -Original Message- From: Jessica [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 9:23 AM To: [EMAIL PROTECTED] Subject: need help extracting words from a string I am such a knuckle head... I read the lists. I stumble through books and still I cant figure out

Re: need help extracting words from a string

2002-08-20 Thread Robin Norwood
Jessica <[EMAIL PROTECTED]> writes: > I am such a knuckle head... I read the lists. I stumble through books and still I >cant figure out how to do something that I would think should be relativly simple. > > I am attempting to extract a two words or fields from every line of a tab delimited >

Regex to split router ifDescr up

2002-08-20 Thread Shawn
So, I have an interesting question and a bit of code. I didn't really know whether this was the right forum or not, but here goes. I have two goals I would like help with: 1. Optimize/simplify the regex 2. Recognize where the regex would produce false positives on some ifDescrs which don

(Question about a script)

2002-08-20 Thread Ashutosh Jog
Hi all, I am trying to write a script which checks a dir for a file and then compares the number of days old the file is. Comparing this the mail should go to a user to whom the file (in the dir) belongs. Likewise there will be 'n' number of directories for 'n' number of users on this Server. The

Re: Getting directory path

2002-08-20 Thread Peter Scott
At 12:23 PM 8/20/02 -0400, FlashGuy wrote: >We don't have the Spec module installed. Then your Perl has been misinstalled, since File::Spec is part of the core and has been since 1998. Talk to whoever installed your Perl and tell them it's either broken or horribly out of date. >On Tue, 20 A

Re: Getting directory path

2002-08-20 Thread Samy Kamkar
you can use the Cwd module: use Cwd; my @vars = split(/\//, cwd); # or in your case ($var1, $var2, $var3, $var4) = split(/\//, cwd); I believe, even on windows, cwd will return the directory path with "/"s instead of "\"s FlashGuy wrote: > Hi, > > How can I retrieve the directory path and sp

Help with scripts

2002-08-20 Thread Ashutosh Jog
Anyone here done any scripts for any serverswhere the users files will be checked for time stamps and then the info will be emailed to respective users.for the last time the file was modified? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECT

Re: Getting directory path

2002-08-20 Thread drieux
On Tuesday, August 20, 2002, at 09:00 , FlashGuy wrote: > How can I retrieve the directory path and split the results into separate > variables based on the "\" > > Example: > > d:\temp\test\files> I would recommend the File::Basename approach, or you could go with say: #!/usr/bin/perl

On possible IP addresses

2002-08-20 Thread doug
There are perfectly valid IP addresses of the form x.x.x.255. Try tracerouting to 24.130.78.255, for instance. RFC 1518 (http://www.ietf.org/rfc/rfc1518.txt) goes into some depth on this issue, but essentially we've done away with the idea of hard "classes" for IP addresses with implied masks.

Re: AW: how to make a regex for a ip address

2002-08-20 Thread Mat Harris
the addresses x.x.x.255 and x.x.x.254 are not valid as the former is broadcast and the latter is multicast. Also, depending on your application, you may want to eliminate the class c addresses, (can't remember exact numbers) 172.15.x.x 172.25.x.x and 192.168.x.x and the class a address 10.0.0.0 O

Re: Is there a way to do cron on windows?

2002-08-20 Thread Frank Wiles
.--[ Daryl J. Hoyt wrote (2002/08/20 at 09:05:19) ]-- | | Hi all, | I am looking for a way to run something like a cron job on windows. I | would like to check every 10 minutes to see if an application is running. | If it is not running, I would then like to launch it. Is

Re: Getting directory path

2002-08-20 Thread Peter Scott
At 12:00 PM 8/20/02 -0400, FlashGuy wrote: >Hi, > >How can I retrieve the directory path and split the results into >separate variables based on the "\" > >Example: > >d:\temp\test\files> > >Split: > >var1: d: >var2: temp >var3: test >var4: files Use File::Spec, which is also portable. (Since

need help extracting words from a string

2002-08-20 Thread Jessica
I am such a knuckle head... I read the lists. I stumble through books and still I cant figure out how to do something that I would think should be relativly simple. I am attempting to extract a two words or fields from every line of a tab delimited file. Sometimes the words that I need are in

RE: Is there a way to do cron on windows?

2002-08-20 Thread Timothy Johnson
Actually, there is a module, Win32::TaskScheduler that can set the user to run under and all of those nifty little things that the Task Scheduler GUI lets you do. If you can't find it on CPAN, look on sourceforge.net. -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sen

Getting directory path

2002-08-20 Thread FlashGuy
Hi, How can I retrieve the directory path and split the results into separate variables based on the "\" Example: d:\temp\test\files> Split: var1: d: var2: temp var3: test var4: files -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Is there a way to do cron on windows?

2002-08-20 Thread Akens, Anthony
Microsoft also has a product called "Unix tools for Windows" which has cron built into it. I run it on a few machines, and it works fairly well. (has an nfs client/server, telnet server, and a few other nice items in it). Cygwin is also a good option. -Original Message- From: [EMAIL PRO

Re: Is there a way to do cron on windows?

2002-08-20 Thread shawn_milochik
If you can write a Perl script to detect whether the program is running, then to start it if it isn't, then you can run the Perl script in a loop, using the 'sleep()' function to make it run every (up to you) seconds. Just be aware that, if you use Task Scheduler in Windows, you will need to sche

Re: Is there a way to do cron on windows?

2002-08-20 Thread Robert Citek
Hello Daryl, At 09:05 AM 8/20/2002 -0500, Daryl J. Hoyt wrote: > I am looking for a way to run something like a cron job on windows. I >would like to check every 10 minutes to see if an application is running. >If it is not running, I would then like to launch it. Is there a way to do >t

Re: Passing Hashes into a function

2002-08-20 Thread John Ross
Thank you to all of you who responded to my question about pasing hashes into a function. The -> operator did the trick. My problem was that I thought once I passed the hash in, I could dereference it That doesn't appear to work like I expected. sub mod_hash { my $hash_ref = @_; my

RE: comparing file dates from different servers

2002-08-20 Thread shawn_milochik
Oops. That was a typo. The script does not have this error. Shawn matt.wasserman@

AW: Is there a way to do cron on windows?

2002-08-20 Thread Angerstein
sorry, today it´s the Taskplaner > -Ursprüngliche Nachricht- > Von: Angerstein [mailto:[EMAIL PROTECTED]] > Gesendet am: Dienstag, 20. August 2002 16:16 > An: Daryl J. Hoyt > Cc: [EMAIL PROTECTED] > Betreff: AW: Is there a way to do cron on windows? > > You can create services that runs o

AW: AW: how to make a regex for a ip address

2002-08-20 Thread Angerstein
yes, correctly > -Ursprüngliche Nachricht- > Von: Mat Harris [mailto:[EMAIL PROTECTED]] > Gesendet am: Dienstag, 20. August 2002 16:07 > An: Angerstein > Cc: [EMAIL PROTECTED] > Betreff: Re: AW: how to make a regex for a ip address > > the addresses x.x.x.255 and x.x.x.254 are not valid a

AW: Is there a way to do cron on windows?

2002-08-20 Thread Angerstein
You can create services that runs on defined times. try windowshelp --> scheduler > -Ursprüngliche Nachricht- > Von: Daryl J. Hoyt [mailto:[EMAIL PROTECTED]] > Gesendet am: Dienstag, 20. August 2002 16:05 > An: Beginners Perl > Betreff: Is there a way to do cron on windows? > > Hi all, >

Re: Is there a way to do cron on windows?

2002-08-20 Thread Felix Geerinckx
on Tue, 20 Aug 2002 14:05:19 GMT, [EMAIL PROTECTED] (Daryl J. Hoyt) wrote: > I am looking for a way to run something like a cron job on > windows. Take your pick. -- felix -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

RE: comparing file dates from different servers

2002-08-20 Thread Matt Wasserman
Not for nothing, and I am no expert, but you have a space between c and $ in your $destFile variable... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 20, 2002 9:56 AM To: [EMAIL PROTECTED] Subject: comparing file dates from different servers

Is there a way to do cron on windows?

2002-08-20 Thread Daryl J. Hoyt
Hi all, I am looking for a way to run something like a cron job on windows. I would like to check every 10 minutes to see if an application is running. If it is not running, I would then like to launch it. Is there a way to do this in Perl (or any other way)? Any help would be appreciat

comparing file dates from different servers

2002-08-20 Thread shawn_milochik
Hi. I'm new to Perl (just a couple of weeks). I'm trying to write a script which will check the date of a local file, compare it to a remote file (on another server on the same network), and copy the local over if it is newer. I'm currently using the 'stat' function. Here is part of the script

AW: AW: how to make a regex for a ip address

2002-08-20 Thread Angerstein
0.0.0.0 is not an possible ip. see O´Reilly TCP-IP or any other good Network book. There are a some "not possible" ips, because of some bit-compinations that may not appear. (Has something to do with routing I think...) (And the reserved for further development/technologies IPs hehehehehe) tr

Re: AW: how to make a regex for a ip address

2002-08-20 Thread Samy Kamkar
wouldn't match 0.0.0.0 ;) oy vey, when will it be figured out how about /^(?:2(?:[0-4]\d|5[0-5])|1?\d{1,2}\.){3}(?:2(?:[0-4]\d|5[0-5])|1?\d{1,2})$/ Nikola Janceski wrote: > /^(?:(25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9 > ]|[0-1][0-9]{2}|[1-9]{1,2})$/ > > shorte

AW: AW: how to make a regex for a ip address

2002-08-20 Thread Angerstein
That really scores... what about some bin: @ip = split (/\./); foreach $part (@ip) { $binpart = dec2bin($part) # Reports Error if not dec numeric unless ($binpart =~ /^\d{8}$/ ) { # if not exactly 8 bits print "not an IP"; } } don´t know if this works un

Re: NEA and 911

2002-08-20 Thread drieux
On Monday, August 19, 2002, at 07:48 , irish wrote: > I know you know the difference, Drieux, but your fingers slipped a little > on > the keyboard. Or is it a bit of dyslexia? > > Jim would you believe Gosh, I'm not the same spring chicken ciao drieux --- -- To unsubscrib

RE: AW: how to make a regex for a ip address

2002-08-20 Thread Nikola Janceski
Ooopss... mistake /^(?:(25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[0-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9 ]|[0-1][0-9]{2}|[0-9]{1,2})$/ ^ ^ > -Original Message- > From: Nikola Janceski [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 20,

RE: AW: how to make a regex for a ip address

2002-08-20 Thread Nikola Janceski
/^(?:(25[0-5]|2[0-4][0-9]|[0-1][0-9]{2}|[1-9]{1,2})\.){3}(25[0-5]|2[0-4][0-9 ]|[0-1][0-9]{2}|[1-9]{1,2})$/ shortened from stephen's just a bit. > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 20, 2002 9:17 AM > To: [EMAIL PROTECTED] > Sub

RE: AW: how to make a regex for a ip address

2002-08-20 Thread stephen . redding
/^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[ 0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[ 0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9 ]{2}|[1-9]{1}[0-9]{1}|[0-9])$/ Stephen Redding BT Ignite Solutio

RE: AW: how to make a regex for a ip address

2002-08-20 Thread Nikola Janceski
oh and anything else after that last . 000255.000255.000255.000255.slkfdja;ljd;alkjf;lajkd;ljkasfljka;ljdkf;lajsdl; jkf;lsajd > -Original Message- > From: Nikola Janceski > Sent: Tuesday, August 20, 2002 9:12 AM > To: 'Samy Kamkar'; Angerstein > Cc: [EMAIL PROTECTED] > Subject: RE: AW:

RE: AW: how to make a regex for a ip address

2002-08-20 Thread Nikola Janceski
But that would match 000255.000255.000255.000255. hehehe :) I like the split loop check. > -Original Message- > From: Samy Kamkar [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 20, 2002 9:02 AM > To: Angerstein > Cc: [EMAIL PROTECTED] > Subject: Re: AW: how to make a regex for a ip

Re: AW: how to make a regex for a ip address

2002-08-20 Thread Samy Kamkar
/^(?:0*(?:2(?:[0-4]\d|5[0-5])|1?\d{1,2})(?:\.|$)){4}/ -Samy Angerstein wrote: > What about: > /\d?\d?\d\.\d?\d?\d\.\d?\d?\d\.\d?\d?\d\/ > > or > > @ip = split (/\./); > foreach $part (@ip) { > if ( $part > 255 && $part =~ /\d?\d?\d\/ ) { > die "That´s not an IP"; > }

RE: how to make a regex for a ip address

2002-08-20 Thread Nikola Janceski
er.. see correction > -Original Message- > From: Angerstein [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 20, 2002 9:00 AM > To: [EMAIL PROTECTED] > Subject: AW: how to make a regex for a ip address > > > What about: > /\d?\d?\d\.\d?\d?\d\.\d?\d?\d\.\d?\d?\d\/ /^\d{1,3}\.\d{1,3}\.

AW: how to make a regex for a ip address

2002-08-20 Thread Angerstein
What about: /\d?\d?\d\.\d?\d?\d\.\d?\d?\d\.\d?\d?\d\/ or @ip = split (/\./); foreach $part (@ip) { if ( $part > 255 && $part =~ /\d?\d?\d\/ ) { die "That´s not an IP"; } } > -Ursprüngliche Nachricht- > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im A

Re: how to make a regex for a ip address

2002-08-20 Thread zentara
On Mon, 19 Aug 2002 12:07:21 -0700, [EMAIL PROTECTED] (Root) wrote: >for a one liner: > >$_ = '12.34.56.78'; >map {$_ < 256} /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/g || warn("not valid ip: $_\n"); > I tried this with $_ = '1234.2345.56.78'; and received no warning. That's not good. -- To unsubscribe,

Re: newbie question

2002-08-20 Thread Kevin Meltzer
On Mon, Aug 19, 2002 at 05:17:05PM -0700, John W. Krahn ([EMAIL PROTECTED]) said something similar to: > Kevin Meltzer wrote: > > > > On Mon, Aug 19, 2002 at 04:35:53PM -0700, John W. Krahn ([EMAIL PROTECTED]) said >something similar to: > > > Kevin Meltzer wrote: > > > > > > > > This is actual

Re: Help!! Retrieving Image File

2002-08-20 Thread Archie
Dear All, Thank you for replying to my inquiry regarding retrieving image. Especially to Connie Chan who shares her/his code, and advise, and also to Zentara who tested my code. Thank you very BIG! I used the same code that I've posted and right now its working fine, just like Zentara replied.

Re: Time and Date

2002-08-20 Thread david zhuo
You should be aware that your have multiple gmtime() function calls in your script and this could cause problem. the reason is because between your first and second gmtime() function call, some times have passed(yes, very very very little but...) so the time return by the 2 gmtime() functions

Re: Time and Date

2002-08-20 Thread David Zhuo
$hour = 1; $hour = sprintf("%02d",$hour); // $hour now become "01" $hour = 10; $hour = sprintf("%02d",$hour); // $hour still "10" no need for the checking it's length. david "A Taylor" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi all, > Thanks for your

Re: time and date

2002-08-20 Thread David Zhuo
do you want to extract the date and time string in your email message(header) or that you want to know what time does the email arrive? david "A Taylor" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am trying to get the time and date that some one sends me

Re: Is it legal ???

2002-08-20 Thread root
A Taylor wrote: > Hi all, I am trying to declare some variables and was wondering what the > best way to do this was. Is it legal to do something like this: > my (@pairs, $ENV, $buffer); > The reason I ask is that I am not sure if its cool to have Arrays and Scalar > vars within the same brackets

Re: BEGIN statement in Perl?

2002-08-20 Thread root
James Kipp wrote: > BEGIN blocks are interpreted a the first phase of compilation. eval blocks > and constants are also evaluated at this stage. so the code in the begin > block is run before compiling the rest of the file. > this insures the these variables are initialized before your sub is cal

Re: another reg needed

2002-08-20 Thread root
Connie Chan wrote: > Strange ... > > my ($row, $col) = /(\d+)/g; > Can get the value. > > but > my ($row, $col) =~ /(\d+)/g; > will get , only. > > Why ? > > Besides, that's really that mine one on the last post > doesn't work. but what's the problem ? > > Anyway, here is a stupid update for my a

Best way to split log

2002-08-20 Thread Matt Simonsen
I'm wondering what people would suggest as the best way to split this so it respects the "" and [] as fields yet doesn't kill performance? 1.2.3.4 - - [15/Aug/2002:06:43:39 -0700] "GET /usr/123 HTTP/1.0" 200 38586 "http://www.careercast.com/js.php"; "Mozilla/4.0 (compatible; MSIE 5.5; Windows 98

Re: inserting a single word in every file (fwd)

2002-08-20 Thread Sudarshan Raghavan
Sorry! forgot to post to the list -- Forwarded message -- Date: Wed, 21 Aug 2002 00:39:30 +0530 (IST) From: Sudarshan Raghavan <[EMAIL PROTECTED]> To: Nandita <[EMAIL PROTECTED]> Subject: Re: inserting a single word in every file On Mon, 19 Aug 2002, Nandita wrote: > Hello al

Re: Is it legal ???

2002-08-20 Thread Lance
I declare like that all of the time on WinNT and it seems to work fine. Anyway, if you do the 'perl -c -w scriptname.pl' test AND use strict, any syntax errors will become (painfully!) obvious ;-) "A Taylor" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi a

Re: inserting a single word in every file

2002-08-20 Thread Dharmendra Rai
nandita, go to the point where u want to insert the word. read the file from that point to EOF in a scalar/array variable . write ur word there in the file. and after that write the contents of the variable back intp the file. - Get a bigger mailbox -- c