Mailing List Archive

function classification
How does something like this sound for grouping predefined function names?

STRING chomp, chop, chr, crypt, hex, index, lc, lcfirst, length, oct,
ord, q/STRING/, qq/STRING/, qx/STRING/, reverse, rindex,
sprintf, substr, uc, ucfirst

ARRAY pop, push, shift, splice, unshift

LIST grep, join, map, qw/STRING/, reverse, sort

HASH delete, each, exists, keys, values

Math abs, atan2, cos, exp, hex, int, log, rand, sin, sqrt, srand

Regexp m//, pos, quotemeta, s///, split, study, tr///, y///

Objects bless, dbmclose, dbmopen, import, no, ref, require, tie, untie,
use

Files -X, chdir, chmod, chown, chroot, glob, link, lstat, mkdir,
open, opendir, readlink, rename, rmdir, stat, symlink, unlink,
utime

I/O close, closedir, die, eof, fileno, flock, format, getc, print,
printf, read, readdir, rewinddir, seek, seekdir, select,
sysread, syswrite, tell, telldir, truncate, warn, write

PERL caller, defined, dump, eval, formline, local, my, reset,
scalar, undef, wantarray

Flow die, do, dump, eval, exit, goto, last, next, redo, return

Binary pack, read, sysread, syswrite, unpack, vec

Time gmtime, localtime

Admin endgrent, endhostent, endnetent, endprotoent, endpwent,
endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
gethostbyname, gethostent, getnetbyaddr, getnetbyname,
getnetent, getprotobyname, getprotobynumber, getprotoent,
getpwent, getpwnam, getpwuid, getservbyname, getservbyport,
getservent, setgrent, sethostent, setnetent, setprotoent,
setpwent, setservent

UNIX alarm, exec, fcntl, fork, getlogin, getpgrp, getppid,
getpriority, ioctl, kill, pipe, setpgrp, setpriority, sleep,
syscall, system, time, times, umask, wait, waitpid

Socket accept, bind, connect, getpeername, getsockname, getsockopt,
listen, recv, send, setsockopt, shutdown, socket, socketpair

SysV msgctl, msgget, msgrcv, msgsnd, semctl, semget, semop, shmctl,
shmget, shmread, shmwrite

DOS binmode

--tom

while (<DATA>) {
chomp;
($name, $type, $text) = split "\t", $_, 3;
for $type ( split /[,\s]+/, $type ) {
push @{$types{$type}}, $name;
}
}

foreach $type ( sort keys %types ) {
$list = join(", ", sort @{$types{$type}});
write;
}

format =

@<<<<<<<<<<< ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$type, $list
~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$list
Re: function classification [ In reply to ]
In article <10973.819245617@mox>, Tom Christiansen (tchrist@mox.perl.com) wrote:
> How does something like this sound for grouping predefined function names?

Great!

(Very good idea!)

> STRING chomp, chop, chr, crypt, hex, index, lc, lcfirst, length, oct,
> ord, q/STRING/, qq/STRING/, qx/STRING/, reverse, rindex,
> sprintf, substr, uc, ucfirst

> ARRAY pop, push, shift, splice, unshift

> LIST grep, join, map, qw/STRING/, reverse, sort

> HASH delete, each, exists, keys, values

> Math abs, atan2, cos, exp, hex, int, log, rand, sin, sqrt, srand

> Regexp m//, pos, quotemeta, s///, split, study, tr///, y///

> Objects bless, dbmclose, dbmopen, import, no, ref, require, tie, untie,
> use

> Files -X, chdir, chmod, chown, chroot, glob, link, lstat, mkdir,
> open, opendir, readlink, rename, rmdir, stat, symlink, unlink,
> utime

> I/O close, closedir, die, eof, fileno, flock, format, getc, print,
> printf, read, readdir, rewinddir, seek, seekdir, select,
> sysread, syswrite, tell, telldir, truncate, warn, write

> PERL caller, defined, dump, eval, formline, local, my, reset,
> scalar, undef, wantarray

> Flow die, do, dump, eval, exit, goto, last, next, redo, return

> Binary pack, read, sysread, syswrite, unpack, vec

