File-Tools
view release on metacpan or search on metacpan
lib/File/Tools.pm view on Meta::CPAN
}
=head2 getopts
Not implemented.
See L<Getops::Std> and L<Getops::Long> for possible implementations we will use here.
=cut
=head2 grep
Not implemented.
A basic implementation of grep in Perl would be the following code:
my $p = shift;
while (<>) {
print if /$p/
}
but within real code we are going to be more interested doing such operation
on a list of values (possibly file lines) already in memory in an array or
piped in from an external file. For this one can use the grep build in function.
@selected = grep { $_ =~ /REGEX/ } @original;
TODO: See also L<File::Grep>
=cut
=head2 gzip
Not implemented.
=cut
=head2 head
Not implemented.
=cut
=head2 id
Normally the id command shows the current username, userid, group and gid.
In Perl one can access the current ireal UID as $< and the effective UID as $>.
The real GID is $( and the effective GID is $) of the current user.
To get the username and the group name use the getpwuid($uid) and getpwgrid($gid)
functions respectively in scalar context.
=cut
=head2 kill
See built in kill function.
=cut
=head2 less
Not implemented.
This is used in interactive mode only. No need to provide this functionality here.
=cut
=head2 ln
Not implemented.
See the build in L<link> and L<symlink> functions.
=cut
=head2 ls
Not implemented.
See glob and the opendir/readdir pair for listing filenames
use stat and lstat to retreive information needed for the -l
display mode of ls.
=cut
=head2 mail
Sending e-mails.
See L<Mail::Sendmail> and L<Net::SMTP>
=cut
=head2 mkdir
Not implemented.
See the built in mkdir function.
See also L</mkpath>
( run in 0.835 second using v1.01-cache-2.11-cpan-e1769b4cff6 )