RE: New Perl Forum Up

2006-09-28 Thread Thomas Bätzler
Philip <[EMAIL PROTECTED]> wrote: > I've decided to create a Perl forum board over at > http://perl.nixpub.combecause I'm tired of the advertisement > infested Perl forums that are out there. I could go on, but > if your interested please take a look, I am very interested > in helping the Perl

DatabasePlugin for DB2 and SQLSERVER on TWiki ...

2006-09-28 Thread benbart
Hi all, Am trying to setup TWiki to connect to DB2 and SQLSERVER and needs to configure the DatabasePlugin.pm and DatabasePluginConfig.pm. So far, am not having any luck with them. Already, the notes/docs said the plugin had been tested on MySQL and ORACLE databases only but since I was able to wr

Re: DBI - DB2 Perl Script ... TWiki

2006-09-28 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > Hi all, Hello, > I have this script that am trying to use to connect to DB2. > > At the moment I cannot get the script to connect to DB2. > > In the UNIX prompt, if I run . /home/db2inst1/sqllib/db2profile first and then > run the Perl script, then I can connect to DB

DBI - DB2 Perl Script ... TWiki

2006-09-28 Thread benbart
Hi all, I have this script that am trying to use to connect to DB2. At the moment I cannot get the script to connect to DB2. In the UNIX prompt, if I run . /home/db2inst1/sqllib/db2profile first and then run the Perl script, then I can connect to DB2. Also, I can only do export DB2INSTANCE=db2i

sorting DBM hash

2006-09-28 Thread John W. Burns
Sorting DBM Hash Greetings: I've run into what appears to be a conflict in sorting a DBM Hash. The DBM is opened and closed through tie and untie to store selections from Perl Tk medical questionnaire which uses checkboxes, radio buttons and lists, and contains over 200 items. I'm attempting

sorting DBM hash

2006-09-28 Thread John W. Burns
Sorting DBM Hash Greetings: I've run into what appears to be a conflict in sorting a DBM Hash. The DBM is opened and closed through tie and untie to store selections from Perl Tk medical questionnaire which uses checkboxes, radio buttons and lists, and contains over 200 items. I'm attempting to

RE: Querying very big database

2006-09-28 Thread Toddy Prawiraharjo
THX! I always knew it's my n00b scripting that caused the problem. It now down to 4 lines inside while loop, and I'm flying! The processing down from ~15 minutes to 4 secs! But, for longer date range (2 weeks time limit) it clocked at 25 wallclock secs (with processing ~350k mysql return entries).

Re: Querying very big database

2006-09-28 Thread Rob Dixon
Toddy Prawiraharjo wrote: Hello all, I am not sure if i'm inside the correct mailing list, but it should be simple for you guys. Recently i started a simple perl program to catch all syslog from my netscreen firewall, and put them into a database, so later can do some analysing on it (sort of AW

Querying very big database

2006-09-28 Thread Toddy Prawiraharjo
Hello all, I am not sure if i'm inside the correct mailing list, but it should be simple for you guys. Recently i started a simple perl program to catch all syslog from my netscreen firewall, and put them into a database, so later can do some analysing on it (sort of AWStats). the database itself

Re: Hash problem

2006-09-28 Thread Dr.Ruud
"Johnson, Reginald (GTI)" schreef: > I guess it > is a good practice to use data::dumper when you are developing > programs. ITYM: Data::Dumper (casing matters). -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO

Re: hash slices

2006-09-28 Thread Rob Dixon
Gerald Host wrote: > > Rob Dixon wrote: > >> You don't want to use selectall_hashref because, as is the nature of hashes, >> the key must be unique, which means the database table's key field that >> provides it must also be unique. If you get this working, you will retrieve a >> single record for

Re: Hash problem

2006-09-28 Thread D. Bolliger
Johnson, Reginald (GTI) am Donnerstag, 28. September 2006 22:56: > I guess it > is a good practice to use data::dumper when you are developing programs. What you should always use is (as others pointed out) the lines: use strict; use warnings; to improve detection of errors. Data::Dumper is use

Re: interpoliation within regexp