> Time gmtime, localtime

> Admin endgrent, endhostent, endnetent, endprotoent, endpwent,
> endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
> gethostbyname, gethostent, getnetbyaddr, getnetbyname,
> getnetent, getprotobyname, getprotobynumber, getprotoent,
> getpwent, getpwnam, getpwuid, getservbyname, getservbyport,
> getservent, setgrent, sethostent, setnetent, setprotoent,
> setpwent, setservent

> UNIX alarm, exec, fcntl, fork, getlogin, getpgrp, getppid,
> getpriority, ioctl, kill, pipe, setpgrp, setpriority, sleep,
> syscall, system, time, times, umask, wait, waitpid

> Socket accept, bind, connect, getpeername, getsockname, getsockopt,
> listen, recv, send, setsockopt, shutdown, socket, socketpair

> SysV msgctl, msgget, msgrcv, msgsnd, semctl, semget, semop, shmctl,
> shmget, shmread, shmwrite

> DOS binmode

> --tom

Did you check with Johan Vromans if your classifications agree?

Kind regards,
--
Steffen Beyer
mailto:sb@sdm.de |s |d &|m | software design & management GmbH&Co.KG
phone: +49 89 63812-244 | | | | Thomas-Dehler-Str. 27
fax: +49 89 63812-150 | | | | 81737 Munich, Germany.
Re: function classification [ In reply to ]
Otherwise looks fine but this

> Admin endgrent, endhostent, endnetent, endprotoent, endpwent,
> endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
> gethostbyname, gethostent, getnetbyaddr, getnetbyname,
> getnetent, getprotobyname, getprotobynumber, getprotoent,
> getpwent, getpwnam, getpwuid, getservbyname, getservbyport,
> getservent, setgrent, sethostent, setnetent, setprotoent,
> setpwent, setservent

The name 'Admin' is a bit odd, only applicable to *{pw,gr}* I would say,
the network stuff has normally very little to do with any 'admining'.
'UNIXdb'?

++jhi;
Re: function classification [ In reply to ]
: How does something like this sound for grouping predefined function names?
:
: STRING chomp, chop, chr, crypt, hex, index, lc, lcfirst, length, oct,
: ord, q/STRING/, qq/STRING/, qx/STRING/, reverse, rindex,
: sprintf, substr, uc, ucfirst

qx// is about Process, really. Which should probably be its own category.

Some of these also belong in a Number category. Either that, or STRING
should be SCALAR. At least, it should be String, since ref never returns
it in all caps.

On the other hand, one could argue that oct() belongs in Math.

: ARRAY pop, push, shift, splice, unshift
:
: LIST grep, join, map, qw/STRING/, reverse, sort
:
: HASH delete, each, exists, keys, values
:
: Math abs, atan2, cos, exp, hex, int, log, rand, sin, sqrt, srand
:
: Regexp m//, pos, quotemeta, s///, split, study, tr///, y///

tr/// doesn't belong here. STRING maybe.

: Objects bless, dbmclose, dbmopen, import, no, ref, require, tie, untie,
: use

use, no and import are about modules, not objects.

: Files -X, chdir, chmod, chown, chroot, glob, link, lstat, mkdir,
: open, opendir, readlink, rename, rmdir, stat, symlink, unlink,
: utime
:
: I/O close, closedir, die, eof, fileno, flock, format, getc, print,
: printf, read, readdir, rewinddir, seek, seekdir, select,
: sysread, syswrite, tell, telldir, truncate, warn, write
:
: PERL caller, defined, dump, eval, formline, local, my, reset,
: scalar, undef, wantarray

This seems more like Misc. caller() is about flow, really.

: Flow die, do, dump, eval, exit, goto, last, next, redo, return
:
: Binary pack, read, sysread, syswrite, unpack, vec

This is confusing some issues. All the functions are binary, to the
extent that the OS allows it. What it's more about is fixed-position
data, which tends to be binary.

