
davorg
Thaumaturge
/ Moderator
Oct 29, 2004, 6:45 AM
Post #2 of 2
(654 views)
|
|
Re: [coolkille] die after open
[In reply to]
|
Can't Post
|
|
(I've moved this to the beginners forum as it's really not an advanced question) If you don't want your program to die, then don't call the "die" function. I suggest you call "warn" instead. Along with a few other improvements, your code will then look like this:
while () { foreach my $file (@ListA) { print "\nProcessing: $file"; @tmp = split(m|/|, $file); open(INPUT, $file) || warn "Can't open $file: $!\n"; } } -- Dave Cross, Perl Hacker, Trainer and Writer http://www.dave.org.uk/ Get more help at Perl Monks
|