Perl taking a long time to exit? Freeing memory?

2002-09-04 Thread Jeff AA
Hi folks, I have a Perl script that creates a large hash, from a collection of files. I am running Perl 5.6.1 on SMP Linux 2.4.18, top shows my process using up to 700MB of memory (which is fine on our servers). I have noticed though that when perl hits my exit 0; line, the process pauses for

RE: Perl taking a long time to exit? Freeing memory?

2002-09-04 Thread Jeff AA
> > It could be garbage collection, but it shouldn't take 2 minutes to > free() 700MBs of data. Could be that your code is written in such > a way that it is having to back out of lots of subroutines and > free'ing things as it goes? Such as with recursion? no recursion, and on

RE: Reading Directory

2002-09-05 Thread Jeff AA
Why not: my $spec = "/var/www/*.mp3"; my ( @files ) = glob $spec; print "Checked '$spec' - found ", scalar(@files), " files:\n ", join("\n ", @files ), "\n"; regards Jeff > -Original Message- > From: Fabian Funk [mailto:[EMAIL PROTECTED]] > Sent: 04 September 2002 20:4

Perl debugging: dumpvar.pl Data::Dumper Dumpvalue et al?

2002-09-05 Thread Jeff AA
I have used Perl for a while, and always used dumpvar.pl / main::dumpvalue() to dump out things (I guess that tells you how long! 8-)) I had a look at Data::Dumper - but its dumps are either too terse (i.e. all one line) or too verbose (i.e. I am dumping data structures and don't really need to w

RE: get a list into array from a remote machine

2002-09-06 Thread Jeff AA
Try @lines = `/usr/local/bin/ssh -l priss remotehost cat list-txt`; and then skip any blank lines at this end... foreach my $line ( @lines ) { chomp $line; next unless $line; } regards Jeff > -Original Message- > From: Priss [mailto:[EMAIL PROTECTED]] > Sent: 06 September 200

RE: perl and my DB...

2002-09-09 Thread Jeff AA
> -Original Message- > From: Mariusz [mailto:[EMAIL PROTECTED]] > Sent: 09 September 2002 05:59 > To: perl > Subject: perl and my DB... > > (Can I submit the record via DBI and read the primary key > "ID" within the same script. Other words, can I send the last > name creating a new

RE: change directories

2002-09-09 Thread Jeff AA
> -Original Message- > From: Javeed SAR [mailto:[EMAIL PROTECTED]] > Sent: 09 September 2002 11:25 > To: Sudarshan Raghavan; Perl beginners > Subject: RE: change directories > > > Hi, > > I printed the statement: > print cwd; > it's in right path, but the program comes out in c:\, i wa

RE: new output error

2002-09-11 Thread Jeff AA
> -Original Message- > From: Mike Singleton [mailto:[EMAIL PROTECTED]] > Sent: 11 September 2002 04:40 > To: [EMAIL PROTECTED] > Subject: new output error > > > The output file (myfile.csv) is blank... any ideas out there? Thanks! > > print OUT join (',', @f) . "\n" if >/$JOBST

RE: when does a program get __DIE__

2002-09-13 Thread Jeff AA
> -Original Message- > From: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED]] > Sent: 13 September 2002 10:30 > To: [EMAIL PROTECTED] > Subject: when does a program get __DIE__ > > Can anyone tell me under what conditions does a program get SIGNAL > __DIE__ under linux > > if I

sorting a hash - multiple key fields

2002-09-17 Thread Jeff AA
Folks, I want to sort my masked hashes into neat little piles for easier digestion: Please note this is _example_ data 8-) my $h = { a => { name => 'apple', taste => 3 }, b => { name => 'peach', taste => 2 }, c => { name => 'banana', taste => 2 }, } I want to sort first on taste and then

RE: sorting a hash - multiple key fields

2002-09-17 Thread Jeff AA
> -Original Message- > From: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED]] > Sent: 17 September 2002 14:44 > To: [EMAIL PROTECTED]; Jeff Aa > Cc: [EMAIL PROTECTED] > Subject: Re: sorting a hash - multiple key fields > > > Use this . I think you wud

RE: Regexp

2002-09-18 Thread Jeff AA
> -Original Message- > From: Sudarshan Raghavan [mailto:[EMAIL PROTECTED]] > Sent: 19 September 2002 23:57 > To: Perl beginners > Subject: Re: Regexp > > > On Wed, 18 Sep 2002, Panel Vincent - A53 wrote: > > > I would like to reformat names like > > > > Francois de la Varenne > >

RE: lots of numbers...

