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:
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
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
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
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
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
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
-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
-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
-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
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
11 matches
Mail list logo