Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Loading a part of the file to array using Tie::File (updated)

by haukex (Archbishop)
on Nov 21, 2017 at 14:56 UTC ( [id://1203889]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Tie::File;
    tie my @array, 'Tie::File', $filename or die $!;
    ...
    while (defined( my $line = $array[$l] )) {
        print "<$line>\n";
    } continue { $l++ }
    
  2. or download this
    open my $fh, '<', $filename or die "$filename: $!";
    scalar <$fh> for 1..9;  # skip 9 lines
    ...
        print "<$_>\n";
    }
    close $fh;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1203889]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-24 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found