Re: Searching in a line
- From: lerameur <lerameur@xxxxxxxxx>
- Date: Thu, 30 Aug 2007 07:28:54 -0700
On Aug 30, 9:35 am, lerameur <leram...@xxxxxxxxx> 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";
}
close $fh;
getting compilation error.
Well, the indentation gives it away: the my $val=... statement is missing
the trailing semicolon, dude.
New to perl, different then C and Basic
Put neither of those is accepting syntax errors, either.
jue
Indeed...
not getting any errors.
BUt there is no output, when I type >./program_name.pl
it skips two lines and returns to the prompt.
k
Ok I got it working by removing the $log in the my val line, also
removing the my's
k
.
- Follow-Ups:
- Re: Searching in a line
- From: Uri Guttman
- Re: Searching in a line
- 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: Searching in a line
- Next by Date: Memory leaks with SOAP Lite
- Previous by thread: Re: Searching in a line
- Next by thread: Re: Searching in a line
- Index(es):
Relevant Pages
|
|