Perl functions references-readdir Function - Perl Scripting

What is Perl readdir function?

Description

This function returns the next directory entry from the directory associated with DIRHANDLE in a scalar context. In a list context, it returns all of the remaining directory entries in DIRHANDLE.

Syntax

Following is the simple syntax for this function −

Return Value

This function returns the next directory entry from the directory associated with DIRHANDLE in a scalar context. In a list context, returns all of the remaining directory entries in DIRHANDLE.

Example

Following is the example code showing its basic usage −
When above code is executed, it produces the following result −

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Perl Scripting Topics