Big5
view release on metacpan or search on metacpan
lib/Ebig5.pm view on Meta::CPAN
}
my $dummy_for_underline_cache = -B $fh;
sysseek $fh, $systell, 0;
}
else {
if (-d $_ or -d "$_/.") {
return wantarray ? (undef,@_) : undef;
}
$fh = gensym();
if (_open_r($fh, $_)) {
}
else {
return wantarray ? (undef,@_) : undef;
}
if (sysread $fh, my $block, 512) {
if ($block =~ /[\000\377]/oxms) {
$B = 1;
}
elsif (($block =~ tr/\000-\007\013\016-\032\034-\037\377//) * 10 > CORE::length $block) {
$B = 1;
}
}
# 0 byte or eof
else {
$B = 1;
}
my $dummy_for_underline_cache = -B $fh;
close($fh) or die "Can't close file: $_: $!";
}
return wantarray ? ($B,@_) : $B;
}
#
# Big5 file test -M expr
#
sub Ebig5::M(;*@) {
local $_ = shift if @_;
croak 'Too many arguments for -M (Ebig5::M)' if @_ and not wantarray;
if ($_ eq '_') {
return wantarray ? (-M _,@_) : -M _;
}
elsif (defined fileno(my $fh = qualify_to_ref $_)) {
return wantarray ? (-M $fh,@_) : -M $fh;
}
elsif (-e $_) {
return wantarray ? (-M _,@_) : -M _;
}
elsif (_MSWin32_5Cended_path($_)) {
if (-d "$_/.") {
return wantarray ? (-M _,@_) : -M _;
}
else {
my $fh = gensym();
if (_open_r($fh, $_)) {
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = CORE::stat $fh;
close($fh) or die "Can't close file: $_: $!";
my $M = ($^T - $mtime) / (24*60*60);
return wantarray ? ($M,@_) : $M;
}
}
}
return wantarray ? (undef,@_) : undef;
}
#
# Big5 file test -A expr
#
sub Ebig5::A(;*@) {
local $_ = shift if @_;
croak 'Too many arguments for -A (Ebig5::A)' if @_ and not wantarray;
if ($_ eq '_') {
return wantarray ? (-A _,@_) : -A _;
}
elsif (defined fileno(my $fh = qualify_to_ref $_)) {
return wantarray ? (-A $fh,@_) : -A $fh;
}
elsif (-e $_) {
return wantarray ? (-A _,@_) : -A _;
}
elsif (_MSWin32_5Cended_path($_)) {
if (-d "$_/.") {
return wantarray ? (-A _,@_) : -A _;
}
else {
my $fh = gensym();
if (_open_r($fh, $_)) {
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = CORE::stat $fh;
close($fh) or die "Can't close file: $_: $!";
my $A = ($^T - $atime) / (24*60*60);
return wantarray ? ($A,@_) : $A;
}
}
}
return wantarray ? (undef,@_) : undef;
}
#
# Big5 file test -C expr
#
sub Ebig5::C(;*@) {
local $_ = shift if @_;
croak 'Too many arguments for -C (Ebig5::C)' if @_ and not wantarray;
if ($_ eq '_') {
return wantarray ? (-C _,@_) : -C _;
}
elsif (defined fileno(my $fh = qualify_to_ref $_)) {
return wantarray ? (-C $fh,@_) : -C $fh;
}
elsif (-e $_) {
return wantarray ? (-C _,@_) : -C _;
}
elsif (_MSWin32_5Cended_path($_)) {
if (-d "$_/.") {
return wantarray ? (-C _,@_) : -C _;
}
else {
my $fh = gensym();
if (_open_r($fh, $_)) {
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = CORE::stat $fh;
close($fh) or die "Can't close file: $_: $!";
my $C = ($^T - $ctime) / (24*60*60);
return wantarray ? ($C,@_) : $C;
}
}
}
return wantarray ? (undef,@_) : undef;
}
#
# Big5 stacked file test $_
#
sub Ebig5::filetest_ {
my $filetest = substr(pop @_, 1);
unless (CORE::eval qq{Ebig5::${filetest}_}) {
return '';
}
for my $filetest (CORE::reverse @_) {
unless (CORE::eval qq{ $filetest _ }) {
return '';
}
}
return 1;
}
#
# Big5 file test -r $_
#
sub Ebig5::r_() {
if (-e $_) {
return -r _ ? 1 : '';
}
elsif (_MSWin32_5Cended_path($_)) {
if (-d "$_/.") {
return -r _ ? 1 : '';
}
else {
my $fh = gensym();
if (_open_r($fh, $_)) {
my $r = -r $fh;
close($fh) or die "Can't close file: $_: $!";
return $r ? 1 : '';
}
}
}
# 10.10. Returning Failure
# in Chapter 10. Subroutines
# of ISBN 0-596-00313-7 Perl Cookbook, 2nd Edition.
# (and so on)
# 2010-01-26 The difference of "return;" and "return undef;"
# http://d.hatena.ne.jp/gfx/20100126/1264474754
#
# "Perl Best Practices" recommends to use "return;"*1 to return nothing, but
# it might be wrong in some cases. If you use this idiom for those functions
# which are expected to return a scalar value, e.g. searching functions, the
lib/Ebig5.pm view on Meta::CPAN
else {
$T = 1;
}
my $dummy_for_underline_cache = -T $fh;
close($fh) or die "Can't close file: $_: $!";
return $T;
}
#
# Big5 file test -B $_
#
sub Ebig5::B_() {
my $B = '';
if (-d $_ or -d "$_/.") {
return undef;
}
my $fh = gensym();
if (_open_r($fh, $_)) {
}
else {
return undef;
}
if (sysread $fh, my $block, 512) {
if ($block =~ /[\000\377]/oxms) {
$B = 1;
}
elsif (($block =~ tr/\000-\007\013\016-\032\034-\037\377//) * 10 > CORE::length $block) {
$B = 1;
}
}
# 0 byte or eof
else {
$B = 1;
}
my $dummy_for_underline_cache = -B $fh;
close($fh) or die "Can't close file: $_: $!";
return $B;
}
#
# Big5 file test -M $_
#
sub Ebig5::M_() {
if (-e $_) {
return -M _;
}
elsif (_MSWin32_5Cended_path($_)) {
if (-d "$_/.") {
return -M _;
}
else {
my $fh = gensym();
if (_open_r($fh, $_)) {
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = CORE::stat $fh;
close($fh) or die "Can't close file: $_: $!";
my $M = ($^T - $mtime) / (24*60*60);
return $M;
}
}
}
return undef;
}
#
# Big5 file test -A $_
#
sub Ebig5::A_() {
if (-e $_) {
return -A _;
}
elsif (_MSWin32_5Cended_path($_)) {
if (-d "$_/.") {
return -A _;
}
else {
my $fh = gensym();
if (_open_r($fh, $_)) {
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = CORE::stat $fh;
close($fh) or die "Can't close file: $_: $!";
my $A = ($^T - $atime) / (24*60*60);
return $A;
}
}
}
return undef;
}
#
# Big5 file test -C $_
#
sub Ebig5::C_() {
if (-e $_) {
return -C _;
}
elsif (_MSWin32_5Cended_path($_)) {
if (-d "$_/.") {
return -C _;
}
else {
my $fh = gensym();
if (_open_r($fh, $_)) {
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = CORE::stat $fh;
close($fh) or die "Can't close file: $_: $!";
my $C = ($^T - $ctime) / (24*60*60);
return $C;
}
}
}
return undef;
}
#
# Big5 path globbing (with parameter)
#
sub Ebig5::glob($) {
if (wantarray) {
my @glob = _DOS_like_glob(@_);
for my $glob (@glob) {
$glob =~ s{ \A (?:\./)+ }{}oxms;
}
return @glob;
}
else {
my $glob = _DOS_like_glob(@_);
$glob =~ s{ \A (?:\./)+ }{}oxms;
return $glob;
}
}
#
# Big5 path globbing (without parameter)
#
sub Ebig5::glob_() {
if (wantarray) {
my @glob = _DOS_like_glob();
for my $glob (@glob) {
$glob =~ s{ \A (?:\./)+ }{}oxms;
}
return @glob;
}
else {
my $glob = _DOS_like_glob();
$glob =~ s{ \A (?:\./)+ }{}oxms;
return $glob;
}
}
#
# Big5 path globbing via File::DosGlob 1.10
#
# Often I confuse "_dosglob" and "_doglob".
# So, I renamed "_dosglob" to "_DOS_like_glob".
#
my %iter;
my %entries;
sub _DOS_like_glob {
# context (keyed by second cxix argument provided by core)
my($expr,$cxix) = @_;
lib/Ebig5.pm view on Meta::CPAN
field, not all the rest of the fields. In time-critical applications, it behooves
you not to split into more fields than you really need. (The trouble with
powerful languages it that they let you be powerfully stupid at times.)
We said earlier that the separators are not returned, but if the /pattern/
contains parentheses, then the substring matched by each pair of parentheses is
included in the resulting list, interspersed with the fields that are ordinarily
returned. Here's a simple example:
Ebig5::split(/([-,])/, "1-10,20");
which produces the list value:
(1, "-", 10, ",", 20)
With more parentheses, a field is returned for each pair, even if some pairs
don't match, in which case undefined values are returned in those positions. So
if you say:
Ebig5::split(/(-)|(,)/, "1-10,20");
you get the value:
(1, "-", undef, 10, undef, ",", 20)
The /pattern/ argument may be replaced with an expression to specify patterns
that vary at runtime. As with ordinary patterns, to do run-time compilation only
once, use /$variable/o.
As a special case, if the expression is a single space (" "), the subroutine
splits on whitespace just as Ebig5::split with no arguments does. Thus,
Ebig5::split(" ") can be used to emulate awk's default behavior. In contrast,
Ebig5::split(/ /) will give you as many null initial fields as there are
leading spaces. (Other than this special case, if you supply a string instead
of a regular expression, it'll be interpreted as a regular expression anyway.)
You can use this property to remove leading and trailing whitespace from a
string and to collapse intervaning stretches of whitespace into a single
space:
$string = join(" ", Ebig5::split(" ", $string));
The following example splits an RFC822 message header into a hash containing
$head{'Date'}, $head{'Subject'}, and so on. It uses the trick of assigning a
list of pairs to a hash, because separators altinate with separated fields, It
users parentheses to return part of each separator as part of the returned list
value. Since the split pattern is guaranteed to return things in pairs by virtue
of containing one set of parentheses, the hash assignment is guaranteed to
receive a list consisting of key/value pairs, where each key is the name of a
header field. (Unfortunately, this technique loses information for multiple lines
with the same key field, such as Received-By lines. Ah well)
$header =~ s/\n\s+/ /g; # Merge continuation lines.
%head = ("FRONTSTUFF", Ebig5::split(/^(\S*?):\s*/m, $header));
The following example processes the entries in a Unix passwd(5) file. You could
leave out the chomp, in which case $shell would have a newline on the end of it.
open(PASSWD, "/etc/passwd");
while (<PASSWD>) {
chomp; # remove trailing newline.
($login, $passwd, $uid, $gid, $gcos, $home, $shell) =
Ebig5::split(/:/);
...
}
Here's how process each word of each line of each file of input to create a
word-frequency hash.
while (<>) {
for my $word (Ebig5::split()) {
$count{$word}++;
}
}
The inverse of Ebig5::split is join, except that join can only join with the
same separator between all fields. To break apart a string with fixed-position
fields, use unpack.
Processing long $string (over 32766 octets) requires Perl 5.010001 or later.
=item * Transliteration
$tr = Ebig5::tr($variable,$bind_operator,$searchlist,$replacementlist,$modifier);
$tr = Ebig5::tr($variable,$bind_operator,$searchlist,$replacementlist);
This is the transliteration (sometimes erroneously called translation) operator,
which is like the y/// operator in the Unix sed program, only better, in
everybody's humble opinion.
This subroutine scans a Big5 string character by character and replaces all
occurrences of the characters found in $searchlist with the corresponding character
in $replacementlist. It returns the number of characters replaced or deleted.
If no Big5 string is specified via =~ operator, the $_ variable is translated.
$modifier are:
---------------------------------------------------------------------------
Modifier Meaning
---------------------------------------------------------------------------
c Complement $searchlist.
d Delete found but unreplaced characters.
s Squash duplicate replaced characters.
r Return transliteration and leave the original string untouched.
---------------------------------------------------------------------------
To use with a read-only value without raising an exception, use the /r modifier.
print Ebig5::tr('bookkeeper','=~','boep','peob','r'); # prints 'peekkoobor'
=item * Chop string
$chop = Ebig5::chop(@list);
$chop = Ebig5::chop();
$chop = Ebig5::chop;
This subroutine chops off the last character of a string variable and returns the
character chopped. The Ebig5::chop subroutine is used primary to remove the newline
from the end of an input recoed, and it is more efficient than using a
substitution. If that's all you're doing, then it would be safer to use chomp,
since Ebig5::chop always shortens the string no matter what's there, and chomp
is more selective. If no argument is given, the subroutine chops the $_ variable.
lib/Ebig5.pm view on Meta::CPAN
This subroutine is internal use to m/ /, s/ / /, split / /, and qr/ /.
=item * Make character
$chr = Ebig5::chr($code);
$chr = Ebig5::chr_;
This subroutine returns a programmer-visible character, character represented by
that $code in the character set. For example, Ebig5::chr(65) is "A" in either
ASCII or Big5, not Unicode. For the reverse of Ebig5::chr, use Big5::ord.
=item * File test subroutine Ebig5::X
The following all subroutines function when the pathname ends with chr(0x5C) on
MSWin32.
A file test subroutine is a unary function that takes one argument, either a
filename or a filehandle, and tests the associated file to see whether something
is true about it. If the argument is omitted, it tests $_. Unless otherwise
documented, it returns 1 for true and "" for false, or the undefined value if
the file doesn't exist or is otherwise inaccessible. Currently implemented file
test subroutines are listed in:
Available in MSWin32, MacOS, and UNIX-like systems
------------------------------------------------------------------------------
Subroutine and Prototype Meaning
------------------------------------------------------------------------------
Ebig5::r(*), Ebig5::r_() File or directory is readable by this (effective) user or group
Ebig5::w(*), Ebig5::w_() File or directory is writable by this (effective) user or group
Ebig5::e(*), Ebig5::e_() File or directory name exists
Ebig5::x(*), Ebig5::x_() File or directory is executable by this (effective) user or group
Ebig5::z(*), Ebig5::z_() File exists and has zero size (always false for directories)
Ebig5::f(*), Ebig5::f_() Entry is a plain file
Ebig5::d(*), Ebig5::d_() Entry is a directory
------------------------------------------------------------------------------
Available in MacOS and UNIX-like systems
------------------------------------------------------------------------------
Subroutine and Prototype Meaning
------------------------------------------------------------------------------
Ebig5::R(*), Ebig5::R_() File or directory is readable by this real user or group
Same as Ebig5::r(*), Ebig5::r_() on MacOS
Ebig5::W(*), Ebig5::W_() File or directory is writable by this real user or group
Same as Ebig5::w(*), Ebig5::w_() on MacOS
Ebig5::X(*), Ebig5::X_() File or directory is executable by this real user or group
Same as Ebig5::x(*), Ebig5::x_() on MacOS
Ebig5::l(*), Ebig5::l_() Entry is a symbolic link
Ebig5::S(*), Ebig5::S_() Entry is a socket
------------------------------------------------------------------------------
Not available in MSWin32 and MacOS
------------------------------------------------------------------------------
Subroutine and Prototype Meaning
------------------------------------------------------------------------------
Ebig5::o(*), Ebig5::o_() File or directory is owned by this (effective) user
Ebig5::O(*), Ebig5::O_() File or directory is owned by this real user
Ebig5::p(*), Ebig5::p_() Entry is a named pipe (a "fifo")
Ebig5::b(*), Ebig5::b_() Entry is a block-special file (like a mountable disk)
Ebig5::c(*), Ebig5::c_() Entry is a character-special file (like an I/O device)
Ebig5::u(*), Ebig5::u_() File or directory is setuid
Ebig5::g(*), Ebig5::g_() File or directory is setgid
Ebig5::k(*), Ebig5::k_() File or directory has the sticky bit set
------------------------------------------------------------------------------
The tests -T and -B takes a try at telling whether a file is text or binary.
But people who know a lot about filesystems know that there's no bit (at least
in UNIX-like operating systems) to indicate that a file is a binary or text file
--- so how can Perl tell?
The answer is that Perl cheats. As you might guess, it sometimes guesses wrong.
This incomplete thinking of file test operator -T and -B gave birth to UTF8 flag
of a later period.
The Ebig5::T, Ebig5::T_, Ebig5::B, and Ebig5::B_ work as follows. The first block
or so of the file is examined for strange chatracters such as
[\000-\007\013\016-\032\034-\037\377] (that don't look like Big5). If more
than 10% of the bytes appear to be strange, it's a *maybe* binary file;
otherwise, it's a *maybe* text file. Also, any file containing ASCII NUL(\0) or
\377 in the first block is considered a binary file. If Ebig5::T or Ebig5::B is
used on a filehandle, the current input (standard I/O or "stdio") buffer is
examined rather than the first block of the file. Both Ebig5::T and Ebig5::B
return 1 as true on an empty file, or on a file at EOF (end-of-file) when testing
a filehandle. Both Ebig5::T and Ebig5::B doesn't work when given the special
filehandle consisting of a solitary underline. Because Ebig5::T has to read to
do the test, you don't want to use Ebig5::T on special files that might hang or
give you other kinds or grief. So on most occasions you'll want to test with a
Ebig5::f first, as in:
next unless Ebig5::f($file) && Ebig5::T($file);
Available in MSWin32, MacOS, and UNIX-like systems
------------------------------------------------------------------------------
Subroutine and Prototype Meaning
------------------------------------------------------------------------------
Ebig5::T(*), Ebig5::T_() File looks like a "text" file
Ebig5::B(*), Ebig5::B_() File looks like a "binary" file
------------------------------------------------------------------------------
File ages for Ebig5::M, Ebig5::M_, Ebig5::A, Ebig5::A_, Ebig5::C, and Ebig5::C_
are returned in days (including fractional days) since the script started running.
This start time is stored in the special variable $^T ($BASETIME). Thus, if the
file changed after the script, you would get a negative time. Note that most time
values (86,399 out of 86,400, on average) are fractional, so testing for equality
with an integer without using the int function is usually futile. Examples:
next unless Ebig5::M($file) > 0.5; # files are older than 12 hours
&newfile if Ebig5::M($file) < 0; # file is newer than process
&mailwarning if int(Ebig5::A_) == 90; # file ($_) was accessed 90 days ago today
Available in MSWin32, MacOS, and UNIX-like systems
------------------------------------------------------------------------------
Subroutine and Prototype Meaning
------------------------------------------------------------------------------
Ebig5::M(*), Ebig5::M_() Modification age (measured in days)
Ebig5::A(*), Ebig5::A_() Access age (measured in days)
Same as Ebig5::M(*), Ebig5::M_() on MacOS
Ebig5::C(*), Ebig5::C_() Inode-modification age (measured in days)
------------------------------------------------------------------------------
The Ebig5::s, and Ebig5::s_ returns file size in bytes if succesful, or undef
unless successful.
lib/Ebig5.pm view on Meta::CPAN
@spacies = <"*e f*">;
@spacies = Ebig5::glob('"*e f*"');
@spacies = Ebig5::glob(q("*e f*"));
If you had to get a variable through, you could do this:
@spacies = Ebig5::glob("'*${var}e f*'");
@spacies = Ebig5::glob(qq("*${var}e f*"));
Another way on MSWin32
# relative path
@relpath_file = split(/\n/,`dir /b wildcard\\here*.txt 2>NUL`);
# absolute path
@abspath_file = split(/\n/,`dir /s /b wildcard\\here*.txt 2>NUL`);
# on COMMAND.COM
@relpath_file = split(/\n/,`dir /b wildcard\\here*.txt`);
@abspath_file = split(/\n/,`dir /s /b wildcard\\here*.txt`);
=item * Statistics about link
@lstat = Ebig5::lstat($file);
@lstat = Ebig5::lstat_;
Like Ebig5::stat, returns information on file, except that if file is a symbolic
link, Ebig5::lstat returns information about the link; Ebig5::stat returns
information about the file pointed to by the link. If symbolic links are
unimplemented on your system, a normal Ebig5::stat is done instead. If file is
omitted, returns information on file given in $_. Returns values (especially
device and inode) may be bogus.
This subroutine function when the filename ends with chr(0x5C) on MSWin32.
=item * Open directory handle
$rc = Ebig5::opendir(DIR,$dir);
This subroutine opens a directory named $dir for processing by readdir, telldir,
seekdir, rewinddir, and closedir. The subroutine returns true if successful.
Directory handles have their own namespace from filehandles.
This subroutine function when the directory name ends with chr(0x5C) on MSWin32.
=item * Statistics about file
$stat = Ebig5::stat(FILEHANDLE);
$stat = Ebig5::stat(DIRHANDLE);
$stat = Ebig5::stat($expr);
$stat = Ebig5::stat_;
@stat = Ebig5::stat(FILEHANDLE);
@stat = Ebig5::stat(DIRHANDLE);
@stat = Ebig5::stat($expr);
@stat = Ebig5::stat_;
In scalar context, this subroutine returns a Boolean value that indicates whether
the call succeeded. In list context, it returns a 13-element list giving the
statistics for a file, either the file opened via FILEHANDLE or DIRHANDLE, or
named by $expr. It's typically used as followes:
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) = Ebig5::stat($expr);
Not all fields are supported on all filesystem types; unsupported fields return
0. Here are the meanings of the fields:
-------------------------------------------------------------------------
Index Field Meaning
-------------------------------------------------------------------------
0 $dev Device number of filesystem
drive number for MSWin32
vRefnum for MacOS
1 $ino Inode number
zero for MSWin32
fileID/dirID for MacOS
2 $mode File mode (type and permissions)
3 $nlink Nunmer of (hard) links to the file
usually one for MSWin32 --- NTFS filesystems may
have a value greater than one
1 for MacOS
4 $uid Numeric user ID of file's owner
zero for MSWin32
zero for MacOS
5 $gid Numeric group ID of file's owner
zero for MSWin32
zero for MacOS
6 $rdev The device identifier (special files only)
drive number for MSWin32
NULL for MacOS
7 $size Total size of file, in bytes
8 $atime Last access time since the epoch
same as $mtime for MacOS
9 $mtime Last modification time since the epoch
since 1904-01-01 00:00:00 for MacOS
10 $ctime Inode change time (not creation time!) since the epoch
creation time instead of inode change time for MSWin32
since 1904-01-01 00:00:00 for MacOS
11 $blksize Preferred blocksize for file system I/O
zero for MSWin32
12 $blocks Actual number of blocks allocated
zero for MSWin32
int(($size + $blksize-1) / $blksize) for MacOS
-------------------------------------------------------------------------
$dev and $ino, token together, uniquely identify a file on the same system.
The $blksize and $blocks are likely defined only on BSD-derived filesystems.
The $blocks field (if defined) is reported in 512-byte blocks. The value of
$blocks * 512 can differ greatly from $size for files containing unallocated
blocks, or "hole", which aren't counted in $blocks.
If Ebig5::stat is passed the special filehandle consisting of an underline, no
actual stat(2) is done, but the current contents of the stat structure from
the last Ebig5::stat, Ebig5::lstat, or Ebig5::stat-based file test subroutine
(such as Ebig5::r, Ebig5::w, and Ebig5::x) are returned.
Because the mode contains both the file type and its permissions, you should
mask off the file type portion and printf or sprintf using a "%o" if you want
to see the real permissions:
$mode = (Ebig5::stat($expr))[2];
printf "Permissions are %04o\n", $mode & 07777;
If $expr is omitted, returns information on file given in $_.
This subroutine function when the filename ends with chr(0x5C) on MSWin32.
=item * Deletes a list of files.
$unlink = Ebig5::unlink(@list);
$unlink = Ebig5::unlink($file);
$unlink = Ebig5::unlink;
Delete a list of files. (Under Unix, it will remove a link to a file, but the
file may still exist if another link references it.) If list is omitted, it
unlinks the file given in $_. The subroutine returns the number of files
successfully deleted.
This subroutine function when the filename ends with chr(0x5C) on MSWin32.
=item * Changes the working directory.
$chdir = Ebig5::chdir($dirname);
$chdir = Ebig5::chdir;
This subroutine changes the current process's working directory to $dirname, if
possible. If $dirname is omitted, $ENV{'HOME'} is used if set, and $ENV{'LOGDIR'}
( run in 0.411 second using v1.01-cache-2.11-cpan-97f6503c9c8 )