Re: [mail_lists] Re: regex $1 not updating?

2003-04-04 Thread R. Joseph Newton
"John W. Krahn" wrote: > "R. Joseph Newton" wrote: > > > > from your original post raised a red flag for me: > > > $var =~ /.*? \(.*\) (.*?) \(.*?\)/; > > I saw it, and wondered "Well, what is he doing with it?". The matching function > > is intended to return a true value on success, and that va

Re: maching end of a line with $

2003-04-04 Thread R. Joseph Newton
Jose Malacara wrote: > Can someone help me out here, please. > > I have an if statement that is looping over a list of IP addresses: > > 192.168.1.1 > 192.168.1.2 > 192.168.1.3 ...192.168.1.10 > > $value="192.168.1.1" > if ($line =~ /($value)/) ... Should not return true for 192.168.1.3 But shou

Re: [mail_lists] Re: regex $1 not updating?

2003-04-04 Thread John W. Krahn
"R. Joseph Newton" wrote: > > from your original post raised a red flag for me: > > $var =~ /.*? \(.*\) (.*?) \(.*?\)/; > I saw it, and wondered "Well, what is he doing with it?". The matching function > is intended to return a true value on success, and that value is assigned to your > blandly-n

Re: sending an email to a email address after a perl operation

2003-04-04 Thread R. Joseph Newton
mel awaisi wrote: > >There was a thread earlier today about namespaces. Check out the archive it > >was quite informative. > > > > > rename.pl line 140. Global symbol "$smtp" requires explicit > > > package name at rename.pl line 143. Global symbol "$smtp" > > > requires explicit package name at r

Re: [mail_lists] Re: regex $1 not updating?

2003-04-04 Thread R. Joseph Newton
Jim wrote: > ... It doesn't because when $back returns $1 as a valid return from the > regex then $1 remains a valid rval for the condition for $line. I need to > get around that! Don't test on $1. Since we now know that it stays set after a successful match, we know it is not a valid test. T

Re: use of "?" operator instead of "if"

2003-04-04 Thread R. Joseph Newton
Jeff Westman wrote: > > At last! Thanks Bob, this /is/ how to use the conditional operator, > > while > > > > $VAL ? ( $VAL = "$VAL:$expr" ) : ( $VAL = $expr ) > > > > /isn't/. ?: is an /operator/. It happens to have three operands > > instead of the usual two or 1, but it is meant for derivin

Re: HASH PRINTING

2003-04-04 Thread R. Joseph Newton
Eric Walker wrote: > Sorry for the ignorance but I think I am able to pull the first layer of > the hash but the values that are also hashes or arrays I get memory > pointers out . Not exactly. Those are references. The difference in some ways is suble, but the upshot is that you shold never t

Re: dumb array/hash question

2003-04-04 Thread R. Joseph Newton
jdavis wrote: Hi Please post to the list. I did a lot of work on my reply to this, and didn't even notice till now that it had not reached the list. Pasted below: > On Tue, 2003-04-01 at 13:07, R. Joseph Newton wrote: > > jdavis wrote: > > > > I have a hash. To use this hash with a module I ne

Re: matching patterns - - - EXPLANATION

2003-04-04 Thread R. Joseph Newton
"R. Joseph Newton" wrote: Sorry Diego, Turns out that there was a logic error in the code I posted that gave a false positive on the match. > #!perl -w > > use strict; > use warnings; > > my $pat1 = qr /Hi.*?\sBye/; > # my $pat2 = qr /(Hi|[Hh]ello).*?\sBye--I'll sure miss you\!/; # Error Th

Re: need help - simple HASHES question

2003-04-04 Thread John W. Krahn
Ciprian Morar wrote: > > 1. What is the difference between Line #1 and Line #2? > 2. Why is the Line #2 declaration incorrect? > > use strict; > > my %option; > $option {'q'} = new CGI; > > #Line 1- > $option{'Mon'} = 'Monday'; > > #Line 2 - > $option->{

need help - simple HASHES question

