How to close a directory in perl?



How to close a directory in perl?..

Answer / Naman Sharma

To close a directory in Perl, you can use the `closedir()` function. Here's an example:

```perl
my $dir = opendir(my $dh, 'yourdirectory'); # Open the directory
# Do stuff with $dh
closedir($dh); # Close the directory

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

What is Perl?

1 Answers  


Explain socket programming in perl?

1 Answers  


Explain lists ?

1 Answers  


Write a cgi program to show the header part?

1 Answers  


Differentiate between use and require, my and local, for and foreach and exec and system

1 Answers  


what is the difference b/w coldfusion MX 6 and Coldfusion MX 7?

1 Answers  


What is the Common Gateway Interface?

2 Answers  


What is the use of –w?

1 Answers  


Demonstrate subroutines in perl with a simple example.

1 Answers  


What does init 5 and init 0 do?

1 Answers  


what is the difference between require and use in perl?

3 Answers   IBM,


How to renaming a file in perl programming?

1 Answers  


Categories