Last active
August 29, 2015 13:56
-
-
Save reneeb/8842073 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reneeb@perl-services:~/community$ perl -E ' open $wfh, ">", "large_file.txt"; say $wfh $_ for 0 .. 1_000_000; close $wfh; open my $fh, "<","large_file.txt"; my $line; for ( ;<$fh>; ) { $line = $. } say $.; <STDIN>' | |
1000001 | |
=> 18083 reneeb 20 0 29924 3952 1972 S 0,0 0,1 0:00.50 perl | |
reneeb@perl-services:~/community$ perl -E ' open $wfh, ">", "large_file.txt"; say $wfh $_ for 0 .. 1_000_000; close $wfh; open my $fh, "<","large_file.txt"; my $line; for ( <$fh> ) { $line = $. } say $.; <STDIN>' | |
1000001 | |
=> 18101 reneeb 20 0 174m 148m 1988 S 0,0 1,9 0:00.70 perl | |
reneeb@perl-services:~/community$ perl -E ' open $wfh, ">", "large_file.txt"; say $wfh $_ for 0 .. 1_000_000; close $wfh; open my $fh, "<","large_file.txt"; my $line; while ( <$fh> ) { $line = $. } say $.; <STDIN>' | |
1000001 | |
=> 18107 reneeb 20 0 29924 3952 1972 S 0,0 0,1 0:00.52 perl | |
reneeb@perl-services:~/community$ perl -E ' open $wfh, ">", "large_file.txt"; say $wfh $_ for 0 .. 1_000_000; close $wfh; open my $fh, "<","large_file.txt"; my $line; foreach ( <$fh> ) { $line = $. } say $.; <STDIN>' | |
1000001 | |
=> 18109 reneeb 20 0 174m 148m 1988 S 0,0 1,9 0:00.68 perl | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment