"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
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
"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
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
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
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
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
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
"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
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->{
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(),
$
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
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
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
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
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
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:
>
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
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
> 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
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
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
This feature is by design. :)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
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
> 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
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
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
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
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
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
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
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
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
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
"[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
[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
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
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
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,
> >
>
[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
> 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
> 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
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
>
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
> 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
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
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
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
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
> 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
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
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
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
53 matches
Mail list logo