Re: First line of input file not accessible.

2024-07-17 Thread David Precious
On Wed, 17 Jul 2024 17:41:22 +1000 Peter West via beginners wrote: [...] > $ cat print_file > #!/usr/bin/perl -n > while (<>) { > print "$. $_"; > } > exit; [...] > What happened to line 1? It's eaten by the `while (<>) { ... }` loop that is wrapped around your program because you used `-n` i

First line of input file not accessible.

2024-07-17 Thread Peter West via beginners
$ uname -a Darwin Rosie.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103 arm64 $ locale LANG="en_AU.UTF-8" LC_COLLATE="en_AU.UTF-8" LC_CTYPE="en_AU.UTF-8" LC_MESSAGES="en_AU.UTF-8" LC_MONETARY="en_AU.UTF-8" LC_NUMERIC="en_AU.UTF-8