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: Wonderful!
    ... "Southern at Heart" wrote in ... Note that you don't need a trailing semicolon in a SQL statement, and Access likes to add lots of unnecessary parentheses when you build queries in the design grid. ... Removing strings from any part of a field is simpler than removing them from just the end of the field, as you can just use the Replace function, and don't need to loop until they're all gone. ... Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.modulesdaovba)
  • 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)