Re: Problem sorting hash

2007-05-04 Thread leslie . polzer
On Fri, May 04, 2007 at 04:05:46AM -0700, John W. Krahn wrote: > my @toc_keys = sort { $toc{ $a }{ lines } <=> $toc{ $b }{ lines } } keys %toc; I don't think this will do what I want. I want the full hash structure preserved, not an array of the keys sorted by 'lines'... Leslie -- Personal

Text Formatters

2007-05-04 Thread Mathew Snyder
Hello all. Question regarding the text formatting modules out there. I've found three on CPAN that seem to have the functionality that I'm looking for but I don't know which would best suit my needs. The three are Text::Format, Text::Wrapper and Text::Autoformat. I have a script which populates

Re: Problem sorting hash

2007-05-04 Thread Jeff Pang
2007/5/4, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: On Fri, May 04, 2007 at 04:05:46AM -0700, John W. Krahn wrote: > my @toc_keys = sort { $toc{ $a }{ lines } <=> $toc{ $b }{ lines } } keys %toc; I don't think this will do what I want. I want the full hash structure preserved, not an array of the

Re: Problem sorting hash

2007-05-04 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > On Fri, May 04, 2007 at 04:05:46AM -0700, John W. Krahn wrote: > >>my @toc_keys = sort { $toc{ $a }{ lines } <=> $toc{ $b }{ lines } } keys %toc; > > I don't think this will do what I want. I want the full hash structure > preserved, not an array of the keys sorted by

Re: Text Formatters

2007-05-04 Thread John W. Krahn
Mathew Snyder wrote: > > Question regarding the text formatting modules out there. I've found three on > CPAN that seem to have the functionality that I'm looking for but I don't know > which would best suit my needs. The three are Text::Format, Text::Wrapper and > Text::Autoformat. > > I have

Detecting whether a script was called via CGI or the command line

2007-05-04 Thread Nigel Peck
Hi, I have a script which is usually run through CGI, but I want to set it up to be executed by a cron job each day too. Within the script I want to know where it was executed from; CGI or command line/cron job. I'm currently checking @ARGV to do this i.e. if there is data in @ARGV then it

Re: Text Formatters

2007-05-04 Thread Chas Owens
On 5/4/07, Mathew Snyder <[EMAIL PROTECTED]> wrote: Hello all. Question regarding the text formatting modules out there. I've found three on CPAN that seem to have the functionality that I'm looking for but I don't know which would best suit my needs. The three are Text::Format, Text::Wrapper

Re: Detecting whether a script was called via CGI or the command line

2007-05-04 Thread Xavier Noria
On May 4, 2007, at 2:44 PM, Nigel Peck wrote: Within the script I want to know where it was executed from; CGI or command line/cron job. I'm currently checking @ARGV to do this i.e. if there is data in @ARGV then it was called from the command line, but obviously this means there must be co

Re: Problem sorting hash

2007-05-04 Thread leslie . polzer
On Fri, May 04, 2007 at 07:36:57PM +0800, Jeff Pang wrote: > Since you've got the sorted keys,can't you access the full hash? Well, it works this way -- thanks! But I wonder why it's not possible to sort a hash in a more intuitive way... Leslie -- Personal homepage: https://viridian.dnsalia

module namespace

2007-05-04 Thread Beginner
Hi, I am using 2 modules under the GGI tree. If I remove CGI and use CGI::ProgressBar, am I importing all the methods from the CGI module still? My experiments suggest not but I thought I read that @INC will search up the tree. If I do this #use CGI qw/:standard/; use CGI::ProgressBar qw/:s

Re: Problem sorting hash

2007-05-04 Thread Martin Barth
On Fri, 4 May 2007 16:17:35 +0200 [EMAIL PROTECTED] wrote: > On Fri, May 04, 2007 at 07:36:57PM +0800, Jeff Pang wrote: > > > Since you've got the sorted keys,can't you access the full hash? > > Well, it works this way -- thanks! > > But I wonder why it's not possible to sort a hash in a more i

Re: Keeping a process alive..

2007-05-04 Thread Steve Pittman
Tom, Yes this works for my problem*your solution is quick and eloquent*thanks* I would be interested in a reference for PID monitoring for cases where we have more that one *identical* spawned process to consider* Thanks, Steve >>> Tom Phoenix <[EMAIL PROTECTED]> 4/26/2007 6:01 PM >>> On 4/26/

how to write my own makefile?

2007-05-04 Thread carol white
Hi, I searched for a good document on how to write a makefile but didn't find anything satisfactory. I would like to write something similar to what is written below. I want that my_pg.PL takes the specific modules that are specified in PM. note that it is better not to specify the directory of

CGI OO style