: Time gmtime, localtime
:
: Admin endgrent, endhostent, endnetent, endprotoent, endpwent,
: endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
: gethostbyname, gethostent, getnetbyaddr, getnetbyname,
: getnetent, getprotobyname, getprotobynumber, getprotoent,
: getpwent, getpwnam, getpwuid, getservbyname, getservbyport,
: getservent, setgrent, sethostent, setnetent, setprotoent,
: setpwent, setservent

Looks more like NIS.

: UNIX alarm, exec, fcntl, fork, getlogin, getpgrp, getppid,
: getpriority, ioctl, kill, pipe, setpgrp, setpriority, sleep,
: syscall, system, time, times, umask, wait, waitpid

Most of these I'd call Process. Might want to differentiate our process
from other processes, though some are both, like kill(), and setpriority().

: Socket accept, bind, connect, getpeername, getsockname, getsockopt,
: listen, recv, send, setsockopt, shutdown, socket, socketpair
:
: SysV msgctl, msgget, msgrcv, msgsnd, semctl, semget, semop, shmctl,
: shmget, shmread, shmwrite
:
: DOS binmode

For more than DOS, potentially. Probably just belongs under I/O.

Larry
Re: function classification [ In reply to ]
> From: Jarkko Hietaniemi <jhi@snakemail.hut.fi>
>
>
> Otherwise looks fine but this
>
> > Admin endgrent, endhostent, endnetent, endprotoent, endpwent,
> > endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
> > gethostbyname, gethostent, getnetbyaddr, getnetbyname,
> > getnetent, getprotobyname, getprotobynumber, getprotoent,
> > getpwent, getpwnam, getpwuid, getservbyname, getservbyport,
> > getservent, setgrent, sethostent, setnetent, setprotoent,
> > setpwent, setservent
>
> The name 'Admin' is a bit odd, only applicable to *{pw,gr}* I would say,
> the network stuff has normally very little to do with any 'admining'.
> 'UNIXdb'?

The module list uses User for pw and gw:

User::
::pwent adpf A by-name interface to password database TOMC
::grent adpf A by-name interface to groups database TOMC

and host, net, server & protocols are all network related.

Tim.
Re: function classification [ In reply to ]
thanks for all your inputs. i'll redo the data file sometime
soon.

btw, the reason why i'd like a nice function classification isn't
really just for a man page. it's also for html pages and to
support this kind of thing: splitpod, which is like splitman
but smarter. It gets fed POSIX or perlfunc pods.

--tom

#!/usr/bin/perl
use PerlDoc::Functions;
$/ = '';
$cur = '';
while (<>) {
next unless /^=(?!cut)/ .. /^=cut/;
if (s/=item (\S+)/$1/) {
# $cur = "POSIX::" . $1;
$cur = $1;
$syn{$cur} .= $_;
next;
} else {
# s,L</,L<POSIX/,g;
s,L</,L<perlfunc/,g;
$pod{$cur} .= $_ if $cur;
}
}
for $f ( keys %syn ) {
$type = $Type{$f} || next;
$flavor = $Flavor{$f};
$orig = $f;
($name = $f) =~ s/\W//g;
open (POD, "> $name.pod") || die "can't open $name.pod: $!";
print POD <<EOF;
=head1 NAME

$orig - $flavor

=head1 SYNOPSIS

$syn{$orig}

=head1 DESCRIPTION

$pod{$orig}

EOF
close POD;
}
Re: function classification [ In reply to ]
>> From: Jarkko Hietaniemi <jhi@snakemail.hut.fi>
>>
>>
>> Otherwise looks fine but this
>>
>> > Admin endgrent, endhostent, endnetent, endprotoent, endpwent,
>> > endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
>> > gethostbyname, gethostent, getnetbyaddr, getnetbyname,
>> > getnetent, getprotobyname, getprotobynumber, getprotoent,
>> > getpwent, getpwnam, getpwuid, getservbyname, getservbyport,
>> > getservent, setgrent, sethostent, setnetent, setprotoent,
>> > setpwent, setservent
>>
>> The name 'Admin' is a bit odd, only applicable to *{pw,gr}* I would say,
>> the network stuff has normally very little to do with any 'admining'.
>> 'UNIXdb'?

>The module list uses User for pw and gw:

>User::
>::pwent adpf A by-name interface to password database TOMC
>::grent adpf A by-name interface to groups database TOMC

>and host, net, server & protocols are all network related.


i was having host, net, server, and protocols in the Socket
section, but reneged. larry's NIS seems best, albeit imperfect.

--tom
Re: function classification [ In reply to ]
Here's the current list. Still not really happy with Binary.
And the Unix category has become too sparse to continue its existence.
Whereas might we put those two?

--tom

ARRAY pop, push, shift, splice, unshift

Binary pack, read, sysread, syswrite, unpack, vec

File -X, chdir, chmod, chown, chroot, fcntl, glob, ioctl, link,
lstat, mkdir, open, opendir, readlink, rename, rmdir, stat,
symlink, umask, unlink, utime

Flow caller, continue, die, do, dump, eval, exit, goto, last, next,
redo, return, sub

HASH delete, each, exists, keys, values

I/O binmode, close, closedir, dbmclose, dbmopen, die, eof, fileno,
flock, format, getc, print, printf, read, readdir, rewinddir,
seek, seekdir, select, sysread, syswrite, tell, telldir,
truncate, warn, write

LIST grep, join, map, qw/STRING/, reverse, sort, unpack

Math abs, atan2, cos, exp, hex, int, log, oct, rand, sin, sqrt,
srand

Misc defined, dump, eval, formline, local, my, reset, scalar, undef,
wantarray

Modules do, import, no, require, use

NIS endgrent, endhostent, endnetent, endprotoent, endpwent,
endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
gethostbyname, gethostent, getnetbyaddr, getnetbyname,
getnetent, getprotobyname, getprotobynumber, getprotoent,
getpwent, getpwnam, getpwuid, getservbyname, getservbyport,
getservent, setgrent, sethostent, setnetent, setprotoent,
setpwent, setservent

Objects bless, dbmclose, dbmopen, ref, tie, untie, use

Process alarm, exec, fork, getpgrp, getppid, getpriority, kill, pipe,
qx/STRING/, setpgrp, setpriority, sleep, system, times, wait,
waitpid

Regexp m//, pos, quotemeta, s///, split, study

Socket accept, bind, connect, getpeername, getsockname, getsockopt,
listen, recv, send, setsockopt, shutdown, socket, socketpair

String chomp, chop, chr, crypt, hex, index, lc, lcfirst, length, oct,
ord, pack, q/STRING/, qq/STRING/, reverse, rindex, sprintf,
substr, tr///, uc, ucfirst, y///

SysV msgctl, msgget, msgrcv, msgsnd, semctl, semget, semop, shmctl,
shmget, shmread, shmwrite

Time gmtime, localtime, time

UNIX getlogin, syscall
Re: function classification [ In reply to ]
Here's the current list. Still not really happy with Binary.
And the Unix category has become too sparse to continue its existence.
Whereas might we put those two?

--tom

ARRAY pop, push, shift, splice, unshift

Binary pack, read, sysread, syswrite, unpack, vec

File -X, chdir, chmod, chown, chroot, fcntl, glob, ioctl, link,
lstat, mkdir, open, opendir, readlink, rename, rmdir, stat,
symlink, umask, unlink, utime

Flow caller, continue, die, do, dump, eval, exit, goto, last, next,
redo, return, sub

HASH delete, each, exists, keys, values

I/O binmode, close, closedir, dbmclose, dbmopen, die, eof, fileno,
flock, format, getc, print, printf, read, readdir, rewinddir,
seek, seekdir, select, sysread, syswrite, tell, telldir,
truncate, warn, write

LIST grep, join, map, qw/STRING/, reverse, sort, unpack

Math abs, atan2, cos, exp, hex, int, log, oct, rand, sin, sqrt,
srand

Misc defined, dump, eval, formline, local, my, reset, scalar, undef,
wantarray

Modules do, import, no, require, use

NIS endgrent, endhostent, endnetent, endprotoent, endpwent,
endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
gethostbyname, gethostent, getnetbyaddr, getnetbyname,
getnetent, getprotobyname, getprotobynumber, getprotoent,
getpwent, getpwnam, getpwuid, getservbyname, getservbyport,
getservent, setgrent, sethostent, setnetent, setprotoent,
setpwent, setservent

