releases.)
----------------
- Cast and Crew
----------------
+ ---------------
+ CAST AND CREW
+ ---------------
-To save space, and to give due honor to those who have made Perl 5.004
-what is is today, here are some of the more common names in the Changes
-file, and their current addresses (as of March 1997):
+To give due honor to those who have made Perl 5.004 what is is today,
+here are some of the more common names in the Changes file, and their
+current addresses (as of March 1997):
Gisle Aas <gisle@aas.no>
Kenneth Albanowski <kjahds@kjahds.com>
Chip Salzenberg <chip@perl.com>
--------------------
- Version 5.003_97f
--------------------
+-----------------
+Version 5.003_97g
+-----------------
+
+This one has two security bug fixes for buffer overflows. Perl has
+not yet been searched to see if more fixes are needed.
+
+ CORE LANGUAGE CHANGES
+
+ Title: "Improve sysseek(), remove systell(), fix Opcode"
+ From: Chip Salzenberg
+ Files: doio.c ext/Opcode/Makefile.PL ext/Opcode/Opcode.pm
+ ext/Opcode/Opcode.xs global.sym keywords.pl opcode.pl
+ pod/perldelta.pod pod/perldiag.pod pod/perlfunc.pod pp_sys.c
+ proto.h t/op/sysio.t toke.c
+
+ Title: "Fix (and test) spaces in {,un}pack()"
+ From: Chip Salzenberg
+ Files: pp.c t/op/pack.t
+
+ CORE PORTABILITY
+
+ Title: "Irix update"
+ From: Scott Henry <scotth@sgi.com>
+ Msg-ID: <yd8d8rsi0ln.fsf@hoshi.engr.sgi.com>
+ Date: 18 Apr 1997 12:37:24 -0700
+ Files: MANIFEST hints/irix_6.sh hints/irix_6_0.sh hints/irix_6_1.sh
+
+ Title: "ExtUtils/Miniperl.pm not built on Win32"
+ From: Nick Ing-Simmons
+ Msg-ID: <199704181742.SAA08407@ni-s.u-net.com>
+ Date: Fri, 18 Apr 1997 18:42:32 +0100
+ Files: win32/Makefile
+
+ OTHER CORE CHANGES
+
+ Title: "SECURITY FIX: 'Identifier too long'"
+ From: Chip Salzenberg
+ Files: pod/perldelta.pod pod/perldiag.pod toke.c
+
+ Title: "SECURITY FIX: Buffer overflow in gv_fetchfile()"
+ From: Chip Salzenberg
+ Files: gv.c
+
+ Title: "Remove pp_method() inefficiency from last patch"
+ From: Chip Salzenberg
+ Files: pp_hot.c
+
+ BUILD PROCESS
+
+ Title: "Fix unnecessary re-linking"
+ From: Chip Salzenberg
+ Files: lib/ExtUtils/MM_Unix.pm
+
+ Title: "Fix tcsh hack in Configure"
+ From: Chip Salzenberg
+ Files: Configure
+
+ Title: "Minor, optional patch to Makefile.SH"
+ From: "Randy J. Ray" <rjray@uswest.com>
+ Msg-ID: <rjray-9703180132.AA00374040@snakepit.ecte.uswc.uswest.com>
+ Date: Thu, 17 Apr 1997 19:32:17 -0600
+ Files: Makefile.SH
+
+ LIBRARY AND EXTENSIONS
+
+ Title: "Patch to Getopt::Long"
+ From: Johan Vromans <jvromans@squirrel.nl>
+ Msg-ID: <m0wIKCO-00081IC@phoenix.squirrel.nl>
+ Date: Fri, 18 Apr 97 22:24 MET DST
+ Files: lib/Getopt/Long.pm
+
+ Title: "Fix NAME in SDBM_File build"
+ From: Chip Salzenberg
+ Files: ext/SDBM_File/sdbm/Makefile.PL
+
+ TESTS
+
+ (no other changes)
+
+ UTILITIES
+
+ Title: "Make h2ph generate constant subs"
+ From: Roderick Schertler
+ Msg-ID: <pz2088w5ot.fsf@eeyore.ibcinc.com>
+ Date: 18 Apr 1997 14:23:46 -0400
+ Files: utils/h2ph.PL
+
+ DOCUMENTATION
+
+ Title: "Document {,un}pack changes"
+ From: Paul Marquess
+ Msg-ID: <9704181249.AA11733@claudius.bfsec.bt.co.uk>
+ Date: Fri, 18 Apr 97 13:49:39 BST
+ Files: pod/perldelta.pod pod/perldiag.pod
+
+
+-----------------
+Version 5.003_97f
+-----------------
This is it before _98. No more last-minute features. Really, I mean
it this time. No kidding.
Files: pod/perlfunc.pod
--------------------
- Version 5.003_97e
--------------------
+-----------------
+Version 5.003_97e
+-----------------
Y'know, I've heard of this "beta" thing, but it's been so long since
I've seen one, I'm not sure it really exists...
Files: pod/perlop.pod
--------------------
- Version 5.003_97d
--------------------
+-----------------
+Version 5.003_97d
+-----------------
Any minute now... second public beta... no, really...
Files: pod/perlpod.pod
--------------------
- Version 5.003_97c
--------------------
+-----------------
+Version 5.003_97c
+-----------------
That second public beta will be Real Soon Now...
Files: ext/IO/lib/IO/Socket.pm
--------------------
- Version 5.003_97b
--------------------
+-----------------
+Version 5.003_97b
+-----------------
Working on the second public beta...
Files: pod/perltrap.pod
--------------------
- Version 5.003_97a
--------------------
+-----------------
+Version 5.003_97a
+-----------------
This release gets a letter instead of a full subversion because I'm
planning on making 5.003_98 the second public beta.
pod/perlstyle.pod pod/perltoc.pod pod/perlvar.pod
-------------------
- Version 5.003_97
-------------------
+----------------
+Version 5.003_97
+----------------
CORE LANGUAGE CHANGES
Files: lib/CGI.pm lib/ExtUtils/Command.pm
-------------------
- Version 5.003_96
-------------------
+----------------
+Version 5.003_96
+----------------
CORE LANGUAGE CHANGES
Files: pod/*.pod
-------------------
- Version 5.003_95
-------------------
+----------------
+Version 5.003_95
+----------------
CORE LANGUAGE CHANGES
Files: pod/perlfaq*.pod
-------------------
- Version 5.003_94
-------------------
+----------------
+Version 5.003_94
+----------------
CORE LANGUAGE CHANGES
Files: ext/DB_File/DB_File.pm
-------------------
- Version 5.003_93
-------------------
+----------------
+Version 5.003_93
+----------------
Me, last time:
"This release will be the public beta of 5.004,
pod/perlop.pod pod/perlsub.pod
-------------------
- Version 5.003_92
-------------------
+----------------
+Version 5.003_92
+----------------
This release will be the public beta of 5.004, or my name isn't
Larson T. Pettifogger.
Files: pod/*.pod
-------------------
- Version 5.003_91
-------------------
+----------------
+Version 5.003_91
+----------------
This is (should be? must be!) the public beta of 5.004.
pod/perltoc.pod
-------------------
- Version 5.003_90
-------------------
+----------------
+Version 5.003_90
+----------------
At last, a mil[le]stone: The first beta of Perl 5.004.
Files: pod/perldiag.pod pod/perlsec.pod
-------------------
- Version 5.003_28
-------------------
+----------------
+Version 5.003_28
+----------------
This release is beta candidate #6. If this isn't good enough to go beta,
I'll eat a floppy disk. (Okay, it's a chocolate floppy, but still....)
pod/perltie.pod pod/perltoc.pod pod/perltrap.pod x2p/a2p.pod
-------------------
- Version 5.003_27
-------------------
+----------------
+Version 5.003_27
+----------------
This release is beta candidate #5: Our last, best hope for a beta.
Files: pod/perldiag.pod
-------------------
- Version 5.003_26
-------------------
+----------------
+Version 5.003_26
+----------------
This release is beta candidate #4. "Once more, dear friends...."
Files: pod/perltie.pod
-------------------
- Version 5.003_25
-------------------
+----------------
+Version 5.003_25
+----------------
This release is beta candidate #3. Here's hoping...
Files: pod/perldiag.pod
-------------------
- Version 5.003_24
-------------------
+----------------
+Version 5.003_24
+----------------
This release is the second candidate for a public beta test.
It's, well, bunches better than _23.
Files: pod/perlsyn.pod
-------------------
- Version 5.003_23
-------------------
+----------------
+Version 5.003_23
+----------------
This release is our first candidate for a public beta test.
Files: pod/perllocale.pod
-------------------
- Version 5.003_22
-------------------
+----------------
+Version 5.003_22
+----------------
This release is primarily made up of bug fixes, the foremost among
which repairs a showstopper memory corruption bug in formats.
Files: configpm
-------------------
- Version 5.003_21
-------------------
+----------------
+Version 5.003_21
+----------------
This release includes several important bug fixes, and a couple of
minor but valuable language tweaks. Please read on for a list of the
Files: pod/perlsub.pod pod/perltoc.pod pod/perlvar.pod
-------------------
- Version 5.003_20
-------------------
+----------------
+Version 5.003_20
+----------------
The only language change in this release is the recension of support
for named closures: Now, no subroutine declared "sub foo {}" can be
Files: pod/perlfunc.pod pod/perltoc.pod
-------------------
- Version 5.003_19
-------------------
+----------------
+Version 5.003_19
+----------------
Lots of internal cleanup in this patch, especially plugged memory
leaks when embedded Perl interpreters shut down and restart. The
vms/descrip.mms
-------------------
- Version 5.003_18
-------------------
+----------------
+Version 5.003_18
+----------------
Yet further down the road to 5.004....
Files: pod/perldiag.pod
-------------------
- Version 5.003_17
-------------------
+----------------
+Version 5.003_17
+----------------
The rate of patches is slowing down.... I see 5.004 at the end of the
tunnel! (Hey, what's that whistle?)
Files: pod/perllocale.pod
-------------------
- Version 5.003_16
-------------------
+----------------
+Version 5.003_16
+----------------
This patch is all bug fixes, library updates, and documentation
updates. We'll get to 5.004 RSN, I promise. :-)
Files: pod/perllocale.pod
-------------------
- Version 5.003_15
-------------------
+----------------
+Version 5.003_15
+----------------
As soon as I posted 5.003_14, I found a fatal error in it. :-(
changes that were supposed to be improvements, but weren't.
-------------------
- Version 5.003_14
-------------------
+----------------
+Version 5.003_14
+----------------
We seem to have achieved "release candidate" status.
Files: lib/Class/Template.pm lib/Time/tm.pm
-------------------
- Version 5.003_13
-------------------
+----------------
+Version 5.003_13
+----------------
The watchword here is "synchronization." There were a couple of
show-stopper bugs in 5.003_12, so I'm issuing this patch to bring
Files: pod/perlpod.pod pod/pod2html.PL
-------------------
- Version 5.003_12
-------------------
+----------------
+Version 5.003_12
+----------------
This patch is huge. A multitude of bug fixes, new modules (especially
CPAN and Net::FTP), a couple of new Configure variables, updated
Date: Sat, 14 Dec 1996 18:56:33 -0700
Files: pod/*
-------------------
- Version 5.003_11
-------------------
+----------------
+Version 5.003_11
+----------------
This patch is (still) closing in on 5.004. Nothing dramatic, lots of
value.
Files: ext/DB_File/DB_File.pm ext/DB_File/DB_File.xs
-------------------
- Version 5.003_10
-------------------
+----------------
+Version 5.003_10
+----------------
This patch is closing in on 5.004. It contains lots of small and
valuable changes, but nothing dramatic.
Files: pod/perlfunc.pod
-------------------
- Version 5.003_09
-------------------
+----------------
+Version 5.003_09
+----------------
This patch was a compendium of various fixes and enhancements from
many people, including some serious improvement in lexical variable
Files: x2p/util.c
-------------------
- Version 5.003_08
-------------------
+----------------
+Version 5.003_08
+----------------
This patch was a compendium of various fixes and enhancements from
many people. Here are some of the more significant changes.
Files: x2p/a2p.c x2p/a2p.y
-------------------
- Version 5.003_07
-------------------
+----------------
+Version 5.003_07
+----------------
This patch was primarily to fix bugs or include little things I missed
in 5.003_06. 5.003_07 is intended to be stable enough to merit serious
pathname of the file being extracted.
-------------------
- Version 5.003_06
-------------------
+----------------
+Version 5.003_06
+----------------
This patch was primarily to fix bugs, improve the documentation,
and work towards restoring binary compatibility with 5.003.
I then embedded the pod into the s2p script.
-------------------
- Version 5.003_05
-------------------
+----------------
+Version 5.003_05
+----------------
This patch was primarily to fix bugs and to clean up some of
the remaining issues from in 5.003_04. The details are described below.
VMS 5.003_05 Update.
-------------------
- Version 5.003_04
-------------------
+----------------
+Version 5.003_04
+----------------
This patch was primarily to fix bugs and to clean up some of
the changes made in 5.003_03. The details are described below.
doesn't support the -x option.)
-------------------
- Version 5.003_03
-------------------
+----------------
+Version 5.003_03
+----------------
Most of the changes in 5.003_03 are to make the build and installation
process more robust. The details are described below. A very brief
Use Configure's FILE_filbuf macro instead of a raw _filbuf.
-------------------
- Version 5.003_02
-------------------
+----------------
+Version 5.003_02
+----------------
o Visible Changes to Core Functionality
- Redefining constant subs, or changing sub's prototype now give warnings.
- Typo patch for VMS.
-------------------
- Version 5.003_01
-------------------
+----------------
+Version 5.003_01
+----------------
Version 5.003_01 contains bugfixes and additions accumulated since
version 5.002_01, since the patch to version 5.003 was deliberately
if (PerlIO_eof(fp))
(void)PerlIO_seek(fp, 0L, 2); /* ultrix 1.2 workaround */
#endif
- if (op->op_type == OP_SYSTELL)
- return lseek(PerlIO_fileno(fp), 0L, 1);
- else
- return PerlIO_tell(fp);
+ return PerlIO_tell(fp);
}
if (dowarn)
- warn("%s() on unopened file", op_name[op->op_type]);
+ warn("tell() on unopened file");
SETERRNO(EBADF,RMS$_IFI);
return -1L;
}
if (PerlIO_eof(fp))
(void)PerlIO_seek(fp, 0L, 2); /* ultrix 1.2 workaround */
#endif
- if (op->op_type == OP_SYSSEEK)
- return lseek(PerlIO_fileno(fp), pos, whence) >= 0;
- else
- return PerlIO_seek(fp, pos, whence) >= 0;
+ return PerlIO_seek(fp, pos, whence) >= 0;
}
if (dowarn)
- warn("%s() on unopened file", op_name[op->op_type]);
+ warn("seek() on unopened file");
SETERRNO(EBADF,RMS$_IFI);
return FALSE;
}
+long
+do_sysseek(gv, pos, whence)
+GV *gv;
+long pos;
+int whence;
+{
+ register IO *io;
+ register PerlIO *fp;
+
+ if (gv && (io = GvIO(gv)) && (fp = IoIFP(io)))
+ return lseek(PerlIO_fileno(fp), pos, whence);
+ if (dowarn)
+ warn("sysseek() on unopened file");
+ SETERRNO(EBADF,RMS$_IFI);
+ return -1L;
+}
+
#if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE) && defined(F_FREESP)
/* code courtesy of William Kucharski */
#define HAS_CHSIZE
#define do_semop Perl_do_semop
#define do_shmio Perl_do_shmio
#define do_sprintf Perl_do_sprintf
+#define do_sysseek Perl_do_sysseek
#define do_tell Perl_do_tell
#define do_trans Perl_do_trans
#define do_vecset Perl_do_vecset
NAME => 'Opcode',
MAN3PODS => ' ',
VERSION_FROM => 'Opcode.pm',
- XS_VERSION => '1.01'
+ XS_VERSION => '1.02'
);
use vars qw($VERSION $XS_VERSION @ISA @EXPORT_OK);
-$VERSION = "1.03";
-$XS_VERSION = "1.01";
+$VERSION = "1.04";
+$XS_VERSION = "1.02";
use strict;
use Carp;
print sysread syswrite send recv
- eof tell seek systell sysseek
+ eof tell seek sysseek
readdir telldir seekdir rewinddir
while(i-- > 0)
bitmap[i] = 0xFF;
/* Take care to set the right number of bits in the last byte */
- bitmap[len-1] = ~(0xFF << (maxo & 0x07));
+ bitmap[len-1] = (maxo & 0x07) ? ~(0xFF << (maxo & 0x07)) : 0xFF;
put_op_bitspec(":all",0, opset_all); /* don't mortalise */
}
while(len-- > 0)
bitmap[len] = ~bitmap[len];
/* take care of extra bits beyond maxo in last byte */
- bitmap[opset_len-1] &= ~(0xFF << (maxo & 0x07));
+ if (maxo & 07)
+ bitmap[opset_len-1] &= ~(0xFF << (maxo & 0x07));
}
ST(0) = opset;
=item lseek
-Move the read/write file pointer. This uses file descriptors such as
+Move the file's read/write position. This uses file descriptors such as
those obtained by calling C<POSIX::open>.
$fd = POSIX::open( "foo", &POSIX::O_RDONLY );
do_semop
do_shmio
do_sprintf
+do_sysseek
do_tell
do_trans
do_vecset
#define KEY_sysopen 211
#define KEY_sysread 212
#define KEY_sysseek 213
-#define KEY_systell 214
-#define KEY_system 215
-#define KEY_syswrite 216
-#define KEY_tell 217
-#define KEY_telldir 218
-#define KEY_tie 219
-#define KEY_tied 220
-#define KEY_time 221
-#define KEY_times 222
-#define KEY_tr 223
-#define KEY_truncate 224
-#define KEY_uc 225
-#define KEY_ucfirst 226
-#define KEY_umask 227
-#define KEY_undef 228
-#define KEY_unless 229
-#define KEY_unlink 230
-#define KEY_unpack 231
-#define KEY_unshift 232
-#define KEY_untie 233
-#define KEY_until 234
-#define KEY_use 235
-#define KEY_utime 236
-#define KEY_values 237
-#define KEY_vec 238
-#define KEY_wait 239
-#define KEY_waitpid 240
-#define KEY_wantarray 241
-#define KEY_warn 242
-#define KEY_while 243
-#define KEY_write 244
-#define KEY_x 245
-#define KEY_xor 246
-#define KEY_y 247
+#define KEY_system 214
+#define KEY_syswrite 215
+#define KEY_tell 216
+#define KEY_telldir 217
+#define KEY_tie 218
+#define KEY_tied 219
+#define KEY_time 220
+#define KEY_times 221
+#define KEY_tr 222
+#define KEY_truncate 223
+#define KEY_uc 224
+#define KEY_ucfirst 225
+#define KEY_umask 226
+#define KEY_undef 227
+#define KEY_unless 228
+#define KEY_unlink 229
+#define KEY_unpack 230
+#define KEY_unshift 231
+#define KEY_untie 232
+#define KEY_until 233
+#define KEY_use 234
+#define KEY_utime 235
+#define KEY_values 236
+#define KEY_vec 237
+#define KEY_wait 238
+#define KEY_waitpid 239
+#define KEY_wantarray 240
+#define KEY_warn 241
+#define KEY_while 242
+#define KEY_write 243
+#define KEY_x 244
+#define KEY_xor 245
+#define KEY_y 246
sysopen
sysread
sysseek
-systell
system
syswrite
tell
OP_PRTF, /* 205 */
OP_PRINT, /* 206 */
OP_SYSOPEN, /* 207 */
- OP_SYSTELL, /* 208 */
- OP_SYSSEEK, /* 209 */
- OP_SYSREAD, /* 210 */
- OP_SYSWRITE, /* 211 */
- OP_SEND, /* 212 */
- OP_RECV, /* 213 */
- OP_EOF, /* 214 */
- OP_TELL, /* 215 */
- OP_SEEK, /* 216 */
- OP_TRUNCATE, /* 217 */
- OP_FCNTL, /* 218 */
- OP_IOCTL, /* 219 */
- OP_FLOCK, /* 220 */
- OP_SOCKET, /* 221 */
- OP_SOCKPAIR, /* 222 */
- OP_BIND, /* 223 */
- OP_CONNECT, /* 224 */
- OP_LISTEN, /* 225 */
- OP_ACCEPT, /* 226 */
- OP_SHUTDOWN, /* 227 */
- OP_GSOCKOPT, /* 228 */
- OP_SSOCKOPT, /* 229 */
- OP_GETSOCKNAME, /* 230 */
- OP_GETPEERNAME, /* 231 */
- OP_LSTAT, /* 232 */
- OP_STAT, /* 233 */
- OP_FTRREAD, /* 234 */
- OP_FTRWRITE, /* 235 */
- OP_FTREXEC, /* 236 */
- OP_FTEREAD, /* 237 */
- OP_FTEWRITE, /* 238 */
- OP_FTEEXEC, /* 239 */
- OP_FTIS, /* 240 */
- OP_FTEOWNED, /* 241 */
- OP_FTROWNED, /* 242 */
- OP_FTZERO, /* 243 */
- OP_FTSIZE, /* 244 */
- OP_FTMTIME, /* 245 */
- OP_FTATIME, /* 246 */
- OP_FTCTIME, /* 247 */
- OP_FTSOCK, /* 248 */
- OP_FTCHR, /* 249 */
- OP_FTBLK, /* 250 */
- OP_FTFILE, /* 251 */
- OP_FTDIR, /* 252 */
- OP_FTPIPE, /* 253 */
- OP_FTLINK, /* 254 */
- OP_FTSUID, /* 255 */
- OP_FTSGID, /* 256 */
- OP_FTSVTX, /* 257 */
- OP_FTTTY, /* 258 */
- OP_FTTEXT, /* 259 */
- OP_FTBINARY, /* 260 */
- OP_CHDIR, /* 261 */
- OP_CHOWN, /* 262 */
- OP_CHROOT, /* 263 */
- OP_UNLINK, /* 264 */
- OP_CHMOD, /* 265 */
- OP_UTIME, /* 266 */
- OP_RENAME, /* 267 */
- OP_LINK, /* 268 */
- OP_SYMLINK, /* 269 */
- OP_READLINK, /* 270 */
- OP_MKDIR, /* 271 */
- OP_RMDIR, /* 272 */
- OP_OPEN_DIR, /* 273 */
- OP_READDIR, /* 274 */
- OP_TELLDIR, /* 275 */
- OP_SEEKDIR, /* 276 */
- OP_REWINDDIR, /* 277 */
- OP_CLOSEDIR, /* 278 */
- OP_FORK, /* 279 */
- OP_WAIT, /* 280 */
- OP_WAITPID, /* 281 */
- OP_SYSTEM, /* 282 */
- OP_EXEC, /* 283 */
- OP_KILL, /* 284 */
- OP_GETPPID, /* 285 */
- OP_GETPGRP, /* 286 */
- OP_SETPGRP, /* 287 */
- OP_GETPRIORITY, /* 288 */
- OP_SETPRIORITY, /* 289 */
- OP_TIME, /* 290 */
- OP_TMS, /* 291 */
- OP_LOCALTIME, /* 292 */
- OP_GMTIME, /* 293 */
- OP_ALARM, /* 294 */
- OP_SLEEP, /* 295 */
- OP_SHMGET, /* 296 */
- OP_SHMCTL, /* 297 */
- OP_SHMREAD, /* 298 */
- OP_SHMWRITE, /* 299 */
- OP_MSGGET, /* 300 */
- OP_MSGCTL, /* 301 */
- OP_MSGSND, /* 302 */
- OP_MSGRCV, /* 303 */
- OP_SEMGET, /* 304 */
- OP_SEMCTL, /* 305 */
- OP_SEMOP, /* 306 */
- OP_REQUIRE, /* 307 */
- OP_DOFILE, /* 308 */
- OP_ENTEREVAL, /* 309 */
- OP_LEAVEEVAL, /* 310 */
- OP_ENTERTRY, /* 311 */
- OP_LEAVETRY, /* 312 */
- OP_GHBYNAME, /* 313 */
- OP_GHBYADDR, /* 314 */
- OP_GHOSTENT, /* 315 */
- OP_GNBYNAME, /* 316 */
- OP_GNBYADDR, /* 317 */
- OP_GNETENT, /* 318 */
- OP_GPBYNAME, /* 319 */
- OP_GPBYNUMBER, /* 320 */
- OP_GPROTOENT, /* 321 */
- OP_GSBYNAME, /* 322 */
- OP_GSBYPORT, /* 323 */
- OP_GSERVENT, /* 324 */
- OP_SHOSTENT, /* 325 */
- OP_SNETENT, /* 326 */
- OP_SPROTOENT, /* 327 */
- OP_SSERVENT, /* 328 */
- OP_EHOSTENT, /* 329 */
- OP_ENETENT, /* 330 */
- OP_EPROTOENT, /* 331 */
- OP_ESERVENT, /* 332 */
- OP_GPWNAM, /* 333 */
- OP_GPWUID, /* 334 */
- OP_GPWENT, /* 335 */
- OP_SPWENT, /* 336 */
- OP_EPWENT, /* 337 */
- OP_GGRNAM, /* 338 */
- OP_GGRGID, /* 339 */
- OP_GGRENT, /* 340 */
- OP_SGRENT, /* 341 */
- OP_EGRENT, /* 342 */
- OP_GETLOGIN, /* 343 */
- OP_SYSCALL, /* 344 */
+ OP_SYSSEEK, /* 208 */
+ OP_SYSREAD, /* 209 */
+ OP_SYSWRITE, /* 210 */
+ OP_SEND, /* 211 */
+ OP_RECV, /* 212 */
+ OP_EOF, /* 213 */
+ OP_TELL, /* 214 */
+ OP_SEEK, /* 215 */
+ OP_TRUNCATE, /* 216 */
+ OP_FCNTL, /* 217 */
+ OP_IOCTL, /* 218 */
+ OP_FLOCK, /* 219 */
+ OP_SOCKET, /* 220 */
+ OP_SOCKPAIR, /* 221 */
+ OP_BIND, /* 222 */
+ OP_CONNECT, /* 223 */
+ OP_LISTEN, /* 224 */
+ OP_ACCEPT, /* 225 */
+ OP_SHUTDOWN, /* 226 */
+ OP_GSOCKOPT, /* 227 */
+ OP_SSOCKOPT, /* 228 */
+ OP_GETSOCKNAME, /* 229 */
+ OP_GETPEERNAME, /* 230 */
+ OP_LSTAT, /* 231 */
+ OP_STAT, /* 232 */
+ OP_FTRREAD, /* 233 */
+ OP_FTRWRITE, /* 234 */
+ OP_FTREXEC, /* 235 */
+ OP_FTEREAD, /* 236 */
+ OP_FTEWRITE, /* 237 */
+ OP_FTEEXEC, /* 238 */
+ OP_FTIS, /* 239 */
+ OP_FTEOWNED, /* 240 */
+ OP_FTROWNED, /* 241 */
+ OP_FTZERO, /* 242 */
+ OP_FTSIZE, /* 243 */
+ OP_FTMTIME, /* 244 */
+ OP_FTATIME, /* 245 */
+ OP_FTCTIME, /* 246 */
+ OP_FTSOCK, /* 247 */
+ OP_FTCHR, /* 248 */
+ OP_FTBLK, /* 249 */
+ OP_FTFILE, /* 250 */
+ OP_FTDIR, /* 251 */
+ OP_FTPIPE, /* 252 */
+ OP_FTLINK, /* 253 */
+ OP_FTSUID, /* 254 */
+ OP_FTSGID, /* 255 */
+ OP_FTSVTX, /* 256 */
+ OP_FTTTY, /* 257 */
+ OP_FTTEXT, /* 258 */
+ OP_FTBINARY, /* 259 */
+ OP_CHDIR, /* 260 */
+ OP_CHOWN, /* 261 */
+ OP_CHROOT, /* 262 */
+ OP_UNLINK, /* 263 */
+ OP_CHMOD, /* 264 */
+ OP_UTIME, /* 265 */
+ OP_RENAME, /* 266 */
+ OP_LINK, /* 267 */
+ OP_SYMLINK, /* 268 */
+ OP_READLINK, /* 269 */
+ OP_MKDIR, /* 270 */
+ OP_RMDIR, /* 271 */
+ OP_OPEN_DIR, /* 272 */
+ OP_READDIR, /* 273 */
+ OP_TELLDIR, /* 274 */
+ OP_SEEKDIR, /* 275 */
+ OP_REWINDDIR, /* 276 */
+ OP_CLOSEDIR, /* 277 */
+ OP_FORK, /* 278 */
+ OP_WAIT, /* 279 */
+ OP_WAITPID, /* 280 */
+ OP_SYSTEM, /* 281 */
+ OP_EXEC, /* 282 */
+ OP_KILL, /* 283 */
+ OP_GETPPID, /* 284 */
+ OP_GETPGRP, /* 285 */
+ OP_SETPGRP, /* 286 */
+ OP_GETPRIORITY, /* 287 */
+ OP_SETPRIORITY, /* 288 */
+ OP_TIME, /* 289 */
+ OP_TMS, /* 290 */
+ OP_LOCALTIME, /* 291 */
+ OP_GMTIME, /* 292 */
+ OP_ALARM, /* 293 */
+ OP_SLEEP, /* 294 */
+ OP_SHMGET, /* 295 */
+ OP_SHMCTL, /* 296 */
+ OP_SHMREAD, /* 297 */
+ OP_SHMWRITE, /* 298 */
+ OP_MSGGET, /* 299 */
+ OP_MSGCTL, /* 300 */
+ OP_MSGSND, /* 301 */
+ OP_MSGRCV, /* 302 */
+ OP_SEMGET, /* 303 */
+ OP_SEMCTL, /* 304 */
+ OP_SEMOP, /* 305 */
+ OP_REQUIRE, /* 306 */
+ OP_DOFILE, /* 307 */
+ OP_ENTEREVAL, /* 308 */
+ OP_LEAVEEVAL, /* 309 */
+ OP_ENTERTRY, /* 310 */
+ OP_LEAVETRY, /* 311 */
+ OP_GHBYNAME, /* 312 */
+ OP_GHBYADDR, /* 313 */
+ OP_GHOSTENT, /* 314 */
+ OP_GNBYNAME, /* 315 */
+ OP_GNBYADDR, /* 316 */
+ OP_GNETENT, /* 317 */
+ OP_GPBYNAME, /* 318 */
+ OP_GPBYNUMBER, /* 319 */
+ OP_GPROTOENT, /* 320 */
+ OP_GSBYNAME, /* 321 */
+ OP_GSBYPORT, /* 322 */
+ OP_GSERVENT, /* 323 */
+ OP_SHOSTENT, /* 324 */
+ OP_SNETENT, /* 325 */
+ OP_SPROTOENT, /* 326 */
+ OP_SSERVENT, /* 327 */
+ OP_EHOSTENT, /* 328 */
+ OP_ENETENT, /* 329 */
+ OP_EPROTOENT, /* 330 */
+ OP_ESERVENT, /* 331 */
+ OP_GPWNAM, /* 332 */
+ OP_GPWUID, /* 333 */
+ OP_GPWENT, /* 334 */
+ OP_SPWENT, /* 335 */
+ OP_EPWENT, /* 336 */
+ OP_GGRNAM, /* 337 */
+ OP_GGRGID, /* 338 */
+ OP_GGRENT, /* 339 */
+ OP_SGRENT, /* 340 */
+ OP_EGRENT, /* 341 */
+ OP_GETLOGIN, /* 342 */
+ OP_SYSCALL, /* 343 */
OP_max
} opcode;
-#define MAXO 345
+#define MAXO 344
#ifndef DOINIT
EXT char *op_name[];
"prtf",
"print",
"sysopen",
- "systell",
"sysseek",
"sysread",
"syswrite",
"printf",
"print",
"sysopen",
- "systell",
"sysseek",
"sysread",
"syswrite",
OP * pp_prtf _((void));
OP * pp_print _((void));
OP * pp_sysopen _((void));
-OP * pp_systell _((void));
OP * pp_sysseek _((void));
OP * pp_sysread _((void));
OP * pp_syswrite _((void));
pp_prtf,
pp_print,
pp_sysopen,
- pp_systell,
pp_sysseek,
pp_sysread,
pp_syswrite,
ck_listiob, /* prtf */
ck_listiob, /* print */
ck_fun, /* sysopen */
- ck_fun, /* systell */
ck_fun, /* sysseek */
ck_fun, /* sysread */
ck_fun, /* syswrite */
0x00002e15, /* prtf */
0x00002e15, /* print */
0x00911604, /* sysopen */
- 0x00000e0c, /* systell */
0x00011604, /* sysseek */
0x0091761d, /* sysread */
0x0091161d, /* syswrite */
print print ck_listiob ims F? L
sysopen sysopen ck_fun s F S S S?
-systell systell ck_fun st F?
sysseek sysseek ck_fun s F S S
sysread sysread ck_fun imst F R S S?
syswrite syswrite ck_fun imst F S S S?
,"Dev97D - Fourth development patch to 5.003_97"
,"Dev97E - Fifth development patch to 5.003_97"
,"Dev97F - Sixth development patch to 5.003_97"
+ ,"Dev97G - Seventh development patch to 5.003_97"
,NULL
};
first. Bit eight of each byte is set, except for the last byte, in
which bit eight is clear.
-=item sysseek() and systell()
+Both pack() and unpack() now fail when their templates contain invalid
+types. (Invalid types used to be ignored.)
-These are new. The sysseek() operator is a variant of seek() that works
-on the system file pointer. It is the only reliable way to seek before
-using sysread() or syswrite(). Its companion operator systell() reports
-the current position of the system file pointer.
+=item sysseek()
+
+The new sysseek() operator is a variant of seek() that sets and gets the
+file's system read/write position, using the lseek(2) system call. It is
+the only reliable way to seek before using sysread() or syswrite(). Its
+return value is the new position, or the undefined value on failure.
=item use VERSION
=item C<perl_eval_pv>
-A new function handy for eval'ing strings of Perl code inside C code.
+A new function handy for eval'ing strings of Perl code inside C code.
This function returns the value from the eval statement, which can
be used instead of fetching globals from the symbol table. See
L<perlguts>, L<perlembed> and L<perlcall> for details and examples.
subroutine) by unconventional means, such as a goto, or a loop control
statement. See L<perlfunc/sort>.
+=item Identifier too long
+
+(F) Perl limits identifiers (names for variables, functions, etc.) to
+252 characters for simple names, somewhat more for compound names (like
+C<$A::B>). You've exceeded Perl's limits. Future versions of Perl are
+likely to eliminate these arbitrary limitations.
+
=item Illegal character %s (carriage return)
(F) A carriage return character was found in the input. This is an
think csh is missing. In either case, after editing config.sh, run
C<./Configure -S> and rebuild Perl.
+=item Invalid type in pack: '%s'
+
+(F) The given character is not a valid pack type. See L<perlfunc/pack>.
+
+=item Invalid type in unpack: '%s'
+
+(F) The given character is not a valid unpack type. See L<perlfunc/unpack>.
+
=item Name "%s::%s" used only once: possible typo
(W) Typographical errors often show up as unique variable names.
(D) Really old Perl let you omit the % on hash names in some spots. This
is now heavily deprecated.
+=item Identifier too long
+
+(F) Perl limits identifiers (names for variables, functions, etc.) to
+252 characters for simple names, somewhat more for compound names (like
+C<$A::B>). You've exceeded Perl's limits. Future versions of Perl are
+likely to eliminate these arbitrary limitations.
+
=item Ill-formed logical name |%s| in prime_env_iter
(W) A warning peculiar to VMS. A logical name was encountered when preparing
=item Invalid type in pack: '%s'
-(F) The given character is not a valid pack type. See L<perlop/pack>.
+(F) The given character is not a valid pack type. See L<perlfunc/pack>.
=item Invalid type in unpack: '%s'
-(F) The given character is not a valid unpack type. See L<perlop/unpack>.
+(F) The given character is not a valid unpack type. See L<perlfunc/unpack>.
=item ioctl is not implemented
(W) The filehandle you're writing to got itself closed sometime before now.
Check your logic flow.
-=item %stell() on unopened file
+=item tell() on unopened file
-(W) You tried to use the tell() or systell() function on a filehandle that
-was either never opened or has since been closed.
+(W) You tried to use the tell() function on a filehandle that was either
+never opened or has since been closed.
=item Test on unopened file E<lt>%sE<gt>
binmode, close, closedir, dbmclose, dbmopen, die, eof,
fileno, flock, format, getc, print, printf, read, readdir,
rewinddir, seek, seekdir, select, syscall, sysread, sysseek,
-systell, syswrite, tell, telldir, truncate, warn, write
+syswrite, tell, telldir, truncate, warn, write
=item Functions for fixed length data or records
See L<perlform> for many details and examples.
-=item formline PICTURE, LIST
+=item formline PICTURE,LIST
This is an internal function used by C<format>s, though you may call it
too. It formats (see L<perlform>) a list of values according to the
=item seek FILEHANDLE,POSITION,WHENCE
-Randomly positions the file pointer for FILEHANDLE, just like the fseek()
-call of stdio. FILEHANDLE may be an expression whose value gives the name
-of the filehandle. The values for WHENCE are 0 to set the file pointer to
-POSITION, 1 to set the it to current plus POSITION, and 2 to set it to EOF
-plus offset. You may use the values SEEK_SET, SEEK_CUR, and SEEK_END for
-this from either the IO::Seekable or the POSIX module. Returns 1 upon
-success, 0 otherwise.
-
-If you want to position a file pointer for sysread() or syswrite(), don't
-use seek() -- buffering makes its effect on the system file pointer
+Sets FILEHANDLE's position, just like the fseek() call of stdio.
+FILEHANDLE may be an expression whose value gives the name of the
+filehandle. The values for WHENCE are 0 to set the new position to
+POSITION, 1 to set it to the current position plus POSITION, and 2 to
+set it to EOF plus POSITION (typically negative). For WHENCE you may
+use the constants SEEK_SET, SEEK_CUR, and SEEK_END from either the
+IO::Seekable or the POSIX module. Returns 1 upon success, 0 otherwise.
+
+If you want to position file for sysread() or syswrite(), don't use
+seek() -- buffering makes its effect on the file's system position
unpredictable and non-portable. Use sysseek() instead.
On some systems you have to do a seek whenever you switch between reading
and writing. Amongst other things, this may have the effect of calling
-stdio's clearerr(3). A "whence" of 1 (SEEK_CUR) is useful for not moving
-the file pointer:
+stdio's clearerr(3). A WHENCE of 1 (SEEK_CUR) is useful for not moving
+the file position:
seek(TEST,0,1);
This is also useful for applications emulating C<tail -f>. Once you hit
EOF on your read, and then sleep for a while, you might have to stick in a
-seek() to reset things. First the simple trick listed above to clear the
-filepointer. The seek() doesn't change the current position, but it
-I<does> clear the end-of-file condition on the handle, so that the next
-C<E<lt>FILEE<gt>> makes Perl try again to read something. We hope.
+seek() to reset things. The seek() doesn't change the current position,
+but it I<does> clear the end-of-file condition on the handle, so that the
+next C<E<lt>FILEE<gt>> makes Perl try again to read something. We hope.
If that doesn't work (some stdios are particularly cantankerous), then
you may need something more like this:
=item sysseek FILEHANDLE,POSITION,WHENCE
-Randomly positions the system file pointer for FILEHANDLE using the
-system call lseek(2). It bypasses stdio, so mixing this with reads
-(other than sysread()), print(), write(), seek(), or tell() may cause
-confusion. FILEHANDLE may be an expression whose value gives the name
-of the filehandle. The values for WHENCE are 0 to set the file pointer
-to POSITION, 1 to set the it to current plus POSITION, and 2 to set it
-to EOF plus offset. You may use the values SEEK_SET, SEEK_CUR, and
-SEEK_END for this from either the IO::Seekable or the POSIX module.
-Returns 1 upon success, 0 otherwise. See also L</systell>.
-
-=item systell FILEHANDLE
-
-=item systell
-
-Returns the current position of the system file pointer for FILEHANDLE
-as reported by the system call lseek(2). It bypasses stdio, so mixing
-this with reads (other than sysread()), print(), write(), seek(), or
-tell() may cause confusion. FILEHANDLE may be an expression whose value
-gives the name of the actual filehandle. If FILEHANDLE is omitted,
-assumes the file last read. See also L</sysseek>.
+Sets FILEHANDLE's system position using the system call lseek(2). It
+bypasses stdio, so mixing this with reads (other than sysread()),
+print(), write(), seek(), or tell() may cause confusion. FILEHANDLE may
+be an expression whose value gives the name of the filehandle. The
+values for WHENCE are 0 to set the new position to POSITION, 1 to set
+the it to the current position plus POSITION, and 2 to set it to EOF
+plus POSITION (typically negative). For WHENCE, you may use the
+constants SEEK_SET, SEEK_CUR, and SEEK_END from either the IO::Seekable
+or the POSIX module.
+
+Returns the new position, or the undefined value on failure. A position
+of zero is returned as the string "0 but true"; thus sysseek() returns
+TRUE on success and FALSE on failure, yet you can still easily determine
+the new position.
=item system LIST
=item tell
-Returns the current file position for FILEHANDLE. FILEHANDLE may be an
+Returns the current position for FILEHANDLE. FILEHANDLE may be an
expression whose value gives the name of the actual filehandle. If
FILEHANDLE is omitted, assumes the file last read.
=item New and changed builtin functions
delete on slices, flock, printf and sprintf, keys as an lvalue, my() in
-Control Structures, pack() and unpack(), sysseek() and systell(), use
-VERSION, use Module VERSION LIST, prototype(FUNCTION), srand, $_ as
-Default, C<m//g> does not reset search position on failure, C<m//x> ignores
-whitespace before ?*+{}, nested C<sub{}> closures work now, formats work
-right on changing lexicals
+Control Structures, pack() and unpack(), sysseek(), use VERSION, use Module
+VERSION LIST, prototype(FUNCTION), srand, $_ as Default, C<m//g> does not
+reset search position on failure, C<m//x> ignores whitespace before ?*+{},
+nested C<sub{}> closures work now, formats work right on changing lexicals
=item New builtin methods
Can't use bareword ("%s") as %s ref while "strict refs" in use, Cannot
resolve method `%s' overloading `%s' in package `%s', Constant subroutine
%s redefined, Constant subroutine %s undefined, Copy method did not return
-a reference, Died, Exiting pseudo-block via %s, Illegal character %s
-(carriage return), Illegal switch in PERL5OPT: %s, Integer overflow in hex
-number, Integer overflow in octal number, internal error: glob failed, Name
-"%s::%s" used only once: possible typo, Null picture in formline, Offset
-outside string, Out of memory!, Out of memory during request for %s,
-Possible attempt to put comments in qw() list, Possible attempt to separate
-words with commas, Scalar value @%s{%s} better written as $%s{%s}, Stub
-found while resolving method `%s' overloading `%s' in package `%s', Too
-late for "B<-T>" option, untie attempted while %d inner references still
-exist, Unrecognized character %s, Unsupported function fork, Use of
-"$$<digit>" to mean "${$}<digit>" is deprecated, Value of %s can be "0";
-test with defined(), Variable "%s" may be unavailable, Variable "%s" will
-not stay shared, Warning: something's wrong, Ill-formed logical name |%s|
-in prime_env_iter, Got an error from DosAllocMem, Malformed PERLLIB_PREFIX,
-PERL_SH_DIR too long, Process terminated by SIG%s
+a reference, Died, Exiting pseudo-block via %s, Identifier too long,
+Illegal character %s (carriage return), Illegal switch in PERL5OPT: %s,
+Integer overflow in hex number, Integer overflow in octal number, internal
+error: glob failed, Invalid type in pack: '%s', Invalid type in unpack:
+'%s', Name "%s::%s" used only once: possible typo, Null picture in
+formline, Offset outside string, Out of memory!, Out of memory during
+request for %s, Possible attempt to put comments in qw() list, Possible
+attempt to separate words with commas, Scalar value @%s{%s} better written
+as $%s{%s}, Stub found while resolving method `%s' overloading `%s' in
+package `%s', Too late for "B<-T>" option, untie attempted while %d inner
+references still exist, Unrecognized character %s, Unsupported function
+fork, Use of "$$<digit>" to mean "${$}<digit>" is deprecated, Value of %s
+can be "0"; test with defined(), Variable "%s" may be unavailable, Variable
+"%s" will not stay shared, Warning: something's wrong, Ill-formed logical
+name |%s| in prime_env_iter, Got an error from DosAllocMem, Malformed
+PERLLIB_PREFIX, PERL_SH_DIR too long, Process terminated by SIG%s
=item BUGS
SUBROUTINE(LIST), do EXPR, dump LABEL, each HASH, eof FILEHANDLE, eof (),
eof, eval EXPR, eval BLOCK, exec LIST, exists EXPR, exit EXPR, exp EXPR,
exp, fcntl FILEHANDLE,FUNCTION,SCALAR, fileno FILEHANDLE, flock
-FILEHANDLE,OPERATION, fork, format, formline PICTURE, LIST, getc
-FILEHANDLE, getc, getlogin, getpeername SOCKET, getpgrp PID, getppid,
-getpriority WHICH,WHO, getpwnam NAME, getgrnam NAME, gethostbyname NAME,
-getnetbyname NAME, getprotobyname NAME, getpwuid UID, getgrgid GID,
-getservbyname NAME,PROTO, gethostbyaddr ADDR,ADDRTYPE, getnetbyaddr
-ADDR,ADDRTYPE, getprotobynumber NUMBER, getservbyport PORT,PROTO, getpwent,
-getgrent, gethostent, getnetent, getprotoent, getservent, setpwent,
-setgrent, sethostent STAYOPEN, setnetent STAYOPEN, setprotoent STAYOPEN,
-setservent STAYOPEN, endpwent, endgrent, endhostent, endnetent,
-endprotoent, endservent, getsockname SOCKET, getsockopt
-SOCKET,LEVEL,OPTNAME, glob EXPR, glob, gmtime EXPR, goto LABEL, goto EXPR,
-goto &NAME, grep BLOCK LIST, grep EXPR,LIST, hex EXPR, hex, import, index
-STR,SUBSTR,POSITION, index STR,SUBSTR, int EXPR, int, ioctl
-FILEHANDLE,FUNCTION,SCALAR, join EXPR,LIST, keys HASH, kill LIST, last
-LABEL, last, lc EXPR, lc, lcfirst EXPR, lcfirst, length EXPR, length, link
-OLDFILE,NEWFILE, listen SOCKET,QUEUESIZE, local EXPR, localtime EXPR, log
-EXPR, log, lstat FILEHANDLE, lstat EXPR, lstat, m//, map BLOCK LIST, map
-EXPR,LIST, mkdir FILENAME,MODE, msgctl ID,CMD,ARG, msgget KEY,FLAGS, msgsnd
-ID,MSG,FLAGS, msgrcv ID,VAR,SIZE,TYPE,FLAGS, my EXPR, next LABEL, next, no
-Module LIST, oct EXPR, oct, open FILEHANDLE,EXPR, open FILEHANDLE, opendir
+FILEHANDLE,OPERATION, fork, format, formline PICTURE,LIST, getc FILEHANDLE,
+getc, getlogin, getpeername SOCKET, getpgrp PID, getppid, getpriority
+WHICH,WHO, getpwnam NAME, getgrnam NAME, gethostbyname NAME, getnetbyname
+NAME, getprotobyname NAME, getpwuid UID, getgrgid GID, getservbyname
+NAME,PROTO, gethostbyaddr ADDR,ADDRTYPE, getnetbyaddr ADDR,ADDRTYPE,
+getprotobynumber NUMBER, getservbyport PORT,PROTO, getpwent, getgrent,
+gethostent, getnetent, getprotoent, getservent, setpwent, setgrent,
+sethostent STAYOPEN, setnetent STAYOPEN, setprotoent STAYOPEN, setservent
+STAYOPEN, endpwent, endgrent, endhostent, endnetent, endprotoent,
+endservent, getsockname SOCKET, getsockopt SOCKET,LEVEL,OPTNAME, glob EXPR,
+glob, gmtime EXPR, goto LABEL, goto EXPR, goto &NAME, grep BLOCK LIST, grep
+EXPR,LIST, hex EXPR, hex, import, index STR,SUBSTR,POSITION, index
+STR,SUBSTR, int EXPR, int, ioctl FILEHANDLE,FUNCTION,SCALAR, join
+EXPR,LIST, keys HASH, kill LIST, last LABEL, last, lc EXPR, lc, lcfirst
+EXPR, lcfirst, length EXPR, length, link OLDFILE,NEWFILE, listen
+SOCKET,QUEUESIZE, local EXPR, localtime EXPR, log EXPR, log, lstat
+FILEHANDLE, lstat EXPR, lstat, m//, map BLOCK LIST, map EXPR,LIST, mkdir
+FILENAME,MODE, msgctl ID,CMD,ARG, msgget KEY,FLAGS, msgsnd ID,MSG,FLAGS,
+msgrcv ID,VAR,SIZE,TYPE,FLAGS, my EXPR, next LABEL, next, no Module LIST,
+oct EXPR, oct, open FILEHANDLE,EXPR, open FILEHANDLE, opendir
DIRHANDLE,EXPR, ord EXPR, ord, pack TEMPLATE,LIST, package NAMESPACE, pipe
READHANDLE,WRITEHANDLE, pop ARRAY, pop, pos SCALAR, pos, print FILEHANDLE
LIST, print LIST, print, printf FILEHANDLE FORMAT, LIST, printf FORMAT,
symlink OLDFILE,NEWFILE, syscall LIST, sysopen FILEHANDLE,FILENAME,MODE,
sysopen FILEHANDLE,FILENAME,MODE,PERMS, sysread
FILEHANDLE,SCALAR,LENGTH,OFFSET, sysread FILEHANDLE,SCALAR,LENGTH, sysseek
-FILEHANDLE,POSITION,WHENCE, systell FILEHANDLE, systell, system LIST,
-syswrite FILEHANDLE,SCALAR,LENGTH,OFFSET, syswrite
-FILEHANDLE,SCALAR,LENGTH, tell FILEHANDLE, tell, telldir DIRHANDLE, tie
-VARIABLE,CLASSNAME,LIST, tied VARIABLE, time, times, tr///, truncate
-FILEHANDLE,LENGTH, truncate EXPR,LENGTH, uc EXPR, uc, ucfirst EXPR,
-ucfirst, umask EXPR, umask, undef EXPR, undef, unlink LIST, unlink, unpack
-TEMPLATE,EXPR, untie VARIABLE, unshift ARRAY,LIST, use Module LIST, use
-Module, use Module VERSION LIST, use VERSION, utime LIST, values HASH, vec
-EXPR,OFFSET,BITS, wait, waitpid PID,FLAGS, wantarray, warn LIST, write
-FILEHANDLE, write EXPR, write, y///
+FILEHANDLE,POSITION,WHENCE, system LIST, syswrite
+FILEHANDLE,SCALAR,LENGTH,OFFSET, syswrite FILEHANDLE,SCALAR,LENGTH, tell
+FILEHANDLE, tell, telldir DIRHANDLE, tie VARIABLE,CLASSNAME,LIST, tied
+VARIABLE, time, times, tr///, truncate FILEHANDLE,LENGTH, truncate
+EXPR,LENGTH, uc EXPR, uc, ucfirst EXPR, ucfirst, umask EXPR, umask, undef
+EXPR, undef, unlink LIST, unlink, unpack TEMPLATE,EXPR, untie VARIABLE,
+unshift ARRAY,LIST, use Module LIST, use Module, use Module VERSION LIST,
+use VERSION, utime LIST, values HASH, vec EXPR,OFFSET,BITS, wait, waitpid
+PID,FLAGS, wantarray, warn LIST, write FILEHANDLE, write EXPR, write, y///
=back
#endif /* no flock() */
+#define ZBTLEN 10
+static char zero_but_true[ZBTLEN + 1] = "0 but true";
+
/* Pushy I/O. */
PP(pp_backtick)
PP(pp_tell)
{
- return pp_systell(ARGS);
-}
-
-PP(pp_systell)
-{
dSP; dTARGET;
GV *gv;
long offset = POPl;
gv = last_in_gv = (GV*)POPs;
- PUSHs(boolSV(do_seek(gv, offset, whence)));
+ if (op->op_type == OP_SEEK)
+ PUSHs(boolSV(do_seek(gv, offset, whence)));
+ else {
+ long n = do_sysseek(gv, offset, whence);
+ PUSHs((n < 0) ? &sv_undef
+ : sv_2mortal(n ? newSViv((IV)n)
+ : newSVpv(zero_but_true, ZBTLEN)));
+ }
RETURN;
}
PUSHi(retval);
}
else {
- PUSHp("0 but true", 10);
+ PUSHp(zero_but_true, ZBTLEN);
}
RETURN;
}
PUSHi(anum);
}
else {
- PUSHp("0 but true",10);
+ PUSHp(zero_but_true, ZBTLEN);
}
RETURN;
#else
I32 do_shmio _((I32 optype, SV** mark, SV** sp));
#endif
void do_sprintf _((SV* sv, I32 len, SV** sarg));
+long do_sysseek _((GV* gv, long pos, int whence));
long do_tell _((GV* gv));
I32 do_trans _((SV* sv, OP* arg));
void do_vecset _((SV* sv));
#!./perl
-print "1..34\n";
+print "1..36\n";
chdir('op') || die "sysio.t: cannot look for myself: $!";
print 'not ' unless ($b eq '#!ererl');
print "ok 30\n";
-# test sysseek and systell
+# test sysseek
-sysseek(I, 2, 0);
+print 'not ' unless sysseek(I, 2, 0) == 2;
+print "ok 31\n";
sysread(I, $b, 3);
print 'not ' unless $b eq 'ere';
-print "ok 31\n";
-print 'not ' unless systell(I) == 5;
print "ok 32\n";
-sysseek(I, -2, 1);
+print 'not ' unless sysseek(I, -2, 1) == 3;
+print "ok 33\n";
sysread(I, $b, 4);
print 'not ' unless $b eq 'rerl';
-print "ok 33\n";
-print 'not ' unless systell(I) == 7;
print "ok 34\n";
+print 'not ' unless sysseek(I, 0, 0) eq '0 but true';
+print "ok 35\n";
+print 'not ' if defined sysseek(I, -1, 1);
+print "ok 36\n";
+
close(I);
unlink $outfile;
static char *scan_const _((char *start));
static char *scan_formline _((char *s));
static char *scan_heredoc _((char *s));
-static char *scan_ident _((char *s, char *send, char *dest, I32 ck_uni));
+static char *scan_ident _((char *s, char *send, char *dest, STRLEN destlen,
+ I32 ck_uni));
static char *scan_inputsymbol _((char *start));
static char *scan_pat _((char *start));
static char *scan_str _((char *start));
static char *scan_subst _((char *start));
static char *scan_trans _((char *start));
-static char *scan_word _((char *s, char *dest, int allow_package, STRLEN *slp));
+static char *scan_word _((char *s, char *dest, STRLEN destlen,
+ int allow_package, STRLEN *slp));
static char *skipspace _((char *s));
static void checkcomma _((char *s, char *name, char *what));
static void force_ident _((char *s, int kind));
static char * filter_gets _((SV *sv, PerlIO *fp, STRLEN append));
static void restore_rsfp _((void *f));
+static char too_long[] = "Identifier too long";
+
static char *linestart; /* beg. of most recently read line */
static char pending_ident; /* pending identifier lookup */
(allow_pack && *s == ':') ||
(allow_tick && *s == '\'') )
{
- s = scan_word(s, tokenbuf, allow_pack, &len);
+ s = scan_word(s, tokenbuf, sizeof tokenbuf, allow_pack, &len);
if (check_keyword && keyword(tokenbuf, len))
return start;
if (token == METHOD) {
char seen[256];
unsigned char un_char = 0, last_un_char;
char *send = strchr(s,']');
- char tmpbuf[512];
+ char tmpbuf[sizeof tokenbuf * 4];
if (!send) /* has to be an expression */
return TRUE;
case '$':
weight -= seen[un_char] * 10;
if (isALNUM(s[1])) {
- scan_ident(s,send,tmpbuf,FALSE);
+ scan_ident(s, send, tmpbuf, sizeof tmpbuf, FALSE);
if ((int)strlen(tmpbuf) > 1 && gv_fetchpv(tmpbuf,FALSE, SVt_PV))
weight -= 100;
else
GV *gv;
{
char *s = start + (*start == '$');
- char tmpbuf[1024];
+ char tmpbuf[sizeof tokenbuf];
STRLEN len;
GV* indirgv;
if (!GvCVu(gv))
gv = 0;
}
- s = scan_word(s, tmpbuf, TRUE, &len);
+ s = scan_word(s, tmpbuf, sizeof tmpbuf, TRUE, &len);
if (*start == '$') {
if (gv || last_lop_op == OP_PRINT || isUPPER(*tokenbuf))
return 0;
case '*':
if (expect != XOPERATOR) {
- s = scan_ident(s, bufend, tokenbuf, TRUE);
+ s = scan_ident(s, bufend, tokenbuf, sizeof tokenbuf, TRUE);
expect = XOPERATOR;
force_ident(tokenbuf, '*');
if (!*tokenbuf)
Mop(OP_MODULO);
}
tokenbuf[0] = '%';
- s = scan_ident(s, bufend, tokenbuf+1, TRUE);
+ s = scan_ident(s, bufend, tokenbuf + 1, sizeof tokenbuf - 1, TRUE);
if (!tokenbuf[1]) {
if (s == bufend)
yyerror("Final % should be \\% or %name");
d++;
}
if (d < bufend && isIDFIRST(*d)) {
- d = scan_word(d, tokenbuf + 1, FALSE, &len);
+ d = scan_word(d, tokenbuf + 1, sizeof tokenbuf - 1,
+ FALSE, &len);
while (d < bufend && (*d == ' ' || *d == '\t'))
d++;
if (*d == '}') {
BAop(OP_BIT_AND);
}
- s = scan_ident(s-1, bufend, tokenbuf, TRUE);
+ s = scan_ident(s - 1, bufend, tokenbuf, sizeof tokenbuf, TRUE);
if (*tokenbuf) {
expect = XOPERATOR;
force_ident(tokenbuf, '&');
if (expect == XOPERATOR)
no_op("Array length", bufptr);
tokenbuf[0] = '@';
- s = scan_ident(s+1, bufend, tokenbuf+1, FALSE);
+ s = scan_ident(s + 1, bufend, tokenbuf + 1, sizeof tokenbuf - 1,
+ FALSE);
if (!tokenbuf[1])
PREREF(DOLSHARP);
expect = XOPERATOR;
if (expect == XOPERATOR)
no_op("Scalar", bufptr);
tokenbuf[0] = '$';
- s = scan_ident(s, bufend, tokenbuf+1, FALSE);
+ s = scan_ident(s, bufend, tokenbuf + 1, sizeof tokenbuf - 1, FALSE);
if (!tokenbuf[1]) {
if (s == bufend)
yyerror("Final $ should be \\$ or $name");
if (dowarn && strEQ(tokenbuf+1, "SIG") &&
(t = strchr(s, '}')) && (t = strchr(t, '=')))
{
- char tmpbuf[1024];
+ char tmpbuf[sizeof tokenbuf];
STRLEN len;
for (t++; isSPACE(*t); t++) ;
if (isIDFIRST(*t)) {
- t = scan_word(t, tmpbuf, TRUE, &len);
+ t = scan_word(t, tmpbuf, sizeof tmpbuf, TRUE, &len);
if (*t != '(' && perl_get_cv(tmpbuf, FALSE))
warn("You need to quote \"%s\"", tmpbuf);
}
else if (strchr("&*<%", *s) && isIDFIRST(s[1]))
expect = XTERM; /* e.g. print $fh &sub */
else if (isIDFIRST(*s)) {
- char tmpbuf[1024];
- scan_word(s, tmpbuf, TRUE, &len);
+ char tmpbuf[sizeof tokenbuf];
+ scan_word(s, tmpbuf, sizeof tmpbuf, TRUE, &len);
if (keyword(tmpbuf, len))
expect = XTERM; /* e.g. print $fh length() */
else {
if (expect == XOPERATOR)
no_op("Array", s);
tokenbuf[0] = '@';
- s = scan_ident(s, bufend, tokenbuf+1, FALSE);
+ s = scan_ident(s, bufend, tokenbuf + 1, sizeof tokenbuf - 1, FALSE);
if (!tokenbuf[1]) {
if (s == bufend)
yyerror("Final @ should be \\@ or @name");
keylookup:
bufptr = s;
- s = scan_word(s, tokenbuf, FALSE, &len);
+ s = scan_word(s, tokenbuf, sizeof tokenbuf, FALSE, &len);
/* Some keywords can be followed by any delimiter, including ':' */
tmp = (len == 1 && strchr("msyq", tokenbuf[0]) ||
/* Get the rest if it looks like a package qualifier */
if (*s == '\'' || *s == ':' && s[1] == ':') {
- s = scan_word(s, tokenbuf + len, TRUE, &len);
+ s = scan_word(s, tokenbuf + len, sizeof tokenbuf - len,
+ TRUE, &len);
if (!len)
croak("Bad name after %s::", tokenbuf);
}
if (*s == ':' && s[1] == ':') {
s += 2;
d = s;
- s = scan_word(s, tokenbuf, FALSE, &len);
+ s = scan_word(s, tokenbuf, sizeof tokenbuf, FALSE, &len);
tmp = keyword(tokenbuf, len);
if (tmp < 0)
tmp = -tmp;
s = skipspace(s);
if (isIDFIRST(*s) || *s == '\'' || *s == ':') {
- char tmpbuf[128];
+ char tmpbuf[sizeof tokenbuf];
expect = XBLOCK;
- d = scan_word(s, tmpbuf, TRUE, &len);
+ d = scan_word(s, tmpbuf, sizeof tmpbuf, TRUE, &len);
if (strchr(tmpbuf, ':'))
sv_setpv(subname, tmpbuf);
else {
case KEY_sysopen:
LOP(OP_SYSOPEN,XTERM);
- case KEY_systell:
- UNI(OP_SYSTELL);
-
case KEY_sysseek:
LOP(OP_SYSSEEK,XTERM);
if (strEQ(d,"sysopen")) return -KEY_sysopen;
if (strEQ(d,"sysread")) return -KEY_sysread;
if (strEQ(d,"sysseek")) return -KEY_sysseek;
- if (strEQ(d,"systell")) return -KEY_systell;
break;
case 8:
if (strEQ(d,"syswrite")) return -KEY_syswrite;
}
static char *
-scan_word(s, dest, allow_package, slp)
+scan_word(s, dest, destlen, allow_package, slp)
register char *s;
char *dest;
+STRLEN destlen;
int allow_package;
STRLEN *slp;
{
register char *d = dest;
+ register char *e = d + destlen - 3; /* two-character token, ending NUL */
for (;;) {
+ if (d >= e)
+ croak(too_long);
if (isALNUM(*s))
*d++ = *s++;
else if (*s == '\'' && allow_package && isIDFIRST(s[1])) {
}
static char *
-scan_ident(s,send,dest,ck_uni)
+scan_ident(s, send, dest, destlen, ck_uni)
register char *s;
register char *send;
char *dest;
+STRLEN destlen;
I32 ck_uni;
{
register char *d;
+ register char *e;
char *bracket = 0;
char funny = *s++;
if (isSPACE(*s))
s = skipspace(s);
d = dest;
+ e = d + destlen - 3; /* two-character token, ending NUL */
if (isDIGIT(*s)) {
- while (isDIGIT(*s))
+ while (isDIGIT(*s)) {
+ if (d >= e)
+ croak(too_long);
*d++ = *s++;
+ }
}
else {
for (;;) {
+ if (d >= e)
+ croak(too_long);
if (isALNUM(*s))
*d++ = *s++;
else if (*s == '\'' && isIDFIRST(s[1])) {