Re: How to manage around 1000 entries which will constantly be changing

2006-04-01 Thread Frank Bax
At 06:59 PM 3/31/06, Mr. Shawn H. Corey wrote: On Fri, 2006-31-03 at 15:45 -0800, Tom Phoenix wrote: > You should loop over the input, pushing each item on to an array. If > at any time you have 2000 items in the array, sort them and discard > any you don't want to keep. > > $#data = 999 if

Re: Whimsical Question

2006-03-29 Thread Frank Bax
At 08:03 AM 3/29/06, Ryan Frantz wrote: _Is_ there a name for '$_' ? http://www.rexswain.com/perl5.html $_ The default input and pattern-searching space. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: SMS or text messaging

2006-03-25 Thread Frank Bax
At 07:11 AM 3/25/06, Tom Allison wrote: I'm pretty familiar with some (or enough) of the perl mail modules to send email whereever and however I need to. I'm trying to understand how this relates to text messages on cell phones. I've used email for sending text messages to pagers ([EMAIL PROT

Re: Character class for ?&*%$@ etc...

2006-03-16 Thread Frank Bax
At 11:19 AM 3/16/06, Colin Robinson wrote: Can anyone tell me if I can short hand ?&*%$@ etc. as matches for my regular expression. I don't want spaces, new line, carriage returns, tabs etc. to be matched. google "perl regexp". All top five results have the answer. -- To unsubscribe, e-mail:

Re: DBI problem

2005-12-14 Thread Frank Bax
At 11:07 PM 12/13/05, john wrote: I can't see it in emacs. Then my guess was off-base. What do you mean by "dump the last line of the file in binary"? Sounds like something I need to learn about. tail -2 filename | cat -v -v Displays non-printing characters so they are visible. --

Re: DBI problem

2005-12-13 Thread Frank Bax
At 02:30 AM 12/13/05, john wrote: I'm attempting to loop thru an input file, executing a SELECT query with the value from each line. The script works for the first iteration, and then gives these error messages: DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at ./describe_s

chop/chomp/?

2005-12-08 Thread Frank Bax
What's the correct way to trim trailing newlines from a text file that might be either DOS or UNIX format for newlines? The docs (and my experience) is that chomp only works properly if the text file is native to the current operating system? I'm running on *bsd system. -- To unsubscribe, e-

Re: which is more effective between map and foreach?

2005-12-06 Thread Frank Bax
At 06:06 AM 12/6/05, Jennifer Garner wrote: I have a small script,when it run,it generate much more lines and put them into a file. The code for printing I writed: map { print RESULT $_,":",$ips{$_},"\n" } sort { $ips{$b} <=> $ips{$a} } keys %ips; Certainly, I can write that code with

processing at preset times

2005-11-08 Thread Frank Bax
I have script that takes a very long time to run - hours, sometimes even days (even on a P2-2.8Ghz machine. After loading some data from a database at the beginning (less than a second), the script does no i/o until results are output at the end of script. I'd like to know how the script is p

Re: hash of hash - copy

2005-11-04 Thread Frank Bax
At 03:17 PM 11/4/05, Jeff 'japhy' Pinyan wrote: On Nov 4, Frank Bax said: $aSuit{0}{'a'} = 'A'; $aSuit{0}{'b'} = 'B'; $aSuit{0}{'c'} = 'C'; $aSuit{1}{'a'} = 'D'; $aSuit{1}{'b'} = 'E';

hash of hash - copy

2005-11-04 Thread Frank Bax
#!/usr/bin/perl -w use strict; my %aSuit = (); $aSuit{0}{'a'} = 'A'; $aSuit{0}{'b'} = 'B'; $aSuit{0}{'c'} = 'C'; $aSuit{1}{'a'} = 'D'; $aSuit{1}{'b'} = 'E'; $aSuit{1}{'c'} = 'F'; Now I want to make $aSuit{1} a copy of $aSuit{0} %aSuit{1} = %aSuit{0}; This doesn't work (syntax error), w

Re: map/array performance

2005-10-24 Thread Frank Bax
At 10:07 PM 10/23/05, Jeff 'japhy' Pinyan wrote: On Oct 23, Frank Bax said: my $aval=''; map { $aval=$aval.sprintf("%4d",$aSuit{$a}{$_}); } @f_seq; my $aval=''; foreach $f (@f_seq) { $aval=$aval.sprintf("%4d",$aSuit{$a}{$f});

Re: map/array performance

2005-10-23 Thread Frank Bax
At 04:35 PM 10/23/05, Frank Bax wrote: At 02:11 PM 10/23/05, John W. Krahn wrote: Frank Bax wrote: > my $snew = > sprintf("%4d%4d",$aSuit{$new}{'rescap'},$aSuit{$new}{'resval'}); > my $slow = > sprintf("%4d%4d",$aSuit{$lo

Re: map/array performance

2005-10-23 Thread Frank Bax
At 02:11 PM 10/23/05, John W. Krahn wrote: Frank Bax wrote: > my $snew = > sprintf("%4d%4d",$aSuit{$new}{'rescap'},$aSuit{$new}{'resval'}); > my $slow = > sprintf("%4d%4d",$aSuit{$low}{'rescap'},$aSuit{$low}{'res

map/array performance

2005-10-23 Thread Frank Bax
Rather than create/store/sort many billion entities, my script creates these entities dynamically and maintains a hash of the "top 100". As each entity is created, I search my hash for the entity with "lowest" value, based on a number of elements in the hash; then "low" element gets replaced w