Objects bless, dbmclose, dbmopen, ref, tie, untie, use

Process alarm, exec, fork, getpgrp, getppid, getpriority, kill, pipe,
qx/STRING/, setpgrp, setpriority, sleep, system, times, wait,
waitpid

Regexp m//, pos, quotemeta, s///, split, study

Socket accept, bind, connect, getpeername, getsockname, getsockopt,
listen, recv, send, setsockopt, shutdown, socket, socketpair

String chomp, chop, chr, crypt, hex, index, lc, lcfirst, length, oct,
ord, pack, q/STRING/, qq/STRING/, reverse, rindex, sprintf,
substr, tr///, uc, ucfirst, y///

SysV msgctl, msgget, msgrcv, msgsnd, semctl, semget, semop, shmctl,
shmget, shmread, shmwrite

Time gmtime, localtime, time

UNIX getlogin, syscall
Re: function classification [ In reply to ]
> TC> NIS endgrent, endhostent, endnetent, endprotoent, endpwent,
> TC> endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
> TC> gethostbyname, gethostent, getnetbyaddr, getnetbyname,
> TC> getnetent, getprotobyname, getprotobynumber, getprotoent,
> TC> getpwent, getpwnam, getpwuid, getservbyname, getser<SNIP>
> TC> getservent, setgrent, sethostent, setnetent, setprotoent,
> TC> setpwent, setservent

>Is NIS intended to be the Product Formerly Known as Yellow Pages? Many
>of these exist even if NIS isn't used, so it seems an odd choice.


i give up. i'll remove those functions from the documentation. :-)

--tom
Re: function classification [ In reply to ]
Paul Hudson writes:
>
> TC> NIS endgrent, endhostent, endnetent, endprotoent, endpwent,
> TC> endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
> TC> gethostbyname, gethostent, getnetbyaddr, getnetbyname,
> TC> getnetent, getprotobyname, getprotobynumber, getprotoent,
> TC> getpwent, getpwnam, getpwuid, getservbyname, getservbyport,
> TC> getservent, setgrent, sethostent, setnetent, setprotoent,
> TC> setpwent, setservent
>
> Is NIS intended to be the Product Formerly Known as Yellow Pages? Many
> of these exist even if NIS isn't used, so it seems an odd choice.

My thoughts exactly. We have a userbase of 13500 accounts but NIS only
in those few wretched machines that do not support /etc/passwd.{dir,pag}.
I still stand by my 'UNIXdb' :-) (besides, getlogin() would find home there)

++jhi;
Re: function classification [ In reply to ]
Tom Christiansen writes:
> > TC> NIS endgrent, endhostent, endnetent, endprotoent, endpwent,
> > TC> endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
> > TC> gethostbyname, gethostent, getnetbyaddr, getnetbyname,
> > TC> getnetent, getprotobyname, getprotobynumber, getprotoent,
> > TC> getpwent, getpwnam, getpwuid, getservbyname, getser<SNIP>
> > TC> getservent, setgrent, sethostent, setnetent, setprotoent,
> > TC> setpwent, setservent
>
> >Is NIS intended to be the Product Formerly Known as Yellow Pages? Many
> >of these exist even if NIS isn't used, so it seems an odd choice.
>
> Ok. May this category be henceforth known as UNIX AND UNIX-DERIVED (EVEN
> IF THEY DON'T LIKE IT) USER ACCOUNT AND NETWORKING ADMINISTRATIVE DATABASE
> ACCESSOR FUNCTIONS.
>
> Accuracy over brevity, of course. :-)
>
> --tom

UAU-D(EITDLI)UAANADAF? Sounds a like a religious chant or something :-)

++jhi;
Re: function classification [ In reply to ]
i don't really want to add getprotobyname,etc to Sockets. It makes
it too long.

--tom
Re: function classification [ In reply to ]
> From: Tom Christiansen <tchrist@mox.perl.com>
>
> >> From: Jarkko Hietaniemi <jhi@snakemail.hut.fi>
> >>
> >> Otherwise looks fine but this
> >>
> >> > Admin endgrent, endhostent, endnetent, endprotoent, endpwent,
> >> > endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
> >> > gethostbyname, gethostent, getnetbyaddr, getnetbyname,
> >> > getnetent, getprotobyname, getprotobynumber, getprotoent,
> >> > getpwent, getpwnam, getpwuid, getservbyname, getservbyport,
> >> > getservent, setgrent, sethostent, setnetent, setprotoent,
> >> > setpwent, setservent
> >>
> >> The name 'Admin' is a bit odd, only applicable to *{pw,gr}* I would say,
> >> the network stuff has normally very little to do with any 'admining'.
> >> 'UNIXdb'?
>
> >The module list uses User for pw and gw:
>
> >User::
> >::pwent adpf A by-name interface to password database TOMC
> >::grent adpf A by-name interface to groups database TOMC
>
> >and host, net, server & protocols are all network related.
>
> i was having host, net, server, and protocols in the Socket
> section, but reneged. larry's NIS seems best, albeit imperfect.

I fear that NIS will be meaningless to many (most?) of perl users.

This is more like what I had in mind:

User getpwent, setpwent, endpwent, getpwnam, getpwuid,
getgrent, setgrent, endgrent, getgrnam, getgrgid

Network getnetent, setnetent, endnetent,
getprotoent, setprotoent, endprotoent,
gethostent, sethostent, endhostent,
...

Tim.
Re: function classification [ In reply to ]
>I fear that NIS will be meaningless to many (most?) of perl users.

How about "YP^h^hNIS", with the "cat -v"'d backspaces? :-)

>This is more like what I had in mind:

>User getpwent, setpwent, endpwent, getpwnam, getpwuid,
> getgrent, setgrent, endgrent, getgrnam, getgrgid

>Network getnetent, setnetent, endnetent,
> getprotoent, setprotoent, endprotoent,
> gethostent, sethostent, endhostent,
> ...


Done!

--tom
Re: function classification [ In reply to ]
Tom Christiansen wrote :
||
|| >I fear that NIS will be meaningless to many (most?) of perl users.
||
|| How about "YP^h^hNIS", with the "cat -v"'d backspaces? :-)
||
|| >This is more like what I had in mind:
||
|| >User getpwent, setpwent, endpwent, getpwnam, getpwuid,
|| > getgrent, setgrent, endgrent, getgrnam, getgrgid
||
|| >Network getnetent, setnetent, endnetent,
|| > getprotoent, setprotoent, endprotoent,
|| > gethostent, sethostent, endhostent,
|| > ...

I think that one of the reasons that the degree of success
that perl has achieved has been Larry's attention to careful
choice of names - ensuring that names within the language
are both sensible and work together.

Tim has carried on that concept with the module list and
organization of the module names.

The serious consideration of naming for new newgroup proposals
is another example.

Here it is happening again as Tom is organizing the docs.

|| Done!

Make that a "Well done!"

--
Maybe we can fix reality one of these days. | John Macdonald
<- Larry Wall Carl Dichter -> | jmm@Elegant.COM
I'd be happy if we could just index it. |
Re: function classification [ In reply to ]
#:vi:set ts=20
package PerlDoc::Functions;
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(%Kinds %Type %Flavor %Type_Descriptions @Type_Order);

while (<DATA>) {
chomp;
s/#.*//;
next unless $_;
($name, $type, $text) = split " ", $_, 3;
$Type{$name} = $type;
$Flavor{$name} = $text;
for $type ( split /[,\s]+/, $type ) {
push @{$Kinds{$type}}, $name;
}
}

unless (caller) {
foreach $type ( @Type_Order ) {
$list = join(", ", sort @{$Kinds{$type}});
$typedesc = $Type_Description{$type} . ":";
write;
}
}

