Re: Perl Rules

2002-08-03 Thread bob ackerman
On Saturday, August 3, 2002, at 08:43 AM, David Farnum wrote: >Hello i have been learning perl for about 1 year now on my own. I have > been learning C++, Java, HTML, Visual Basic, and C# is school. And the > one thing i want to say is that perl is the best. Everytime I find myself > wri

Re: Perl Rules

2002-08-03 Thread bob ackerman
On Saturday, August 3, 2002, at 06:52 AM, drieux wrote: > > On Saturday, August 3, 2002, at 08:43 , David Farnum wrote: > [..] >> I am learning Object oriented programming and perl Tk right now. I hope >> to move on to regular expretions soon. Well that is it just wanted to >> say I would ra

Re: help dereferencing arrayref so I can put the value into a hash

2002-07-10 Thread bob ackerman
On Wednesday, July 10, 2002, at 09:05 AM, Jeff 'japhy' Pinyan wrote: > On Jul 10, bob ackerman said: > >> and, as someone pointed out, this does work: >> $x = ['abc','def','ghi']; >> print @$x[2]."\n"; # prints &

Re: help dereferencing arrayref so I can put the value into a hash

2002-07-10 Thread bob ackerman
On Wednesday, July 10, 2002, at 09:39 AM, Jeff 'japhy' Pinyan wrote: > On Jul 10, George Schlossnagle said: > >> Am I alone in thinking that $x->[2] is much more readable that @$x[2] >> or $$x[2]? > > No; I always use the $ref->... syntax, unless I'm golfing. > >> @b[2] is an array slice with

Re: help dereferencing arrayref so I can put the value into a hash

2002-07-10 Thread bob ackerman
On Wednesday, July 10, 2002, at 09:29 AM, George Schlossnagle wrote: >> and, as someone pointed out, this does work: >> $x = ['abc','def','ghi']; >> print @$x[2]."\n"; # prints 'ghi' > > > Am I alone in thinking that $x->[2] is much more readable that @$x[2] > or $$x[2]? i was only sa

Re: help dereferencing arrayref so I can put the value into a hash

2002-07-10 Thread bob ackerman
On Wednesday, July 10, 2002, at 01:31 AM, Janek Schleicher wrote: > Shawn wrote at Wed, 10 Jul 2002 09:59:54 +0200: > >> I think what you are looking for is: >> $avg_resp_time->[0] >> >> if you want to have the '@' at the front, I think you would need >> something like this: >> @{$avg_resp_t

Re: real beginner's question (s|{(.*?)}|$1=~ tr///|xg)

2002-07-08 Thread bob ackerman
On Monday, July 8, 2002, at 02:03 PM, Kevin Pfeiffer wrote: > bob ackerman writes: > [...] >> so: >> s|{(.*?)}|$1=~ tr///|xg; > > I'm trying to test this myself on a string (rather than $_), but don't > understand how to use tr/// on $1 and then pl

Re: real beginner's question

2002-07-07 Thread bob ackerman
On Sunday, July 7, 2002, at 10:03 PM, bob ackerman wrote: > > On Monday, July 8, 2002, at 12:55 AM, Todd Wade wrote: > >> >> "David Carpenter" <[EMAIL PROTECTED]> wrote in message >> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> &

Re: real beginner's question

2002-07-07 Thread bob ackerman
On Monday, July 8, 2002, at 12:55 AM, Todd Wade wrote: > > "David Carpenter" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >> I have a text file with occasional strings enclosed in braces: >> kdkdkiwiwdkdkdk {iwidkwidkw} kdkdkdwiwiwkdkdk . . . >> >> I wou

Re: sort arrays by size

2002-07-07 Thread bob ackerman
On Monday, July 8, 2002, at 12:46 AM, Todd Wade wrote: > > "Patricia Hinman" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> Does anyone know of a routine that will sort arrays by >> size. I need to sort any number of given arrays, and >> operate on the l

Re: help with globals and if

2002-07-07 Thread bob ackerman
On Sunday, July 7, 2002, at 05:47 AM, David T-G wrote: > Hi, all -- > > It must still be early, because I just don't get this. > > Given the snippet > > sub setpath(my $shelltype) > { > my ($setenv,$equals) ; > # $_[0] =~ /tcsh/ && $setenv = "setenv" ; > # $_[0] =~ /tcsh/ && { $se

Re: cookies

2002-07-05 Thread bob ackerman
On Friday, July 5, 2002, at 02:32 PM, Connie Chan wrote: > Try Cookies.pm, > $cookie_jar->accept_cookies($bool); > document at > http://search.cpan.org/doc/ILYAM/HTTP- > WebTest-1.99_07/lib/HTTP/WebTest/Cooki > es.pm accept_cookies($optional_accept_cookies) Enables or disables receipt of cooki

Re: need readers

2002-07-03 Thread bob ackerman
On Wednesday, July 3, 2002, at 01:17 PM, drieux wrote: > > volks, > > http://www.wetware.com/drieux/pbl/perlTrick/CBO/PingIt/ > > as a way to look at evolving code upward from the > simple idea oops: One could in theory just take this Forth Script and "go" - modify it as appropriate

Re: How to check if a string is a valid english word?

2002-06-30 Thread bob ackerman
On Sunday, June 30, 2002, at 08:37 AM, drieux wrote: > > On Saturday, June 29, 2002, at 11:07 , George Georgalis wrote: > >> Huh? Why not look it up in a dictionary? ... oh I guess you said that to >> :) > > part of the problem is that there are many > dictionary routines that would consider >

