#!/usr/bin/perl -w
use strict;
=head
this section describes file system;
=cut
=head1
1 test operators
2 built-in subroutines
chdir "directory" or die "$!";
chdir; === cd $HOME;
chmod umask, @filename;
chmod 0777, "./lzc";
chown uid, gid, @files;
@arr = glob "*.pl"; === @arr = <*.pl>; === ls *.pl;
@arr = <FH/*>; # glob;
@arr = <FH>; # read from File Handle;
$name = "FD"; @arr = <$name>; read from File Handle; $name = "FD", @arr = <$name/*>; glob link "src", "dest"; === ln src, dest (hard link) mkdir path, umask; === in shell, mkdir path; chmod umask path; rename oldname, newname; rmdir dir; dir NOT @dir, success if dir is empty; unlink @arr; unlink glob "dir/*"; unlink @_ or die $!; ONLY del files; utime atime, mtime, @files; ctime is always the "now" time;Cannot modified; @t = localtime(timestamp); or we can use it in a readable way: ($sec, $min, $hour, $day, $mon, $year, $wday, $yday, $isdat) = localtime(t); @status = stat|lstat filename; also we can use in a more explicit way: ($dev_id, $inode_id, $mode, $num_of_ln, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat filename;=cutprint "1. ls * /n";print "$_/n" for (<*>); # no need "*"rmdir $_ for glob "./dir*"; # rmdir ONLY remove one empty dir per time;mkdir "./lzcdir";print "2. ls -d * /n";for (glob "*") { print "$_/n" if (-d $_);}print "3. chmod 777 *.pl /n";chmod 0777, <*.pl>; # no need of "" in <>;