#!/usr/bin/perl use warnings; use strict; open( DIR, "dir *.* |" ) or die( "Cannot open dir pipe: $!" ); open( MORE, "| more" ) or die( "Cannot open more: $!" ); while ( <DIR> ) { print( MORE ); } close( DIR ) or die( "Cannot close DIR: $!" ); close( MORE ) or die( "Cannot close MORE: $!" );