RE: Info from flat file

2008-04-28 Thread Rob Benton
On your question about $/, the answer is yes. That's why it's always recommended you modify that variable inside an anonymous block like this: { local $/ = "+===+\n"; # read your file } Look at this page and search for "$/". http://perldoc.perl.org/perlvar.html Manoj <[EMAIL PRO

special chars as scalar inside regex

2008-03-28 Thread Rob Benton
I've got a problem I think there may be a straight-forward solution to that I just don't know. I have a program that reads a variable-length input file. And the field delimiter of that file is given as an argument. The problem is something like pipe "|" might show up as the delimiter.

Math::BigInt maximum value

2006-02-08 Thread Rob Benton
What are the limitatins of Math::BigInt? I ask because I have a c++ program that outputs an unsigned 64 bit integer that my perl script picks up. Am I safe to use BigInt for this on all platforms? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Out of Memory! error on large tied hash

2004-09-27 Thread Rob Benton
Chris Devers wrote: This may be the sort of problem that would best be handled by a proper database server. The folks writing RDBMSes have been tackling problems like this for decades now, and have some useful techniques; rather than reinvent the wheel, you can just leverage their efforts by put

using DB_BTREE on an 8mm record file

2004-08-17 Thread Rob Benton
I've been using the DB_File $DB_BTREE module to create groups and sort them on an 8 million record file. Is there a faster way to do this or am I still getting pretty good perfomance with this module? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

using tie on a hash of anonymous arrays

2004-08-12 Thread Rob Benton
Is this possible? I know what I have below won't work. == use DB_File; my %hash; tie(%hash, "DB_File", undef, O_RDWR|O_CREAT, 0640, $DB_BTREE) or die $hash{1} = [ 2, 3, 4 ]; print "@{$hash{1}}\n"; untie(%newhash);

Re: How to Sort on a substr

2004-07-15 Thread Rob Benton
Jeff Westman wrote: Hi, I need to do a sort on a couple of column ranges. I want to be able to do a primary sort, on say, columns 21-25 and then a secondary sort on columns 40-49. Any ideas on how to approach this? TIA /j __ Do you Yahoo!? Yahoo!

Re: Using the () list notation with $scalars

2004-07-01 Thread Rob Benton
John W. Krahn wrote: On Thursday 01 July 2004 14:30, Rob Benton wrote: I'm looking for a little help here. I'm not understanding exactly what's wrong with this code: === #!/usr/bin/perl -w use strict; open IN, &q

Using the () list notation with $scalars

2004-07-01 Thread Rob Benton
I'm looking for a little help here. I'm not understanding exactly what's wrong with this code: === #!/usr/bin/perl -w use strict; open IN, " my %rows; while () { chomp; my @fields = split( /,/, $_); $rows{$fields[2]} = [ ($f