Re: DBI

2001-06-18 Thread Tim Keefer
open a command prompt and type ppm install DBD-ODBC and ppm install DBI At 09:43 AM 6/18/2001 -0500, Kris Cook wrote: I'd like to try using the DBI interface for database access, but when I downloaded it from ActiveState, I fount that I had to have a make utility to get it installed. Does

Re: Example of OOP cgi ?

2001-06-18 Thread Brett W. McCoy
On Mon, 18 Jun 2001, Vinicius Jose Latorre wrote: An interesting twist on the display is to use templates, e.g. the Template Toolkit or HTML::Template. Then not only is the display separated from the logic, but the views can then be maintained by a non-programmer. Another excellent

RE: DBI

2001-06-18 Thread Kris Cook
I've tried to follow your suggestion, and I get the following error message: C:\perl\libppm install DBD Installing package 'DBD'... Error installing package 'DBD': Could not locate a PPD file for package DBD -Original Message- From: Tim Keefer [mailto:[EMAIL PROTECTED]] Sent: Monday,

RE: DBI

2001-06-18 Thread Brett W. McCoy
On Mon, 18 Jun 2001, Kris Cook wrote: Actually, I've used make for all sorts of stuff without a C compiler. It's amazing what you can automate. Actually, I've even used it as the backbone for a QnD (Quick'n'Dirty) system security monitoring package before. I've also used it for automated

database

2001-06-18 Thread Kris Cook
I'm curious. Why, when the ODBC functionality is distributed with ActiveState's Perl, do all examples I see in this group use DBI? The application I'm working on uses an Access database, and I can't find Access drivers for DBD, so DBI is useless to me, along with every example using it. I'd

RE: MS Access DB

2001-06-18 Thread Kris G Findlay
ok thats what i though !! would it be possible to convert the ms access db to somthing else ? thing is i have a friend .. who is using access db. he wants the info stored in it to be acess on-line to form part of customer services eg product details and rpair ststus .. etc ... as i said all the

Re: MIME::Lite

2001-06-18 Thread Timothy Kimball
Teresa Raymond write: : OK, I'm not going to write my own script for attaching an email. I'm : going to try to modify the script from Randal's Web Techniques. I : need to point to the location of MIME::Lite. I'm having difficulty : with syntax with CGI.pm and strict. all of the below

Re: testing for max size of file

2001-06-18 Thread Timothy Kimball
Curtis Poe wrote: : That will only give the approximate filesize. $ENV{CONTENT_LENGTH} is the total :size of the : entity body. With 'multipart/form-data' (the enctype used with file uploading), the :entity bodies : size is even larger than normal. The more data sent (besides the file), the

Your Guidence Please

2001-06-18 Thread Ginntonnik
I am Interested In creating a Mirc Bot that Pulls Information From a Database Via Triggers, If someone has seen this Done, Or Knows of some Open examples, Could you please forward some examples to me. Thank you

RE: database

2001-06-18 Thread Kris Cook
Well, interestingly, DBD-ODBC works fine here at the office, and on my Win2K platform at home. However, it doesn't like (or isn't liked by) my Windows ME machine at home, resulting in an illegal instruction in PWS (Pretty Weak Software) every time. Of course, I hate Windows ME anyway, so to

RE: Your Guidence Please

2001-06-18 Thread Kris G Findlay
hey Ginn !! fancy seeing you here !! check out this perl ircbot at http://www.infobot.org/ [---] Kris G Findlay [EMAIL PROTECTED] [---] ( Ghost-Hunter ) -Original Message- From: Ginntonnik [mailto:[EMAIL PROTECTED]] Sent: 18

RE: DBI

