Search Results

Search found 2 results on 1 pages for 'robjez'.

Page 1/1 | 1 

  • How can I count paragraphs in text file using Perl?

    - by robjez
    I need to create Perl code which allows counting paragraphs in text files. I tried this and doesn't work: open(READFILE, "<$filename") or die "could not open file \"$filename\":$!"; $paragraphs = 0; my($c); while($c = getc(READFILE)) { if($C ne"\n") { $paragraphs++; } } close(READFILE); print("Paragraphs: $paragraphs\n");

    Read the article

  • counting paragraphs in text file

    - by robjez
    I need to create perl code which allows counting paragraphs in text files. I tried this and doesn't work: open(READFILE, "<$filename") or die "could not open file \"$filename\":$!"; $paragraphs = 0; my($c); while($c = getc(READFILE)) { if($C ne"\n") { $paragraphs++; } } close(READFILE); print("Paragraphs: $paragraphs\n");

    Read the article

1