in reply to Execute Interactive commands
And an example run is:#!/usr/bin/perl use warnings; use strict; print "Enter a search pattern.\n"; my $info=<STDIN>; chomp($info); if ( $info =~ m/\w+/ ) { system("dir $info"); } else { print "You didn\'t enter text.\n"; }
C:\Info>perl search.pl Enter a search pattern. why* Volume in drive C has no label. Volume Serial Number is ACCF-791E Directory of C:\Info 02/25/2008 07:40 PM 175 whydont.pl 1 File(s) 175 bytes 0 Dir(s) 51,114,610,688 bytes free
|
|---|