Skip to content

Commit

Permalink
More pod updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Timofey Potapov committed Sep 21, 2024
1 parent 486b584 commit 72748b1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 10 deletions.
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Benchmark two snippets of code:

$ perl -Me -e 'n { slow => sub{ ... }, fast => sub{ ... }}, 10000'

Launch the Runtime::Debugger:
Create a breakpoint in code:

$ perl -Me -e 'repl'

Expand Down Expand Up @@ -117,6 +117,8 @@ Encode/decode UTF-8:
$ perl -Me -e 'utf8; say dec "\xD7\x90"'
א

And much, much more ...

# DESCRIPTION

This module imports many features that make
Expand All @@ -126,21 +128,44 @@ It has been optimized for performance to not
import all features right away:
thereby making its startup cost quite low.

## How to Import

This module will overwrite existing methods
of the same name (which triggers a warning)!

Should this happen and it is not desired,
simply import this module first.

Should you prefer the methods in this module,
import this module last (if needed, at the end
of the file).

# SUBROUTINES

## Investigation

### repl

Add a breakpoint to code.
Add a breakpoint using [Runtime::Debugger](https://metacpan.org/pod/Runtime%3A%3ADebugger).

Basically inserts a Read Evaluate Print Loop.

Version 0 was basically:

while ( 1 ) {
my $input = <STDIN>;
last if $input eq 'q';
eval "$input";
}

(Much more powerful since then).

Enable to analyze code in the process.

CODE ...

# Breakpoint
use e;
repl

CODE ...
Expand Down Expand Up @@ -667,18 +692,18 @@ Insert subroutines into the symbol table.

Extracted from Mojo::Util for performance.

Import methods into another package
Imports method(s) into another package
(as done in this module):

Take a look at import method for an example.
Take a look at the import method for an example.

### pod

Work with perl pod.

### import

\[Internal\] Imports a DSL into another package.
Imports a DSL into another package.

Can be used in a sub class to import this class
plus its own commands like this:
Expand Down
35 changes: 30 additions & 5 deletions lib/e.pm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Benchmark two snippets of code:
$ perl -Me -e 'n { slow => sub{ ... }, fast => sub{ ... }}, 10000'
Launch the Runtime::Debugger:
Create a breakpoint in code:
$ perl -Me -e 'repl'
Expand Down Expand Up @@ -129,6 +129,8 @@ Encode/decode UTF-8:
$ perl -Me -e 'utf8; say dec "\xD7\x90"'
א
And much, much more ...
=cut

=head1 DESCRIPTION
Expand All @@ -140,6 +142,18 @@ It has been optimized for performance to not
import all features right away:
thereby making its startup cost quite low.
=head2 How to Import
This module will overwrite existing methods
of the same name (which triggers a warning)!
Should this happen and it is not desired,
simply import this module first.
Should you prefer the methods in this module,
import this module last (if needed, at the end
of the file).
=cut

=head1 SUBROUTINES
Expand All @@ -150,15 +164,26 @@ thereby making its startup cost quite low.
=head3 repl
Add a breakpoint to code.
Add a breakpoint using L<Runtime::Debugger>.
Basically inserts a Read Evaluate Print Loop.
Version 0 was basically:
while ( 1 ) {
my $input = <STDIN>;
last if $input eq 'q';
eval "$input";
}
(Much more powerful since then).
Enable to analyze code in the process.
CODE ...
# Breakpoint
use e;
repl
CODE ...
Expand Down Expand Up @@ -703,18 +728,18 @@ Insert subroutines into the symbol table.
Extracted from Mojo::Util for performance.
Import methods into another package
Imports method(s) into another package
(as done in this module):
Take a look at import method for an example.
Take a look at the import method for an example.
=head3 pod
Work with perl pod.
=head3 import
[Internal] Imports a DSL into another package.
Imports a DSL into another package.
Can be used in a sub class to import this class
plus its own commands like this:
Expand Down

0 comments on commit 72748b1

Please sign in to comment.