Re: Searching in a line



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

.



Relevant Pages

  • Re: Searching in a line
    ... statement is missing ... the trailing semicolon, dude. ... Put neither of those is accepting syntax errors, ...
    (comp.lang.perl.misc)
  • Re: Searching in a line
    ... statement is missing ... the trailing semicolon, dude. ... Put neither of those is accepting syntax errors, ...
    (comp.lang.perl.misc)
  • Re: Searching in a line
    ... statement is missing ... the trailing semicolon, dude. ... Put neither of those is accepting syntax errors, ...
    (comp.lang.perl.misc)
  • Re: Searching in a line
    ... statement is missing ... the trailing semicolon, dude. ... Put neither of those is accepting syntax errors, ...
    (comp.lang.perl.misc)
  • Re: Searching in a line
    ... statement is missing ... the trailing semicolon, dude. ... Put neither of those is accepting syntax errors, ...
    (comp.lang.perl.misc)