View Single Post
  #4 (permalink)  
Old November 30th, 2010, 08:38 AM
chorny chorny is offline
Authorized User
Points: 93, Level: 1
Points: 93, Level: 1 Points: 93, Level: 1 Points: 93, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2009
Location: Moldova
Posts: 23
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Try this program:

Code:
use strict;
use warnings;
open (my $h_zsk_bestanden_4, '<', "J:\\m_20_zsk\\m_02_bestanden\\zsk_bestanden_4.txt ") or die ("Unable to open zsk_bestanden_4.txt");
while (my $naam_meerling = <$h_zsk_bestanden_4>)
{
  chomp $naam_meerling;
  my $bestand_1 = $naam_meerling;
  if (-e $bestand_1) {
    unlink $bestand_1 or print "File could not be removed\n\n";
  } else {
    warn "$bestand_1 does not exist";
  }
}
Reply With Quote