Re: Parsing pipe delimited file

2003-10-21 Thread Katy Brownfield
Exactly what structure you want to end up with isn't clear, but I assume you that you need to keep the tracks and artists associated with their UPCs. If there were only one upc and one track/artist per line, grouped by upc, it would be easier. The position of the track/artist on each line is wh

can't open dbm file - no space left on device

2003-07-30 Thread Katy Brownfield
I'm modifying an existing script that has been moved to a new domain and a new ISP. It opens a DBM file like this dbmopen %fileinfo, "../data/fileinfo", 0644 or die "cannot open fileinfo: $!\n"; This fails intermittently with [Thu Jul 31 00:46:16 2003] [error] [client 53.259.56.55] cannot op

Re: Hey, I mapped something without training wheels

2003-06-06 Thread Katy Brownfield
On Fri, 6 Jun 2003 21:22:13 +0100, Rob Dixon <[EMAIL PROTECTED]> wrote: Katy Brownfield wrote: On Fri, 6 Jun 2003 18:16:26 +0100, Rob Dixon <[EMAIL PROTECTED]> wrote: > John W. Krahn wrote: > > Mark Anderson wrote: > > > > > > B) You should NEVER use map i

Re: Hey, I mapped something without training wheels

2003-06-06 Thread Katy Brownfield
On Fri, 6 Jun 2003 18:16:26 +0100, Rob Dixon <[EMAIL PROTECTED]> wrote: John W. Krahn wrote: Mark Anderson wrote: > > B) You should NEVER use map in a void context. map works very hard >to build up it's return value, so there should be an assignment >(=) operator to the left of your map

Re: why objects?

2003-03-09 Thread Katy Brownfield
On Fri, 7 Mar 2003 07:56:29 -0800 (PST), Paul <[EMAIL PROTECTED]> wrote: --- Dan Muey <[EMAIL PROTECTED]> wrote: () - easier for other people to maintain even years from now - easier to migrate and expand () Agreed, agreed, agreed, agreed, and agreed, but they don't take my word for it. I n

last and grep - was: Re: Test for empty list

2003-03-09 Thread Katy Brownfield
On Sat, 08 Mar 2003 17:31:08 -0800, R. Joseph Newton <[EMAIL PROTECTED]> wrote: "Scott R. Godin" wrote: > #!/usr/bin/perl -w > > use strict; > > my @array = ('', 0, "", 1); > > my $hasTruth; > foreach (@array) { > if ($_ ){ > $hasTruth = "yezzindeedydo!"; > last; > } > } > if ($hasTr

Re: help with nearly identical hash keys

2003-02-25 Thread Katy Brownfield
Here's a simpler example that contains some tools that might be useful to you. (Sorry for the lazy hash declarations.) If you explain the bigger picture, you might get suggestions for data structures that can be manipulated more simply. Katy my %one = qw(_cat peach _dog apple _mouse apricot

Re: Dynamic downloads

2003-02-24 Thread Katy Brownfield
Part two of Dan's question is how to specify a file name for dynamic content so that the name of the script that generated the content won't be used as the default. The following worked for me in IE 6.0, Netscape 6.2 and Opera 7.0: print "Content-type: text/plain\n"; print "Content-Disposition:

Re: Regular Expression Help sought

2002-07-04 Thread Katy Brownfield
; u > below..! > Thanks a ton for the help.but may I request for a small explanation > of the > line > $file =~ s/((^|\n\n).+?)\n/$1 /g; > > Sunish > > Katy Brownfield wrote: > > > Or, instead of changing the input file, change the regular expression > to >

Re: Regular Expression Help sought

2002-07-03 Thread Katy Brownfield
Or, instead of changing the input file, change the regular expression to also detect the beginning of the string. $file =~ s/((^|\n\n).+?)\n/$1 /g; Katy Timothy Johnson wrote: > > > I think you'll need 2 blank lines. > > -Original Message- > From: Sunish Kapoor > To: Nigel Peck > Cc:

How do I read groups of 9 lines from a file into 1 record?

2002-04-20 Thread Katy Brownfield
Others have answered the question about what the problem was, so this is another suggestion. If the file isn't enormous, what about reading and writing all at once? It is more readable and could be more efficient. open INPUT, "; close INPUT; chomp @all_info; my $out = ''; while (@all_info) {