2006-09-28 Thread John W. Krahn
Derek B. Smith wrote: > >>Why not just specify a non-digit for the first >>character: >> >>my @a = ( 0 .. 9, 'a' .. 'z', 'A' .. 'Z'); >> >>my $password = join '', $a[ 10 + rand( @a - 10 ) ], >>map $a[ rand @a ], 1 .. 5; > > Ok great, but I do not fully understand this. Will you > explain in Engl

RE: Hash problem

2006-09-28 Thread Johnson, Reginald \(GTI\)
-Original Message- From: D. Bolliger [mailto:[EMAIL PROTECTED] Sent: Thursday, September 28, 2006 4:32 PM To: beginners@perl.org Subject: Re: Hash problem Johnson, Reginald (GTI) am Donnerstag, 28. September 2006 21:58: > I am doing an example from Perl Objects, References & modules. I

Re: interpoliation within regexp

2006-09-28 Thread D. Bolliger
Derek B. Smith am Donnerstag, 28. September 2006 22:28: > > Why not just specify a non-digit for the first > > character: > > > > my @a = ( 0 .. 9, 'a' .. 'z', 'A' .. 'Z'); > > > > my $password = join '', $a[ 10 + rand( @a - 10 ) ], > > map $a[ rand @a ], 1 .. 5; > > > > > > > > John > > Ok great,

New Perl Forum Up

2006-09-28 Thread Philip
Hi everyone - I sincerely hope this email is not regarded as spam, if so please excuse me. I've decided to create a Perl forum board over at http://perl.nixpub.combecause I'm tired of the advertisement infested Perl forums that are out there. I could go on, but if your interested please take a lo

Re: Hash problem

2006-09-28 Thread John W. Krahn
Johnson, Reginald (GTI) wrote: > I am doing an example from Perl Objects, References & modules. I suspect > many of you already use this book as a reference. > My hash is showing the address instead of the name and I'm not sure > why. Here is my output. > > this is person=>HASH(0x20040014) > thi

Re: Hash problem

2006-09-28 Thread D. Bolliger
Johnson, Reginald (GTI) am Donnerstag, 28. September 2006 21:58: > I am doing an example from Perl Objects, References & modules. I suspect > many of you already use this book as a reference. > My hash is showing the address instead of the name and I'm not sure > why. Here is my output. > > this

Re: Hash problem

2006-09-28 Thread chen li
--- "Johnson, Reginald (GTI)" <[EMAIL PROTECTED]> wrote: > I am doing an example from Perl Objects, References > & modules. I suspect > many of you already use this book as a reference. > My hash is showing the address instead of the name > and I'm not sure > why. Here is my output. > > this

Re: interpoliation within regexp

2006-09-28 Thread Derek B. Smith
> Why not just specify a non-digit for the first > character: > > my @a = ( 0 .. 9, 'a' .. 'z', 'A' .. 'Z'); > > my $password = join '', $a[ 10 + rand( @a - 10 ) ], > map $a[ rand @a ], 1 .. 5; > > > > John Ok great, but I do not fully understand this. Will you explain in English? thx _

Re: interpoliation within regexp

2006-09-28 Thread John W. Krahn
Derek B. Smith wrote: > --- "Mumia W." <[EMAIL PROTECTED]> > wrote: >> >>What is the purpose of this program? > > To generate a random 6 character string. > > If the first character starts with a # then I just > ignore the new string and tell it to goto LABLE, b/c > for 0-32 on the ASCII table c

Hash problem

2006-09-28 Thread Johnson, Reginald \(GTI\)
I am doing an example from Perl Objects, References & modules. I suspect many of you already use this book as a reference. My hash is showing the address instead of the name and I'm not sure why. Here is my output. this is person=>HASH(0x20040014) this is who=>HASH(0x20040014) HASH(0x20040014) i

Re: interpoliation within regexp

2006-09-28 Thread Derek B. Smith
--- "Mumia W." <[EMAIL PROTECTED]> wrote: > On 09/28/2006 12:04 PM, Derek B. Smith wrote: > > ** > > The input data is a 6 character randomized string > that > > could start with a # such as 6FhJ9Z. If it does > start > > with a number then I need to conver

Re: hash slices

2006-09-28 Thread John W. Krahn
Gerald Host wrote: > I'm using DBI's selectall_hashref with 5 key columns. I want to display > each row where key col 1 is 'yes' or NULL (undef or '' ?) > > > foreach my $medCategory (keys %{$href->{'yes'}->{qw('' 'yes')}->{qw('' > 'yes')}}) { > foreach my $med (keys %{$href->{qw('yes')}->{

Re: interpoliation within regexp

2006-09-28 Thread Mumia W.
On 09/28/2006 12:04 PM, Derek B. Smith wrote: ** The input data is a 6 character randomized string that could start with a # such as 6FhJ9Z. If it does start with a number then I need to convert this character into its cooresponding alpha char, [a-z,A-Z].

Re: regex help needed

2006-09-28 Thread Jay Savage
On 9/27/06, Owen <[EMAIL PROTECTED]> wrote: On Wed, 27 Sep 2006 13:11:17 -0600 "Gerald Wheeler" <[EMAIL PROTECTED]> wrote: > I am looking for: ab1in line1 > and looking for: ab2 in line 2 > > actually ab1 and ab2 immediately follow the last "/" (there are > numerous "/" on the line (w/o

Re: hash slices

2006-09-28 Thread Gerald Host
Ryan/Gerald (!) (Ryan) You don't want to use selectall_hashref because, as is the nature of hashes, the key must be unique, which means the database table's key field that provides it must also be unique. If you get this working, you will retrieve a single record for each possible value of

Re: match and grab

2006-09-28 Thread Rob Dixon
Rob Dixon wrote: > > John W. Krahn wrote: >> >> Rob Dixon wrote: >>> >>> John W. Krahn wrote: perldoc -f print print FILEHANDLE LIST print LIST print Prints a string or a list of strings. Returns true if successful. FILEHANDLE may be a scalar variable name, in

Re: hash slices

2006-09-28 Thread Rob Dixon
Gerald Host wrote: > > I'm using DBI's selectall_hashref with 5 key columns. I want to display > each row where key col 1 is 'yes' or NULL (undef or '' ?) > > > foreach my $medCategory (keys %{$href->{'yes'}->{qw('' 'yes')}->{qw('' 'yes')}}) { > foreach my $med (keys %{$href->{qw('yes')}->{qw(

hash slices

2006-09-28 Thread Gerald Host
I'm using DBI's selectall_hashref with 5 key columns. I want to display each row where key col 1 is 'yes' or NULL (undef or '' ?) foreach my $medCategory (keys %{$href->{'yes'}->{qw('' 'yes')}->{qw('' 'yes')}}) { foreach my $med (keys %{$href->{

Re: interpoliation within regexp

2006-09-28 Thread Derek B. Smith
--- "Mumia W." <[EMAIL PROTECTED]> wrote: > On 09/28/2006 08:16 AM, Derek B. Smith wrote: > > --- "Derek B. Smith" <[EMAIL PROTECTED]> > > wrote: > > > >> I need to substitute a conversion using chr, but > >> have > >> failed on multiple attempts. Basically if the > first > >> element contains a

Re: interpoliation within regexp

2006-09-28 Thread Derek B. Smith
-- "Derek B. Smith" <[EMAIL PROTECTED]> wrote: > --- "Derek B. Smith" <[EMAIL PROTECTED]> > wrote: > > > I need to substitute a conversion using chr, but > > have > > failed on multiple attempts. Basically if the > first > > element contains a # then convert it. Will anyone > > advise? > > > >

Re: interpoliation within regexp

2006-09-28 Thread Mumia W.
On 09/28/2006 08:16 AM, Derek B. Smith wrote: --- "Derek B. Smith" <[EMAIL PROTECTED]> wrote: I need to substitute a conversion using chr, but have failed on multiple attempts. Basically if the first element contains a # then convert it. Will anyone advise? thank you derek #if first char is

Re: cgi script

2006-09-28 Thread Tom Phoenix
On 9/28/06, Kaushal Shriyan <[EMAIL PROTECTED]> wrote: #!/bin/bash echo "Content-type: text/plain"; echo set That's a shell script. You're not even using a Perl program; why are you asking for help in a Perl beginners' forum? I dont get values for REMOTE_HOST = and REMOTE_USER = Are you su

Re: why Perl complaints my script

2006-09-28 Thread chen li
Hi Andriano, Thank you very much, Li --- Adriano Ferreira <[EMAIL PROTECTED]> wrote: > On 9/28/06, chen li <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I write a small script for permutation. When I use > > version 1) Perl always complaint it although I get > the > > result. If I use version

Re: why Perl complaints my script

2006-09-28 Thread chen li
Thank you very much, Li --- Igor Sutton <[EMAIL PROTECTED]> wrote: > > > > for ($k; $k>=1;$k--) {$result*=$n--;}#line > 15 > > > > You don't need to declare $k inside for (). Change > that to > > for (; $k >= 1; $k--) > > and perl won't complain about it anymore. I think > the place b

Re: why Perl complaints my script

2006-09-28 Thread chen li
Thanks, Li --- "Dr.Ruud" <[EMAIL PROTECTED]> wrote: > chen li schreef: > > > for ($k; $k>=1;$k--) {$result*=$n--;} > > Alternative: > > $result *= $n-- for 1..$k ; > > -- > Affijn, Ruud > > "Gewoon is een tijger." > > > > -- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additio

Re: why Perl complaints my script

2006-09-28 Thread Dr.Ruud
chen li schreef: > for ($k; $k>=1;$k--) {$result*=$n--;} Alternative: $result *= $n-- for 1..$k ; -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: why Perl complaints my script

2006-09-28 Thread Adriano Ferreira
On 9/28/06, chen li <[EMAIL PROTECTED]> wrote: Hi all, I write a small script for permutation. When I use version 1) Perl always complaint it although I get the result. If I use version 2) it never says a word about it. Any comments? Perl always complain (provided you called for that with -w o

Re: interpoliation within regexp

2006-09-28 Thread Derek B. Smith
--- "Derek B. Smith" <[EMAIL PROTECTED]> wrote: > I need to substitute a conversion using chr, but > have > failed on multiple attempts. Basically if the first > element contains a # then convert it. Will anyone > advise? > > thank you > derek > > #if first char is a-z then print it else warn >

Re: why Perl complaints my script

2006-09-28 Thread Igor Sutton
for ($k; $k>=1;$k--) {$result*=$n--;}#line 15 You don't need to declare $k inside for (). Change that to for (; $k >= 1; $k--) and perl won't complain about it anymore. I think the place before the first ';' is used for declaring any variables inside the lexical scope of for. Maybe s

why Perl complaints my script

2006-09-28 Thread chen li
Hi all, I write a small script for permutation. When I use version 1) Perl always complaint it although I get the result. If I use version 2) it never says a word about it. Any comments? Thank you in advance, Li version 1)### use strict; use warnings; print permutation(5,2); # 5 choose 2

cgi script

2006-09-28 Thread Kaushal Shriyan
Hi ALL I have a issue when i use script (test.cgi) #!/bin/bash echo "Content-type: text/plain"; echo set I get all the http headers populated with the values correctly but when I use the below script (test-cgi) #!/bin/sh # disable filename globbing set -f echo Content-type: text/plain echo

Re: please advise help with regex

2006-09-28 Thread Gregory Machin
i have been playing... will this work and wich is more efficient ? /^([0-3][0-9]\- #day-| (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+#month | \-(20)[0-9][0-9]\s+ #year till 2099 | [0-9][0-9]\: #hour

Re: please advise help with regex

2006-09-28 Thread Rob Dixon
Gregory Machin wrote: > Hi > I need to parse the logs for my named server. i'm having difficulty getting > my mind around the regex to break the data up .. i want the break it up and > store it in a data base then maniptulate the data from there ... > |date | time |catagory|severit

please advise help with regex

2006-09-28 Thread Gregory Machin
Hi I need to parse the logs for my named server. i'm having difficulty getting my mind around the regex to break the data up .. i want the break it up and store it in a data base then maniptulate the data from there ... |date | time |catagory|severity|client |ip |port