Re: Searching in a line
- From: lerameur <lerameur@xxxxxxxxx>
- Date: Thu, 30 Aug 2007 05:00:25 -0700
On Aug 30, 12:14 am, Peter Makholm <pe...@xxxxxxxxxxx> wrote:
lerameur <leram...@xxxxxxxxx> writes:
Hi
either way I am getting these error messages:
./spam2: my: command not found
./spam2: line 6: unexpected EOF while looking for matching `"'
./spam2: line 10: syntax error: unexpected end of file
Looks like you're trying to use bash af perl interpreter. That
wouldn't work. Did you forgot the #!-line?
//Makholm
Thanks fo ryour help
I re-wrote the program like you said without #! line.. Doh
here your/my program: (the file.txt file i sin the same directory with
two lines)
12,45,7,435,435,42342,2432;
243,454,324,45,2,4;
~
the program :
#!/usr/bin/perl
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.
New to perl, different then C and Basic
.
- Follow-Ups:
- Re: Searching in a line
- From: Jürgen Exner
- 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
- Searching in a line
- Prev by Date: Re: 2D array of real numbers
- Next by Date: Re: Searching in a line
- Previous by thread: Re: Searching in a line
- Next by thread: Re: Searching in a line
- Index(es):
Relevant Pages
|