#!/usr/bin/perl use warnings; use strict; my @files = glob "*"; print join ("\n", @files),"\n"; open (my $IN, '-|', 'dir') or die "$!"; while (<$IN>) { print; }