My bad.....

2001-06-18 Thread Alonzo Hess Jr
I stand corrected. I did buy "Programming Perl" not "Learning Perl" Sorry! Alonzo

RE: MS-DOS

2001-06-18 Thread BANKSTON,EUWELL (Non-HP-USA,ex1)
I feel your problem is with associations. If you install Active Perl, they make all the registration entries for you. The other choice is to say perl provided perl is in your path. I chose the former, but run in multi-unix/Windows environments -Original Message- From: [EMAIL PROTECTED

Re: $hash{$_}++

2001-06-18 Thread Dave Cross
On Mon, Jun 18, 2001 at 05:34:29PM -0400, David Gilden ([EMAIL PROTECTED]) wrote: > How about a an example or 2 where you would use this, > > $hash{$_}++ # count the occurences of values in an array my %hash; $hash{$_}++ foreach @array; # and display the results sorted print map { "$_: $hash{

ICQ Trouble

2001-06-18 Thread a
Hi everyone, i'm having this problem and i would like help please: When i send an e-mail message using MIME::Lite to an ICQ number lets say mine [EMAIL PROTECTED] i fill the sender with something the from with someone the subject with something the type with Type=>"text",and Data=>"some text i

Re: Quick Perl Question

2001-06-18 Thread Me
I forgot to explain. > > 1. I want to read in a text file and match any line that begins with > > three capital letters followed by a space. i.e. "USD " > > while (<>) { <> will read from the file(s) you specify on the command line when you run your perl script, ie perl myscript.pl

Re: Quick Perl Question

2001-06-18 Thread Me
> 1. I want to read in a text file and match any line that begins with > three capital letters followed by a space. i.e. "USD " while (<>) { /^[A-Z]{3} / and dostuff; # $_ contains line } > > 2. I need to ignore any blank lines, lines containing all "---", lines > containing a

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

2001-06-18 Thread Peter Scott
At 06:09 PM 6/18/01 -0700, Peter Cornelius wrote: > > 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" > > > ); > > > > > >pr

Quick Perl Question

2001-06-18 Thread Jack Lauman
1. I want to read in a text file and match any line that begins with three capital letters followed by a space. i.e. "USD " How do you do that? 2. I need to ignore any blank lines, lines containing all "---", lines containing all "===". Again, how? Thanks in advance, Jack

Re: Binary Coded Decimail BCD on Perl

2001-06-18 Thread Me
> Please, find me some method. http://groups.google.com/groups?ic=1&th=b1d971a887f189ca,8 I don't know of any more up to date news.

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 Some more bits about ARGV... 1. Shift will work on @A

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

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 va

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

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: Autovivification/$key++ (was RE: $hash{$_}++)

2001-06-18 Thread Peter Cornelius
> 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{$k

Re: NEED E-mail Collectors Spiders

2001-06-18 Thread Randal L. Schwartz
> "zhf" == zhf <[EMAIL PROTECTED]> writes: zhf> I want to creat a E-mail Collectors Spiders in database, URL zhf> already haved. If someone has seen this Done, Or Knows of some zhf> Open examples, Could you please forward some examples to zhf> me. Thank you! I want to have you never be able

Re: $hash{$_}++

2001-06-18 Thread Me
$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. Wouldn't it just do 1 and 2? Would

Re: 3rd edition of Learning Perl

2001-06-18 Thread Randal L. Schwartz
> "Brett" == Brett W McCoy <[EMAIL PROTECTED]> writes: Brett> 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 LEAR

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

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"; >

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 displaye

Re: Perl question

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

converting MS access DB to mysql

2001-06-18 Thread Kris G Findlay
i have an Ms Access DB and need to use it on a linux web server !! does anyone know how i can go about converting it to Mysql or suchlike ?? as it is quite large. !! thanx [--] Kris G Findlay [EMAIL PROTECTED] [--]

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 t

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 and process all of the lines that follow it until it encounters a second . The code as it stands works, put it also processes all the garbage above a

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 t

Re: more class stuff

2001-06-18 Thread Chas Owens
On 18 Jun 2001 17:00:28 -0500, Nick Transier wrote: > @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 d

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

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: 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 Valu

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: $hash{$_}++

2001-06-18 Thread Me
> In simple cases, step 3 will happen momentarily, > but if you haven't used it, then it will go away, and > the new key won't be defined. > > But if it's part of a larger expression that also > dereferences out of the new element, then the > new element will remain defined, even if that's > not

Re: $hash{$_}++

2001-06-18 Thread Me
> > > 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

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, >

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

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 t

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{$_}++ > 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. #!/usr

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 v

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

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: 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, >

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 sh

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: $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

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 }, );

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

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){ &print_ta

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 ch

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

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 Pa

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 valu

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 yo

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 i

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

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: $hash{$_}++

2001-06-18 Thread Brett W. McCoy
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 the key, you would say > > "$hash{$k

Re: Sysopen v. Open

2001-06-18 Thread Michael Fowler
On Mon, Jun 18, 2001 at 12:52:40PM -0700, Paul Burkett wrote: > What is the difference between sysopen and open? The arguments, plain and simple. The handle created by sysopen is the same as that created by an equivalent open call, the only difference is in what arguments the functions take, and

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

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: 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

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 => somet

$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.

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/

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 rewrit

Re: Private Data

2001-06-18 Thread Me
> 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, Use my to declare variables local to a package. pack

Re: Private Data

2001-06-18 Thread Brett W. McCoy
On Mon, 18 Jun 2001, 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, How are you de

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 privat

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: 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/per

Re: class definition

2001-06-18 Thread Paul
--- Nick Transier <[EMAIL PROTECTED]> 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: class definition

2001-06-18 Thread Jos I. Boumans
Hi, > 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, >@_ , > }; > return bless $self,$cla

Private Data

2001-06-18 Thread Nick Transier
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, -Nick

class definition

2001-06-18 Thread Nick Transier
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, @_ , }; return bless $self

Re: PERL DB Question

2001-06-18 Thread victor
> 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 pulli

Selection Mask

2001-06-18 Thread Gary Luther
This is probably another one of my trivial questions, so thanks in advance for not flaming me:-)   I have a statement that I am using to mask from the user some file names that I am displaying (print) to him for a y or n decision. There are many files and so I am trying to give hi

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 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 e

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

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:

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; $filen

Re: Please suggest a better method...

2001-06-18 Thread Paul
--- Me <[EMAIL PROTECTED]> wrote: > > 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}; > > Wrap that with -p, and you can make the whole pr

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 mock

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};

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 t

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? -- Bre

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

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: 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? >

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} {2223334445

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 {

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 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"; > # ... > } > > closed

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 => 'select=Al

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 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 you to look into POE (p

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

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 .. , w

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 the

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; Beg

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 an

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 *

  1   2   >