in reply to Going to a specific line in a file.

You can use the Tie::File module

use strict; use warnings; use Tie::File; my $file = shift @ARGV; tie my @arr, 'Tie::File', $file; #Update: (thanks Corion and JohnGG) #print $arr[15]."\n"; print $arr[14]."\n";

citromatik

Replies are listed 'Best First'.
Re^2: Going to a specific line in a file.
by johngg (Canon) on Jun 13, 2007 at 14:17 UTC
    print $arr[15]."\n";

    <nit>That is the 16th line.</nit>

    Also, why not just interpolate into the string rather than using concatenation?

    print qq{$arr[14]\n};

    Cheers,

    JohnGG