Right now, to get to a certain line number, I will open the file, set a for
loop to get a line until line number is reached, and then quit. Is there a
faster way?
ex: for (my $i = 1; $i = $LineNumber; $i++)
{
$Line = $FileHandle-getline;
}
Thanks.
Sean
--
I need a function, like getline, which gets the previous line. I'm thinking
I've read somewhere how to do this, but I can't remember where. Anyone
know?
Sean
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I think, when you use system(), that you're expecting something it's not
going to give you. I found this out trying to use grep. I said
my $Value = system(grep -l somevalue somefile)
and the return was always 0. I found, though, that instead of using system,
use the '`' character:
Where can I find the Tie module on cpan? I'm not sure where to look for.
My perl distribution doesn't have it loaded, and my system administrator is
gone.
Sean
-Original Message-
From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 27, 2002 6:41 AM
To: [EMAIL
never mind, i found it.
-Original Message-
From: Rowe, Sean D. [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 27, 2002 8:40 AM
To: Janek Schleicher; [EMAIL PROTECTED]
Subject: RE: Faster way to go to a line in a file
Where can I find the Tie module on cpan? I'm not sure where
I have a string that is delimited by the '|' character. I pass this string
to a sub, and within the sub I break it apart using split
my @Array = split(/|/, $_[1]);
When I print out the array, I find that split has broken the string apart
character by character, and not by the
I see. Thanks!
Sean
-Original Message-
From: Rowe, Sean D. [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 10:53 AM
To: [EMAIL PROTECTED]
Subject: Problem with split
I have a string that is delimited by the '|' character. I pass this string
to a sub, and within
how about using a label?
-Original Message-
From: chad kellerman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 9:19 AM
To: Perl beginners
Subject: Don't know how to title this email.
Hello everyone,
I am sure this is a newbie question but I have never had to do this
I know it's a reference to a hash. What I don't know is why it's printing
out like this. I have hash values that I need to print out, but not in any
order, so I put each hash value that I want to print in a join statement in
the order I need them. The really strange part is that I also have a
I'm having a very strange problem that I'm hoping someone has come across
before. I'm using a hash to collect some field values. I want to write the
hash values to file, and I want them delimited by the '|' character, so I
use
my $LineToWrite = join('|', hash_var_1, ..., hash_var_n) .
( this message was accidentally submitted under the subject RE: getpid?
Sorry )
I'm having a very strange problem that I'm hoping someone has come across
before. I'm using a hash to collect some field values. I want to write the
hash values to file, and I want them delimited by the '|'
11 matches
Mail list logo