Re: questions about heredocs

2004-07-16 Thread Randy W. Sims
On 7/17/2004 2:08 AM, gohaku wrote: Hello everyone, After months of searching perl documentation and books, I finally found out what those "<<" are called. What's strange is that I found my answer in a PHP book! Having seen heredocs in a php script first, I find Perl's syntax very confusing. The fo

questions about heredocs

2004-07-16 Thread gohaku
Hello everyone, After months of searching perl documentation and books, I finally found out what those "<<" are called. What's strange is that I found my answer in a PHP book! Having seen heredocs in a php script first, I find Perl's syntax very confusing. The following works as a php script but no

RE: Order of evaluation

2004-07-16 Thread David Arnold
Charles et al, Certainly good advice, and I did print it out, so I do know what happens. %perl junk.pl affection3 Compilation finished at Fri Jul 16 20:02:43 It's just that I don't know why this happens. At 09:52 PM 7/16/04 -0500, Charles K. Clarkson wrote: >David Arnold <[EMAIL PROTECTED]> wr

RE: Order of evaluation

2004-07-16 Thread Charles K. Clarkson
David Arnold <[EMAIL PROTECTED]> wrote: : If I have: : : my $state={}; : $state->{WORD}='affection'; : $state->{GAMENO}=3; : $state->{GUESSES}=3; : : Then, the following line puzzles me: : : my @[EMAIL PROTECTED](WORD GAMENO)}; : : How does the order of evaluation go here in order to : populat

Order of evaluation

2004-07-16 Thread David Arnold
All, If I have: my $state={}; $state->{WORD}='affection'; $state->{GAMENO}=3; $state->{GUESSES}=3; Then, the following line puzzles me: my @[EMAIL PROTECTED](WORD GAMENO)}; How does the order of evaluation go here in order to populate @ary? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For ad

Re: Help translate into Perl

2004-07-16 Thread John W . Krahn
On Friday 16 July 2004 14:51, Mike Blezien wrote: > > hello, Hello, > I have been given some programming code that I need to convert or > translate into perl coding, and I was hoping someone on this list > maybe able to help me out. I have a vague idea what it's suppose to > be doing, but some of

RE: keeping the file name while checking w/ LWP