2007-05-04 Thread Beginner
Hi Again, I am trying to make a progressbar and am stuck. I might not sure if it my lack of understanding of the differences between the OO style or function-oriented style (to paraphrase the Stein-monster) of writing CGI scripts. Script 1 uses the function style and works albeit with one java

Re: Keeping a process alive..

2007-05-04 Thread Tom Phoenix
On 5/4/07, Steve Pittman <[EMAIL PROTECTED]> wrote: I would be interested in a reference for PID monitoring for cases where we have more that one *identical* spawned process to consider* Maybe you want something like POE? http://search.cpan.org/author/RCAPUTO/POE-0.9989/lib/POE.pm But her

regular expression

2007-05-04 Thread xavier mas
HI list!, I have a file with labels and a small text inside. When this text is different of a pattern text (n, for instance), this label must be deleted, for instance: f(more text)n(more text)mpl... (labels containing something different to 'n' must be deleted of the string.) How can I do thi

Re: regular expression

2007-05-04 Thread Ken Foskey
On Sat, 2007-05-05 at 01:01 +0200, xavier mas wrote: > HI list!, > > I have a file with labels and a small text inside. When this text is > different > of a pattern text (n, for instance), this label must be deleted, for > instance: > > f(more text)n(more text)mpl... > > (labels containing so

Re: Text Formatters

2007-05-04 Thread Mathew Snyder
John W. Krahn wrote: > Mathew Snyder wrote: >> Question regarding the text formatting modules out there. I've found three >> on >> CPAN that seem to have the functionality that I'm looking for but I don't >> know >> which would best suit my needs. The three are Text::Format, Text::Wrapper >> a

Re: Text Formatters

2007-05-04 Thread Chas Owens
On 5/5/07, Mathew Snyder <[EMAIL PROTECTED]> wrote: snip However, when I run the script I get the following error: Format not terminated at ./ticket_lists.pl line 128, at end of line syntax error at ./ticket_lists.pl line 128, at EOF Execution of ./ticket_lists.pl aborted due to compilation error

Re: Text Formatters

2007-05-04 Thread John W. Krahn
Mathew Snyder wrote: > > Thanks for enlightening me about 'format' > > I've run your example code from the command line and got exactly the results > you > did (not that I'd expect to get anything different ;) ). I then attempted to > incorporate the idea into my script: > > foreach my $user (

Re: Text Formatters

2007-05-04 Thread Mathew Snyder
John W. Krahn wrote: > Mathew Snyder wrote: >> Thanks for enlightening me about 'format' >> >> I've run your example code from the command line and got exactly the results >> you >> did (not that I'd expect to get anything different ;) ). I then attempted to >> incorporate the idea into my script

Re: regular expression

2007-05-04 Thread xavier mas
El Sábado 05 Mayo 2007 01:16, Ken Foskey escribió: > On Sat, 2007-05-05 at 01:01 +0200, xavier mas wrote: > > HI list!, > > > > I have a file with labels and a small text inside. When this text is > > different of a pattern text (n, for instance), this label must be > > deleted, for instance: > > >

Re: file lists and diffs?

2007-05-04 Thread Ken Foskey
On Thu, 2007-05-03 at 22:40 -0400, Mathew Snyder wrote: > I have been given a task of installing a piece of backup software, then > tarring > up all of the associated files in order to automate the installation onto > other > machines. The only way I can think of doing this is to do an ls -l on

Problem sorting hash

2007-05-04 Thread leslie . polzer
Hello guys, I can't find the solution for sorting a two-dimensional hash. I'm sure some of you can help me. The first dimension of the hash has filenames in it, the second consists of two keys, 'data' and 'lines'. I want to sort the whole thing by a numerical comparison on 'lines' and tri

Re: file lists and diffs?

2007-05-04 Thread Howard Sherman
I think Rodrick's idea is best. But if the installation process doesn't let you specify an installation directory, and if it doesn't document where it's putting the binaries and config files, then perhaps right after the install you could use the find command in a manner such as the following: # f

Re: Problem sorting hash

2007-05-04 Thread Jeff Pang
2007/5/4, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: Hello guys, I can't find the solution for sorting a two-dimensional hash. I'm sure some of you can help me. The first dimension of the hash has filenames in it, the second consists of two keys, 'data' and 'lines'. I want to sort the whole th

Re: Problem sorting hash

2007-05-04 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > Hello guys, Hello, > I can't find the solution for sorting a two-dimensional hash. > I'm sure some of you can help me. perldoc -q "How do I sort a hash" > The first dimension of the hash has filenames in it, the second > consists of two keys, 'data' and 'lines'. > >

Re: file lists and diffs?

2007-05-04 Thread Mathew Snyder
Thanks for all the input. I've found that the program puts most of its files in one location and only a few in one other. I don't actually need to worry about this anymore as the tar command isn't as long as I thought it would be. Mathew Mathew Snyder wrote: > I have been given a task of instal