2003-04-04 Thread Ciprian Morar
1. What is the difference between Line #1 and Line #2? 2. Why is the Line #2 declaration incorrect? use strict; my %option; $option {'q'} = new CGI; #Line 1- $option{'Mon'} = 'Monday'; #Line 2 - $option->{'Tue'} = 'Tuesday'; print $option{'q'} -> header(), $

Re: maching end of a line with $

2003-04-04 Thread John W. Krahn
Jose Malacara wrote: > > Can someone help me out here, please. > > I have an if statement that is looping over a list of IP addresses: > > 192.168.1.1 > 192.168.1.2 > 192.168.1.3 ...192.168.1.10 > > $value="192.168.1.1" ^ ^ ^ ^ ^ ^ > if ($line =~ /($value)/) ... T

Re: maching end of a line with $

2003-04-04 Thread Wiggins d'Anconia
Jose Malacara wrote: Can someone help me out here, please. I have an if statement that is looping over a list of IP addresses: 192.168.1.1 192.168.1.2 192.168.1.3 ...192.168.1.10 $value="192.168.1.1" if ($line =~ /($value)/) ... I only want to match the value exactly (192.168.1.1). My problem i

maching end of a line with $

2003-04-04 Thread Jose Malacara
Can someone help me out here, please. I have an if statement that is looping over a list of IP addresses: 192.168.1.1 192.168.1.2 192.168.1.3 ...192.168.1.10 $value="192.168.1.1" if ($line =~ /($value)/) ... I only want to match the value exactly (192.168.1.1). My problem is that I am matching

Re: HASH PRINTING

2003-04-04 Thread Wiggins d'Anconia
Eric Walker wrote: Sorry for the ignorance but I think I am able to pull the first layer of the hash but the values that are also hashes or arrays I get memory pointers out . For example: TEMP: 2.0 TEMP5: ARRAY(0xdb660) TEMP6: HASH(0xa2058) Any suggestions on how to access the array and or hash

Re: Is there any Polling mechanism in perl ?

2003-04-04 Thread Wiggins d'Anconia
Madhu Reddy wrote: Hi, Is there any polling mechanism in perl ? Following is my problem.. my program has to wait (poll) on particular folder... If any file arrived on that folder, my main program has to invoke another program... In Unix, we have poll() system call for waiting on particular event

Re: [mail_lists] Re: regex $1 not updating?

2003-04-04 Thread Rob Dixon
Hi Jim. I think yu've got a bit lost in your nexted loops. I've tried to understand what your code does and is meant to do and have written my interpretation below. There are a few things that I can't fathom though. Jim wrote: > On Friday 04 April 2003 14:34, John W. Krahn wrote: > > Jim wrote: >

RE: sending an email to a email address after a perl operation

2003-04-04 Thread mel awaisi
thanks Dan, sorry for forgetting to send to list. the email script works alone, as it is, so maybe it is something else. Regards, Mel From: "Dan Muey" <[EMAIL PROTECTED]> To: "mel awaisi" <[EMAIL PROTECTED]> CC: <[EMAIL PROTECTED]> Subject: RE: sending an email to a email address after a p

Re: [mail_lists] Re: regex $1 not updating?

2003-04-04 Thread Jim
On Friday 04 April 2003 14:54, Bob Showalter wrote: Wow! I've coding in Perl for almost three years now and I didn't this. Anyhoo, Bob's advice was the what I used and it works now. I just moved the regex evals into the if condition statements vs the way I was doing it. Thanks for the assista

RE: sending an email to a email address after a perl operation

2003-04-04 Thread Dan Muey
> Hi Dan Hey, reply to the list not just me. > > yeh still here, back from a small break. just want to finish it!!. > > i tried this and this is what i got: > > Global symbol "$smtp" requires explicit package name at Make $smtp = ... my $smtp = ... There was a thread earlier today about

RE: [mail_lists] Re: regex $1 not updating?

