RE: Seek wrap reformat routine

2007-02-09 Thread Helliwell, Kim
If you're on a Unix system, just use the 'fold' or 'fmt' commands in a pipe open. Kim Helliwell LSI Logic, Inc 408 433 8475 [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 08, 2007 8:11 AM To: beginners@perl.org Subject:

RE: error in execution

2007-02-09 Thread Helliwell, Kim
That would be one way. Alternatively, if you know you already have List/MoreUtils.pm somewhere on your system, you could simply add its location to @INC in the script itself (as, say, the first line). You have to decide for yourself which approach is the more portable in your situation... Kim

RE: declaring a zero size hash

2006-12-12 Thread Helliwell, Kim
I think you need to do: my %loginhash = {}; Kim Helliwell LSI Logic Corporation Work: 408 433 8475 Cell: 408 832 5365 [EMAIL PROTECTED] Please Note: My email address changed to [EMAIL PROTECTED] on Oct 14. The old email address ([EMAIL PROTECTED]) will stop working after Jan 15, 2007. Please

extracting common substrings...

2006-12-12 Thread Helliwell, Kim
Is there a function (perhaps in a library module) that would take two strings and return the common substring (if any) contained in the arguments? I've been looking for such a beast on CPAN, but no luck so far. If not, I guess I have to write it myself... Any help appreciated. Kim

RE: reading a file

2006-10-20 Thread Helliwell, Kim
Try using: my @lines = IN; I don't think you need the split, and it's goofing things up. I know the above works, because I use it all the time. Kim Helliwell LSI Logic Corporation Work: 408 433 8475 Cell: 408 832 5365 [EMAIL PROTECTED] Please Note: My email address will change to [EMAIL

RE: reading a file

2006-10-20 Thread Helliwell, Kim
Another way: foreach $line (IN) { ... } if you don't want to slurp all the lines into an array (to save memory). Kim Helliwell LSI Logic Corporation Work: 408 433 8475 Cell: 408 832 5365 [EMAIL PROTECTED] Please Note: My email address will change to [EMAIL PROTECTED] on Oct 14. The old

Non-blocking child process

2006-10-19 Thread Helliwell, Kim
I'm not even sure the title is the appropriate terminology. What I am trying to do is fork a process that receives data from the parent, but, once the data is received, the parent can go on and do whatever it wants (and likewise the child). How do I arrange for the child process to be detached

RE: Non-blocking child process

2006-10-19 Thread Helliwell, Kim
-Original Message- From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Thursday, October 19, 2006 2:10 AM To: Helliwell, Kim; beginners@perl.org Subject: Re: Non-blocking child process Hello, I changed your codes like below: use strict; for (my $i=0;$i2;++$i) { my

RE: Non-deprecated way to capture array length

2006-10-09 Thread Helliwell, Kim
-Original Message- From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 7:48 AM To: beginners Subject: Re: Non-deprecated way to capture array length I needed to find out the length of an array and did it by referencing the array in scalar context. However, use

RE: Non-deprecated way to capture array length

2006-10-09 Thread Helliwell, Kim
-Original Message- From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Monday, October 09, 2006 8:25 AM To: beginners Subject: RE: Non-deprecated way to capture array length -- Perhaps I'm behind the times here, but what's wrong with: my $num = $#array ?? [EMAIL PROTECTED] ~]$ perl

Bad scoping? Bad prototyping?

2006-10-09 Thread Helliwell, Kim
The following test script fails to compile, complaining that there are not enough arguments in the call to sub2. #!/bin/perl sub1(Hello, ); sub1(world\n); sub sub2($str) { print $str; } sub sub1($str) { sub2($str) } The basic problem is that I'm trying to call