BEGIN {

%Type_Description = (
'ARRAY' => 'Functions wfor real @ARRAYs',
'Binary' => 'Functions for fixed length data or records',
'File' => 'Functions for filehandles, files, or directories',
'Flow' => 'Keywords that control flow of your perl program',
'HASH' => 'Functions for real %HASHes',
'I/O' => 'Input and output functions',
'LIST' => 'Functions for list data',
'Math' => 'Numeric functions',
'Misc' => 'Miscellaneous functions',
'Modules' => 'Keywords related to perl modules',
'Network' => 'Fetching network info',
'Objects' => 'Keywords related to classes and object-orientedness',
'Process' => 'Functions for processes and process groups',
'Regexp' => 'Regular expressions and pattern matching',
'Socket' => 'Low-level socket functions',
'String' => 'Functions for SCALARs or strings',
'SysV' => 'System V interprocess communication functions',
'Time' => 'Time-related functions',
'User' => 'Fetching user and group info',
'Namespace' => 'Keywords altering or affecting scoping of identifiers',
);

@Type_Order = qw{
String
Regexp
Math
ARRAY
LIST
HASH
I/O
Binary
File
Flow
Namespace
Misc
Process
Modules
Objects
Socket
SysV
User
Network
Time
};

}

format =

^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$typedesc
~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$typedesc
~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$list
Re: function classification [ In reply to ]
Tom Christiansen writes:
>
> Here's the current list. Still not really happy with Binary.
> And the Unix category has become too sparse to continue its existence.
> Whereas might we put those two?

>
> UNIX getlogin, syscall
>

DOS ;-) ? If I remember correct, in one of the ancient DOS perls
syscalls were used to get to interrupts...

Ilya
Re: function classification [ In reply to ]
> From: jmm@elegant.com (John Macdonald)
>
> I think that one of the reasons that the degree of success
> that perl has achieved has been Larry's attention to careful
> choice of names - ensuring that names within the language
> are both sensible and work together.
>
> Tim has carried on that concept with the module list and
> organization of the module names.

I don't know how it started but from my earliest software projects
I've always done the initial conceptual design with a thesaurus handy.

Names are crucial.

Tim.

(I don't do it quite so much now but I think that's because I know
more words :-)
Re: function classification [ In reply to ]
Paul Hudson <paulh@harlequin.co.uk> writes:
PH> TC> NIS endgrent, endhostent, endnetent, endprotoent, endpwent,
PH> TC> endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
PH> TC> gethostbyname, gethostent, getnetbyaddr, getnetbyname,
PH> TC> getnetent, getprotobyname, getprotobynumber, getprotoent,
PH> TC> getpwent, getpwnam, getpwuid, getservbyname, getser<SNIP>
PH> TC> getservent, setgrent, sethostent, setnetent, setprotoent,
PH> TC> setpwent, setservent
PH>
PH> >> Is NIS intended to be the Product Formerly Known as Yellow Pages? Many
PH> >> of these exist even if NIS isn't used, so it seems an odd choice.
PH>
PH> TC> Ok. May this category be henceforth known as UNIX AND UNIX-DERIVED (EVEN
PH> TC> IF THEY DON'T LIKE IT) USER ACCOUNT AND NETWORKING ADMINISTRATIVE DATABASE
PH> TC> ACCESSOR FUNCTIONS.
PH>
PH> TC> Accuracy over brevity, of course. :-)
PH>
PH> Well, that's closer :) Actually, it may be a good split, too. Non-UNIX
PH> but TCP-IPish things would have to have some equivalent of getproto*,
PH> for instance, but they'd be unlikely to have getpw*.
PH>
PH> (My tame NT guru is away from his desk, so I can't ask how NT actually
PH> does it, but it does have a SERVICES file, apparently).