2003-04-04 Thread Mark Anderson
Go back and re-read John's message. Then look at your conditionals. They are different. His work, yours don't. Yours: 87 $back =~ /.*\(.*\) (.*?) .*/; 88 89 if ( $1 ) 103 $line =~ /.* \(.*\) (.*?) .*/; 104 105

Re: regex $1 not updating?

2003-04-04 Thread Rob Dixon
Jim wrote: > I've never encountered this before but I have to be doing something wrong. What you're doing wrong is expecting it to do something different! This is how it works, I'm afraid. > snippet of code: > > ]$ perl -e ' > > $var = "Company Online (Company Systems) NETBLK-COM-5BLK (NET-24-256

RE: regex $1 not updating?

2003-04-04 Thread Timothy Johnson
This feature is by design. :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: [mail_lists] Re: regex $1 not updating?

2003-04-04 Thread Jim
On Friday 04 April 2003 14:34, John W. Krahn wrote: | Jim wrote: | > I've never encountered this before but I have to be doing something | > wrong. | | Yes, you are. This is the documented behaviour of the numeric variables | and is why we always tell beginners to use them only if the regular | ex

RE: sending an email to a email address after a perl operation

2003-04-04 Thread Dan Muey
> Hi, Howdy again, still working on this huh? > > I have a script named renamer.pl that takes images from a > directory and > renames images and stores image meta information in a mysql. > i also have a > script that sends an email notification when excecuted to a > desired email > address

Re: regex $1 not updating?

2003-04-04 Thread Bob Showalter
Jim wrote: > I've never encountered this before but I have to be doing something > wrong. > > snippet of code: > > ]$ perl -e ' > > $var = "Company Online (Company Systems) NETBLK-COM-5BLK > > (NET-24-256-0-0-1)"; $var =~ /.*? \(.*\) (.*?) \(.*?\)/; > > print $1,"\n"; > > > > $var = "NetBlock: NETB

sending an email to a email address after a perl operation

2003-04-04 Thread mel awaisi
Hi, I have a script named renamer.pl that takes images from a directory and renames images and stores image meta information in a mysql. i also have a script that sends an email notification when excecuted to a desired email address. is there away that i could combine the 2 scripts together, s

Re: [mail_lists] Re: looking for help with Net::IRC

2003-04-04 Thread Jim
On Friday 04 April 2003 11:59, you wrote: Yes. I agree. IO::Socket is better. Anyone tried the POE components? 31 POE::Component::IRC 2.70 FIMM 32 POE::Component::IRC::Object 0.02 MSERGEANT 33 POE::Component::IRC::On

Re: regex $1 not updating?

2003-04-04 Thread John W. Krahn
Jim wrote: > > I've never encountered this before but I have to be doing something wrong. Yes, you are. This is the documented behaviour of the numeric variables and is why we always tell beginners to use them only if the regular expression matched. > snippet of code: > > ]$ perl -e ' > > $va

regex $1 not updating?

2003-04-04 Thread Jim
I've never encountered this before but I have to be doing something wrong. snippet of code: ]$ perl -e ' > $var = "Company Online (Company Systems) NETBLK-COM-5BLK (NET-24-256-0-0-1)"; > $var =~ /.*? \(.*\) (.*?) \(.*?\)/; > print $1,"\n"; > > $var = "NetBlock: NETBLK-10H-6BLK"; > $var =~ /sddd

Re: looking for help with Net::IRC

2003-04-04 Thread Oliver Schaedlich
Hello Dan, Thursday, April 3, 2003, 11:04:36 PM, you wrote: > Net::IRC isn't the best way in the world of creating an IRC bot. I just use > IO::Socket, and establish & maintain the connection to IRC myself within my > own source. Personally that's the better option. thanks for your advice. Since

RE: How to measure Array or Hash's byte size ?

2003-04-04 Thread Shawn
That's not what he was asking. On Thu, 2003-04-03 at 10:07, BUFFERNE,VINCENT (HP-France,ex1) wrote: > What's about: > > my @foo = ( '1', '2' ,'3' ); > my $size = $#foo + 1; > print "table size $size\n"; > > Ouput: > table size 3 > > Vincent > > -Original Message- > From: Li Ngok Lam [m