Re: CPAN Modules

2002-06-26 Thread bob ackerman
On Wednesday, June 26, 2002, at 08:50 AM, drieux wrote: > { embedded in that is - so how should I be making perl modules > in a standard way that will be easiest for the perl community. Trust > me that question will come - since you started with the right form > of "I found modules I can us

Re: extracting a string from between parens

2002-06-26 Thread bob ackerman
On Wednesday, June 26, 2002, at 08:48 AM, Shishir K. Singh wrote: >> $out = $1 if ($in =~ /\((.*?)\)/); > Nope..won't work..I take it back!! > looks ok to me. except it adds extra strokes to previous answer. what do you think is wrong with it?

Re: Looping Control structures

2002-06-25 Thread bob ackerman
On Tuesday, June 25, 2002, at 04:59 AM, John W. Krahn wrote: > Will Shiver wrote: [...] > perl -lane'$a{$F[0]}++or$a=qw/box robo rain/[$b++%3];print"$F[0] $a"' > yourfile.txt > > > John sure. almost obviously. but... i assume things like '$a' ,'$b', and '$F' come from those switches, so on

Re: Running Modules

2002-06-24 Thread bob ackerman
On Monday, June 24, 2002, at 01:48 PM, drieux wrote: > > On Monday, June 24, 2002, at 01:34 , bob ackerman wrote: > [..] >> yes but there is not a place to easily grasp the idea of using h2xs. >> a little holdhanding would help. > [..] > > thanks for keeping me h

Re: Running Modules

2002-06-24 Thread bob ackerman
On Monday, June 24, 2002, at 01:00 PM, drieux wrote: > > On Monday, June 24, 2002, at 11:30 , Theresa Mullin wrote: > [..] >> use Test; >> > [..] >> >> …Here is module Test: >> >> #!/usr/bin/perl >> >> ### Program Name: Test.pm >> ### Created By:Theresa Mullin >> ### Date: 5/20

Re: how to include a subroutine from external file?

2002-06-23 Thread bob ackerman
start the file with: package utils;#or whatever name you want put your subroutines in the file: sub foo() # for instance { } end the file with: 1; # package should return true then in other files, to access: use utils; # at top of file and: foo(); # to acces

Re: Perl programmer born and bred

2002-06-21 Thread bob ackerman
On Friday, June 21, 2002, at 09:15 AM, drieux wrote: > > On Friday, June 21, 2002, at 08:38 , Nigel Peck wrote: > [..] >> Or is it d, something I shouldn't be wasting my time thinking about so >> move on (boring git). > > IT IS A SCARY PLACE OUT THERE!!! > > ciao > drieux > or 'out there' is

Re: LWP post fails

2002-06-11 Thread bob ackerman
On Tuesday, June 11, 2002, at 03:02 PM, David T-G wrote: > Bob -- > > ...and then bob ackerman said... > % > % i am trying to login to DI-704 DLink router. > > Why was this in the "killing idle users" thread instead of in your > "get external IP from D-

Re: get external ip from D-Link router

2002-06-11 Thread bob ackerman
On Tuesday, June 11, 2002, at 10:55 PM, Todd Wade wrote: > Right, but is the document you are trying to get the ip from called > status.htm? i have changed my strategy since then. the python posted to the /cgi- bin/logi file first to login. then called the status.htm to get data. again, i say,

LWP post fails

2002-06-11 Thread bob ackerman
i am trying to login to DI-704 DLink router. i have python code that works. i want to do it in perl. the params below come from the python code. i get a 'Failed to login' when i run the code below. use LWP::UserAgent; my $ua = new LWP::UserAgent; my $req = HTTP::Request->new(POST => 'http://192.

Re: get external ip from D-Link router

2002-06-10 Thread bob ackerman
On Monday, June 10, 2002, at 09:02 PM, drieux wrote: > > On Monday, June 10, 2002, at 07:29 , bob ackerman wrote: > >> >> note the ip was slightly different for linksys. it was 192.168.1.1. >> above is the ip i use to manually login. the html file is what the >

Re: get external ip from D-Link router

2002-06-10 Thread bob ackerman
On Monday, June 10, 2002, at 09:48 PM, Todd Wade wrote: > > "Bob Ackerman" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> > >> i can't quite figure out how to do this in perl. i have: >> us

Re: get external ip from D-Link router

2002-06-10 Thread bob ackerman
On Monday, June 10, 2002, at 06:30 PM, Geoffrey F. Green wrote: > On 6/10/02 8:55 PM, "bob ackerman" <[EMAIL PROTECTED]> wrote: > >> # Fetch the page >> $admin = ARGV[0];#password >> print $admin,"\n"; >> my $ua = LWP::User

Re: get external ip from D-Link router

2002-06-10 Thread bob ackerman
On Monday, June 10, 2002, at 05:26 PM, Todd Wade wrote: > Bob Ackerman wrote: > >> my box is behind a D-Link router 704. >> The router gets its ip from my isp using dhcp. >> anyone know how to get that external ip from the router? >> is any module designed to f

Re: file read and then write problem

2002-06-10 Thread bob ackerman
On Monday, June 10, 2002, at 11:57 AM, Jeff 'japhy' Pinyan wrote: > On Jun 10, bob ackerman said: > >> On Monday, June 10, 2002, at 11:23 AM, aman cgiperl wrote: >> >>> $MSG is a link http://www.foo.com/dpt/index.html >>> >>> Is there an

Re: get external ip from D-Link router

2002-06-10 Thread bob ackerman
On Monday, June 10, 2002, at 10:49 AM, drieux wrote: > > On Monday, June 10, 2002, at 10:35 , bob ackerman wrote: > >> my box is behind a D-Link router 704. >> The router gets its ip from my isp using dhcp. >> anyone know how to get that external ip from the rout

Re: file read and then write problem

2002-06-10 Thread bob ackerman
On Monday, June 10, 2002, at 11:23 AM, aman cgiperl wrote: > $MSG is a link http://www.foo.com/dpt/index.html > > Is there anything else other than EOF, that can cause a while loop to exit > when reading file? there is something that will stop the substitution - a slash in $MSG. you could use

get external ip from D-Link router

2002-06-10 Thread bob ackerman
my box is behind a D-Link router 704. The router gets its ip from my isp using dhcp. anyone know how to get that external ip from the router? is any module designed to find your external ip when you are on a lan? router is admined from a web page, so i guess it is possible to using LWP (or some

Re: Conditional Operator && STDIN

2002-06-03 Thread bob ackerman
On Monday, June 3, 2002, at 10:45 AM, bob ackerman wrote: > > On Monday, June 3, 2002, at 10:37 AM, Jeff 'japhy' Pinyan wrote: > >> On Jun 3, bob ackerman said: >> >>>> @ARGV = "< $filename" if $opt_f; >>> >>> why &

Re: Conditional Operator && STDIN

2002-06-03 Thread bob ackerman
On Monday, June 3, 2002, at 10:37 AM, Jeff 'japhy' Pinyan wrote: > On Jun 3, bob ackerman said: > >>> @ARGV = "< $filename" if $opt_f; >> >> why '<' ? isn't '$filename' enough for get '<>' to open

Re: Conditional Operator && STDIN

2002-06-03 Thread bob ackerman
On Monday, June 3, 2002, at 09:27 AM, Jeff 'japhy' Pinyan wrote: > On Jun 3, Balint, Jess said: > >> Hello all. I am working on my script, and I would like to be able to use >> STDIN as a filehandle input unless a filename is specified. I have used >> the >> getopt for the filename, let's say

Re: Help with parsing output

2002-05-30 Thread bob ackerman
On Thursday, May 30, 2002, at 02:53 PM, bob ackerman wrote: > > On Thursday, May 30, 2002, at 11:20 AM, David Gray wrote: > >>>>> while () { >>>>> chomp; >>>>> s/^\s+//; >>>>> next if (m/^$/ || (1 .. /

Re: Help with parsing output

2002-05-30 Thread bob ackerman
On Thursday, May 30, 2002, at 11:20 AM, David Gray wrote: while () { chomp; s/^\s+//; next if (m/^$/ || (1 .. /^NPROC/)); >>> >>> what does the range thing do? >>> wouldn't just ... || /^NPROC/ be enough? >> >> ok. opposite sense: || ! /^NPROC/ > > So that wo

Re: Help with parsing output

2002-05-30 Thread bob ackerman
On Thursday, May 30, 2002, at 09:44 AM, bob ackerman wrote: > > On Thursday, May 30, 2002, at 07:31 AM, Sudarsan Raghavan wrote: > >> "Kipp, James" wrote: >> >>> I am reading output from a pipe to a command called 'prstat' (like top) >>

Re: Help with parsing output

2002-05-30 Thread bob ackerman
On Thursday, May 30, 2002, at 07:31 AM, Sudarsan Raghavan wrote: > "Kipp, James" wrote: > >> I am reading output from a pipe to a command called 'prstat' (like top). >> just wanted to get some ideas on the best way to capture the data i am >> looking for. below is an example of the output: > >

Re: How do I use grep to get a list of files given multiple grep criteria?

2002-05-26 Thread bob ackerman
On Sunday, May 26, 2002, at 09:53 PM, Schuessler, Robert BTB TKY wrote: > Hello, > > I want to use grep to get a list of files into @files. Here's what it > looks > like now: > > $sender = "CHAS"; > $asofdate = "20020401"; > > @files = `grep -sl $sender /home/data/*`; > print @files; > > > >

Re: Another Bundle::DBI question

2002-05-25 Thread bob ackerman
On Saturday, May 25, 2002, at 12:00 PM, Phil Dobbin wrote: > On 25/5/02 at 11:46, [EMAIL PROTECTED] (bob ackerman) wrote: > >> >> On Saturday, May 25, 2002, at 11:41 AM, Phil Dobbin wrote: >> >>> I'm trying to install Bundle::DBI and CPAN gives me thi

Re: SQL: Insert column?

2002-05-20 Thread bob ackerman
On Sunday, May 19, 2002, at 10:58 PM, [EMAIL PROTECTED] wrote: > Hello, All: > > I'm using DBI.pm to interact with flat-file database and want to add a new > column to the database. Is there an SQL statement for such a task or do I > need to transfer the contents of the file to another file and

Re: Looping through variables

2002-05-17 Thread bob ackerman
On Friday, May 17, 2002, at 05:35 PM, drieux wrote: > > On Friday, May 17, 2002, at 05:16 , Mark Anderson wrote: > > we all agree that this is a 'bad' idea and that > timothy has the right solution... > now for the troubling bits... > > >>> What's the best way to do this? I've tried >>> >>>

Re: Help please

2002-05-17 Thread bob ackerman
On Friday, May 17, 2002, at 09:40 AM, Batchelor, Scott wrote: > /([^a-zA-Z])\1/ did you mean to be checking for repeating non-alpha characters? if you are testing with repeating alpha characters, that test won't catch it.

Re: using vec

2002-05-17 Thread bob ackerman
On Friday, May 17, 2002, at 08:40 AM, VINCENT BUFFERNE wrote: > I am using vec($foo1, $foo2, $foo3). It seems that the value of $foo3 is > limited to 2048 (with perl 5.004 or perl 5.6.1). Is it possible to use > wider > values: up to 60,000 ??? are you sure it is limited? i don't have a test

Re: SQL Statement error msg. Please advise

2002-05-16 Thread bob ackerman
On Thursday, May 16, 2002, at 04:12 PM, Daniel J. Rychlik wrote: > Hello, > > Im working on running this $sqlstatement for work purposes. My = > $txtAgentID='skraal'; will be an array of 13 agents. (I was just trying > to get this to run for one agent) The error message Im getting is at > th

Re: Large Insert statements

2002-05-16 Thread bob ackerman
On Thursday, May 16, 2002, at 01:55 PM, Kevin O wrote: > Hello all, > > I need to insert a lot of data into a mysql table. Know that I can do it > like this example: > > > > my $sth = $dbh->prepare(q{ >INSERT INTO sales (product_code, qty, price) VALUES (?, ?, ?) > }) or die $dbh->errstr

Re: TIMTOWTDI

2002-05-13 Thread bob ackerman
On Monday, May 13, 2002, at 10:40 AM, Todd Wade,,,Room 108 wrote: > Bob Ackerman wrote: > >> >> this one wins the prolix award of the solutions we have seen today. >> we dare a non-perl programmer to believe this could mean something. >> I'm not sure i be

Re: TIMTOWTDI

2002-05-12 Thread bob ackerman
On Sunday, May 12, 2002, at 11:08 PM, Todd Wade wrote: > > "JosÈ nyimi" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> The Perl slogan is: "There Is More Than One Way To Do It". >> >> I'm interested to see how you will do the small convertion below. > > T

Re: Validation Error

2002-05-12 Thread bob ackerman
On Sunday, May 12, 2002, at 09:38 PM, Bill Lyles wrote: > Huh? > i think you are calling an html file that gets the input and posts to this cgi script. so drieux is confused when you say the whole script. it is the whole cgi, but there is an html file that does the post. > - Original M

Re: Validation Error

2002-05-12 Thread bob ackerman
On Sunday, May 12, 2002, at 06:13 PM, Bill Lyles wrote: > if ($email !~ /.+\@.+\..+/) { we assume you are assigning something to $email and the email address with the '@' is single quoted so it doesn't try to interpolate. (or you are escaping the '@' in a double quoted string.) otherwise the

Re: If you can't fix the mailer - fix the link

2002-05-11 Thread bob ackerman
On Saturday, May 11, 2002, at 05:35 PM, drieux wrote: > > On Saturday, May 11, 2002, at 01:12 , drieux wrote: > >> >> thought I would formalize the play a bit, and see >> what folks think about: >> >> http://www.wetware.com/drieux/CS/lang/Perl/Beginners/RegEx/HowPatternsEvolve. >> txt > > > htt

Re: Another RegEx Exercise

2002-05-11 Thread bob ackerman
On Saturday, May 11, 2002, at 01:12 PM, drieux wrote: > http://www.wetware.com/drieux/CS/lang/Perl/Beginners/RegEx/HowPatternsEvolve. > txt Lo! another wapped url which readers will chop off and get wrong. urk. how Do we avoid that? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additiona

Re: Really Dumb Perl Question

2002-05-10 Thread bob ackerman
On Friday, May 10, 2002, at 08:09 AM, Nikola Janceski wrote: > tie %ANSWER "/dev/brain"; > print %ANSWER{$question}, "\n"; > ^D > Most of it. shouldn't that be: print $ANSWER{$question},"\n"; >> -Original Message- >> From: drieux [mailto:[EMAIL PROTECTED]] >> Sent: Friday, May 10, 20

Re: Ok- real dumb question

2002-05-07 Thread bob ackerman
On Tuesday, May 7, 2002, at 11:07 AM, drieux wrote: > > shouldn't that be: > ciao > drieux > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: FILE to subroutine

2002-05-07 Thread bob ackerman
On Tuesday, May 7, 2002, at 09:03 AM, Timothy Johnson wrote: > Oops! Looks like I forgot the 'm'. That should be > http://www.rocketaware.com/perl/perlfaq5/How_can_I_make_a_filehandle_loc > a.htm you didn't forget it the first time. the letter 'm' had wrapped to the next line and wasn't se

Re: DBI - selectall_arrayref Help!

2002-05-04 Thread bob ackerman
On Friday, May 3, 2002, at 12:39 PM, Jason Frisvold wrote: > Let's see if I can explain what I'm trying to do before I toss code > out... I have a database with several columns of data. I want to fetch > all the pertinent info into a single array of arrays and then work on > each row of the d

Re: what kind of data type?

2002-05-02 Thread bob ackerman
On Thursday, May 2, 2002, at 02:45 AM, Paul Weissman wrote: > > what i'm trying to do is open a binary file and read from it... > > ---\ > > open ( FD, $filename ); > binmode ( FD ); > > #read two bytes > while (read(FD, $buf, 2)) { > # hopefully print the hex value of two bytes > print hex($

Re: split array

2002-05-01 Thread bob ackerman
On Wednesday, May 1, 2002, at 03:43 PM, Ron wrote: > Hello Greg > > This is a simple method that may work. > > while ( my @data= $cursor->fetchrow_array ) { > $idnum = $row[0]; > $username = $row[1]; > $email = $row[2]; > $code= $row[3]; > > print "$idnum $username $email $code "; > }

Re: split array

2002-05-01 Thread bob ackerman
On Wednesday, May 1, 2002, at 02:55 PM, drieux wrote: > > On Wednesday, May 1, 2002, at 02:47 , Greg D. wrote: > >> Hi, >> >> Is there any way i can split an array that contains information that i >> got >> from the mysql database? >> >> here's the code: >> >> while(my @data = $sth->fetchrow_a

Re: searching arrays with foreign element

2002-04-30 Thread bob ackerman
On Tuesday, April 30, 2002, at 04:07 PM, Johnson, Shaunn wrote: > Howdy: > > I'm looking for examples of how to use element 0 > in one array as a search pattern and looking in > other arrays for that pattern. Here's what I have > so far ... > > [snip code] > #!/usr/bin/perl -w > use diagnostic

Re: CGI, submit buttons, using them as variables.

2002-04-30 Thread bob ackerman
On Tuesday, April 30, 2002, at 04:17 PM, Tor Hildrum wrote: > First of all, I would just like to apologize for not sending this to the > CGI-list, but I prefer this list. As this is where I've gotten the best > help > in the past. Blame yourself :) > > I was reading CGI.pm when I discovered th

Re: array numerical name...

2002-04-30 Thread bob ackerman
On Tuesday, April 30, 2002, at 03:51 AM, [EMAIL PROTECTED] wrote: > > Thats it Thanks Harry understand now.. for completion's sake: you were asking how to create a variable name programmatically and use it. $h='0'; $TRY = 'world'; $tryvar = $try.$h; # we have created a new variabl

Re: authentication and user management

2002-04-29 Thread bob ackerman
# handle error } this we avoid trying to get the value of an undefined item. you can do what you want on error - ignore it,print out an error message, redirect, etc. > -Original Message- > From: bob ackerman [mailto:[EMAIL PROTECTED]] > Sent: Sunday, April 28, 2002

Re: authentication and user management

2002-04-28 Thread bob ackerman
existence. say $ref = $cookie{'usertype'}; $val=0; if ($ref)# or if (defined($ref)) ? { $val = $ref->value; } else { print "cookie 'usertype' doesn't exist"; } > -Original Message- > From: bob ackerman [mailto:[EMAIL

Re: 3 field hash, value lookup by key is 2nd field

2002-04-28 Thread bob ackerman
On Friday, April 26, 2002, at 11:27 PM, r wrote: > Goal- look up value in a hash of 3 fields where middle is key field for > lookup. The build hash from text file part below is working fine. > Then I read in a transaction file with field $sicode which should > lookup/chain/match to the key ($si

Re: wipe out elements in an array

2002-04-25 Thread bob ackerman
On Thursday, April 25, 2002, at 05:24 PM, Jeff 'japhy' Pinyan wrote: > On Apr 25, Bryan R Harris said: > >> I'd like to remove all elements in an array that meet a certain criteria >> without changing their order. I'm sure this gets done all the time, but >> I'm not sure how to do it... > > You

Re: authentication and user management

2002-04-25 Thread bob ackerman
at start of each of my cgi files. > -Original Message- > From: bob ackerman [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 25, 2002 7:26 PM > To: [EMAIL PROTECTED] > Subject: Re: authentication and user management > > > > On Thursday, April 25, 2002,

Re: authentication and user management

2002-04-25 Thread bob ackerman
no absolute guarantee. > -Original Message----- > From: bob ackerman [mailto:[EMAIL PROTECTED]] > Sent: Thursday, April 25, 2002 7:26 PM > To: [EMAIL PROTECTED] > Subject: Re: authentication and user management > > > > On Thursday, April 25, 2002, at 10:58 AM, Mat Har

Re: authentication and user management

2002-04-25 Thread bob ackerman
On Thursday, April 25, 2002, at 10:58 AM, Mat Harrison wrote: > i am building a perl/cookie members system for my site using SSI to check > if > a cookie is present (set at login), if not, to redirect to an error page. > This is my plan: > > > 1. login page. check that the username and passwor

Re: evaluating multiple conditions

2002-04-23 Thread bob ackerman
On Tuesday, April 23, 2002, at 03:05 PM, Jonathan E. Paton wrote: >>> Is there a better way to simplify the syntax when testing for multiple >>> conditions? >> >> Your original code is the proper way to do it. All the other solutions >> proffered are inferior, IMO. > > Use 'or' and 'and' to rem

Re: sort regex trouble!

2002-04-23 Thread bob ackerman
On Monday, April 22, 2002, at 06:01 AM, [EMAIL PROTECTED] wrote: > hi > > im trying to sort out this sort routine: > > the sub by_number_of_citations works > > but if i try to make a sort alphabetically, my regex fails? > > how should it be done? > > > martin > > > > # sting to match: 1212Cited

what is this syntax mean?

2002-04-20 Thread bob ackerman
could someone explain how this syntax works? does the call to member function 'proxy' return the object which is then used to call function 'uri' which returns the object which is used to call function 'hi' which returns the object which is used to call method 'result'? use SOAP::Lite; print SO

Re: variable interpolation

2002-04-19 Thread bob ackerman
On Friday, April 19, 2002, at 07:18 AM, bernabe diaz wrote: > Hi everyone, > could somebody help me with the following problem: > i have a code something like that > my $variable = CGI->param('NAME'); > #making connection to database > . > my $variable_ =$dbh->q

Re: Rounding numbers

2002-04-17 Thread bob ackerman
for integers: (add one) divide by 2. $rndup = ($var+1)/2; On Wednesday, April 17, 2002, at 10:01 AM, Glenn Cannon wrote: > I am dividing a number by 2. How do I force a round up of the result? > > Glenn. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PR

Re: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread bob ackerman
read now on this list about bidirectional sockets. > -----Original Message- > From: bob ackerman [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 16, 2002 3:02 PM > To: [EMAIL PROTECTED] >

Re: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread bob ackerman
nf file. usually find it in /etc directory. > -Original Message- > From: bob ackerman [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, April 16, 2002 1:13 PM > To: [EMAIL PROTECTED] > Subject:Re: Errors Runn

Re: Writing formatted results to a file

2002-04-16 Thread bob ackerman
On Tuesday, April 16, 2002, at 10:11 AM, Ho, Tony wrote: > Hi guys > I was wondering if you could help me. > Does anybody know how to write formatted results to a file ? > > I am getting the following error : > > write() on closed filehandle main::ADDRESSLABEL at ./test.pl line 2785, > line 5.

Re: Writing formatted results to a file

2002-04-16 Thread bob ackerman
On Tuesday, April 16, 2002, at 10:11 AM, Ho, Tony wrote: > Hi guys > I was wondering if you could help me. > Does anybody know how to write formatted results to a file ? > > I am getting the following error : > > write() on closed filehandle main::ADDRESSLABEL at ./test.pl line 2785, > line 5.

Re: Errors Running Learning Perl in Win32 Scripts

2002-04-16 Thread bob ackerman
On Tuesday, April 16, 2002, at 09:05 AM, Anthony Beaman wrote: > Thanks! I think your advice may apply to the following code that I'm > having trouble with: > > use Win32::NetAdmin; > $username = Win32::LoginName; > Win32::NetAdmin::UserGetAttributes("", $username, $password, > $passwordage, $

Re: Checking and email address

2002-04-15 Thread bob ackerman
On Monday, April 15, 2002, at 08:58 PM, Daniel Falkenberg wrote: > Hello All, > > How would I go about checking to see if a variable contains an @ symbol? > > $email = "[EMAIL PROTECTED]"; > > if ($email ne "@" || $email eq "") { > print "Please make sure your type your email address in correc

Re: Checking and email address

2002-04-15 Thread bob ackerman
On Monday, April 15, 2002, at 08:58 PM, Daniel Falkenberg wrote: > Hello All, > > How would I go about checking to see if a variable contains an @ symbol? > > $email = "[EMAIL PROTECTED]"; > > if ($email ne "@" || $email eq "") { > print "Please make sure your type your email address in correc

Re: Validating form data

2002-04-15 Thread bob ackerman
On Monday, April 15, 2002, at 07:46 PM, Daniel Falkenberg wrote: > Hey All, > > I am just about to go ahead and start validating form data. I was > thinking about tackling it in the following way... > > $data1 = param("data1"); > $data2 = param("data2"); > $data3 = param("data3"); > $data4 = p

Re: Bidirectional Sockets

2002-04-15 Thread bob ackerman
On Monday, April 15, 2002, at 02:31 PM, James Taylor wrote: > I'm sure this is frequently asked, and I am truly sorry if it is, but > reading through my mail I don't see this question anywhere: > > Curious as to how I would go about creating bidirectional sockets, ie. > client sends informati

Re: pattern match

2002-04-15 Thread bob ackerman
ll tell me you don't want to read the whole file in at once :) that's when you have to do like what i offered the first time. >> Thanks, >> Ramesh >> >> -Original Message- >> From: bob ackerman [mailto:[EMAIL PROTECTED]] >> Sent: Friday, April

Re: help with crypt anf pack

2002-04-12 Thread bob ackerman
On Friday, April 12, 2002, at 07:55 PM, Gabriel Duchateau wrote: > I am trying to setup a small application with a passwd controlled access. > I > need just a little bit of security so I decided to use the crypt function > on > perl to encrypt the user passwd. The problem I have is when writi

Re: pattern match

2002-04-12 Thread bob ackerman
On Friday, April 12, 2002, at 12:58 PM, David Gray wrote: >> for e.g : >> >> (not showing the new lines..) >> >> >> word1.word1.word1word2word1...word2wor >> d2word2 >> . > > You're gonna want to check out (in the perldoc perlre manpage) (??{ code > }), which

Re: Find and replace a word or characater in a the same file.

2002-04-12 Thread bob ackerman
On Friday, April 12, 2002, at 09:09 AM, Guan Boon Lee wrote: > I would like to find a word or character in a file and > replace it with another word or character, while > leaving others untouched. Currently, I am using the > following method > > #!/bin/perl -Dr -w > open(FILE,"$ARGV[0]") || di

Re: Need help grabbing program output.

2002-04-12 Thread bob ackerman
On Friday, April 12, 2002, at 08:05 AM, Timothy A. DeWees wrote: > Hello, > > I am trying to convert a shell script to perl because I need to do > some > binary math, and I want to add more flexibility in general.I'm a bit > new > to perl, but here is my question (don't laugh). > > I

Re: max/min

2002-04-11 Thread bob ackerman
es) {$max=$_ if($_>$max)} > >> -----Original Message- >> From: bob ackerman [mailto:[EMAIL PROTECTED]] >> Sent: Thursday, April 11, 2002 5:52 PM >> To: [EMAIL PROTECTED] >> Subject: Re: max/min >> >&

Re: max/min

2002-04-11 Thread bob ackerman
On Thursday, April 11, 2002, at 01:42 PM, Jeff 'japhy' Pinyan wrote: > On Apr 11, Bryan R Harris said: > >> $someVar = max(@listofvalues); >> >> Is there a function in perl like this? > > You could use the List::Util module (from CPAN). Or, you could write your > own: > > sub max { > my

Re: while and do

2002-04-11 Thread bob ackerman
On Thursday, April 11, 2002, at 01:17 PM, Timothy Johnson wrote: > > Just for those who haven't figured out why the first example is so useful, > consider what perl is doing in the following two snippets: > > 1 > == > open(INFILE,"myfile.txt"); > @file = ; > foreach(@file){ >do somethin

Re: RegEx matching multiple items.

2002-04-11 Thread bob ackerman
On Thursday, April 11, 2002, at 11:46 AM, Amerson, Kevin wrote: > Hello, > > How would you put the matches into a comma separated list? > if you want to print it out: print "@data"; if you want to create a single string: $data = join ',',@data; or did you have something else in mind? > > --

Re: Problem with replacing text in a variable...

2002-04-11 Thread bob ackerman
On Thursday, April 11, 2002, at 10:57 AM, wim wrote: > my $var = "test"; > my $rvar = "\$interface"; > try: my $rvar = '\$interface'; so it doesn't look like a variable to be interpolated when you get to the substitution. > my $cmd = "int \$interface\n"; > > print "$var\n"; > print "$cmd\

Re: HELP needed with printing to a text file

2002-04-10 Thread bob ackerman
On Wednesday, April 10, 2002, at 01:34 PM, @fro @ndy wrote: > Hi, > Once again i have another problem regarding my message board lol. This > time the message board is fine but i have made an admin so that it will > read the contents of a text file where all the entries are printed to and > d

Re: Opening another script and changing variables

2002-04-09 Thread bob ackerman
On Tuesday, April 9, 2002, at 12:29 PM, bob ackerman wrote: > > On Tuesday, April 9, 2002, at 11:06 AM, Helen Dynah wrote: > >> >> HI, >> >> I have a perl script and I am trying to write another perl script which >> will open my first perl script, c

Re: Opening another script and changing variables

2002-04-09 Thread bob ackerman
On Tuesday, April 9, 2002, at 11:06 AM, Helen Dynah wrote: > > HI, > > I have a perl script and I am trying to write another perl script which > will open my first perl script, change the values of some variables, and > run the script with these new variables. Does anyone know if this is >

Re: Date Handling

2002-04-09 Thread bob ackerman
On Tuesday, April 9, 2002, at 10:19 AM, Schroeter, Richard wrote: > Greetings, > I am having a problem with Perl providing me the correct date when I > subtract 86400 from the date. This is only happening when I set the > computer's system's date to today's date. If I set the system's date to

Re: Search & Replace Issue

2002-04-09 Thread bob ackerman
On Tuesday, April 9, 2002, at 09:39 AM, Kristin A. I. wrote: > I am trying to indent a scroll-thru menu which has been made into a tree > using the following database query: > select dept_id, LPAD(' ',2*(Level-1))||dept_name dept_name > from depts > start with dept_id = 1 > connect by

Re: extra space

2002-04-08 Thread bob ackerman
On Monday, April 8, 2002, at 05:10 PM, Bryan R Harris wrote: > open (FILE, $file) || die("Couldn't open $file: $!\n"); > @_ = ; > close(FILE); > while ($_[1] =~ /^[#\n]/) { push(@comments, shift(@_)); } > print "@comments"; seems unnecessary to create an array then print each element. just p

  1   2   >