Differences

This shows you the differences between two versions of the page.

Link to this comparison view

programming:perl:read_file [2015/03/31 22:45] (current)
Line 1: Line 1:
 +====== Read file ======  
 +  
 +===== Read last X lines =====  
 +  
 +==== Using bash tail ====  
 +  
 +<code perl>  
 +open my $fh, "-|", "tail", "-3", @ARGV or die "$0: cannot read file: $!";  
 +  
 +print while <$fh>;  
 +</code> 
Navigation
Print/export
Toolbox