Friday, 24 January 2020

What is the opendir() function in Perl?


opendir  function is used for reading the content of a particular folder.

Method 1:


opendir(DIRHANDLE,"/some director/path") or die "Can't open directory";

Method 2:


opendir DIRHANDLE, '/some diretory/path' or die "Can't open directory";


Method 3:


@contents = glob ('/some diretory/path*');

Method 4:


@contents = </some diretory/path*>;

kaavannan perl blogspot

Labels: , , , , , , , ,

0 Comments:

Post a Comment

Note: only a member of this blog may post a comment.

<< Home