From David at starlightmedia.net Thu Jul 3 18:10:51 2003
From: David at starlightmedia.net (David Murphy)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Wide Character Error
Message-ID: <000201c341b8$60deade0$6601a8c0@monster>
When using MIME::Base64
open(FILE, "$imgpath/$cat/Tall/$img") or print LOG "$today ERROR
opening image while posting $!\n";
while (read(FILE, $buf, 60*57)) {
$unf .= encode_base64($buf);
}
close FILE;
This returns a "Wide Characater in subroutine" error what causes this
and how to I fix the issue. Or is there another encoding method that
can get around this issue...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/austin/attachments/20030703/4b36cf62/attachment.htm
From dbii at mudpuddle.com Fri Jul 4 12:59:23 2003
From: dbii at mudpuddle.com (David Bluestein II)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Meeting on the 16th?
Message-ID:
Hey Mark-
What's up on the 16th? I know we were planning a social meeting, but where
and when and how? The website still lists the last meeting.
I talked w/Wayne and maybe Roaring Fork downtown? They have summer specials
for a $6 12 oz. hamburger, so that should take care of food. Don't know if
we can fit in.
I figured we should all see what was up since it is < 2 weeks away so
everyone could start planning.
David
----------
David H. Bluestein II President & Lead Developer
dbii@interaction.net ii, inc.
http://www.interaction.net
- Specializing in Designing Interactive Websites -
- and Searchable Internet Databases -
From eharris at puremagic.com Tue Jul 8 23:48:25 2003
From: eharris at puremagic.com (Evan Harris)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Debugging memory leak
Message-ID:
Is there a way to track where memory is being used in a large
long-running perl program?
I have a program that after about 6 hours has leaked about 200meg of memory,
and I can't figure out why. It started doing this after an upgrade from
perl 5.6.1 to 5.8.
I'd like to be able to get some sort of stats on which modules what amount
of the memory is being used in, so I can figure out where to start trying to
fix it.
Any suggestions would be appreciated.
Evan
From wwalker at broadq.com Wed Jul 9 10:54:34 2003
From: wwalker at broadq.com (Wayne Walker)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Debugging memory leak
In-Reply-To:
References:
Message-ID: <20030709155434.GA1568@broadq.com>
I don't know of any memory monitoring stuff in perl, but it may be
there.
I would start by generating log output that prints a line every time you
use significant memory.
While looking at the code to see where you use significant memory you
may find the culprit.
Otherwise you may see in the log that something you thought wasn't
called often is.
On Tue, Jul 08, 2003 at 11:48:25PM -0500, Evan Harris wrote:
>
> Is there a way to track where memory is being used in a large
> long-running perl program?
>
> I have a program that after about 6 hours has leaked about 200meg of memory,
> and I can't figure out why. It started doing this after an upgrade from
> perl 5.6.1 to 5.8.
>
> I'd like to be able to get some sort of stats on which modules what amount
> of the memory is being used in, so I can figure out where to start trying to
> fix it.
>
> Any suggestions would be appreciated.
>
> Evan
>
> _______________________________________________
> Austin mailing list
> Austin@mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin
--
Wayne Walker
www.broadq.com :) Bringing digital video and audio to the living room
From eharris at puremagic.com Wed Jul 9 11:04:03 2003
From: eharris at puremagic.com (Evan Harris)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Debugging memory leak
In-Reply-To: <20030709155434.GA1568@broadq.com>
Message-ID:
I thought for a while I had it narrowed down to File::Copy move(), as
removing that and replacing it with a system("mv","blah","blah2") really
slowed down the memory leak.
But it didn't eliminate it, and efforts to reduce it to a simple
reproducable problem script weren't successful.
The problem is that nothing in the program whould be using much memory, as
it is pretty much entirely disk based. The normal memory image is about
10meg and fluctuates by about 1meg while running and
parsing/translating/moving files. Until it starts growing, for no apparent
reason.
Evan
On Wed, 9 Jul 2003, Wayne Walker wrote:
> I don't know of any memory monitoring stuff in perl, but it may be
> there.
>
> I would start by generating log output that prints a line every time you
> use significant memory.
>
> While looking at the code to see where you use significant memory you
> may find the culprit.
>
> Otherwise you may see in the log that something you thought wasn't
> called often is.
>
> On Tue, Jul 08, 2003 at 11:48:25PM -0500, Evan Harris wrote:
> >
> > Is there a way to track where memory is being used in a large
> > long-running perl program?
> >
> > I have a program that after about 6 hours has leaked about 200meg of memory,
> > and I can't figure out why. It started doing this after an upgrade from
> > perl 5.6.1 to 5.8.
> >
> > I'd like to be able to get some sort of stats on which modules what amount
> > of the memory is being used in, so I can figure out where to start trying to
> > fix it.
> >
> > Any suggestions would be appreciated.
> >
> > Evan
> >
> > _______________________________________________
> > Austin mailing list
> > Austin@mail.pm.org
> > http://mail.pm.org/mailman/listinfo/austin
>
> --
>
> Wayne Walker
>
> www.broadq.com :) Bringing digital video and audio to the living room
>
From wwalker at bybent.com Wed Jul 9 11:22:16 2003
From: wwalker at bybent.com (Wayne Walker)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Debugging memory leak
In-Reply-To:
References: <20030709155434.GA1568@broadq.com>
Message-ID: <20030709162216.GB1568@broadq.com>
DOH!
Just dump core and do a strings on the core file.
strings --all core | sort | uniq -c | sort -n
or you should be able to read it via the /proc/ stuff but I can't
see how right now.
On Wed, Jul 09, 2003 at 11:04:03AM -0500, Evan Harris wrote:
>
> I thought for a while I had it narrowed down to File::Copy move(), as
> removing that and replacing it with a system("mv","blah","blah2") really
> slowed down the memory leak.
>
> But it didn't eliminate it, and efforts to reduce it to a simple
> reproducable problem script weren't successful.
>
> The problem is that nothing in the program whould be using much memory, as
> it is pretty much entirely disk based. The normal memory image is about
> 10meg and fluctuates by about 1meg while running and
> parsing/translating/moving files. Until it starts growing, for no apparent
> reason.
>
> Evan
>
>
> On Wed, 9 Jul 2003, Wayne Walker wrote:
>
> > I don't know of any memory monitoring stuff in perl, but it may be
> > there.
> >
> > I would start by generating log output that prints a line every time you
> > use significant memory.
> >
> > While looking at the code to see where you use significant memory you
> > may find the culprit.
> >
> > Otherwise you may see in the log that something you thought wasn't
> > called often is.
> >
> > On Tue, Jul 08, 2003 at 11:48:25PM -0500, Evan Harris wrote:
> > >
> > > Is there a way to track where memory is being used in a large
> > > long-running perl program?
> > >
> > > I have a program that after about 6 hours has leaked about 200meg of memory,
> > > and I can't figure out why. It started doing this after an upgrade from
> > > perl 5.6.1 to 5.8.
> > >
> > > I'd like to be able to get some sort of stats on which modules what amount
> > > of the memory is being used in, so I can figure out where to start trying to
> > > fix it.
> > >
> > > Any suggestions would be appreciated.
> > >
> > > Evan
> > >
> > > _______________________________________________
> > > Austin mailing list
> > > Austin@mail.pm.org
> > > http://mail.pm.org/mailman/listinfo/austin
> >
> > --
> >
> > Wayne Walker
> >
> > www.broadq.com :) Bringing digital video and audio to the living room
> >
>
> _______________________________________________
> Austin mailing list
> Austin@mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin
--
Wayne Walker
www.broadq.com :) Bringing digital video and audio to the living room
From mlehmann at marklehmann.com Wed Jul 9 11:44:33 2003
From: mlehmann at marklehmann.com (Mark Lehmann)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Debugging memory leak
In-Reply-To: <20030709155434.GA1568@broadq.com>
References:
<20030709155434.GA1568@broadq.com>
Message-ID: <16140.18033.119402.16950@lehmbrain.marklehmann.com>
Remember that Perl (like other VM based languages) don't give memory back
once they've requested it from the operating system. So a one time load of
data from disk to memory and back to disk again might request memory from the
OS and keep it if the disk to disk copy needed more memory temporarily.
In those cases you need to use things like sysread and read which take byte
sizes and only process a small chunk at a time. It can be inconvenient to
code that way if you want to parse data.
>>>>> "WW" == Wayne Walker writes:
WW> I don't know of any memory monitoring stuff in perl, but it may be
WW> there.
WW> I would start by generating log output that prints a line every time you
WW> use significant memory.
WW> While looking at the code to see where you use significant memory you
WW> may find the culprit.
WW> Otherwise you may see in the log that something you thought wasn't
WW> called often is.
WW> On Tue, Jul 08, 2003 at 11:48:25PM -0500, Evan Harris wrote:
>>
>> Is there a way to track where memory is being used in a large
>> long-running perl program?
>>
>> I have a program that after about 6 hours has leaked about 200meg of memory,
>> and I can't figure out why. It started doing this after an upgrade from
>> perl 5.6.1 to 5.8.
>>
>> I'd like to be able to get some sort of stats on which modules what amount
>> of the memory is being used in, so I can figure out where to start trying to
>> fix it.
>>
>> Any suggestions would be appreciated.
>>
>> Evan
>>
>> _______________________________________________
>> Austin mailing list
>> Austin@mail.pm.org
>> http://mail.pm.org/mailman/listinfo/austin
WW> --
WW> Wayne Walker
WW> www.broadq.com :) Bringing digital video and audio to the living room
WW> _______________________________________________
WW> Austin mailing list
WW> Austin@mail.pm.org
WW> http://mail.pm.org/mailman/listinfo/austin
--
Mark Lehmann
email mlehmann@marklehmann.com | phone 512 689-7705
From ezra at jdba.org Wed Jul 9 11:56:57 2003
From: ezra at jdba.org (ezra pagel)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Debugging memory leak
In-Reply-To:
References:
Message-ID: <1057769810.4780.34.camel@argon>
I don't know of any memory monitoring stuff in perl, but it may be
there.
The Devel:: modules tend to be pretty helpful with this stuff;
specifically, Devel::Peek lets you dump memory stats. I've never used
Devel::Leak, but if you suspect circular references or shiesty gc'ing,
then that may be worth looking into. Only problem is that you'll need a
perl built with -DDEBUGGING, -DEEBUGGING_MSTATS, and using perl's
malloc(). That's not always realistic for production builds, but I find
it useful for testbed/QA environments.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/austin/attachments/20030709/b35645a4/attachment.htm
From bill_raty at yahoo.com Wed Jul 9 13:15:06 2003
From: bill_raty at yahoo.com (Bill Raty)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Debugging memory leak
In-Reply-To: <16140.18033.119402.16950@lehmbrain.marklehmann.com>
Message-ID: <20030709181506.21053.qmail@web20419.mail.yahoo.com>
Mark,
Couldn't one do a fork for those sections of code that are used
temporarily and might alloc lots of mem?
Regards,
-Bill
--- Mark Lehmann wrote:
> Remember that Perl (like other VM based languages) don't give
> memory back
> once they've requested it from the operating system. So a
> one time load of
> data from disk to memory and back to disk again might request
> memory from the
> OS and keep it if the disk to disk copy needed more memory
> temporarily.
>
> In those cases you need to use things like sysread and read
> which take byte
> sizes and only process a small chunk at a time. It can be
> inconvenient to
> code that way if you want to parse data.
>
> >>>>> "WW" == Wayne Walker writes:
>
> WW> I don't know of any memory monitoring stuff in perl, but
> it may be
> WW> there.
>
> WW> I would start by generating log output that prints a line
> every time you
> WW> use significant memory.
>
> WW> While looking at the code to see where you use
> significant memory you
> WW> may find the culprit.
>
> WW> Otherwise you may see in the log that something you
> thought wasn't
> WW> called often is.
>
> WW> On Tue, Jul 08, 2003 at 11:48:25PM -0500, Evan Harris
> wrote:
> >>
> >> Is there a way to track where memory is being used in a
> large
> >> long-running perl program?
> >>
> >> I have a program that after about 6 hours has leaked about
> 200meg of memory,
> >> and I can't figure out why. It started doing this after
> an upgrade from
> >> perl 5.6.1 to 5.8.
> >>
> >> I'd like to be able to get some sort of stats on which
> modules what amount
> >> of the memory is being used in, so I can figure out where
> to start trying to
> >> fix it.
> >>
> >> Any suggestions would be appreciated.
> >>
> >> Evan
> >>
> >> _______________________________________________
> >> Austin mailing list
> >> Austin@mail.pm.org
> >> http://mail.pm.org/mailman/listinfo/austin
>
> WW> --
>
> WW> Wayne Walker
>
> WW> www.broadq.com :) Bringing digital video and audio to
> the living room
> WW> _______________________________________________
> WW> Austin mailing list
> WW> Austin@mail.pm.org
> WW> http://mail.pm.org/mailman/listinfo/austin
>
> --
> Mark Lehmann
> email mlehmann@marklehmann.com | phone 512 689-7705
> _______________________________________________
> Austin mailing list
> Austin@mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin
From bill_raty at yahoo.com Wed Jul 9 13:15:06 2003
From: bill_raty at yahoo.com (Bill Raty)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Debugging memory leak
In-Reply-To: <16140.18033.119402.16950@lehmbrain.marklehmann.com>
Message-ID: <20030709181506.21053.qmail@web20419.mail.yahoo.com>
Mark,
Couldn't one do a fork for those sections of code that are used
temporarily and might alloc lots of mem?
Regards,
-Bill
--- Mark Lehmann wrote:
> Remember that Perl (like other VM based languages) don't give
> memory back
> once they've requested it from the operating system. So a
> one time load of
> data from disk to memory and back to disk again might request
> memory from the
> OS and keep it if the disk to disk copy needed more memory
> temporarily.
>
> In those cases you need to use things like sysread and read
> which take byte
> sizes and only process a small chunk at a time. It can be
> inconvenient to
> code that way if you want to parse data.
>
> >>>>> "WW" == Wayne Walker writes:
>
> WW> I don't know of any memory monitoring stuff in perl, but
> it may be
> WW> there.
>
> WW> I would start by generating log output that prints a line
> every time you
> WW> use significant memory.
>
> WW> While looking at the code to see where you use
> significant memory you
> WW> may find the culprit.
>
> WW> Otherwise you may see in the log that something you
> thought wasn't
> WW> called often is.
>
> WW> On Tue, Jul 08, 2003 at 11:48:25PM -0500, Evan Harris
> wrote:
> >>
> >> Is there a way to track where memory is being used in a
> large
> >> long-running perl program?
> >>
> >> I have a program that after about 6 hours has leaked about
> 200meg of memory,
> >> and I can't figure out why. It started doing this after
> an upgrade from
> >> perl 5.6.1 to 5.8.
> >>
> >> I'd like to be able to get some sort of stats on which
> modules what amount
> >> of the memory is being used in, so I can figure out where
> to start trying to
> >> fix it.
> >>
> >> Any suggestions would be appreciated.
> >>
> >> Evan
> >>
> >> _______________________________________________
> >> Austin mailing list
> >> Austin@mail.pm.org
> >> http://mail.pm.org/mailman/listinfo/austin
>
> WW> --
>
> WW> Wayne Walker
>
> WW> www.broadq.com :) Bringing digital video and audio to
> the living room
> WW> _______________________________________________
> WW> Austin mailing list
> WW> Austin@mail.pm.org
> WW> http://mail.pm.org/mailman/listinfo/austin
>
> --
> Mark Lehmann
> email mlehmann@marklehmann.com | phone 512 689-7705
> _______________________________________________
> Austin mailing list
> Austin@mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin
From mlehmann at marklehmann.com Wed Jul 9 15:56:10 2003
From: mlehmann at marklehmann.com (Mark Lehmann)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Debugging memory leak
In-Reply-To: <20030709181506.21053.qmail@web20419.mail.yahoo.com>
References: <16140.18033.119402.16950@lehmbrain.marklehmann.com>
<20030709181506.21053.qmail@web20419.mail.yahoo.com>
Message-ID: <16140.33130.980097.418916@lehmbrain.marklehmann.com>
That's a good idea if performance of the job is not an issue. If this is an
often repeated operation (several times a second), the forks could slow
things down. However, the forking solution is pretty sweet.
>>>>> "BR" == Bill Raty writes:
BR> Mark,
BR> Couldn't one do a fork for those sections of code that are used
BR> temporarily and might alloc lots of mem?
BR> Regards,
BR> -Bill
BR> --- Mark Lehmann wrote:
>> Remember that Perl (like other VM based languages) don't give
>> memory back
>> once they've requested it from the operating system. So a
>> one time load of
>> data from disk to memory and back to disk again might request
>> memory from the
>> OS and keep it if the disk to disk copy needed more memory
>> temporarily.
>>
>> In those cases you need to use things like sysread and read
>> which take byte
>> sizes and only process a small chunk at a time. It can be
>> inconvenient to
>> code that way if you want to parse data.
>>
>> >>>>> "WW" == Wayne Walker writes:
>>
WW> I don't know of any memory monitoring stuff in perl, but
>> it may be
WW> there.
>>
WW> I would start by generating log output that prints a line
>> every time you
WW> use significant memory.
>>
WW> While looking at the code to see where you use
>> significant memory you
WW> may find the culprit.
>>
WW> Otherwise you may see in the log that something you
>> thought wasn't
WW> called often is.
>>
WW> On Tue, Jul 08, 2003 at 11:48:25PM -0500, Evan Harris
>> wrote:
>> >>
>> >> Is there a way to track where memory is being used in a
>> large
>> >> long-running perl program?
>> >>
>> >> I have a program that after about 6 hours has leaked about
>> 200meg of memory,
>> >> and I can't figure out why. It started doing this after
>> an upgrade from
>> >> perl 5.6.1 to 5.8.
>> >>
>> >> I'd like to be able to get some sort of stats on which
>> modules what amount
>> >> of the memory is being used in, so I can figure out where
>> to start trying to
>> >> fix it.
>> >>
>> >> Any suggestions would be appreciated.
>> >>
>> >> Evan
>> >>
>> >> _______________________________________________
>> >> Austin mailing list
>> >> Austin@mail.pm.org
>> >> http://mail.pm.org/mailman/listinfo/austin
>>
WW> --
>>
WW> Wayne Walker
>>
WW> www.broadq.com :) Bringing digital video and audio to
>> the living room
WW> _______________________________________________
WW> Austin mailing list
WW> Austin@mail.pm.org
WW> http://mail.pm.org/mailman/listinfo/austin
>>
>> --
>> Mark Lehmann
>> email mlehmann@marklehmann.com | phone 512 689-7705
>> _______________________________________________
>> Austin mailing list
>> Austin@mail.pm.org
>> http://mail.pm.org/mailman/listinfo/austin
BR> _______________________________________________
BR> Austin mailing list
BR> Austin@mail.pm.org
BR> http://mail.pm.org/mailman/listinfo/austin
--
Mark Lehmann
email mlehmann@marklehmann.com | phone 512 689-7705
From mlehmann at marklehmann.com Wed Jul 9 15:56:10 2003
From: mlehmann at marklehmann.com (Mark Lehmann)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Debugging memory leak
In-Reply-To: <20030709181506.21053.qmail@web20419.mail.yahoo.com>
References: <16140.18033.119402.16950@lehmbrain.marklehmann.com>
<20030709181506.21053.qmail@web20419.mail.yahoo.com>
Message-ID: <16140.33130.980097.418916@lehmbrain.marklehmann.com>
That's a good idea if performance of the job is not an issue. If this is an
often repeated operation (several times a second), the forks could slow
things down. However, the forking solution is pretty sweet.
>>>>> "BR" == Bill Raty writes:
BR> Mark,
BR> Couldn't one do a fork for those sections of code that are used
BR> temporarily and might alloc lots of mem?
BR> Regards,
BR> -Bill
BR> --- Mark Lehmann wrote:
>> Remember that Perl (like other VM based languages) don't give
>> memory back
>> once they've requested it from the operating system. So a
>> one time load of
>> data from disk to memory and back to disk again might request
>> memory from the
>> OS and keep it if the disk to disk copy needed more memory
>> temporarily.
>>
>> In those cases you need to use things like sysread and read
>> which take byte
>> sizes and only process a small chunk at a time. It can be
>> inconvenient to
>> code that way if you want to parse data.
>>
>> >>>>> "WW" == Wayne Walker writes:
>>
WW> I don't know of any memory monitoring stuff in perl, but
>> it may be
WW> there.
>>
WW> I would start by generating log output that prints a line
>> every time you
WW> use significant memory.
>>
WW> While looking at the code to see where you use
>> significant memory you
WW> may find the culprit.
>>
WW> Otherwise you may see in the log that something you
>> thought wasn't
WW> called often is.
>>
WW> On Tue, Jul 08, 2003 at 11:48:25PM -0500, Evan Harris
>> wrote:
>> >>
>> >> Is there a way to track where memory is being used in a
>> large
>> >> long-running perl program?
>> >>
>> >> I have a program that after about 6 hours has leaked about
>> 200meg of memory,
>> >> and I can't figure out why. It started doing this after
>> an upgrade from
>> >> perl 5.6.1 to 5.8.
>> >>
>> >> I'd like to be able to get some sort of stats on which
>> modules what amount
>> >> of the memory is being used in, so I can figure out where
>> to start trying to
>> >> fix it.
>> >>
>> >> Any suggestions would be appreciated.
>> >>
>> >> Evan
>> >>
>> >> _______________________________________________
>> >> Austin mailing list
>> >> Austin@mail.pm.org
>> >> http://mail.pm.org/mailman/listinfo/austin
>>
WW> --
>>
WW> Wayne Walker
>>
WW> www.broadq.com :) Bringing digital video and audio to
>> the living room
WW> _______________________________________________
WW> Austin mailing list
WW> Austin@mail.pm.org
WW> http://mail.pm.org/mailman/listinfo/austin
>>
>> --
>> Mark Lehmann
>> email mlehmann@marklehmann.com | phone 512 689-7705
>> _______________________________________________
>> Austin mailing list
>> Austin@mail.pm.org
>> http://mail.pm.org/mailman/listinfo/austin
BR> _______________________________________________
BR> Austin mailing list
BR> Austin@mail.pm.org
BR> http://mail.pm.org/mailman/listinfo/austin
--
Mark Lehmann
email mlehmann@marklehmann.com | phone 512 689-7705
From michalk at awpi.com Thu Jul 10 08:00:44 2003
From: michalk at awpi.com (Brian Michalk)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Sparse arrays
In-Reply-To: <20020607002425.C2767@bybent.com>
Message-ID:
Let's say I have a sparse array:
$ary[100]=1;
$ary[100000]=2;
$ary[1000000]=3;
Now, I want to iterate over the array, either from lowest to highest array
index, and still retain the index of the element returned. How do I do
that?
foreach $elt (@ary) {
$some_value = $elt;
$the_index = ????????; # how do I get this information?
}
This algorithm is chewing up CPU time, causing the process to take days to
complete... the dataset is several gigabytes large.
Using a hash, and sorting the keys will not give me a performance benefit.
From jeremyb at univista.com Thu Jul 10 09:28:56 2003
From: jeremyb at univista.com (jeremy)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Sparse arrays
In-Reply-To:
References:
Message-ID: <1057847931.17897.18.camel@oberon>
I simply increment a counter at the bottom of the loop.
I've added a print section so you can see what happens.
$ary[100] = 1;
$ary[100000] = 2;
$ary[1000000] = 3;
$count = 0;
foreach $elt (@ary) {
$some_value = $elt;
$the_index = count; # how do I get this
information?
if( $some_value ){
print "\$ary[ $count ] -> $some_value\n";
}
$count++;
}
As far as this little section of code being a CPU hog ....I don't know
what to say. Does it really take days to complete? On any modern
system this ought to finish in a couple of seconds ...maybe 3. In
fact, on my machine it took 1.315s according to the time function. The
machine is a 1.4 gig P4 with 921 MB SDRAM. Is you machine very old?
Jeremy
On Thu, 2003-07-10 at 08:00, Brian Michalk wrote:
> Let's say I have a sparse array:
> $ary[100]=1;
> $ary[100000]=2;
> $ary[1000000]=3;
>
> Now, I want to iterate over the array, either from lowest to highest array
> index, and still retain the index of the element returned. How do I do
> that?
>
> foreach $elt (@ary) {
> $some_value = $elt;
> $the_index = ????????; # how do I get this information?
> }
>
>
> This algorithm is chewing up CPU time, causing the process to take days to
> complete... the dataset is several gigabytes large.
>
> Using a hash, and sorting the keys will not give me a performance benefit.
>
> _______________________________________________
> Austin mailing list
> Austin@mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin
From ezra at jdba.org Thu Jul 10 09:51:40 2003
From: ezra at jdba.org (ezra pagel)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Sparse arrays
In-Reply-To:
References:
Message-ID: <1057848620.16179.8.camel@argon>
# $numberOfElements = scalar @ary;
# $lastArrayIndex = $#ary;
foreach $idx (0..$#ary) {
$element = $ary[$idx];
print "$element is at index $idx in \$ary\n";
}
tell us a little more about your data and your hardware environment, and
maybe we can help w/ performance. it shouldn't take days to iterate an
array; i guess it's possible that you've got massive swap space and
you're seeing nothing but i/o thrashing, but that's not likely either.
On Thu, 2003-07-10 at 08:00, Brian Michalk wrote:
> Let's say I have a sparse array:
> $ary[100]=1;
> $ary[100000]=2;
> $ary[1000000]=3;
>
> Now, I want to iterate over the array, either from lowest to highest array
> index, and still retain the index of the element returned. How do I do
> that?
>
> foreach $elt (@ary) {
> $some_value = $elt;
> $the_index = ????????; # how do I get this information?
> }
>
>
> This algorithm is chewing up CPU time, causing the process to take days to
> complete... the dataset is several gigabytes large.
>
> Using a hash, and sorting the keys will not give me a performance benefit.
>
> _______________________________________________
> Austin mailing list
> Austin@mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/austin/attachments/20030710/afb4de16/attachment.htm
From renm at iname.com Thu Jul 10 10:00:47 2003
From: renm at iname.com (Ren Maddox)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Sparse arrays
In-Reply-To:
References:
Message-ID: <1057849126.17859.6.camel@kraz.dynamic.austin.ibm.com>
On Thu, 2003-07-10 at 08:00, Brian Michalk wrote:
> Let's say I have a sparse array:
> $ary[100]=1;
> $ary[100000]=2;
> $ary[1000000]=3;
>
> Now, I want to iterate over the array, either from lowest to highest array
> index, and still retain the index of the element returned. How do I do
> that?
>
> foreach $elt (@ary) {
> $some_value = $elt;
> $the_index = ????????; # how do I get this information?
> }
>
>
> This algorithm is chewing up CPU time, causing the process to take days to
> complete... the dataset is several gigabytes large.
>
> Using a hash, and sorting the keys will not give me a performance benefit.
Perhaps not, but in similar circumstances I have found that using a hash
and *storing* the sorted list of keys will give a huge performance
benefit.
my %hash = ( 100, 1, 100_000, 2, 1_000_000, 3 );
my @keys = sort keys %hash;
for my $key ( @keys ) {
$some_value = $hash{$key};
# $key *is* the index
}
Of course, some work is required to maintain consistency between @keys
and %hash. Using one of the existing modules that provides ordered
hashes may be appropriate if that is a concern, though simply rebuilding
@keys periodically may be good enough depending on the situation.
--
Ren Maddox
From michalk at awpi.com Thu Jul 10 09:30:55 2003
From: michalk at awpi.com (Brian Michalk)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Sparse arrays
In-Reply-To: <1057848620.16179.8.camel@argon>
Message-ID:
Well, the data is a profile of pavement collected from a laser. An individual trace can be up to 30 meters long at eight samples per millimeter. The number of points in a trace varies. I have approximately 5,000 such traces.
I have to filter the data to get meaningful information out of it. The culprit algorithm in question needs to determine which part of the pavement is actually touching the tire.
Due to finite element analysis, I know that approximately 5% of the tire patch contact area actually touches the tire. It is this 5% that I'm extracting. My filtering window is 50 millimeters long, or 400 points. I prime a stack, pushing and popping elements into the window, and analyze for each individual point in the window (stack) When I find the datum representing 5% contact area, I pop the last element and subtract the current datum value. Next, I unshift the next point in the trace into the stack and repeat all over again.
This algorithm works, and produces repeatable results. However, the computational power to use this brute force method is too much. I need to convert the data into a histogram, and then start at the high end of the histogram, iterating over the indices until I've found 5% of the sample population.
Using a hash and sorting the keys does provide a performance increase. However, an array is essentially already sorted, and would be ideal if I knew what the indices were when I do a foreach over it. I thought about using another array to keep track of the indices, and that's probably what I'll do. I was just wondering if there was a better method of doing it.
Someone keeps telling me that theres always another way to do it in Perl.
This code is not meant to be portable, and if I have to break into the guts to find pointers, addresses and break all sorts of encapsulation, then I'll do that.
-----Original Message-----
From: ezra pagel [mailto:ezra@jdba.org]
Sent: Thursday, July 10, 2003 9:50 AM
To: Brian Michalk
Cc: austin-pm@pm.org
Subject: Re: APM: Sparse arrays
# $numberOfElements = scalar @ary;
# $lastArrayIndex = $#ary;
foreach $idx (0..$#ary) {
$element = $ary[$idx];
print "$element is at index $idx in \$ary\n";
}
tell us a little more about your data and your hardware environment, and maybe we can help w/ performance. it shouldn't take days to iterate an array; i guess it's possible that you've got massive swap space and you're seeing nothing but i/o thrashing, but that's not likely either.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/austin/attachments/20030710/95e6ac36/attachment.htm
From mike at stok.co.uk Thu Jul 10 10:35:17 2003
From: mike at stok.co.uk (Mike Stok)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Sparse arrays
In-Reply-To: <1057849126.17859.6.camel@kraz.dynamic.austin.ibm.com>
Message-ID:
On 10 Jul 2003, Ren Maddox wrote:
> On Thu, 2003-07-10 at 08:00, Brian Michalk wrote:
> > Let's say I have a sparse array:
> > $ary[100]=1;
> > $ary[100000]=2;
> > $ary[1000000]=3;
> >
> > Now, I want to iterate over the array, either from lowest to highest array
> > index, and still retain the index of the element returned. How do I do
> > that?
> >
> > foreach $elt (@ary) {
> > $some_value = $elt;
> > $the_index = ????????; # how do I get this information?
> > }
> >
> >
> > This algorithm is chewing up CPU time, causing the process to take days to
> > complete... the dataset is several gigabytes large.
> >
> > Using a hash, and sorting the keys will not give me a performance benefit.
>
> Perhaps not, but in similar circumstances I have found that using a hash
> and *storing* the sorted list of keys will give a huge performance
> benefit.
>
> my %hash = ( 100, 1, 100_000, 2, 1_000_000, 3 );
> my @keys = sort keys %hash;
>
> for my $key ( @keys ) {
> $some_value = $hash{$key};
> # $key *is* the index
> }
>
>
> Of course, some work is required to maintain consistency between @keys
> and %hash. Using one of the existing modules that provides ordered
> hashes may be appropriate if that is a concern, though simply rebuilding
> @keys periodically may be good enough depending on the situation.
Why not just say
foreacn my $key (sort {$a <=> $b} keys %hash) {
...
}
unless you have so many keys that sort takes too long.
alternatively it could be possible to make an array-like object, though
too much Ruby has lowered my tolerance to the pain of doing this kind of
thing in perl :-(
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | GPG PGP Key 1024D/059913DA
mike@exegenix.com | Fingerprint 0570 71CD 6790 7C28 3D60
http://www.exegenix.com/ | 75D2 9EC4 C1C0 0599 13DA
From wwalker at broadq.com Thu Jul 10 11:30:07 2003
From: wwalker at broadq.com (Wayne Walker)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Sparse arrays
In-Reply-To:
References: <20020607002425.C2767@bybent.com>
Message-ID: <20030710163007.GH1159@broadq.com>
On Thu, Jul 10, 2003 at 08:00:44AM -0500, Brian Michalk wrote:
> Let's say I have a sparse array:
> $ary[100]=1;
> $ary[100000]=2;
> $ary[1000000]=3;
>
> Now, I want to iterate over the array, either from lowest to highest array
> index, and still retain the index of the element returned. How do I do
> that?
$ary[100]=1;
push @used_elements, 100;
$ary[100000]=2;
push @used_elements, 100000;
$ary[1000000]=3;
push @used_elements, 1000000;
foreach $used_element (sort @used_elements)
{
do_sumthin($ary($used_element));
}
> foreach $elt (@ary) {
> $some_value = $elt;
> $the_index = ????????; # how do I get this information?
> }
>
>
> This algorithm is chewing up CPU time, causing the process to take days to
> complete... the dataset is several gigabytes large.
>
> Using a hash, and sorting the keys will not give me a performance benefit.
>
> _______________________________________________
> Austin mailing list
> Austin@mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin
--
Wayne Walker
www.broadq.com :) Bringing digital video and audio to the living room
From michalk at awpi.com Thu Jul 10 11:53:01 2003
From: michalk at awpi.com (Brian Michalk)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Sparse arrays -- performance analysis
In-Reply-To: <20030710163007.GH1159@broadq.com>
Message-ID:
I ran a single trace through the filtering algorithm.
Old method: 24 seconds
New method: 30 seconds This uses a hash, but I have to sort the keys.
I'll try out the idea of using another array to hold the indices.
The old method of trying a datum, then counting the percent above the datum:
121 my %beenhere;
122 while (($pcnt_above > ($contact_area+.005)) ||
123 ($pcnt_above < ($contact_area-.005))
124 ) {
125 $numloops++;
126 $total_above = 0;
127
128 foreach (@stack) {if (($_-$avg) > $offset )
{$total_above++;}}
129 $pcnt_above = $total_above / $win;
130
131 if ($pcnt_above >= $contact_area ) { $offset++;}
132 if ($pcnt_above < $contact_area ) { $offset--;}
133 if (defined $beenhere{$offset}) {
134 $pcnt_above = $contact_area;
135 }
136 $beenhere{$offset} = 1;
137 }
The new method using a hash to represent a histogram:
126 my $bincount=0;
127 foreach $index (sort {$b <=> $a} keys %hist) {
128 $bincount += $hist{$index};
129 $offset = $index;
130 last if (($bincount/$win)>$contact_area);
131 }
From ascii at ev1.net Fri Jul 11 07:57:45 2003
From: ascii at ev1.net (ASCII)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Debugging memory leak
In-Reply-To: <20030709181506.21053.qmail@web20419.mail.yahoo.com>
References: <20030709181506.21053.qmail@web20419.mail.yahoo.com>
Message-ID: <200307110657.45095@Code>
scanning cpan the other day i run up on quite a few perl benchmarking
routines, just skimming gave some optimization insights.
On Wednesday 09 July 2003 12:15, Bill Raty wrote:
> Mark,
>
> Couldn't one do a fork for those sections of code that are used
> temporarily and might alloc lots of mem?
>
> Regards,
>
> -Bill
>
> --- Mark Lehmann wrote:
> > Remember that Perl (like other VM based languages) don't give
> > memory back
> > once they've requested it from the operating system. So a
> > one time load of
> > data from disk to memory and back to disk again might request
> > memory from the
> > OS and keep it if the disk to disk copy needed more memory
> > temporarily.
> >
> > In those cases you need to use things like sysread and read
> > which take byte
> > sizes and only process a small chunk at a time. It can be
> > inconvenient to
> > code that way if you want to parse data.
> >
> > >>>>> "WW" == Wayne Walker writes:
> >
> > WW> I don't know of any memory monitoring stuff in perl, but
> > it may be
> > WW> there.
> >
> > WW> I would start by generating log output that prints a line
> > every time you
> > WW> use significant memory.
> >
> > WW> While looking at the code to see where you use
> > significant memory you
> > WW> may find the culprit.
> >
> > WW> Otherwise you may see in the log that something you
> > thought wasn't
> > WW> called often is.
> >
> > WW> On Tue, Jul 08, 2003 at 11:48:25PM -0500, Evan Harris
> >
> > wrote:
> > >> Is there a way to track where memory is being used in a
> >
> > large
> >
> > >> long-running perl program?
> > >>
> > >> I have a program that after about 6 hours has leaked about
> >
> > 200meg of memory,
> >
> > >> and I can't figure out why. It started doing this after
> >
> > an upgrade from
> >
> > >> perl 5.6.1 to 5.8.
> > >>
> > >> I'd like to be able to get some sort of stats on which
> >
> > modules what amount
> >
> > >> of the memory is being used in, so I can figure out where
> >
> > to start trying to
> >
> > >> fix it.
> > >>
> > >> Any suggestions would be appreciated.
> > >>
> > >> Evan
> > >>
> > >> _______________________________________________
> > >> Austin mailing list
> > >> Austin@mail.pm.org
> > >> http://mail.pm.org/mailman/listinfo/austin
> >
> > WW> --
> >
> > WW> Wayne Walker
> >
> > WW> www.broadq.com :) Bringing digital video and audio to
> > the living room
> > WW> _______________________________________________
> > WW> Austin mailing list
> > WW> Austin@mail.pm.org
> > WW> http://mail.pm.org/mailman/listinfo/austin
> >
> > --
> > Mark Lehmann
> > email mlehmann@marklehmann.com | phone 512 689-7705
> > _______________________________________________
> > Austin mailing list
> > Austin@mail.pm.org
> > http://mail.pm.org/mailman/listinfo/austin
>
> _______________________________________________
> Austin mailing list
> Austin@mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin
From msouth at shodor.org Thu Jul 10 09:30:30 2003
From: msouth at shodor.org (Mike South)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Sparse arrays
Message-ID: <200307101430.h6AEUUoL029093@scan.shodor.org>
>From: "Brian Michalk"
>To:
>Date: Thu, 10 Jul 2003 08:00:44 -0500
>
>Let's say I have a sparse array:
>$ary[100]=1;
>$ary[100000]=2;
>$ary[1000000]=3;
How is that array being created? If you just keep track of where
the occupied indices are in another array, you can iterate over
that.
>
>Now, I want to iterate over the array, either from lowest to highest array
>index, and still retain the index of the element returned. How do I do
>that?
>
>foreach $elt (@ary) {
> $some_value = $elt;
> $the_index = ????????; # how do I get this information?
>}
>
>
>This algorithm is chewing up CPU time, causing the process to take days to
>complete... the dataset is several gigabytes large.
>
#!/usr/bin/perl -w
use strict;
my @occupied_index = ();
my @data = ();
&add_element(100,1);
&add_element(100000,1);
&add_element(1000000000000,1);
foreach my $index (@occupied_index) {
print "the element at $index is $data[$index]\n";
}
sub add_element {
my ($index, $element) = @_;
push @occupied_index, $index; # you may need to be fancier
# here if you are trying to keep
# these in numerical order
$data[$index] = $element;
}
__END__
mike
From randysleek at hotmail.com Mon Jul 14 10:33:40 2003
From: randysleek at hotmail.com (Randall Hennig)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Matching against an array of patterns
Message-ID:
Hey,
I'm still a bit new to Perl, so bear with me plesae :)
I'm trying to match an array of candidates against an array of patterns, but
I'm having some trouble doing that. Basically, I think my problem is in
declaring the array of patterns. Here is the function I am using:
sub findMatches
{
my @candidates = $_[0] ;
my @patterns = $_[1] ;
my @results = ();
foreach my $candidate (@candidates)
{
if( scalar( map { $candidate =~ /$_/ ? $_ : () } @patterns ) > 0 )
{
push(@results, $candidate);
}
}
return(@results);
}
Here is the array I'm declaring:
my @g_basicTagPatterns = qw(author objective target title grade filename
notes
art passage questions q\d+ question hint
explanation
distracters correct\sanswers);
my @g_tagPatterns=map {qr/^$_:{0,1}$/i} @g_basicTagPatterns;
Here's the code I'm using, which fails to match:
my $text = "q1";
my @c = ();
push(@c, $text);
print "# matches = " . scalar(&findMatches(@c,@g_tagPatterns)) . "\n";
Any help would be appreciated, thanks :)
Randy
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
From bill_raty at yahoo.com Mon Jul 14 11:00:44 2003
From: bill_raty at yahoo.com (Bill Raty)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Matching against an array of patterns
In-Reply-To:
Message-ID: <20030714160044.66157.qmail@web20413.mail.yahoo.com>
Short answer: if you want to pass two arrays to a perl
subroutine you'll need to use subroutine prototyping -or- perl
references.
See perlref and perlsub.
URL for perlref:
http://www.perldoc.com/perl5.8.0/pod/perlref.html
URL for perlsub:
http://www.perldoc.com/perl5.8.0/pod/perlsub.html
-Bill
--- Randall Hennig wrote:
> Hey,
>
> I'm still a bit new to Perl, so bear with me plesae :)
>
> I'm trying to match an array of candidates against an array
> of patterns, but
> I'm having some trouble doing that. Basically, I think my
> problem is in
> declaring the array of patterns. Here is the function I am
> using:
>
>
> sub findMatches
> {
> my @candidates = $_[0] ;
> my @patterns = $_[1] ;
> my @results = ();
> foreach my $candidate (@candidates)
> {
> if( scalar( map { $candidate =~ /$_/ ? $_ : () }
> @patterns ) > 0 )
> {
> push(@results, $candidate);
> }
> }
> return(@results);
> }
>
> Here is the array I'm declaring:
>
> my @g_basicTagPatterns = qw(author objective target title
> grade filename
> notes
> art passage questions q\d+
> question hint
> explanation
> distracters correct\sanswers);
> my @g_tagPatterns=map {qr/^$_:{0,1}$/i} @g_basicTagPatterns;
>
> Here's the code I'm using, which fails to match:
>
> my $text = "q1";
> my @c = ();
> push(@c, $text);
> print "# matches = " .
> scalar(&findMatches(@c,@g_tagPatterns)) . "\n";
>
> Any help would be appreciated, thanks :)
>
> Randy
>
>
_________________________________________________________________
> The new MSN 8: smart spam protection and 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
> _______________________________________________
> Austin mailing list
> Austin@mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin
From dbii at mudpuddle.com Mon Jul 14 19:23:21 2003
From: dbii at mudpuddle.com (David Bluestein II)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Meeting Location and Details?
Message-ID:
Mark-
What is the word on this weeks meeting? Time, Place and Event.
David
----------
David H. Bluestein II President & Lead Developer
dbii@interaction.net ii, inc.
http://www.interaction.net
- Specializing in Designing Interactive Websites -
- and Searchable Internet Databases -
From mlehmann at marklehmann.com Mon Jul 14 23:10:36 2003
From: mlehmann at marklehmann.com (Mark Lehmann)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Social Meeting this Wednesday at 7:00pm
Message-ID: <16147.32444.242923.439561@lehmbrain.marklehmann.com>
We are meeting at the Waterloo Ice House on 1106 W 38th Street at 7:00pm this
Wednesday.
We will discuss "perl stuff..." meaning anything that is cool, career or
hobby related, or even something we are stumped on. Bring your Perl enabled
laptop and we'll try to network them together for fun.
The directions to the Waterloo Ice House are:
>From Mopac, exit 38th Street and go east. The restaurant is on the corner of
38th and Medical Parkway, across from Seton Hospital.
A map is located at:
http://www.waterloomaster.citysearch.com/2.html
--
Mark Lehmann
email mlehmann@marklehmann.com | phone 512 689-7705
From fluhmann at vvm.com Tue Jul 15 16:23:56 2003
From: fluhmann at vvm.com (fluhmann@vvm.com)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Social Meeting this Wednesday at 7:00pm
In-Reply-To: <200307151700.h6FH05d07272@mail.pm.org>
References: <200307151700.h6FH05d07272@mail.pm.org>
Message-ID: <23437.12.161.66.7.1058304236.squirrel@www.vvm.com>
> We are meeting at the Waterloo Ice House on 1106 W 38th Street at 7:00pm
> this Wednesday.
>
> We will discuss "perl stuff..." meaning anything that is cool, career or
> hobby related, or even something we are stumped on. Bring your Perl
> enabled laptop and we'll try to network them together for fun.
Hopefully I will finally be able to attend a meeting. I hope to meet
everyone there.
Jeremy Fluhmann
McLane Company
Enterprise Networking Systems - Intern
From mlehmann at marklehmann.com Thu Jul 17 13:56:53 2003
From: mlehmann at marklehmann.com (Mark Lehmann)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Coincidence? I think not.
Message-ID: <16150.61813.603348.468151@lehmbrain.marklehmann.com>
http://paxil.xunil.net/~mfh/thumpers.jpg
--
Mark Lehmann
email mlehmann@marklehmann.com | phone 512 689-7705
From randysleek at hotmail.com Thu Jul 17 15:27:42 2003
From: randysleek at hotmail.com (Randall Hennig)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Coincidence? I think not.
Message-ID:
Doesn't Homer Simpson look kind of like Steve Balmer? I don't know how that
connects up though...
>From: Mark Lehmann
>To: Austin Perl Mongers
>Subject: APM: Coincidence? I think not.
>Date: Thu, 17 Jul 2003 13:56:53 -0500
>
>http://paxil.xunil.net/~mfh/thumpers.jpg
>--
>Mark Lehmann
>email mlehmann@marklehmann.com | phone 512 689-7705
>_______________________________________________
>Austin mailing list
>Austin@mail.pm.org
>http://mail.pm.org/mailman/listinfo/austin
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus
From brian_clarkson at yahoo.com Fri Jul 18 14:43:19 2003
From: brian_clarkson at yahoo.com (Comrade Burnout)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: O'Reilly review copies?
Message-ID: <20030718194319.94944.qmail@web12105.mail.yahoo.com>
i remember seeing some traffic on the list about o'reilly donating review
copies of books ... or was it just a discount to members of PMs ... ?
can someone help refresh my memory?
i saw two recent books last night i'd love to pick up ( _Practical
mod_perl_ and _Learning Perl Objects, References & Modules_ ), but
economics aren't the strongest right now for me ....
i'd be down with writing reviews of them, or with presenting something
about transitioning form perl to mod_perl ( if that's a topic of interest
... )
--b--
=====
"I must have a prodigious quantity of mind; it takes me as much as a week, sometimes, to make it up."
--- Mark Twain
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
From eharris at puremagic.com Thu Jul 24 12:01:43 2003
From: eharris at puremagic.com (Evan Harris)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Problem opening a file
Message-ID:
I'm getting the following error trying to open a file with perl tie DB_File:
ERROR: Unable to open access.db file '/etc/mail/access.db': Inappropriate
ioctl for device at ./relaydelay.pl line 1168.
Here's the code that generated it:
if (defined $sendmail_accessdb_file) {
my %accessdb;
# Test that we can open the accessdb file
if (! tie (%accessdb, 'DB_File', $sendmail_accessdb_file, O_RDONLY)) {
die "ERROR: Unable to open access.db file '$sendmail_accessdb_file': $!";
}
untie %accessdb;
}
Any suggestions on how to fix this? As far as I can see, the file is fine,
I even deleted it and recompiled it. The strange thing is it was working on
the same system a day or two ago, and AFAIK, nothing has changed on the
system as far as perl/libs etc.
Evan
From eharris at puremagic.com Thu Jul 24 16:23:13 2003
From: eharris at puremagic.com (Evan Harris)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Re: Problem opening a file
In-Reply-To:
Message-ID:
Update to this question. I come to find out that the sendmail install on
this machine was upgraded last night.
Still, I'd like to know what exactly the failure is and how to go about
fixing it. Why did a sendmail upgrade affect tie/DB_File in such a way as
to cause that error to be thrown?
Evan
> I'm getting the following error trying to open a file with perl tie DB_File:
>
> ERROR: Unable to open access.db file '/etc/mail/access.db': Inappropriate
> ioctl for device at ./relaydelay.pl line 1168.
>
> Here's the code that generated it:
>
> if (defined $sendmail_accessdb_file) {
> my %accessdb;
> # Test that we can open the accessdb file
> if (! tie (%accessdb, 'DB_File', $sendmail_accessdb_file, O_RDONLY)) {
> die "ERROR: Unable to open access.db file '$sendmail_accessdb_file': $!";
> }
> untie %accessdb;
> }
>
> Any suggestions on how to fix this? As far as I can see, the file is fine,
> I even deleted it and recompiled it. The strange thing is it was working on
> the same system a day or two ago, and AFAIK, nothing has changed on the
> system as far as perl/libs etc.
>
> Evan
From wwalker at broadq.com Thu Jul 24 16:31:31 2003
From: wwalker at broadq.com (Wayne Walker)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: Re: Problem opening a file
In-Reply-To:
References:
Message-ID: <20030724213131.GG1195@broadq.com>
An upgrade to sendmail will install a new version of makemap. It may
use a new hash system that perl's tieDB doesn't know how to use.
It is VERY common for things that to to hash/DB files to say "cannot
open" if they don't unstand the format rather than an error that
indicates the real problem of invalid format.
On Thu, Jul 24, 2003 at 04:23:13PM -0500, Evan Harris wrote:
>
> Update to this question. I come to find out that the sendmail install on
> this machine was upgraded last night.
>
> Still, I'd like to know what exactly the failure is and how to go about
> fixing it. Why did a sendmail upgrade affect tie/DB_File in such a way as
> to cause that error to be thrown?
>
> Evan
>
> > I'm getting the following error trying to open a file with perl tie DB_File:
> >
> > ERROR: Unable to open access.db file '/etc/mail/access.db': Inappropriate
> > ioctl for device at ./relaydelay.pl line 1168.
> >
> > Here's the code that generated it:
> >
> > if (defined $sendmail_accessdb_file) {
> > my %accessdb;
> > # Test that we can open the accessdb file
> > if (! tie (%accessdb, 'DB_File', $sendmail_accessdb_file, O_RDONLY)) {
> > die "ERROR: Unable to open access.db file '$sendmail_accessdb_file': $!";
> > }
> > untie %accessdb;
> > }
> >
> > Any suggestions on how to fix this? As far as I can see, the file is fine,
> > I even deleted it and recompiled it. The strange thing is it was working on
> > the same system a day or two ago, and AFAIK, nothing has changed on the
> > system as far as perl/libs etc.
> >
> > Evan
>
> _______________________________________________
> Austin mailing list
> Austin@mail.pm.org
> http://mail.pm.org/mailman/listinfo/austin
--
Wayne Walker
www.broadq.com :) Bringing digital video and audio to the living room
From jeremyb at univista.com Thu Jul 24 17:14:54 2003
From: jeremyb at univista.com (jeremy)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: wml wierdness in WML.pm script
Message-ID: <1059085439.20865.11.camel@oberon>
Before I spout on about the problem I've encountered, does anyone here
have experience writing WAP applications using WML.pm?
thanks,
Jeremy
From jeremyb at univista.com Fri Jul 25 15:39:08 2003
From: jeremyb at univista.com (jeremy)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: should I role my own with Win32::RASE?
Message-ID: <1059166100.20855.49.camel@oberon>
Hey folks,
I need a script that can dial up a remote server (don't know the type
yet) from win2000 and send a file to it. It's pretty straight forward.
Let me preface by saying, I'm not a windows programmer and I've never
written anything in Perl for win32. I looked around cpan and determined
that win32::RASE might get me what I need to access and use DUN
connections on win2000.
But, before I start writing... do any of you have or know of a
program or Perl script that would do what I need?
...maybe something I could wrap up in another script of my own design.
thanks,
Jeremy
From fluhmann at vvm.com Fri Jul 25 17:49:40 2003
From: fluhmann at vvm.com (fluhmann@vvm.com)
Date: Mon Aug 2 21:23:19 2004
Subject: APM: should I role my own with Win32::RASE?
In-Reply-To: <1059166100.20855.49.camel@oberon>
References: <1059166100.20855.49.camel@oberon>
Message-ID: <35735.12.161.66.7.1059173380.squirrel@www.vvm.com>
> I need a script that can dial up a remote server (don't know the type
> yet) from win2000 and send a file to it. It's pretty straight forward.
> Let me preface by saying, I'm not a windows programmer and I've never
> written anything in Perl for win32. I looked around cpan and determined
> that win32::RASE might get me what I need to access and use DUN
> connections on win2000.
>
> But, before I start writing... do any of you have or know of a
> program or Perl script that would do what I need?
>
> ...maybe something I could wrap up in another script of my own design.
>-------------
You may have a look at this: http://sourceforge.net/projects/dialtimer/
I have been looking for something similar (for an ISP), but the above link
isn't what I'm looking for. I've been able to use Win32::RASE to dial-up,
but it used an existing DUN. I'm needing it to dial up a specific number
on any computer that the code is run on. (The ISP wishes to sell pre-paid
internet). Now, I just need to play around with writing something that
doesn't use an existing DUN. I can send you what I have for RASE if you
want (unless someone else has better advice).
Jeremy Fluhmann
McLane Information Systems