Help for this page
$ perl -wnle 'push @x, $_; if(@x>=2) {print "@x"; shift @x}' input.txt Hello I ... $ perl -wnle 'push @x, $_; if(@x>=3) {print "@x"; shift @x}' input.txt Hello I am I am happy
#!/usr/bin/env perl use warnings; ... for my $i (0..@array-$WINSIZE) { print @array[$i..$i+$WINSIZE-1]; }
$ perl window.pl input.txt 2 Hello I I am am happy