Re: Installing Curses.pm on Red Hat 8.0

2003-04-04 Thread Bruno Negrao
Hi everybody, I found myself the solution. To install Curses 1.06 with my perl-5.8.0-55, i need a patch for the Curses package. First, I made a search on www.rmpfind.net for the string 'perl-Curses' and I found various rpm and src.rpm packages of it, mostly for mandrake. So, I downloaded the perl

Is there any Polling mechanism in perl ?

2003-04-04 Thread Madhu Reddy
Hi, Is there any polling mechanism in perl ? Following is my problem.. my program has to wait (poll) on particular folder... If any file arrived on that folder, my main program has to invoke another program... In Unix, we have poll() system call for waiting on particular event ? is there any s

Re: HASH PRINTING

2003-04-04 Thread Eric Walker
"[EMAIL PROTECTED]" wrote: > I started to write it but didn't reach to finish it. > Any way, the main idea is > unless (ref = scalar) { > if (ref = hash) { > enter another layer > } > elsif (ref = array) { > print @Array > } > } > print $HASH{$KEY} > > HTH, > Yargo! > > Original Me

Re: SIGINT and SIGQUIT with system()

2003-04-04 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > Hi there > > I'm stuck with system(). According to some posts, system() is passing SIGINT > and SIGQUIT to it's child, yet this doesn't seem to work. I've boiled the > code down to the following lines. (Please note that 'alsaplayer' is a console > soundfile player that ho

Re: How to measure Array or Hash's byte size ?

2003-04-04 Thread Rob Dixon
Li Ngok Lam wrote: > > What's about: > > > > my @foo = ( '1', '2' ,'3' ); > > my $size = $#foo + 1; > > you can simplify this by : $size = scalar @foo; You can simplify even this by : $size = @foo :) Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR

RE: SIGINT and SIGQUIT with system()

2003-04-04 Thread Bob Showalter
R. Joseph Newton wrote: > [EMAIL PROTECTED] wrote: > > > if (!$pid) { &player(); } > > while (!-e "stop") { sleep(10); } > > kill('QUIT', $pid); > > ... > > > Am I missing something here? Any idea how I could do this > > differently? > > > > Yes. Braces. They may not be required

Re: Php perl?

2003-04-04 Thread Gary Stainburn
On Friday 04 Apr 2003 3:59 pm, Dan Muey wrote: > > Dan Muey <[EMAIL PROTECTED]> wrote: > > > If you want it to run like mod_php use mod_perl. Someone said that > > > not using mod_perl "increases dramatically the startup". > > > > Yeah by like > > > > > zillionth of a second. > > > > Hi Dan, > > >

Re: Use strict (beginner question)

2003-04-04 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote: > All, > > I added the "use strict;" statement to my script for the first time and > received the following compilation errors: > Global symbol "$LoginName" requires explicit package name at todaysFiles.pl > line 43. This error means that "$LoginName was declared without

RE: Php perl?

2003-04-04 Thread Dan Muey
> Dan Muey <[EMAIL PROTECTED]> wrote: > > > > If you want it to run like mod_php use mod_perl. Someone said that > > not using mod_perl "increases dramatically the startup". > Yeah by like > > zillionth of a second. > > Hi Dan, > > And remember that the "startup" can also include loading modu

RE: php mySQL question

2003-04-04 Thread Dan Muey
> Hi, Howdy > > I have a php form that takes in data for a mysql query. The > script that > processes the form takes the variables from the form and > submits them to > the db. > > What if the field after LIKE needs to be imprecise? The variable > somehow needs to be converted to a regul

Re: Problem with ^ oprator

2003-04-04 Thread Brett W. McCoy
On 4 Apr 2003, Rado Petrik wrote: > I have two number > > $a=6; #binary - 0110 > $b=10; # 1010 > > I need work this operation "a OR b" > 0110 - 6 > OR 1010 - 10 > - > 1110 - 14 this is true; > > buy when I use this operator "^" in perl > > $a^$b then output is 12 >

RE: Use strict (beginner question)

2003-04-04 Thread wiggins
On Thu, 3 Apr 2003 14:05:19 -0500, [EMAIL PROTECTED] wrote: > > All, > > I added the "use strict;" statement to my script for the first time and > received the following compilation errors: > Global symbol "$LoginName" requires explicit package n

Re: How to measure Array or Hash's byte size ?

2003-04-04 Thread Li Ngok Lam
> What's about: > > my @foo = ( '1', '2' ,'3' ); > my $size = $#foo + 1; you can simplify this by : $size = scalar @foo; > print "table size $size\n"; > > Ouput: > table size 3 TIA, but this is not what I want... because each element is assumpted not in same length... ie.. I am not going to g

Re: HASH PRINTING

2003-04-04 Thread [EMAIL PROTECTED]
I started to write it but didn't reach to finish it. Any way, the main idea is unless (ref = scalar) { if (ref = hash) { enter another layer } elsif (ref = array) { print @Array } } print $HASH{$KEY} HTH, Yargo! Original Message: - From: R. Joseph Newton [EMAIL PR

Re: Problem with ^ oprator

2003-04-04 Thread Jenda Krynicky
From: Rado Petrik <[EMAIL PROTECTED]> > I have two number > > $a=6; #binary - 0110 > $b=10; # 1010 > > I need work this operation "a OR b" > 0110 - 6 > OR 1010 - 10 > - > 1110 - 14 this is true; > > buy when I use this operator "^" in perl > > $a^$b then

Problem with ^ oprator

2003-04-04 Thread Rado Petrik
Hi, I have two number $a=6; #binary - 0110 $b=10; # 1010 I need work this operation "a OR b" 0110 - 6 OR 1010 - 10 - 1110 - 14 this is true; buy when I use this operator "^" in perl $a^$b then output is 12 0110 - 6 OR 1010 - 10 - 11

Re: Use strict (beginner question)

2003-04-04 Thread Morten Liebach
On 2003-04-03 14:05:19 -0500, [EMAIL PROTECTED] wrote: > > All, > > I added the "use strict;" statement to my script for the first time and > received the following compilation errors: > Global symbol "$LoginName" requires explicit package name at todaysFiles.pl > line 43. > Global symbol "$TMPNo

Re: help with SGI::FAM

2003-04-04 Thread Brian J. Miller
> HI > > I installed the module SGI::FAM, but when I run the program monitor. for example: > > #./monitor /var/www > > this show me that error: > > Your Vendor has not defined SGI::FAM macro new at ./monitor line 6 > I have seen this before, but sorry to say was not able to fix it. It seems as F

Use strict (beginner question)

2003-04-04 Thread Steve . E . Pittman
All, I added the "use strict;" statement to my script for the first time and received the following compilation errors: Global symbol "$LoginName" requires explicit package name at todaysFiles.pl line 43. Global symbol "$TMPNow" requires explicit package name at todaysFiles.pl line 45. Global sym

RE: How to measure Array or Hash's byte size ?

2003-04-04 Thread BUFFERNE,VINCENT (HP-France,ex1)
What's about: my @foo = ( '1', '2' ,'3' ); my $size = $#foo + 1; print "table size $size\n"; Ouput: table size 3 Vincent -Original Message- From: Li Ngok Lam [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 5:14 PM To: [EMAIL PROTECTED] Subject: How to measure Array or Hash's by

Re: How conver decimal num. to bin. mum.

2003-04-04 Thread Steve Grazzini
Radovan Petrikí <[EMAIL PROTECTED]> wrote: > > how I conver decimal number to binary number in perl? > You could use pack/unpack() $ perl -le 'print unpack "B*", pack "n", 3' 0011 Or (s)printf $ perl -le 'printf "%b\n", 3' 11 -- Steve -- To unsubscribe, e-mai