Find knowledge base article(s) by searching for keywords in the title e.g. type linux in the search box below
Find knowledge base article(s) by browsing the subject categories of articles
Technology quick references, cheatsheets, user manuals etc.
Shop Online through ShopifyLite
Tutorials on various IT applications.
Search Title    (UL:0 |SS:f)

Scripting >> Perl >> How to work with directories



1.   Opening directories
     $indir = "somedirname";
     opendir(indirhandle,$indir);
 
2.   Listing directories
     $indir = "somedirname";
     opendir(indirhandle,$indir);
     @files = grep{!/^\./} readdir(indirhandle); #remove dots by grep
     foreach $file (@files) { print "$file\n"; }

3.   Changing directories

     In windows, to change to c:\apache and in Unix, to change to /apache

     chdir("/apache");






[ © 2008-2021 myfaqbase.com - A property of WPDC Consulting ]