Comments (8)
From [email protected]
This is a bug report for perl from occitan@esperanto.org,
generated with the help of perlbug 1.26 running under perl 5.00502.
While you go about this, a little remark. When using =cut a lot it sticks out
like a sore thumb, distracting from the code. It would be neat if (given that
this is a sort of closing paren) qr/\bcut=$/ would perform the same trick.
I'm thinking about writing a Pod.pm parser, which the various incarnations
would inherit from and only worry about the generating-half of the job.
In the style of literate programming I just mingled the pod into a very long
statement (GetOptions which is several pages long, and I documented every
option on the spot, for one thing to be sure to cover them all, for another to
make the weird option specs clearer).
The = signs before item and cut are not seen, probably erroneously parsed as
assignments, even though they are on paragraphs of their own. A real pity the
perlpod's assertion "Perl will ignore the pod text." doesn't hold. Silly
example:
=head1 test
=over
=cut
=item number
=cut
1,
=item newline
=cut
"\n";
=back
gives:
Number found where operator expected at test.pl line 13, near "cut
1"
(Do you need to predeclare cut?)
syntax error at test.pl line 13, near "cut
1"
String found where operator expected at test.pl line 19, near "cut
"\n""
(Do you need to predeclare cut?)
Execution of test.pl aborted due to compilation errors.
Site configuration information for perl 5.00502:
Configured by root at Sun Apr 4 19:59:20 /etc/localtime 1999.
Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
Platform:
osname=linux, osvers=2.2.5, archname=i586-linux
uname='linux pascal 2.2.5 #79 tue jan 19 12:41:20 met 1999 i686 unknown '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O2 -pipe', gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release)
cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
libc=, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Locally applied patches:
@INC for perl 5.00502:
/usr/lib/perl5/5.00502/i586-linux
/usr/lib/perl5/5.00502
/usr/lib/perl5/site_perl/5.005/i586-linux
/usr/lib/perl5/site_perl/5.005
.
Environment for perl 5.00502:
HOME=/home/pfeiffer
LANG (unset)
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/home/pfeiffer/bin:/usr/local/system/scripts:/usr/local/bin:/bin:/usr/bin::/sbin:/usr/sbin:/usr/games/bin:/usr/bin/X11:/opt/kde/bin
PERL_BADLANG (unset)
SHELL=/bin/ksh
Site configuration information for perl 5.00502:
Configured by root at Sun Apr 4 19:59:20 /etc/localtime 1999.
Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
Platform:
osname=linux, osvers=2.2.5, archname=i586-linux
uname='linux pascal 2.2.5 #79 tue jan 19 12:41:20 met 1999 i686 unknown '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O2 -pipe', gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release)
cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
libc=, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Locally applied patches:
@INC for perl 5.00502:
/usr/lib/perl5/5.00502/i586-linux
/usr/lib/perl5/5.00502
/usr/lib/perl5/site_perl/5.005/i586-linux
/usr/lib/perl5/site_perl/5.005
.
Environment for perl 5.00502:
HOME=/home/pfeiffer
LANG (unset)
LC_CTYPE=de_DE
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/home/pfeiffer/bin:/usr/local/system/scripts:/usr/local/bin:/bin:/usr/bin::/sbin:/usr/sbin:/usr/games/bin:/usr/bin/X11:/opt/kde/bin
PERL_BADLANG (unset)
SHELL=/bin/bash
from perl5.
From [Unknown Contact. See original ticket]
This bug is still present in 5.6. Porters, anyone game to track
it down?
Nat
This is a bug report for perl from occitan@esperanto.org,
generated with the help of perlbug 1.26 running under perl 5.00502.
-----------------------------------------------------------------
While you go about this, a little remark. When using =cut a lot it sticks out
like a sore thumb, distracting from the code. It would be neat if (given that
this is a sort of closing paren) qr/\bcut=$/ would perform the same trick.
I'm thinking about writing a Pod.pm parser, which the various incarnations
would inherit from and only worry about the generating-half of the job.In the style of literate programming I just mingled the pod into a very long
statement (GetOptions which is several pages long, and I documented every
option on the spot, for one thing to be sure to cover them all, for another to
make the weird option specs clearer).The = signs before item and cut are not seen, probably erroneously parsed as
assignments, even though they are on paragraphs of their own. A real pity the
perlpod's assertion "Perl will ignore the pod text." doesn't hold. Silly
example:=head1 test
=over
=cut
=item number
=cut
1\,
=item newline
=cut
"\\n";
=back
gives:
Number found where operator expected at test.pl line 13, near "cut
1" \(Do you need to predeclare cut?\)
syntax error at test.pl line 13, near "cut
1"
String found where operator expected at test.pl line 19, near "cut
"\\n"" \(Do you need to predeclare cut?\)
Execution of test.pl aborted due to compilation errors.
from perl5.
From [Unknown Contact. See original ticket]
The funny thing is that if it's the first pod directive in the file,
the first =cut doesn't.
--tom
from perl5.
From [Unknown Contact. See original ticket]
This bug is still present in 5.6. Porters, anyone game to track
it down?
The = signs before item and cut are not seen, probably erroneously parsed as
assignments, even though they are on paragraphs of their own. A real pity the
perlpod's assertion "Perl will ignore the pod text." doesn't hold. Silly
example:
This is because POD directives (or whatever the are called, the paragraphs
beginning with an =) must occur where Perl expects a new statement. At
least, this is what I have found to be true through testing.
But I don't know what to do about it, since "I'm more of an idea rat."
--
MIDN 4/C PINYAN, NROTCURPI, US Naval Reserve japhy@pobox.com
http://www.pobox.com/~japhy/ http://pinyaj.stu.rpi.edu/
PerlMonth - An Online Perl Magazine http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc. http://www.perlarchive.com/
from perl5.
From [Unknown Contact. See original ticket]
This is because POD directives (or whatever the are called, the paragraphs
beginning with an =) must occur where Perl expects a new statement. At
least, this is what I have found to be true through testing.
perlsyn:
Perl has a mechanism for intermixing documentation with
source code. While it's expecting the beginning of a new
statement, if the compiler encounters a line that begins
with an equal sign and a word, like this
That could be more clearly worded, but the intent is there.
--tom
from perl5.
From [Unknown Contact. See original ticket]
Tom Christiansen writes:
This is because POD directives (or whatever the are called, the paragraphs
beginning with an =) must occur where Perl expects a new statement. At
least, this is what I have found to be true through testing.perlsyn:
That could be more clearly worded, but the intent is there.
Good enough for me. I'll mark it closed.
Nat
from perl5.
From [Unknown Contact. See original ticket]
On Mon, 20 Mar 2000, Tom Christiansen wrote:
This is because POD directives (or whatever the are called, the paragraphs
beginning with an =) must occur where Perl expects a new statement. At
least, this is what I have found to be true through testing.perlsyn:
Perl has a mechanism for intermixing documentation with source code\. While it's expecting the beginning of a new statement\, if the compiler encounters a line that begins with an equal sign and a word\, like this
There's also an allusion in perlfaq7 under "How can I comment out a large
block of perl code?":
This can't go just anywhere. You have to put a pod
directive where the parser is expecting a new statement,
not just in the middle of an expression or some other
arbitrary yacc grammar production.
Cheers,
Philip
--
Philip Newton <newton@newton.digitalspace.net>
from perl5.
From [Unknown Contact. See original ticket]
Hmm. Why doesn't Perl like reading a lot from STDIN?
perl -Mdiagnostics -e 'read(FOO,$FOO,2 ** 31 - 1)'
runs smoothly.
perl -Mdiagnostics -e 'read(STDIN,$STDIN,2 ** 31 - 1)'
Out of memory during "large" request for -2147479552 bytes at -e line 1
(#1)
(F) The malloc() function returned 0, indicating there was insufficient
remaining memory (or virtual memory) to satisfy the request. However,
the request was judged large enough (compile-time default is 64K), so
a possibility to shut down by trapping this error is granted.
Perhaps if you actually read from something you could read from
you might get a different answer.
% perl -Mdiagnostics -e '*FOO = *STDIN; read(FOO,$FOO,2 ** 31 - 1)'
panic: realloc at -e line 1 (#1)
(P) Something requested a negative number of bytes of realloc.
Uncaught exception from user code:
panic: realloc at -e line 1.
Word to the wise: always read in only as much as is there, and
always check you got what you asked for. And don't be trying to
go preallocating these (off_t (-1)) sized buffers. That's a crackhead
move.
In some cases, this is ok not to, in others, it isn't. If you know
how much is there, certainly check. If you don't know how much is
there, use a block at a time--very carefully. You need to understand
about partial reads and writes.
use Errno qw/EINTR/;
$blksize = (stat FROM)[11] || 16384; # preferred block size?
while ($len = sysread FROM, $buf, $blksize) {
if (!defined $len) {
next if $! == EINTR;
die "System read error: $!\n";
}
$offset = 0;
while ($len) { # Handle partial writes.
$written = syswrite TO, $buf, $len, $offset;
die "System write error: $!\n" unless defined $written;
$offset += $written;
$len -= $written;
}
}
--tom
from perl5.
Related Issues (20)
- inconsistent behavior of dup open w/ barewords under `use strict` HOT 1
- 5.40.0 onwards won't build Darwin fat binaries HOT 17
- Segmentation fault in Perl_csighandler3 when used XS with threads. HOT 10
- BBC: Blead Breaks File::Tabular HOT 10
- feature 'class': out of memory error if subclassing a class with an explicit new HOT 3
- t/op/try.t: one test fails during deparsing tests HOT 3
- strftime crashes with a blessed format HOT 3
- [doc] Bug in Perl Threads tutorial section "A Thread Pitfall: Deadlocks"
- BBC: Blead Breaks Mojolicious HOT 3
- Cross compilation HOT 2
- BBC: Blead Breaks CPAN HOT 4
- Class methods can still be replaced outside the class HOT 10
- BBC: Blead Breaks DBIx::Class HOT 2
- Extensive CPAN breakage from two code removal projects HOT 6
- Perl is always configured for AFS on RHEL9 and derivatives
- 0351a629e7 led to build-time failure in Class-MethodCache
- CPAN distributions broken by switch removal HOT 3
- BBC: Scalar-List-Utils-1.65 breaks Tie::RefHash::Weak HOT 10
- Deprecation of GIMME long promised but not yet scheduled
- Script run does not always confine digits to the same set of ten HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perl5.