VMS also provides the option of using *host*, *serv*, and *proto*, when
socket support is included. The *net* routines aren't there, but may be
coming in the future (they're supported under some configurations, but not
others, so they're not part of the default Perl socket i/f under VMS).

Tim Bunce <Tim.Bunce@ig.co.uk> writes:
TB> This is more like what I had in mind:
TB>
TB> User getpwent, setpwent, endpwent, getpwnam, getpwuid,
TB> getgrent, setgrent, endgrent, getgrnam, getgrgid
TB>
TB> Network getnetent, setnetent, endnetent,
TB> getprotoent, setprotoent, endprotoent,
TB> gethostent, sethostent, endhostent,
TB> ...

The division seems reasonable. For the first group, I'd suggest
'Passwd' as a name, which reflects the organization of the user
information returned more or less into the format of an /etc/passwd
entry.

For the second group, I'd suggest 'Netdb', in order to distinguish
them from other network-related calls.

Regards,
Charles Bailey bailey@genetics.upenn.edu
Re: function classification [ In reply to ]
TC> NIS endgrent, endhostent, endnetent, endprotoent, endpwent,
TC> endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
TC> gethostbyname, gethostent, getnetbyaddr, getnetbyname,
TC> getnetent, getprotobyname, getprotobynumber, getprotoent,
TC> getpwent, getpwnam, getpwuid, getservbyname, getservbyport,
TC> getservent, setgrent, sethostent, setnetent, setprotoent,
TC> setpwent, setservent

Is NIS intended to be the Product Formerly Known as Yellow Pages? Many
of these exist even if NIS isn't used, so it seems an odd choice.
Re: function classification [ In reply to ]
TC> NIS endgrent, endhostent, endnetent, endprotoent, endpwent,
TC> endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
TC> gethostbyname, gethostent, getnetbyaddr, getnetbyname,
TC> getnetent, getprotobyname, getprotobynumber, getprotoent,
TC> getpwent, getpwnam, getpwuid, getservbyname, getser<SNIP>
TC> getservent, setgrent, sethostent, setnetent, setprotoent,
TC> setpwent, setservent

>> Is NIS intended to be the Product Formerly Known as Yellow Pages? Many
>> of these exist even if NIS isn't used, so it seems an odd choice.

TC> Ok. May this category be henceforth known as UNIX AND UNIX-DERIVED (EVEN
TC> IF THEY DON'T LIKE IT) USER ACCOUNT AND NETWORKING ADMINISTRATIVE DATABASE
TC> ACCESSOR FUNCTIONS.

TC> Accuracy over brevity, of course. :-)

Well, that's closer :) Actually, it may be a good split, too. Non-UNIX
but TCP-IPish things would have to have some equivalent of getproto*,
for instance, but they'd be unlikely to have getpw*.

(My tame NT guru is away from his desk, so I can't ask how NT actually
does it, but it does have a SERVICES file, apparently).

P.
Re: function classification [ In reply to ]
In <19026.9512191425@odin.cam.harlequin.co.uk>
On Tue, 19 Dec 95 14:25:33 GMT
Paul Hudson <paulh@harlequin.co.uk> writes:
> TC> NIS endgrent, endhostent, endnetent, endprotoent, endpwent,
> TC> endservent, getgrent, getgrgid, getgrnam, gethostbyaddr,
> TC> gethostbyname, gethostent, getnetbyaddr, getnetbyname,
> TC> getnetent, getprotobyname, getprotobynumber, getprotoent,
> TC> getpwent, getpwnam, getpwuid, getservbyname, getservbyport,
> TC> getservent, setgrent, sethostent, setnetent, setprotoent,
> TC> setpwent, setservent
>
>Is NIS intended to be the Product Formerly Known as Yellow Pages? Many
>of these exist even if NIS isn't used, so it seems an odd choice.

So long as it is not me (NI-S) ;-)
Re: function classification [ In reply to ]
TC> Ok. May this category be henceforth known as UNIX AND UNIX-DERIVED (EVEN
TC> IF THEY DON'T LIKE IT) USER ACCOUNT AND NETWORKING ADMINISTRATIVE DATABASE
TC> ACCESSOR FUNCTIONS.

TC> Accuracy over brevity, of course. :-)

pth> Well, that's closer :) Actually, it may be a good split, too. Non-UNIX
pth> but TCP-IPish things would have to have some equivalent of getproto*,
pth> for instance, but they'd be unlikely to have getpw*.

pth> (My tame NT guru is away from his desk, so I can't ask how NT actually
pth> does it, but it does have a SERVICES file, apparently).

He came back. And indeed getprotobyname etc exist on Windows. Since
(IMO) the networking ones are different from the UNIX-user/password
ones (in that they should exist on 'most anything that talks IP),
maybe they should be split off in Tom's list?
Re: [PERL] function classification [ In reply to ]

1 2  View All