Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
PerlIO::dir(3)	      User Contributed Perl Documentation	PerlIO::dir(3)

NAME
       PerlIO::dir - Reads directories

SYNOPSIS
	       open my $dirh, '<:dir', '.';

	       binmode $dirh, ':encoding(cp932)'; # OK

	       my @dirs	= <$dirh>; # added "\n"	at the end of the name
	       chomp @dirs; # if necessary

DESCRIPTION
       "PerlIO::dir" provides an interface to directory	reading	functions,
       "opendir()", "readdir()", "rewinddir" and "closedir()".

       However,	there is an important difference between ":dir"	and Perl's
       "readdir()". This layer appends a newline code, "\n", to	the end	of the
       name, because "readline()" requires input separators. Call "chomp()" if
       necessary.

       You can use "seek($dirh,	0, 0)" for "rewinddir()".

SEE ALSO
       "opendir" in perlfunc, "readdir"	in perlfunc, "rewinddir" in perlfunc,
       "closedir" in perlfunc.

       PerlIO::Util.

AUTHOR
       Goro Fuji (ex a3/4e) <gfuji (at)	cpan.org>

LICENSE	AND COPYRIGHT
       Copyright (c) 2008, Goro	Fuji <gfuji (at) cpan.org>. Some rights
       reserved.

       This module is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

perl v5.32.0			  2011-05-25			PerlIO::dir(3)

NAME | SYNOPSIS | DESCRIPTION | SEE ALSO | AUTHOR | LICENSE AND COPYRIGHT

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=PerlIO::dir&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help