Re: Searching in a line



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

.



Relevant Pages

  • Re: Searching in a line
    ... the trailing semicolon, dude. ... it skips two lines and returns to the prompt. ... Ok I got it working by removing the $log in the my val line, ...
    (comp.lang.perl.misc)
  • Re: Time To Find Out Who My Real Friends Are...
    ... Then resend the list to 15 more people removing the top ... That's called a Fonzi scheme. ... mr dude ...
    (alt.sports.football.pro.ne-patriots)