Char-KPS9566
view release on metacpan or search on metacpan
lib/Ekps9566.pm view on Meta::CPAN
print STDERR "\n";
print STDERR @_;
die "\n";
}
1;
__END__
=pod
=head1 NAME
Ekps9566 - Run-time routines for KPS9566.pm
=head1 SYNOPSIS
use Ekps9566;
Ekps9566::split(...);
Ekps9566::tr(...);
Ekps9566::chop(...);
Ekps9566::index(...);
Ekps9566::rindex(...);
Ekps9566::lc(...);
Ekps9566::lc_;
Ekps9566::lcfirst(...);
Ekps9566::lcfirst_;
Ekps9566::uc(...);
Ekps9566::uc_;
Ekps9566::ucfirst(...);
Ekps9566::ucfirst_;
Ekps9566::fc(...);
Ekps9566::fc_;
Ekps9566::ignorecase(...);
Ekps9566::capture(...);
Ekps9566::chr(...);
Ekps9566::chr_;
Ekps9566::X ...;
Ekps9566::X_;
Ekps9566::glob(...);
Ekps9566::glob_;
Ekps9566::lstat(...);
Ekps9566::lstat_;
Ekps9566::opendir(...);
Ekps9566::stat(...);
Ekps9566::stat_;
Ekps9566::unlink(...);
Ekps9566::chdir(...);
Ekps9566::do(...);
Ekps9566::require(...);
Ekps9566::telldir(...);
# "no Ekps9566;" not supported
=head1 ABSTRACT
This module has run-time routines for use KPS9566 software automatically, you
do not have to use.
=head1 BUGS AND LIMITATIONS
I have tested and verified this software using the best of my ability.
However, a software containing much regular expression is bound to contain
some bugs. Thus, if you happen to find a bug that's in KPS9566 software and not
your own program, you can try to reduce it to a minimal test case and then
report it to the following author's address. If you have an idea that could
make this a more useful tool, please let everyone share it.
=head1 HISTORY
This Ekps9566 module first appeared in ActivePerl Build 522 Built under
MSWin32 Compiled at Nov 2 1999 09:52:28
=head1 AUTHOR
INABA Hitoshi E<lt>ina@cpan.orgE<gt>
This project was originated by INABA Hitoshi.
For any questions, use E<lt>ina@cpan.orgE<gt> so we can share
this file.
=head1 LICENSE AND COPYRIGHT
This module is free software; you can redistribute it and/or
modify it under the same terms as Perl itself. See L<perlartistic>.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
=head1 EXAMPLES
=over 2
=item * Split string
@split = Ekps9566::split(/pattern/,$string,$limit);
@split = Ekps9566::split(/pattern/,$string);
@split = Ekps9566::split(/pattern/);
@split = Ekps9566::split('',$string,$limit);
@split = Ekps9566::split('',$string);
@split = Ekps9566::split('');
@split = Ekps9566::split();
@split = Ekps9566::split;
This subroutine scans a string given by $string for separators, and splits the
string into a list of substring, returning the resulting list value in list
context or the count of substring in scalar context. Scalar context also causes
split to write its result to @_, but this usage is deprecated. The separators
are determined by repeated pattern matching, using the regular expression given
in /pattern/, so the separators may be of any size and need not be the same
string on every match. (The separators are not ordinarily returned; exceptions
are discussed later in this section.) If the /pattern/ doesn't match the string
at all, Ekps9566::split returns the original string as a single substring, If it
matches once, you get two substrings, and so on. You may supply regular
expression modifiers to the /pattern/, like /pattern/i, /pattern/x, etc. The
//m modifier is assumed when you split on the pattern /^/.
If $limit is specified and positive, the subroutine splits into no more than that
many fields (though it may split into fewer if it runs out of separators). If
lib/Ekps9566.pm view on Meta::CPAN
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 Ekps9566::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 Ekps9566::stat, Ekps9566::lstat, or Ekps9566::stat-based file test subroutine
(such as Ekps9566::r, Ekps9566::w, and Ekps9566::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 = (Ekps9566::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 = Ekps9566::unlink(@list);
$unlink = Ekps9566::unlink($file);
$unlink = Ekps9566::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 = Ekps9566::chdir($dirname);
$chdir = Ekps9566::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'}
otherwise; these are usually the process's home directory. The subroutine returns
true on success, false otherwise (and puts the error code into $!).
chdir("$prefix/lib") || die "Can't cd to $prefix/lib: $!";
This subroutine has limitation on the MSWin32. See also BUGS AND LIMITATIONS.
=item * Do file
$return = Ekps9566::do($file);
The do FILE form uses the value of FILE as a filename and executes the contents
of the file as a Perl script. Its primary use is (or rather was) to include
subroutines from a Perl subroutine library, so that:
Ekps9566::do('stat.pl');
is rather like:
scalar CORE::eval `cat stat.pl`; # `type stat.pl` on Windows
except that Ekps9566::do is more efficient, more concise, keeps track of the current
filename for error messages, searches all the directories listed in the @INC
array, and updates %INC if the file is found.
It also differs in that code evaluated with Ekps9566::do FILE can not see lexicals in
the enclosing scope, whereas code in CORE::eval FILE does. It's the same, however,
in that it reparses the file every time you call it -- so you might not want to do
this inside a loop unless the filename itself changes at each loop iteration.
If Ekps9566::do can't read the file, it returns undef and sets $! to the error. If
Ekps9566::do can read the file but can't compile it, it returns undef and sets an
error message in $@. If the file is successfully compiled, do returns the value of
the last expression evaluated.
Inclusion of library modules (which have a mandatory .pm suffix) is better done
with the use and require operators, which also Ekps9566::do error checking and raise
an exception if there's a problem. They also offer other benefits: they avoid
duplicate loading, help with object-oriented programming, and provide hints to the
compiler on function prototypes.
But Ekps9566::do FILE is still useful for such things as reading program configuration
files. Manual error checking can be done this way:
# read in config files: system first, then user
for $file ("/usr/share/proggie/defaults.rc", "$ENV{HOME}/.someprogrc") {
unless ($return = Ekps9566::do($file)) {
warn "couldn't parse $file: $@" if $@;
warn "couldn't Ekps9566::do($file): $!" unless defined $return;
warn "couldn't run $file" unless $return;
}
}
A long-running daemon could periodically examine the timestamp on its configuration
file, and if the file has changed since it was last read in, the daemon could use
Ekps9566::do to reload that file. This is more tidily accomplished with Ekps9566::do than
with Ekps9566::require.
=item * Require file
Ekps9566::require($file);
Ekps9566::require();
This subroutine asserts a dependency of some kind on its argument. If an argument is
not supplied, $_ is used.
Ekps9566::require loads and executes the Perl code found in the separate file whose
( run in 1.632 second using v1.01-cache-2.11-cpan-df04353d9ac )