Re: Searching in a line
- From: "Jürgen Exner" <jurgenex@xxxxxxxxxxx>
- Date: Thu, 30 Aug 2007 15:50:41 GMT
lerameur wrote:
On Aug 30, 8:28 am, "Jürgen Exner" <jurge...@xxxxxxxxxxx> wrote:
lerameur wrote:
my $log = 'file.txt';
open my $fh, '<', $log or die "cannot open '$log': $!\n";
while (<$fh>) {
my $val =(split( /,/,$log))[3]
print $val, "\n";
BUt there is no output, when I type >./program_name.pl
it skips two lines and returns to the prompt.
That's odd. You should at least have gotten a warning that $val is
undefined. Aren't you using warnings and strict?
Anyway, you are splitting $log which just contains 'file.txt'. Nothing to
split on a comma there. Use $_ instead.
Oh, and BTW: we heard you the first time. No need to flood the NG with a
dozen identical posts.
Oh, and BTW2:
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
jue
.
- References:
- Searching in a line
- From: lerameur
- Re: Searching in a line
- From: Jürgen Exner
- Re: Searching in a line
- From: lerameur
- Re: Searching in a line
- From: Peter Makholm
- Re: Searching in a line
- From: lerameur
- Re: Searching in a line
- From: Jürgen Exner
- Re: Searching in a line
- From: lerameur
- Searching in a line
- Prev by Date: Re: Appending a character to a field
- Next by Date: Re: Appending a character to a field
- Previous by thread: Re: Searching in a line
- Next by thread: Re: Searching in a line
- Index(es):
Relevant Pages
|