2002-09-18 Thread Jeff AA
> -Original Message- > From: Janek Schleicher [mailto:[EMAIL PROTECTED]] > Sent: 18 September 2002 16:34 > To: [EMAIL PROTECTED] > Subject: Re: lots of numbers... > > > I think, it's better to weight the sorted numbers > with their sum rank, in the above example it would be: > > Of c

RE: Using GetOpt::Long

2002-09-19 Thread Jeff AA
> -Original Message- > From: David Samuelsson (PAC) > [mailto:[EMAIL PROTECTED]] > Sent: 19 September 2002 08:09 > To: '[EMAIL PROTECTED]' > Subject: Using GetOpt::Long > > > I found this module was a part off the package, and tried it > out, it works as i want. I have some troubles

RE: Using GetOpt::Long

2002-09-19 Thread Jeff AA
> -Original Message- > From: David Samuelsson (PAC) > [mailto:[EMAIL PROTECTED]] > Sent: 19 September 2002 09:03 > To: 'Jeff AA'; [EMAIL PROTECTED] > Subject: RE: Using GetOpt::Long > > > I want it so it will execute the subs in the order accor

RE: wordswap script

2002-09-19 Thread Jeff AA
> -Original Message- > From: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED]] > Sent: 19 September 2002 11:18 > To: [EMAIL PROTECTED] > Subject: wordswap script > > > Hi All > >I am writing a script that will replace all instance of a > particular > word another in a file > >

RE: lots of numbers...

2002-09-19 Thread Jeff AA
> -Original Message- > From: Janek Schleicher [mailto:[EMAIL PROTECTED]] > Sent: 19 September 2002 16:47 > To: [EMAIL PROTECTED] > Subject: RE: lots of numbers... > > I liked your algorithm as it is quick and easy. > But on the other hand the results aren't as good as possible. Actuall

RE: Using a variable name to invoke a subroutine

2002-09-25 Thread Jeff AA
Lots of good answers so far about using arrays, hashes etc, so won't bother going there... look below to see an OOP that works efficiently, using NAMEs rather than refs. > -Original Message- > From: Zielfelder, Robert > [mailto:[EMAIL PROTECTED]] > Sent: 24 September 2002 18:44 > To: '

RE: dbmopen doesn't work

2002-09-25 Thread Jeff AA
> -Original Message- > From: Bruno Negrao [mailto:[EMAIL PROTECTED]] > Sent: 24 September 2002 23:49 > To: [EMAIL PROTECTED] > Subject: dbmopen doesn't work > > > Hi all, > Could someone say to me why this program doesn't run? (it > doesn't print the database values) > > #!/usr/bin/p

RE: Programming pipes to and from another program

2002-09-25 Thread Jeff AA
If *nix, look at help for the open3 function. Attached as a text file is the little run class that I use to do this. Here is an example of how to use this class to encapsulate GPG, where the passphrase gets written to stdin of the child process, and the results are reaped from the childs stder

RE: Programming pipes to and from another program

2002-09-25 Thread Jeff AA
tember 2002 16:20 > To: Jeff AA > Cc: [EMAIL PROTECTED] > Subject: RE: Programming pipes to and from another program > > > > > >If *nix, look at help for the open3 function. Attached as a > text file is > > > >the little run class that I use to do

Determining highest common factor using Perl

2002-09-26 Thread Jeff AA
I need to determine the highest common factor for a series of integers. I have scribed an initial stab included below - does anyone have a better HCF implementation, or any improvements to suggest? TIA Jeff #!/usr/local/bin/perl -w use strict; my ( $one, $two ) = @ARGV; $one = 37894060279 unle

RE: SQL Table Rows

2002-09-30 Thread Jeff AA
> -Original Message- > From: dan [mailto:[EMAIL PROTECTED]] > Sent: 30 September 2002 13:55 > To: [EMAIL PROTECTED] > Subject: Re: SQL Table Rows > > snip > __ START __ > $id = 1; > $sth = $dbh->prepare("SELECT * FROM table WHERE id=$id"); > $sth->execute; > @ary = $sth->fetchrow_array

RE: how to know weather perl script is already running?

2002-09-30 Thread Jeff AA
> -Original Message- > From: Theuerkorn Johannes [mailto:[EMAIL PROTECTED]] > Sent: 30 September 2002 10:18 > To: '[EMAIL PROTECTED]' > Subject: how to know weather perl script is already running? > > > Hello List, > > i have a perl script that i have running from a cron Job. It > us

RE: Backup Program? [OT]

2002-10-16 Thread Jeff AA
> -Original Message- > From: folschette [mailto:[EMAIL PROTECTED]] > Sent: 16 October 2002 08:19 > To: [EMAIL PROTECTED] > Subject: RE: Backup Program? > > > > hi > and how do this in unix? > cio OT as this is not Perl A nice easy option is rsync http://www.google.com/search?sourc