2001-06-18 Thread Steve Howard
you should not need a c compiler for make. On windows, however, it is either nmake or dmake (I've heard of dmake, but never used it. it has always been nmake for me) You should use PPM, but if you need a module that needs a make on windows you can just substitute nmake for the word make in the

RE: How to generate a table ?

2001-06-18 Thread Moon, John
Glenn Curtis; Thanks for the suggestions ... but more thanks to both you and Curtis for helping me to start thinking out of my box... and this is why I'm replying ... I have used both of your suggestions - the hash below and cgi html shortcuts ... I just needed to stop and invest a little time

beginner's addressbook tutorial - step 6 - writing utility and SQL classes, and using Class::MethodMaker

2001-06-18 Thread fliptop
step 6 is complete, and is available at: http://www.peacecomputers.com/addressbook_toot-step6.html coming next - step 7 - A summary of what we've done so far note: there was an error in the html::template file provided in step 5, i've corrected it (i left out input elements for the prefix and

Lesson Four of online CGI course

2001-06-18 Thread Curtis Poe
For the curious: I have recently finished Lesson 4, part 1 (http://www.easystreet.com/~ovid/cgi_course/lesson_four/lesson_four_1.html) of my online CGI course (http://www.easystreet.com/~ovid/cgi_course/index.html). There have been a few corrections to the rest of the course and improved site

RE: Beginer...Any free resources for Learning Perl

2001-06-18 Thread ivan . drvaric
Unfortunately, foreign nationals do not have respect for the rights of American created property. I'll stick only to this stupid sentence on of the stupidest I've ever heard. It seems author of this sentence doesn't understand the logic it is working these days. I hope this is the last mail of

RE: binaries of DBI, DBD::mysql, CGI

2001-06-18 Thread Ichim, Adrian
You may try the free version of the Borland C++ compiler. You can download the free Turbo Debugger and lots of help files, too. Check http://www.borland.com/bcppbuilder/freecompiler. However, Activestate has lots of binaries for ActivePerl that can be downloaded and installed via PPM (Perl

RE: Reading versus Referencing Books

2001-06-18 Thread John Edwards
Here's another good book. It's called the Perl Black Book. Written by Steven Holzner. It's written from the perspective of a new coder asking How do I do... and being given the answer by a more experienced coder. It's a really good reference guide. It explains not just what function to use, but

Re: simultaneous processing

2001-06-18 Thread Karthik Krishnamurthy
On Sun, Jun 17, 2001 at 10:32:16PM -0400, Ronald J. Yacketta wrote: Folks, Can someone shed some light on the ability to kick off simultaneous process at once within perl. I would like to kick off two system level commands at the same time, as I mentioned before I am populating 2 arrays

re: Which is the newest edition of Learning Perl

2001-06-18 Thread Peter Pitchford
The third addition is coming out in July This page has links to all the upcoming oreilly books: http://www.oreilly.com/catalog/new.html http://www.oreilly.com/catalog/lperl3/ Learning Perl is the quintessential tutorial for the Perl programming language. The third edition has not only been

arrays

2001-06-18 Thread Yacketta, Ronald
Folks, Is it possible to store an array name inside another array? IE: @array1 = bunch o' file names @array2 = { bah, @array1, blah, blah } actualy that would be a pointer from @array1 - @array2 correct?

Re: Problems with LWP::UserAgent and HTTP::Response

2001-06-18 Thread Tim Keefer
Hi Ela, The documentation for perl LWP agent seems sparse. I had a difficult time figuring out how to send multipart form-data. I'll share the code with you that some shared with me. Hope it helps. require LWP; use LWP::UserAgent; use HTTP::Request::Common; # Create a user agent object

Re: arrays

2001-06-18 Thread Brett W. McCoy
On Mon, 18 Jun 2001, Yacketta, Ronald wrote: Is it possible to store an array name inside another array? IE: @array1 = bunch o' file names @array2 = { bah, @array1, blah, blah } actualy that would be a pointer from @array1 - @array2 correct? You can do that, but you need to use

RE: arrays

2001-06-18 Thread Kipp, James
@array2 = { bah, @array1, blah, blah } unless you make an reference to the array like John said, the @array1 will be flattened so to keep the array do this: $ref_array = \@array1; @array2 = { bah, $ref_array, blah, blah }; then to use it you need to dereference it. -Original Message-

Re: fork .. regex ... etc..

2001-06-18 Thread Paul
--- Ronald J. Yacketta [EMAIL PROTECTED] wrote: Paul, anyword on that skeleton code you mentioned ??? This is actually a process-to-CPU spooler I wrote a while back for load-balancing on our production data processing machine. It's worked reasonably well, and might provide some good skeleton

Re: deep hash

2001-06-18 Thread Peter Scott
At 01:00 AM 6/18/01 -0500, Teresa Raymond wrote: I'm sorry, but I mean could you explain the syntax of the whole line. Always ask the list, not an individual respondent. I may be gone for a month in Antarctica or something. At 10:08 PM 6/17/01 -0500, you wrote: Could you please explain this

RFC on my short recursive code

2001-06-18 Thread Pete Emerson
I've written a short program to recursively delete files/directories that haven't been modified in a certain length of time. It appears to work, but in the interest of improving my code/coding skills, I'd like to get any/all comments and criticisms, particularly about the way I handled getting

Re: RFC on my short recursive code

2001-06-18 Thread Tim Musson
Hey Pete, Not sure why you want to call ls when Perl can do the same thing. I asked the list a similar question (I needed to move old files to a different top directory - retaining the path to each file) a couple weeks ago and got the following. (btw, I run this on Win32, so you will need to

Re: RFC on my short recursive code

2001-06-18 Thread Jeff 'japhy' Pinyan
#!/usr/bin/perl -w use strict; use File::stat; my $startingdir=/tmp; # could use $ARGV[0] here to make it more my $cutoff=5;# could also pass in the cutoff from Purge($startingdir); ## Subroutines # sub Purge { (my $dir)=@_; ### this is more normally

Drive cleanup...

2001-06-18 Thread Tim Musson
Hey all you great Perlers, I am helping out my Win32 Server Admin team. They need to clean up the network drives. Currently ~40Gb of data. We are looking at making 3 passes. 1. Folders - for example the Windows and WinNT folders (people were asked to backup their *data*

combining lines in a tagged text file

2001-06-18 Thread Paul_Binkley
Hello All -- I'm new to this forum, and hope someone can help me with a seemingly simple problem. I am reading in a tagged text file, and isolating my efforts to a particular field within. I need to analyze each line ,determine if I have a certain matching string, and if I do, combine them

AW: Problems with LWP::UserAgent and HTTP::Response

2001-06-18 Thread Ela Jarecka
Thanks, at least I know that I am sending my XML properly.. But I still get the same error message, so if anyone has more suggestions please write.. Ela -Ursprüngliche Nachricht- Von: Tim Keefer [mailto:[EMAIL PROTECTED]] Gesendet: Montag, 18. Juni 2001 15:46 An: Ela Jarecka;

Re: RFC on my short recursive code

2001-06-18 Thread Pete Emerson
Jeff 'japhy' Pinyan wrote: ### ick -- use opendir() and readdir(), or glob() Okay, sounds good. I'm not quite sure how to use glob. opendir works: opendir(DIR, $dir); my @ls=readdir(DIR); closedir(DIR); except I get the directories . and .. , which doesn't cut it for recursion. Is there

Re: RFC on my short recursive code

2001-06-18 Thread Jeff 'japhy' Pinyan
On Jun 18, Pete Emerson said: Jeff 'japhy' Pinyan wrote: ### ick -- use opendir() and readdir(), or glob() Okay, sounds good. I'm not quite sure how to use glob. opendir works: opendir(DIR, $dir); my @ls=readdir(DIR); closedir(DIR); except I get the directories . and .. , which doesn't

Re: Reformating text

2001-06-18 Thread Chas Owens
On 15 Jun 2001 17:28:49 -0400, Chas Owens wrote: On 15 Jun 2001 16:04:55 -0400, Tim Musson wrote: Hey Perlers, I have pulled some books from Project Gutenberg (www.Gutenberg.net). What I want to do is take all the Paragraphs and put them on one line, then put them into the Palm

Re: fork

2001-06-18 Thread Jos Boumans
Make your life easy, don't fork... on unix systems, it's ok... on NT it's horrible... it's unreliable, blocking, resource hogging insert expletives here anyway, taht's my 2 bits. enough flaming, now for an answer to your question. if you want to fire off multiple processes, i seriously advice

Re: AW: Problems with LWP::UserAgent and HTTP::Response

2001-06-18 Thread Jos Boumans
I'm being a bit lazy and just showing you a bit of code i wrote to fetch all film info from imdb.com and comment on it a bit, to explain what goes on: ### config hash ### my $href = { base = 'http://www.imdb.com/', spage = 'Find', ua = 'Mozilla/4.74 [en] (Win98; U)', form =

Re: RFC on my short recursive code

2001-06-18 Thread Pete Emerson
Jeff 'japhy' Pinyan wrote: You could go over the entries from readdir() one at a time: opendir DIR, $dir or die can't read $dir: $!; while (defined(my $file = readdir DIR)) { next if $file eq '.' or $file eq '..'; my $full = $dir/$file; # ... } closedir DIR; This

Please suggest a better method...

2001-06-18 Thread Drew Cohan
Hello, Can someone please suggest a better method than using while (){ s/[abc]/2/gi; # 3-8 left out for brevity s/[wxy]/9/gi; } to convert a list of words into numbers based on the phone keypad? thanks in advance, -- Drew Cohan [EMAIL PROTECTED]

Re: RFC on my short recursive code

2001-06-18 Thread Jeff 'japhy' Pinyan
On Jun 18, Pete Emerson said: This isn't successfully going through all of the files. Is the recursion perhaps causing problems because DIR keeps getting redefined with each level of recursion, or am I missing something else? Right. The solution is to localize the dirhandle. sub Purge { my

Re: Please suggest a better method...

2001-06-18 Thread Jeff 'japhy' Pinyan
On Jun 18, Drew Cohan said: while (){ s/[abc]/2/gi; # 3-8 left out for brevity s/[wxy]/9/gi; } to convert a list of words into numbers based on the phone keypad? This is why tr/// is useful. while () { $_ = lc; tr{abcdefghijklmnoprstuvwxy}

Re: Please suggest a better method...

2001-06-18 Thread Drew Cohan
Thanks, very helpful! -- Drew. --- Jeff 'japhy' Pinyan [EMAIL PROTECTED] wrote: On Jun 18, Drew Cohan said: while (){ s/[abc]/2/gi; # 3-8 left out for brevity s/[wxy]/9/gi; } to convert a list of words into numbers based on the phone keypad? This is why tr/// is

64-bit numbers

2001-06-18 Thread Skolfield, John
hi. anybody know if/how perl supports quadword numbers? if i try to operate on anything above a 32-bit number i get an overflow message: Integer overflow in hexadecimal number. thanks. john

Re: 64-bit numbers

2001-06-18 Thread David M. Lloyd
On Mon, 18 Jun 2001, Skolfield, John wrote: hi. anybody know if/how perl supports quadword numbers? if i try to operate on anything above a 32-bit number i get an overflow message: Integer overflow in hexadecimal number. You have to recompile your Perl to use 64-bit integers. - D [EMAIL

Re: 64-bit numbers

2001-06-18 Thread Brett W. McCoy
On Mon, 18 Jun 2001, Skolfield, John wrote: anybody know if/how perl supports quadword numbers? if i try to operate on anything above a 32-bit number i get an overflow message: Integer overflow in hexadecimal number. Are you on an operating system that supports 64-bit integers? -- Brett

PERL DB Question

2001-06-18 Thread Prabhu, Vrunda P (UMC-Student)
I have an existing file, called mockalias that contains entries in the following format: username : e-mail address I want to use a hash %ALIAS to read the mockalias file into the hash, and then be able to delete, update, add entries to this hash. When I run the following code, it tells me that

Re: Please suggest a better method...

2001-06-18 Thread Me
tr{abcdefghijklmnoprstuvwxy} {222333444555666777888999}; or, for a smidgen extra legibility: tr{abc def ghi jkl mno prs tuv wxy} {222 333 444 555 666 777 888 999};

Re: PERL DB Question

2001-06-18 Thread victor
Try this instead tie %ALIAS, DB_File, $filename, O_RDWR|O_CREAT, 0644, $DB_HASH; Prabhu, Vrunda P (UMC-Student) wrote: I have an existing file, called mockalias that contains entries in the following format: username : e-mail address I want to use a hash %ALIAS to read the mockalias file

RE: PERL DB Question

2001-06-18 Thread Prabhu, Vrunda P (UMC-Student)
Thanks for your help. I did try the modification you suggested. Now the program does not die (it does not have that option), however when I ask it to list the contents of the file, it does not do anything either. Here is my code again: #!/usr/bin/perl use CGI ':standard'; use DB_File;

Fw: map function has me confused

2001-06-18 Thread Me
fy'all'si: @newarray = map { local $_ = $_; s/foo/bar/; $_ } @oldarray; The use of the local operator ... adds little functionality other then readabillity, seeing how the map function is in { } meaning that $_ is local to the function anyway. Minor point: Note that this

Re: PERL DB Question

2001-06-18 Thread victor
1) unless you have previously populated the db file, it will start off as empty. 2) $ALIAS is the reference to the hash, maybe you were trying to say print %ALIAS? and may I suggest a little loop like this : foreach (keys %hash) { print $_ :: $hash{$_}\n; } which will print the content

RE: PERL DB Question

2001-06-18 Thread Prabhu, Vrunda P (UMC-Student)
1) unless you have previously populated the db file, it will start off as empty. I guess, this is my most basic and pressing question. A file by the name mockalias exists which already has the usernames and e-mail addresses separated by : When I use the tie command, am I not pulling up all the

RE: Perl DB Question

2001-06-18 Thread Stephen Neu
: and may I suggest a little loop like this : : :foreach (keys %hash) :{ : print $_ :: $hash{$_}\n; :} : : which will print the content of the hash in a nice looking fashion. : I have found Data::Dumper to be excellent in printing lol's and references in a pretty fashion. use Data::Dumper;

Re: PERL DB Question

2001-06-18 Thread Michael Fowler
On Mon, Jun 18, 2001 at 01:15:44PM -0500, Prabhu, Vrunda P (UMC-Student) wrote: I have an existing file, called mockalias that contains entries in the following format: username : e-mail address I want to use a hash %ALIAS to read the mockalias file into the hash [snip] #!/usr/bin/perl

Re: class definition

2001-06-18 Thread Brett W. McCoy
On Mon, 18 Jun 2001, Nick Transier wrote: Here is a basic attribute definition from an O'Reilly Book: sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = { color = bay, legs = 4,

Re: Private Data

2001-06-18 Thread Paul
--- Nick Transier [EMAIL PROTECTED] wrote: Does the C++ notion of private data have a similar structure in perl, when defining packages, I find that when I try to define global variables inside the package, but outside of all the subroutines, I get a million errors. If you need private

Re: Which is the newest edition of Learning Perl

2001-06-18 Thread Randal L. Schwartz
Peter == Peter Pitchford [EMAIL PROTECTED] writes: Peter http://www.oreilly.com/catalog/lperl3/ Peter Learning Perl is the quintessential tutorial for the Perl programming Peter language. The third edition has not only been updated to Perl Version Peter 5.6, but has also been rewritten from the

Sysopen v. Open

2001-06-18 Thread Paul Burkett
What is the difference between sysopen and open? = - Paul Burkett __ Do You Yahoo!? Spot the hottest trends in music, movies, and more. http://buzz.yahoo.com/

$hash{$_}++

2001-06-18 Thread David Gilden
I am having trouble understanding just what the following does, and how to you use it: $hash{$_}++ i.e. are we increment the value or the key? I would appreciate any guidance here! Thanks, Dave G.

Sub Calls

2001-06-18 Thread Nick Transier
Assuming I am defining an object which has as its only property a level associated with it, would these be the correct simple subroutines to retrieve and set that property. Also, is this the correct usage of the @_ array such that the level value would be 999 unless I called new(Level =

Re: How to create a log file from a perl script

2001-06-18 Thread Paul
--- David Gilden [EMAIL PROTECTED] wrote: Could you comment briefly on the use of select LOG; from perldoc -f select: select FILEHANDLE Returns the currently selected filehandle. Sets the current default filehandle for output, if FILEHANDLE is supplied. This has two

Re: Selection Mask

2001-06-18 Thread Gary Luther
Sorry, but I re-read my post and it is slightly misleading. The first snippet does work. When I print $mask it has in it what I expect. It's the second one that doesn't seem to work. ---"They that can give up essential

Re: $hash{$_}++

2001-06-18 Thread Paul
--- Brett W. McCoy [EMAIL PROTECTED] wrote: On Mon, 18 Jun 2001, David Gilden wrote: I am having trouble understanding just what the following does, and how to you use it: $hash{$_}++ i.e. are we increment the value or the key? The value. If you wanted to increment the key,

3rd edition of Learning Perl

2001-06-18 Thread Alonzo Hess Jr
The latest edition is the 3rd edition. It's out, I bought it Saturday at a Barns Noble. Alonzo Hess Jr Systems Admin/SQL DBA United American Video 803.548.1056 xt163

Re: use strict

2001-06-18 Thread Brett W. McCoy
On Mon, 18 Jun 2001, Peter Lemus wrote: My unix system keeps saying I have a problem when I say use strict; can you not use strict on unix? Please advice. Yes, you can use strict on Unix (which Unix flavour?). What is the exact error message you are getting? Are you sure the porblem is

Re: use strict

2001-06-18 Thread David H. Adler
On Mon, Jun 18, 2001 at 01:46:34PM -0700, Peter Lemus wrote: HI, My unix system keeps saying I have a problem when I say use strict; can you not use strict on unix? Please advice. What is the problem that it's telling you about? With no further information, I would *guess* that you

Re: $hash{$_}++

2001-06-18 Thread Peter Scott
At 04:25 PM 6/18/01 -0400, Brett W. McCoy wrote: On Mon, 18 Jun 2001, Paul wrote: I am having trouble understanding just what the following does, and how to you use it: $hash{$_}++ i.e. are we increment the value or the key? The value. If you wanted to increment

Re: 3rd edition of Learning Perl

2001-06-18 Thread Peter Scott
At 04:41 PM 6/18/01 -0400, Alonzo Hess Jr wrote: The latest edition is the 3rd edition. It's out, I bought it Saturday at a Barns Noble. Pardon my skepticism, but I think what you have there is PROGRAMMING Perl, not LEARNING Perl. Does the animal on the front have a hump? -- Peter Scott

use strict

2001-06-18 Thread Peter Lemus
HI, My unix system keeps saying I have a problem when I say use strict; can you not use strict on unix? Please advice. = Peter Lemus UNIX/NT Networks Engineer [EMAIL PROTECTED] --The universe too big for us to be alone; the question is who is out-there? --A wise man will be master of his

Re: 3rd edition of Learning Perl

2001-06-18 Thread Brett W. McCoy
On Mon, 18 Jun 2001, Peter Scott wrote: The latest edition is the 3rd edition. It's out, I bought it Saturday at a Barns Noble. Pardon my skepticism, but I think what you have there is PROGRAMMING Perl, not LEARNING Perl. Does the animal on the front have a hump? Llama, according to the

Re: $hash{$_}++

2001-06-18 Thread Brett W. McCoy
On Mon, 18 Jun 2001, Peter Scott wrote: Ya kow, I saw that when I sent it. I think ++$key would be more appropriate. No, that would: 1. Increment $key 2. Access $hash{$key} # new $key Right, that's what I was implying -- two different keys, two different values. You can't change a

RE: Sort hash by values

2001-06-18 Thread David Gilden
Thanks for all who helped with my Perl coding, I thought some folks here might benefit from me posting the final code I used on a current project: ---snip--- if ($sort_order == 1) { # sort by name (front part of the key) foreach my $key (sort {lc($a) cmp lc($b)} keys %index){

Re: class definition

2001-06-18 Thread Bradford Ritchie
Also, if you were to only include @_, would you need a comma after it -- in other words my $self = {@_}; or {@_,}; doesn't matter... the , allows for appending more entries... after the last entry you dont *need* it anymore, but it does no harm I'd even go so far as to say that

Printing Multi-dimensional Hash

2001-06-18 Thread Christine Lenda
hello! Trying to print out the following multi-dimensional hash: %classes=( Math = { Joan = 95, John = 70, Jane = 50 }, Science = { Joan = 80, John = 90, Jane = 80 }, ); I can print out

Re: $hash{$_}++

2001-06-18 Thread David Gilden
How about a an example or 2 where you would use this, $hash{$_}++ Thnx, Dave, Looking for Web Talent, You found it! portfolio: www.coraconnection.com/web/ email: [EMAIL PROTECTED] tel/fax: (860) 231-9988

class stuff

2001-06-18 Thread Nick Transier
Given this function to create a new class object: sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = { Level = 999, #values Value = 999, Key = 999, @Next,

Re: class definition

2001-06-18 Thread Paul Johnson
On Mon, Jun 18, 2001 at 12:25:53PM -0700, Paul wrote: Also, if you were to only include @_, would you need a comma after it Nope, but it's good style, in case you add more stuff later. Might I suggest that in this case it's actually _bad_ style? The reason is that any new defaults should

Re: Private Data

2001-06-18 Thread Chas Owens
On 18 Jun 2001 14:22:06 -0500, Nick Transier wrote: Does the C++ notion of private data have a similar structure in perl, when defining packages, I find that when I try to define global variables inside the package, but outside of all the subroutines, I get a million errors. Thanks,

more class stuff

2001-06-18 Thread Nick Transier
given this new function which acts as a constructor sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = { Level = 999, Value = 999, Key = 999, @Next, @_,

RE: $hash{$_}++

2001-06-18 Thread Peter Cornelius
The value. If you wanted to increment the key, you would say $hash{$key++}. Wait a sec, brain cramp Wouldn't that: 1) just access $hash{$key} 2) increment $key 3) add $hash{$key + 1} I realize this is getting away from the original post, but I'm confused by #3 here.

Re: Printing Multi-dimensional Hash

2001-06-18 Thread Jeff 'japhy' Pinyan
On Jun 18, Christine Lenda said: %classes=( Math = { Joan = 95, John = 70, Jane = 50 }, Science = { Joan = 80, John = 90, Jane = 80 }, ); I can print out individual values, but I'd like to display

Re: $hash{$_}++

2001-06-18 Thread Chas Owens
On 18 Jun 2001 17:34:29 -0400, David Gilden wrote: How about a an example or 2 where you would use this, $hash{$_}++ snip / This is a simple word counting algorhythm. It might be used to determine the optimal subset of English (or whatever language) a foreigner might need to know. code

Re: Private Data

2001-06-18 Thread Paul
--- Nick Transier [EMAIL PROTECTED] wrote: Thanks, do you start the brackets before the package blah call, or after. I.E. is it {package blah; #stuff; } or package blah; {#stuff;} ? It depends on how tightly private you want those variables. I always put the package statement inside the

RE: $hash{$_}++

2001-06-18 Thread Chas Owens
On 18 Jun 2001 14:45:31 -0700, Peter Cornelius wrote: The value. If you wanted to increment the key, you would say $hash{$key++}. Wait a sec, brain cramp Wouldn't that: 1) just access $hash{$key} 2) increment $key 3) add $hash{$key + 1} I realize this is

Re: more class stuff

2001-06-18 Thread Chas Owens
On 18 Jun 2001 16:42:45 -0500, Nick Transier wrote: given this new function which acts as a constructor sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = { Level = 999, Value = 999, Key =

Re: more class stuff

2001-06-18 Thread Nick Transier
@Next will become a class (or package) variable, but it is not set yet because I have another function which does that after the object is created. It is meant to be an array of pointers or references I guess. Is there anything I can do to quell the error messages without wrongly initializing

Re: class stuff

2001-06-18 Thread Chas Owens
On 18 Jun 2001 16:35:45 -0500, Nick Transier wrote: Given this function to create a new class object: sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; my $self = { Level = 999, #values Value = 999,

NEED E-mail Collectors Spiders

2001-06-18 Thread zhf
I want to creat a E-mail Collectors Spiders in database, URL already haved. If someone has seen this Done, Or Knows of some Open examples, Could you please forward some examples to me. Thank you!

RE: $hash{$_}++

2001-06-18 Thread Brett W. McCoy
On Mon, 18 Jun 2001, Peter Cornelius wrote: Wait a sec, brain cramp Wouldn't that: 1) just access $hash{$key} 2) increment $key 3) add $hash{$key + 1} I realize this is getting away from the original post, but I'm confused by #3 here. Wouldn't it just do 1 and 2? Would

A Perl Project

2001-06-18 Thread Paul Burkett
I have been assigned the project of basically creating an online remote control to control the webcams at my work. Brett has helped me out, but I'm wondering if there are any other suggestions out there. Right now I am in the first step of the project which is basically making the project work

Perl question

2001-06-18 Thread Jack Lauman
I wrote the following to read a daily email that is is sent in ASCII and contains currency exchange rates. I want to search the file and look for PRE and process all of the lines that follow it until it encounters a second PRE. The code as it stands works, put it also processes all the garbage

Autovivification/$key++ (was RE: $hash{$_}++)

2001-06-18 Thread Peter Cornelius
I'm sorry to drag this thread on for something that's completely academic, but I can't help myself. I think it's been established that if you find yourself doing this $key++ thing you are probably using the wrong data structure (i.e. a hash when you want an array), but let me just throw up some

Re: Perl question

2001-06-18 Thread perl
You could do this: $started=0; while(file) { $started = 0 if($_ =~ PRE $started); $started = 1 if($_ =~ PRE !$started); print $_ if($started); ## Will print in between the PRE's } Ryan On Mon, 18 Jun 2001, Jack Lauman wrote: I wrote the following to read a

Two questions in one.

2001-06-18 Thread Ward, Stefan
I have two question related to the question below: 1. Is fetchrow() the fastest way in and out of the DB? I don't want the data warehouse tied up while someone is loading a huge report. 2. I would like to create frames with CGI so the list stays on the left side and the data is

Re: Autovivification/$key++ (was RE: $hash{$_}++)

2001-06-18 Thread Peter Scott
At 04:36 PM 6/18/01 -0700, Peter Cornelius wrote: use Data::Dumper; %hash = ( 1 = I exist..., 2 = This is academic, 3 = I should be using an array ); print Dumper \%hash; for $key (keys %hash) { $hash{$key++}=Redefined; print $key =

Re: $hash{$_}++

2001-06-18 Thread Randal L. Schwartz
Brett == Brett W McCoy [EMAIL PROTECTED] writes: Brett On Mon, 18 Jun 2001, David Gilden wrote: I am having trouble understanding just what the following does, and how to you use it: $hash{$_}++ i.e. are we increment the value or the key? Brett The value. If you wanted to increment

Anyone know how to pass in parameters to .pl files?

2001-06-18 Thread eric wang
Hi everyone, does anyone know how to pass in parameters from command line to a perl script? Is it the same as C++ where i specify an ARGV[ ] and ARGC value or I use the @ARGV? Thanks eric

Re: Anyone know how to pass in parameters to .pl files?

2001-06-18 Thread Me
does anyone know how to pass in parameters from command line to a perl script? Is it the same as C++ where i specify an ARGV[ ] and ARGC value or I use the @ARGV? Sorta. perldoc perlvar look for the ARGV entry

Binary Coded Decimail BCD on Perl

2001-06-18 Thread Harry Yau
Hi Folk: I am working on a project to calculate the average cost of products which is made of a lot of small parts. In order to find out the cost of a product, I have to find out the cost of all its parts. However, I am facing some problem with the the decimal pleace. The range of the parts

Perl Security

2001-06-18 Thread jonathan
Hi, I am insterested in creating a reusable module that allows my scripts to have pretty good security. I just don't know how i would go about encrypting passwords. Please help Thanks

  1   2   >