That's 'cause you have put the question inside the foreach loop:
# get all files
foreach $file (@allfiles){
$filetoopen = $path ."/" .$file;
# filter to check the type of file
print "Enter the type of extension:";
my $ext=;
Btw, it would be easier to just use the fileglob operator from the start
(
Hi,
I'm trying to repeatedly call some external program from Perl using
backticks. This works fine for ~30 rounds, but then the program stops
doing anything, with a process hanging around (apparently Perl
ignores its dead child?). A simple example is this:
#!/usr/bin/perl
for (my $j=0;$j<1000