[Bug 183553] perlbug #38657: Using import() with arguments with -d: broke in 5.8.8, was okay in 5.8.7

bugzilla at redhat.com bugzilla at redhat.com
Wed Mar 1 23:08:06 UTC 2006


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug report.

Summary: perlbug #38657: Using import() with arguments with -d: broke in 5.8.8, was okay in 5.8.7


https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=183553





------- Additional Comments From jvdias at redhat.com  2006-03-01 18:07 EST -------
Actually, under perl-5.8.0, perl-5.8.5, perl-5.8.6, and perl-5.8.7, 
'q\0foo\0' does NOT work (I have tested all versions) - I get the
same result :

$ perl -e '$s=q\0foo\0;'
Number found where operator expected at -e line 1, near "q\0foo\0"
syntax error at -e line 1, near "q\0foo\0"
Execution of -e aborted due to compilation errors.

This is because '\' is a legal delimiter for q(), and the parse breaks
on the last '0;' .

$ perl -e '$s=q\0foo\; print $s,"\n";'
0foo

But if I actually create a file with 'q{0x0}foo{0x0}', it DOES work OK on all 
versions:

$ cat tq.pl
#!/usr/bin/perl
$s=q0foo0;
print "$s\n";
$ ./tq.pl
q0foo0
$ tr '0' '\0' < tq.pl > tq0.pl
$ od -c tq0.pl
0000000   #   !   /   u   s   r   /   b   i   n   /   p   e   r   l  \n
0000020   $   s   =   q  \0   f   o   o  \0   ;  \n   p   r   i   n   t
0000040       "   $   s   \   n   "   ;  \n
0000051
$ ./tq0.pl
foo

So q\0foo\0 with real, unescaped 0x0 chars DOES work OK on all versions .

I think it is just that 0x0 is a bad choice for a '%c' in Perl_sv_catpvf, as
it terminates the C string, and the interpreter doesn't get the rest of the
expression . So I think the first fix posted is OK .

If we really must make Perl_sv_catpvf handle 0x0 chars OK in expressions, 
that is a different problem - I think it is debatable whether it is a problem
worth fixing.

-- 
Configure bugmail: https://bugzilla.redhat.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the Fedora-perl-devel-list mailing list