=item umask: argument is missing initial 0
-(W) A umask of 222 is incorrect. It should be 0222, because octal literals
-always start with 0 in Perl, as in C.
+(W) A umask of 222 is incorrect. It should be 0222, because octal
+literals always start with 0 in Perl, as in C.
+
+=item umask not implemented
+
+(F) Your machine doesn't implement the umask function and you tried
+to use it to restrict permissions for yourself (EXPR & 0700).
=item Unable to create sub named "%s"
=item umask
Sets the umask for the process to EXPR and returns the previous value.
-If EXPR is omitted, merely returns the current umask. If C<umask(2)> is
-not implemented on your system, returns C<undef>. Remember that a
-umask is a number, usually given in octal; it is I<not> a string of octal
-digits. See also L</oct>, if all you have is a string.
+If EXPR is omitted, merely returns the current umask.
+
+If C<umask(2)> is not implemented on your system and you are trying to
+restrict access for I<yourself> (i.e., (EXPR & 0700) > 0), produces a
+fatal error at run time. If C<umask(2)> is not implemented and you are
+not trying to restrict access for yourself, returns C<undef>.
+
+Remember that a umask is a number, usually given in octal; it is I<not> a
+string of octal digits. See also L</oct>, if all you have is a string.
=item undef EXPR
`` qx{} Command yes (unless '' is delimiter)
qw{} Word list no
// m{} Pattern match yes
+ qr{} Pattern yes
s{}{} Substitution yes
tr{}{} Transliteration no (but see below)
if /(tcl|rexx|python)/; # :-)
$baz = "\n"; # a one-character string
+=item qr/STRING/imosx
+
+A string which is (possibly) interpolated and then compiled as a
+regular expression. The result may be used as a pattern in a match
+
+ $re = qr/$pattern/;
+ $string =~ /$re/;
+
+Options are:
+
+ i Do case-insensitive pattern matching.
+ m Treat string as multiple lines.
+ o Compile pattern only once.
+ s Treat string as single line.
+ x Use extended regular expressions.
+
+The benefit from this is that the pattern is compiled into an internal
+representation by the C<qr//> operator and not by the match operator.
+
+ foreach $pattern (@pattern_list) {
+ my $re = qr/$pattern/;
+ foreach $line (@lines) {
+ if($line =~ /$re/) {
+ do_something($line);
+ }
+ }
+ }
+
=item qx/STRING/
=item `STRING`
TAINT_PROPER("umask");
XPUSHi(anum);
#else
+ /* Only DIE if trying to restrict permissions on `user' (self).
+ * Otherwise it's harmless and more useful to just return undef
+ * since 'group' and 'other' concepts probably don't exist here. */
+ if (MAXARG >= 1 && (POPi & 0700))
+ DIE("umask not implemented");
XPUSHs(&sv_undef);
#endif
RETURN;
#ifdef HAS_SOCKET
if (op->op_type == OP_RECV) {
char namebuf[MAXPATHLEN];
-#if defined(VMS_DO_SOCKETS) && defined(DECCRTL_SOCKETS)
+#if (defined(VMS_DO_SOCKETS) && defined(DECCRTL_SOCKETS)) || defined(MPE)
bufsize = sizeof (struct sockaddr_in);
#else
bufsize = sizeof namebuf;
{
djSP;
#ifdef HAS_SOCKET
+#ifdef MPE /* Requires PRIV mode to bind() to ports < 1024 */
+ extern GETPRIVMODE();
+ extern GETUSERMODE();
+#endif
SV *addrsv = POPs;
char *addr;
GV *gv = (GV*)POPs;
register IO *io = GvIOn(gv);
STRLEN len;
+ int bind_ok = 0;
+#ifdef MPE
+ int mpeprivmode = 0;
+#endif
if (!io || !IoIFP(io))
goto nuts;
addr = SvPV(addrsv, len);
TAINT_PROPER("bind");
- if (PerlSock_bind(PerlIO_fileno(IoIFP(io)), (struct sockaddr *)addr, len) >= 0)
+#ifdef MPE /* Deal with MPE bind() peculiarities */
+ if (((struct sockaddr *)addr)->sa_family == AF_INET) {
+ /* The address *MUST* stupidly be zero. */
+ ((struct sockaddr_in *)addr)->sin_addr.s_addr = INADDR_ANY;
+ /* PRIV mode is required to bind() to ports < 1024. */
+ if (((struct sockaddr_in *)addr)->sin_port < 1024 &&
+ ((struct sockaddr_in *)addr)->sin_port > 0) {
+ GETPRIVMODE(); /* If this fails, we are aborted by MPE/iX. */
+ mpeprivmode = 1;
+ }
+ }
+#endif /* MPE */
+ if (PerlSock_bind(PerlIO_fileno(IoIFP(io)),
+ (struct sockaddr *)addr, len) >= 0)
+ bind_ok = 1;
+
+#ifdef MPE /* Switch back to USER mode */
+ if (mpeprivmode)
+ GETUSERMODE();
+#endif /* MPE */
+
+ if (bind_ok)
RETPUSHYES;
else
RETPUSHUNDEF;
die "You need to run \"make test\" first to set things up.\n"
unless -e 'perl' or -e 'perl.exe';
-#$ENV{PERL_DESTRUCT_LEVEL} = '2';
+$ENV{PERL_DESTRUCT_LEVEL} = 2; # check leakage for embedders
$ENV{EMXSHELL} = 'sh'; # For OS/2
if ($#ARGV == -1) {
print "1..0\n";
exit 0;
}
+ $ENV{PERL_DESTRUCT_LEVEL} = 0; # XXX known trouble with global destruction
}
$| = 1;
print "1..12\n";
print "1..58\n";
+$ENV{PERL_DESTRUCT_LEVEL} = 0; # XXX known to leaks scalars
+
sub foo {
local($a, $b) = @_;
local($c, $d);
}
eval 'use Config'; # Defaults assumed if this fails
+$ENV{PERL_DESTRUCT_LEVEL} = 0; # XXX known to leaks scalars
+
$x = "abc\ndef\n";
if ($x =~ /^abc/) {print "ok 1\n";} else {print "not ok 1\n";}
#!./perl
+$ENV{PERL_DESTRUCT_LEVEL} = 0; # XXX known to leaks scalars
+
# The tests are in a separate file 't/op/re_tests'.
# Each line in that file is a separate test.
# There are five columns, separated by tabs.
print "1..106\n";
+$ENV{PERL_DESTRUCT_LEVEL} = 0; # XXX known to leaks scalars
+
#P = start of string Q = start of substr R = end of substr S = end of string
$a = 'abcdefxyz';
print "1..15\n";
+$ENV{PERL_DESTRUCT_LEVEL} = 0; # XXX known to leaks scalars
+
print vec($foo,0,1) == 0 ? "ok 1\n" : "not ok 1\n";
print length($foo) == 0 ? "ok 2\n" : "not ok 2\n";
vec($foo,0,1) = 1;