how can i ammend the above code? thanks#!/usr/bin/perl -w use strict; my $n_lines = 10; my $file = 'test'; my @lines; open(FILE, $file)|| die "Can't $!"; for (1 .. $n_lines) { push @lines, scalar <FILE>; } close FILE; print @lines;
In reply to print lines from a file by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |