Closed p5pRT closed 11 years ago
If perl ran as "perl -Isrc/ src/myscript.pl" I am getting the following warning message for my script: Odd number of elements in hash assignment at src//ChildWorker.pm line 35. (i.e. two '/' characters)
but when run as perl -Isrc/ src/myscript.pl I am getting just on slash Odd number of elements in hash assignment at src/ChildWorker.pm line 35.
On Mon Dec 24 08:42:38 2012\, vsespb wrote:
This is a bug report for perl from victor@vsespb.ru\, generated with the help of perlbug 1.39 running under perl 5.10.1.
----------------------------------------------------------------- [Please describe your issue here]
If perl ran as "perl -Isrc/ src/myscript.pl" I am getting the following warning message for my script: Odd number of elements in hash assignment at src//ChildWorker.pm line 35. (i.e. two '/' characters)
but when run as perl -Isrc/ src/myscript.pl I am getting just on slash Odd number of elements in hash assignment at src/ChildWorker.pm line 35.
Can you supply more details as to the content of 'src/myscript.pl' and 'src/ChildWorker.pm'?
It may be that your code has a problem which truly ought to generate a warning. But it will be difficult to tell for sure until we see some more code.
Thank you very much. Jim Keenan
The RT System itself - Status changed from 'new' to 'open'
Ok\, I made proof-of-concept code:
$ cat src/myscript.pl use MyModule; 1; $ cat src/MyModule.pm package MyModule; use warnings; use strict; $x=1; 1; $ perl -Isrc src/myscript.pl Global symbol "$x" requires explicit package name at src/MyModule.pm line 4. Compilation failed in require at src/myscript.pl line 1. BEGIN failed--compilation aborted at src/myscript.pl line 1. $ perl -Isrc/ src/myscript.pl Global symbol "$x" requires explicit package name at src//MyModule.pm line 4. Compilation failed in require at src/myscript.pl line 1. BEGIN failed--compilation aborted at src/myscript.pl line 1.
bug in message "Global symbol "$x" requires explicit package name at src//MyModule.pm"
Пнд. Дек. 24 20:11:13 2012\, jkeenan писал:
On Mon Dec 24 08:42:38 2012\, vsespb wrote:
This is a bug report for perl from victor@vsespb.ru\, generated with the help of perlbug 1.39 running under perl 5.10.1.
----------------------------------------------------------------- [Please describe your issue here]
If perl ran as "perl -Isrc/ src/myscript.pl" I am getting the following warning message for my script: Odd number of elements in hash assignment at src//ChildWorker.pm line 35. (i.e. two '/' characters)
but when run as perl -Isrc/ src/myscript.pl I am getting just on slash Odd number of elements in hash assignment at src/ChildWorker.pm line 35.
Can you supply more details as to the content of 'src/myscript.pl' and 'src/ChildWorker.pm'?
It may be that your code has a problem which truly ought to generate a warning. But it will be difficult to tell for sure until we see some more code.
Thank you very much. Jim Keenan
"James E Keenan via RT" \perlbug\-followup@​perl\.org wrote: :On Mon Dec 24 08:42:38 2012\, vsespb wrote: :> This is a bug report for perl from victor@vsespb.ru\, :> generated with the help of perlbug 1.39 running under perl 5.10.1. [...] :Can you supply more details as to the content of 'src/myscript.pl' and :'src/ChildWorker.pm'? : :It may be that your code has a problem which truly ought to generate a :warning. But it will be difficult to tell for sure until we see some :more code.
I don't think the script content has any particular relevance. Here's an example:
% mkdir mylib ; echo 'print "hello world" . $undef' >mylib/A.pm % perl -Imylib/ -wle 'use A' Use of uninitialized value $undef in concatenation (.) or string at mylib//A.pm line 1. hello world %
Note the doubled slash in the warning message "mylib//A.pm"? That still happens with a recent blead.
Hugo
I've attached a patch that I believe solves this\, though I'm not sure of its portability on windows. Someone with more experience about how Perl behaves in that regard would be useful.
Also\, I've tested it through t/run/switchM.t\, though the bug is really in "require"\, so that might not be appropriate.
Hope this helps regardless.
-- Matthew Horsfall (alh)
Will it work if dirlen==0 ?
On Thu Dec 27 07:45:05 2012\, alh wrote:
I've attached a patch that I believe solves this\, though I'm not sure of its portability on windows. Someone with more experience about how Perl behaves in that regard would be useful.
Also\, I've tested it through t/run/switchM.t\, though the bug is really in "require"\, so that might not be appropriate.
Hope this helps regardless.
-- Matthew Horsfall (alh)
Will it work if dirlen==0 ?
On Thu Dec 27 07:45:05 2012\, alh wrote:
I've attached a patch that I believe solves this\, though I'm not sure of its portability on windows. Someone with more experience about how Perl behaves in that regard would be useful.
Also\, I've tested it through t/run/switchM.t\, though the bug is really in "require"\, so that might not be appropriate.
Hope this helps regardless.
-- Matthew Horsfall (alh)
On Thu\, Dec 27\, 2012 at 10:45 AM\, Matthew Horsfall via RT \< perlbug-followup@perl.org> wrote:
I've attached a patch that I believe solves this\, though I'm not sure of its portability on windows. Someone with more experience about how Perl behaves in that regard would be useful.
Also\, I've tested it through t/run/switchM.t\, though the bug is really in "require"\, so that might not be appropriate.
Hope this helps regardless.
-- Matthew Horsfall (alh)
--- via perlbug: queue: perl5 status: open https://rt-archive.perl.org/perl5/Ticket/Display.html?id=116192
Now that I look at this\, is it possible for *(tmp-1) to access bad memory? Would "if (!dirlen || *(tmp-1) != '/') { ... } be better?
-- Matthew Horsfall (alh)
.. or even better if (dirlen && *(tmp-1) != '/') { ... }
On Thu Dec 27 12:49:17 2012\, alh wrote:
On Thu\, Dec 27\, 2012 at 10:45 AM\, Matthew Horsfall via RT \< perlbug-followup@perl.org> wrote:
I've attached a patch that I believe solves this\, though I'm not sure of its portability on windows. Someone with more experience about how Perl behaves in that regard would be useful.
Also\, I've tested it through t/run/switchM.t\, though the bug is really in "require"\, so that might not be appropriate.
Hope this helps regardless.
-- Matthew Horsfall (alh)
--- via perlbug: queue: perl5 status: open https://rt-archive.perl.org/perl5/Ticket/Display.html?id=116192
Now that I look at this\, is it possible for *(tmp-1) to access bad memory? Would "if (!dirlen || *(tmp-1) != '/') { ... } be better?
-- Matthew Horsfall (alh)
On Thu\, Dec 27\, 2012 at 3:54 PM\, Victor Efimov via RT \< perlbug-followup@perl.org> wrote:
.. or even better if (dirlen && *(tmp-1) != '/') { ... }
Right now '/' is added whether or not dirlen is > 0\, so (if !dirlen || *(tmp-1) != '/') would continue to behave the same.
if (dirlen && ...) would change that behavior.
-- Matthew Horsfall (alh)
Ok\, get it. Agree.
On Fri Dec 28 09:18:51 2012\, alh wrote:
On Thu\, Dec 27\, 2012 at 3:54 PM\, Victor Efimov via RT \< perlbug-followup@perl.org> wrote:
.. or even better if (dirlen && *(tmp-1) != '/') { ... }
Right now '/' is added whether or not dirlen is > 0\, so (if !dirlen || *(tmp-1) != '/') would continue to behave the same.
if (dirlen && ...) would change that behavior.
-- Matthew Horsfall (alh)
Ok\, get it. Agree.
On Fri Dec 28 09:18:51 2012\, alh wrote:
On Thu\, Dec 27\, 2012 at 3:54 PM\, Victor Efimov via RT \< perlbug-followup@perl.org> wrote:
.. or even better if (dirlen && *(tmp-1) != '/') { ... }
Right now '/' is added whether or not dirlen is > 0\, so (if !dirlen || *(tmp-1) != '/') would continue to behave the same.
if (dirlen && ...) would change that behavior.
-- Matthew Horsfall (alh)
On Thu Dec 27 12:49:17 2012\, alh wrote:
On Thu\, Dec 27\, 2012 at 10:45 AM\, Matthew Horsfall via RT \< perlbug-followup@perl.org> wrote:
I've attached a patch that I believe solves this\, though I'm not sure of its portability on windows. Someone with more experience about how Perl behaves in that regard would be useful.
Also\, I've tested it through t/run/switchM.t\, though the bug is really in "require"\, so that might not be appropriate.
Hope this helps regardless.
-- Matthew Horsfall (alh)
--- via perlbug: queue: perl5 status: open https://rt-archive.perl.org/perl5/Ticket/Display.html?id=116192
Now that I look at this\, is it possible for *(tmp-1) to access bad memory? Would "if (!dirlen || *(tmp-1) != '/') { ... } be better?
Yes. Thank you. Applied as 6b0bdd7.
--
Father Chrysostomos
@cpansprout - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#116192 (status was 'resolved')
Searchable as RT116192$