2004-07-16 Thread Brian Volk
thank you... I was just reading about Grep vs. Loops :-) Thanks again! Brian -Original Message- From: Gunnar Hjalmarsson [mailto:[EMAIL PROTECTED] Sent: Friday, July 16, 2004 4:39 PM To: [EMAIL PROTECTED] Subject: Re: keeping the file name while checking w/ LWP Brian Volk wrote: > I h

RE: Help translate into Perl

2004-07-16 Thread Charles K. Clarkson
From: Mike Blezien wrote: : James Edward Gray II wrote: : : On Jul 16, 2004, at 4:51 PM, Mike Blezien wrote: : : : : : I have been given some programming code that I need to : : : convert or translate into perl coding, and I was : : : hoping someone on this list maybe

Re: Help translate into Perl

2004-07-16 Thread Mike Blezien
James Edward Gray II wrote: On Jul 16, 2004, at 4:51 PM, Mike Blezien wrote: hello, I have been given some programming code that I need to convert or translate into perl coding, and I was hoping someone on this list maybe able to help me out. What have you tried? We will help you when you get s

Re: Help translate into Perl

2004-07-16 Thread James Edward Gray II
On Jul 16, 2004, at 4:51 PM, Mike Blezien wrote: hello, I have been given some programming code that I need to convert or translate into perl coding, and I was hoping someone on this list maybe able to help me out. What have you tried? We will help you when you get stuck, but we won't write it f

Help translate into Perl

2004-07-16 Thread Mike Blezien
hello, I have been given some programming code that I need to convert or translate into perl coding, and I was hoping someone on this list maybe able to help me out. I have a vague idea what it's suppose to be doing, but some of it isn't real clear. Below is the psuedo-code sample # START

Re: keeping the file name while checking w/ LWP

2004-07-16 Thread Gunnar Hjalmarsson
Brian Volk wrote: I have a file that contains the file name and the url. I need to separate the url so I can use LWP::Simple; to check the link, however, I need to keep the file name in tact so I can trace it back to my website. Anyone have any suggestions? Use map() together with split() to popu

RE: Pattern Matching records from a table query.

2004-07-16 Thread Charles K. Clarkson
jason corbett <[EMAIL PROTECTED]> wrote: : I want to eliminate the ". " (periord) or "," (comma) from : records that I return from a query, but I cannot figure out : how to approach it. Does Perl have a way that I can match a : string that from an array, remove a character or characters? : : : F

RE: Is the var recreated in a foreach loop using `my`?

2004-07-16 Thread Rod Za
Thank you, Bob and Chris Charley, In the Bob's example: e.g. >for (1 .. 5) { >my @arr = ($_) x $_; >print [EMAIL PROTECTED], " = @arr\n"; >} > >ARRAY(0x8103418) = 1 >ARRAY(0x80f827c) = 2 2 >ARRAY(0x8103490) = 3 3 3 >ARRAY(0x81034cc) = 4 4 4 4 >ARRAY(0x

Re: Pattern Matching records from a table query.

2004-07-16 Thread James Edward Gray II
On Jul 16, 2004, at 3:46 PM, jason corbett wrote: I want to eliminate the ". " (periord) or "," (comma) from records that I return from a query, but I cannot figure out how to approach it. Does Perl have a way that I can match a string that from an array, remove a character or characters? For e

Pattern Matching records from a table query.

2004-07-16 Thread jason corbett
I want to eliminate the ". " (periord) or "," (comma) from records that I return from a query, but I cannot figure out how to approach it. Does Perl have a way that I can match a string that from an array, remove a character or characters? For example say I have array @records that contain th

Re: Thanks a Ton..Mr Gunnar..

2004-07-16 Thread Gunnar Hjalmarsson
Sunish Kapoor wrote: Dear Mr Gunnar, Thanks a million..it works great now You're welcome, glad it works. Thank you so much for your prompt support via email The best way to thank me, and bring additional value to this community, is to post an updated script including "use strict;" and "use warnin

RE: Is the var recreated in a foreach loop using `my`?

2004-07-16 Thread Bob Showalter
Rod Za wrote: > Hi, > > I have a doubt. If i create an array inside a foreach loop using > `my`, is this array recreated every time or every time the loop pass > by i got a new array? Yes, it's a new array. Try this: for (1 .. 5) { my @arr = ($_) x $_; print [EMAIL PROTECTED],

find out who was online at a given time

2004-07-16 Thread christopher . l . hood
Ok, this may or may not be a tricky one I will try and be succinct in my statement. I have a database (mysql 4.0) with radius log entries for each day, we receive emails about Acceptable Use Abuses and must figure out exactly who was online with a certain IP address when the abuse occurred. As yo

Thanks a Ton..Mr Gunnar..

2004-07-16 Thread Sunish Kapoor
Dear Mr Gunnar, Thanks a million..it works great now Thank you so much for your prompt support via email Regards Sunish Kapoor Muscat, Oman - Original Message - From: "Gunnar Hjalmarsson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 16, 2004 8:36 AM Subject: Re: Coul

Re: Is the var recreated in a foreach loop using `my`?

2004-07-16 Thread Chris Charley
- Original Message - From: "Rod Za" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Friday, July 16, 2004 10:58 AM Subject: Is the var recreated in a foreach loop using `my`? > Hi, > > I have a doubt. If i create an array inside a foreach loop using `my`, is

keeping the file name while checking w/ LWP

2004-07-16 Thread Brian Volk
Hi All, Can someone please point me in the right direction... maybe a module..? I have a file that contains the file name and the url. I need to separate the url so I can use LWP::Simple; to check the link, however, I need to keep the file name in tact so I can trace it back to my website. An

Re: Could anyone please help with Line Extraction and Emailing Question

2004-07-16 Thread Gunnar Hjalmarsson
Sunish Kapoor wrote: Still cant figure out..and make it work.. These are my suggested changes: $hash{$fields[1]}= [$fields[0],$fields[2],$fields[3],$fields[4],$fields[5],$fields[6],$fields[7],$fields[8],$fields[9]] if ($fields[10] == "$epoch" ) ; Replace that line with: push @{ $hash{$fields[1]

RE: !$state

2004-07-16 Thread Tim Johnson
Thank you, yes. That is an important distinction. -Original Message- From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] Sent: Fri 7/16/2004 7:17 AM To: [EMAIL PROTECTED] Cc: Subject: Re: !$state > "Tim" ==

Is the var recreated in a foreach loop using `my`?

2004-07-16 Thread Rod Za
Hi, I have a doubt. If i create an array inside a foreach loop using `my`, is this array recreated every time or every time the loop pass by i got a new array? e.g.: _BEGIN_ #!/usr/bin/perl use warnings; use strict; my @array1 =(1,2,3,4,5,6,7,8,9); foreach(@array1){ my @array2 = ($_,'a','b','c'

RE: symbolic references in perl module help

2004-07-16 Thread Charles K. Clarkson
Luis Pachas <[EMAIL PROTECTED]> wrote: : I keep getting a function undefined, I used require : and exporter but I kept getting subroutine undefined. : at times in the main:: and in the perl modules. Exporter works fine. Perhaps you could show us what you did? : I went around this by having

Re: Could anyone please help with Line Extraction and Emailing Question

2004-07-16 Thread Sunish Kapoor
Hello, Still cant figure out..and make it work.. could anyone pls modify this for me for me ! Do not know how to make change in sub mail_report too Sunish - Original Message - From: "Gunnar Hjalmarsson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 16, 2004 5:28 AM Subj

Re: !$state

2004-07-16 Thread Randal L. Schwartz
> "Tim" == Tim Johnson <[EMAIL PROTECTED]> writes: Tim> "$state = ()" assigns the value of an empty list to the scalar $state, so it would evaluate to false. No, it doesn't. It evaluates () in a scalar context, which returns a scalar undef. Hence, same as "$state = undef". Right conclusio

Help with local install - not "root"

2004-07-16 Thread Moon, John
After installing I run a "test" and get the following error... Below is the install ... which I tried several times... I am trying to have the dir Crypt end up in the dir Library Any help or suggestions will be appreciated. DEV,SUN2>pwd /opt/common/html/td_dev/cgi-bin DEV,SUN2>./foo Can't loca

Re: not sure what I did ?

2004-07-16 Thread Gunnar Hjalmarsson
Brian Volk wrote: Gunnar Hjalmarsson wrote: As I told you in another thread, that just grabs the file names, while you likely need the full paths. Yes, you did. I actually just wanted the file name, but hey, your way works, so I'll stick w/ that. If you only want the file names in @ARGV, setting t

RE: not sure what I did ?

2004-07-16 Thread Brian Volk
Gunnar Hjalmarsson wrote: > As I told you in another thread, that just grabs the file names, while > you likely need the full paths. Yes, you did. I actually just wanted the file name, but hey, your way works, so I'll stick w/ that. > Why do you keep starting new threads about this topic ins

Re: symbolic references in perl module help

2004-07-16 Thread James Edward Gray II
On Jul 16, 2004, at 7:54 AM, Luis Pachas wrote: Hi I have a problem, I have a PM i have this A.pm : package A; my %b; $b = { apple => \&foo1, oranges => \&foo2, open => \&foo3 }; sub foo1 { print "apples\n" } sub foo2 { print "oranges\n" } sub foo3 { my ($item) = @_; print $item."\

Re: symbolic references in perl module help

2004-07-16 Thread Gunnar Hjalmarsson
Luis Pachas wrote: Hi I have a problem, I noticed several problems. I have a PM i have this A.pm : package A; my %b; $b = { Must be global. And you need to decide if you want a hash or a hash reference. I'm assuming a hash reference. our $b = { apple => \&foo1, oranges => \&foo2, ope

RE: Help with deleting hash key?

2004-07-16 Thread arichmond(contr-ird)
Paul Johnson wrote: > $line(){ chomp $line; >if ($line =~/.*row.*/i){ > }else{ > $hash{$line}="new"; > }} > close(BLK); > our $a='3.3.3.3'; > delete ($hash{$a}); > print keys %hash; also, s/our/my/ unless you have a good reason not to. >-- >Paul Johnson - [EMAIL PROTECTED] >http

Re: Help with deleting hash key?

2004-07-16 Thread Paul Johnson
On Fri, Jul 16, 2004 at 08:46:32AM -0400, arichmond(contr-ird) wrote: > I have been playing with ipblocker from ipblocker.org and modified it to > take a list of attackers from an IDS. I wanted to do some error checking > to pull out the "already blocked ip's" before sending it to the original > s

symbolic references in perl module help

2004-07-16 Thread Luis Pachas
Hi I have a problem, I have a PM i have this A.pm : package A; my %b; $b = { apple => \&foo1, oranges => \&foo2, open => \&foo3 }; sub foo1 { print "apples\n" } sub foo2 { print "oranges\n" } sub foo3 { my ($item) = @_; print $item."\n" } 1; ## End Module MAIN : !#/bin/perl lib "$E

Help with deleting hash key?

2004-07-16 Thread arichmond(contr-ird)
Title: Message I have been playing with ipblocker from ipblocker.org and modified it to take a list of attackers from an IDS. I wanted to do some error checking to pull out the "already blocked ip's" before sending it to the original script. I can't figure out why the delete $hash{'$x'} won'

Re: Taint question

2004-07-16 Thread Gunnar Hjalmarsson
Marcus Willemsen wrote: I'm writing CGI scripts on a windows (2000 and xp pro) machine. In order to make them more secure I try to employ the -T switch for taint mode. I used to work when working on a linux station. Under windows the scripts always complain "To late for -T option in script XY line

Taint question

2004-07-16 Thread Marcus Willemsen
Hi everybody, I'm writing CGI scripts on a windows (2000 and xp pro) machine. In order to make them more secure I try to employ the -T switch for taint mode. I used to work when working on a linux station. Under windows the scripts always complain "To late for -T option in script XY line 1" When I

RE: !$state

2004-07-16 Thread Bob Showalter
David Arnold wrote: > All, > > If: > > $state={}; Now state is a reference to an anonymous HASH > > Then, what is: > > !$state This is '' (i.e. "false"), because the ! operator returns 1 ("true") only for the values '', 0, and undef. Any reference will be "true" in this test, even a referenc

Re: Could anyone please help with Line Extraction and Emailing Question

2004-07-16 Thread Gunnar Hjalmarsson
Sunish Kapoor wrote: Today is July 16 so when script should be executed it should send line1, line3, line5 to Randal on [EMAIL PROTECTED] Similarly it should send line7, line9, line11 to Tom on [EMAIL PROTECTED] NOW THE PROBLEM => Though it is sending email but only line5 to Randal and line11 to

RE: grep in perl

2004-07-16 Thread Bob Showalter
[EMAIL PROTECTED] wrote: > Help a perl newbie coding for a bioinfo guy please. > > I have a shell script that contains the following code > > # $1=sequence_file, $2=input_file, $3=output file, $4=chain. > > if [ $# != 4 ] > then > echo "Usage: parse_pdb.sh sequence_file pdb_file output_f

RE: How to Sort on a substr

2004-07-16 Thread Bob Showalter
Jeff Westman wrote: > Hi, > > I need to do a sort on a couple of column ranges. > > I want to be able to do a primary sort, on say, columns 21-25 and > then a secondary sort on columns 40-49. > > Any ideas on how to approach this? Assuming you're numbering columns from 1: @rows = sort { sub

Could anyone please help with Line Extraction and Emailing Question

2004-07-16 Thread Sunish Kapoor
I have been struggling with a script but cant make it work. There are two Sales Executives called : Randal & Tom Randal's Email ID is > [EMAIL PROTECTED] Tom's Email ID is > [EMAIL PROTECTED] Below are the contents of a text file called prospects.txt You'll observe that there a

Re: !$state

2004-07-16 Thread Harald Richard Ashburner
Tim Johnson said: > > >Someone can probably give a better answer, but practically speaking, this is what >I've seen to be true (someone please give me a verbal whipping if I'm off here): > >Perl evaluates a statement as false if it > >a) is undefined >b) evaluates to 0 >c) evaluates to '' (em

RE: !$state

2004-07-16 Thread Tim Johnson
Someone can probably give a better answer, but practically speaking, this is what I've seen to be true (someone please give me a verbal whipping if I'm off here): Perl evaluates a statement as false if it a) is undefined b) evaluates to 0 c) evaluates to '' (empty string) and evaluates

Re: Finding perl documentation

2004-07-16 Thread Randy W. Sims
Randy W. Sims wrote: As far as searching, you have several options. A couple of other (obious) web searches I omitted are: -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]