Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update perlhack.pod - fix link to mirror git repo #1

Closed
wants to merge 1 commit into from
Closed

Update perlhack.pod - fix link to mirror git repo #1

wants to merge 1 commit into from

Conversation

MartinMcGrath
Copy link
Contributor

p5p pushed a commit that referenced this pull request Feb 9, 2014
to avoid splain output like this on 80-column terminals:

rewinddir() attempted on invalid dirhandle foo at -e line 1 (#1)
    (W io) The dirhandle you tried to do a rewinddir() on is either closed or no
t
    really a dirhandle.  Check your control flow.
p5p pushed a commit that referenced this pull request Sep 19, 2014
to the other part of the message.  diagnostics.pm won’t find it otherwise:

$ perl -Mdiagnostics -we '"foo"->bar'
Can't locate object method "bar" via package "foo" (perhaps you forgot to load
	"foo"?) at -e line 1 (#1)
Uncaught exception from user code:
	Can't locate object method "bar" via package "foo" (perhaps you forgot to load "foo"?) at -e line 1.

Now we have this:

Can't locate object method "bar" via package "foo" (perhaps you forgot to load
	"foo"?) at -e line 1 (#1)
    (F) You called a method on a class that did not exist, and the method
    could not be found in UNIVERSAL.  This often means that a method
    requires a package that has not been loaded.

Uncaught exception from user code:
	Can't locate object method "bar" via package "foo" (perhaps you forgot to load "foo"?) at -e line 1.
p5p pushed a commit that referenced this pull request Nov 7, 2014
In the op tree, a statement consists of a nextstate/dbstate op (of
class cop) followed by the contents of the statement.  This cop is
created after the statement has been parsed.  So if you have nested
statements, the outermost statement has the highest sequence number
(cop_seq).  Every sub (including BEGIN blocks) has a sequence number
indicating where it occurs in its containing sub.

So

 BEGIN { } #1
 # seq 2
 {
   # seq 1
   ...
 }

is indistinguishable from

 # seq 2
 {
   BEGIN { } #1
   # seq 1
   ...
 }

because the sequence number of the BEGIN block is 1 in both examples.

By reserving a sequence number at the start of every block and using
it once the block has finished parsing, we can do this:

 BEGIN { } #1
 # seq 1
 {
   # seq 2
   ...
 }

 # seq 1
 {
   BEGIN { } #2
   # seq 2
   ...
 }

and now B::Deparse can tell where to put the blocks.

PL_compiling.cop_seq was unused, so this is where I am stashing
the pending sequence number.
p5p pushed a commit that referenced this pull request Dec 13, 2014
$#1 is a syntax error.
p5p pushed a commit that referenced this pull request Jan 13, 2015
to the other part of the message.  diagnostics.pm won’t find it otherwise:

$ perl -Mdiagnostics -we '"foo"->bar'
Can't locate object method "bar" via package "foo" (perhaps you forgot to load
	"foo"?) at -e line 1 (#1)
Uncaught exception from user code:
	Can't locate object method "bar" via package "foo" (perhaps you forgot to load "foo"?) at -e line 1.

Now we have this:

Can't locate object method "bar" via package "foo" (perhaps you forgot to load
	"foo"?) at -e line 1 (#1)
    (F) You called a method on a class that did not exist, and the method
    could not be found in UNIVERSAL.  This often means that a method
    requires a package that has not been loaded.

Uncaught exception from user code:
	Can't locate object method "bar" via package "foo" (perhaps you forgot to load "foo"?) at -e line 1.

(cherry picked from commit 8af56b9)
p5p pushed a commit that referenced this pull request Mar 2, 2015
8c2e27d changed B::Deparse to deparse $#{1} as that instead of as $#1
which is a syntax error, but also changed $#_ to deparse as $#{_}
which isn't necessary, and broke GFUJI/macro-0.06.tar.gz

This could be considered a bug in macro.pm, but since we don't need to
deparse $#_ as $#{_} let's not do that.
p5p pushed a commit that referenced this pull request Feb 29, 2016
Coverity CID 135025 (#1 of 1): Out-of-bounds read (OVERRUN)
29. overrun-local: Overrunning array addr.sun_path of 108 bytes at byte offset 108 using index addr_len (which evaluates to 108).
 864                for (addr_len = 0; addr.sun_path[addr_len]
 28. incr: Incrementing addr_len. The value of addr_len may now be up to 108.
 865                     && addr_len < maxlen; addr_len++);

Reported upstream as

https://rt.cpan.org/Ticket/Display.html?id=111707
p5p pushed a commit that referenced this pull request Mar 1, 2016
Coverity CID 135025 (#1 of 1): Out-of-bounds read (OVERRUN)
29. overrun-local: Overrunning array addr.sun_path of 108 bytes at byte offset 108 using index addr_len (which evaluates to 108).
 864                for (addr_len = 0; addr.sun_path[addr_len]
 28. incr: Incrementing addr_len. The value of addr_len may now be up to 108.
 865                     && addr_len < maxlen; addr_len++);

Reported upstream as

https://rt.cpan.org/Ticket/Display.html?id=111707
preaction pushed a commit to preaction/perl5 that referenced this pull request Mar 3, 2016
Coverity CID 135025 (Perl#1 of 1): Out-of-bounds read (OVERRUN)
29. overrun-local: Overrunning array addr.sun_path of 108 bytes at byte offset 108 using index addr_len (which evaluates to 108).
 864                for (addr_len = 0; addr.sun_path[addr_len]
 28. incr: Incrementing addr_len. The value of addr_len may now be up to 108.
 865                     && addr_len < maxlen; addr_len++);

Reported upstream as

https://rt.cpan.org/Ticket/Display.html?id=111707
p5p pushed a commit that referenced this pull request Aug 13, 2016
In an eighty-column terminal, this is what it looked like before
this commit:

$ ./perl -Ilib -Mdiagnostics -E 'state ($x)=1'
Initialization of state variables in list context currently forbidden at -e line 1, at EOF
Execution of -e aborted due to compilation errors (#1)
    (F) state only permits initializing a single scalar variable, in scalar
    context. So state $a = 42 is allowed, but not state ($a) = 42. To apply
    state semantics to a hash or array, store a hash or array reference in a sca
lar
    variable.
demerphq added a commit that referenced this pull request Sep 9, 2022
demerphq added a commit that referenced this pull request Sep 9, 2022
demerphq added a commit that referenced this pull request Sep 12, 2022
demerphq added a commit that referenced this pull request Oct 25, 2022
demerphq added a commit that referenced this pull request Nov 5, 2022
demerphq added a commit that referenced this pull request Nov 5, 2022
demerphq added a commit that referenced this pull request Nov 5, 2022
demerphq added a commit that referenced this pull request Nov 5, 2022
demerphq added a commit that referenced this pull request Dec 31, 2022
demerphq added a commit that referenced this pull request Feb 8, 2023
demerphq added a commit that referenced this pull request Feb 19, 2023
demerphq added a commit that referenced this pull request Feb 20, 2023
khwilliamson pushed a commit to khwilliamson/perl5 that referenced this pull request Jul 16, 2023
Switch from «use vars» to «our» or «my»
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant