Skip to content

Commit bf1de15

Browse files
committed
documentation update
1 parent f51470e commit bf1de15

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ These are the basic steps for building your first PEB-based application:
4747
* **3.** Write your Perl scripts.
4848
Input from local HTML forms is read just like reading POST or GET requests in a Perl CGI script. Use the [get-post-test.pl](resources/app/perl/get-post-test.pl) file as an example.
4949

50-
* **4.** Connect your Perl scripts using a link to ``name-of-script-configuration-object.settings``.
50+
* **4.** Connect your Perl scripts to your local HTML page using [one of the three possible methods](#perl-scripts-api).
5151

5252
PEB is created to work from any folder without installation and all your local HTML files and Perl scripts should be located in the ``{PEB_binary_directory}/resources/app`` directory.
5353

@@ -116,7 +116,7 @@ CONFIG += app_bundle
116116

117117
## Runtime Requirements
118118
* Qt 5 libraries.
119-
Their full list for a QtWebKit Linux build of PEB can be found inside the ``start-peb-webkit.sh`` script.
119+
Their full list for a QtWebKit Linux build of PEB can be found inside the [start-peb-webkit.sh](start-peb-webkit.sh) script.
120120

121121
* Perl 5 distribution - any Linux, Mac or Windows Perl distribution.
122122

@@ -131,11 +131,11 @@ CONFIG += app_bundle
131131
PEB can also use any Perl on PATH.
132132

133133
## Preparing a Perl Distribution for PEB
134-
Sometimes it is important to minimize the size of the relocatable (or portable) Perl distribution used by a PEB-based application. [{PEB_binary_directory}/sdk/compactor.pl](sdk/compactor.pl) script is one solution to this problem. It finds all dependencies of all Perl scripts in the ``{PEB_binary_directory}/resources/app`` directory and copies them in a new ``{PEB_binary_directory}/perl/lib`` folder; a new ``{PEB_binary_directory}/perl/bin`` is also created. The original ``bin`` and ``lib`` folders are saved as ``{PEB_binary_directory}/perl/bin-original`` and ``{PEB_binary_directory}/perl/lib-original`` respectively. These directories should be manually archived for future use or removed.
134+
Sometimes it is important to minimize the size of the relocatable (or portable) Perl distribution used by a PEB-based application. [Perl Distribution Compactor](sdk/compactor.pl) is one solution to this problem. It finds all dependencies of all Perl scripts in the ``{PEB_binary_directory}/resources/app`` directory and copies them in a new ``{PEB_binary_directory}/perl/lib`` folder; a new ``{PEB_binary_directory}/perl/bin`` is also created. The original ``bin`` and ``lib`` folders are saved as ``bin-original`` and ``lib-original`` respectively. These directories should be manually archived for future use or removed.
135135

136-
``compactor.pl`` should be started using [{PEB_binary_directory}/compactor.sh](compactor.sh) on a Linux or a Mac machine or [{PEB_binary_directory}/compactor.cmd](compactor.cmd) on a Windows machine to ensure that only the Perl distribution used by PEB is going to start ``compactor.pl``. This is necessary to avoid dependency mismatches with any other Perl on PATH.
136+
Perl Distribution Compactor should be started from the directory of the browser binary using [compactor.sh](compactor.sh) on a Linux or a Mac machine or [compactor.cmd](compactor.cmd) on a Windows machine to ensure that only the Perl distribution of PEB is used. This is necessary to avoid dependency mismatches with any other Perl on PATH.
137137

138-
``compactor.pl`` relies on ``Module::ScanDeps`` and ``File::Copy::Recursive`` CPAN modules, which are included in the ``{PEB_binary_directory}/sdk/lib`` folder.
138+
Perl Distribution Compactor depends on [Module::ScanDeps](https://metacpan.org/pod/Module::ScanDeps) and [File::Copy::Recursive](https://metacpan.org/pod/File::Copy::Recursive) CPAN modules, which are included in the ``{PEB_binary_directory}/sdk/lib`` folder.
139139

140140
## Perl Scripts API
141141
Every Perl script run by PEB is called by clicking a link or submitting a form to a pseudo filename composed from the name of the JavaScript object with the settings of the Perl script and a ``.settings`` extension.
@@ -311,10 +311,12 @@ Data directory is not hard coded in C++ code, but a separation of data files and
311311
```perl
312312
use Cwd;
313313

314-
my $current_working_directory = cwd(); # the directory of the browser binary by default
314+
my $current_working_directory = cwd();
315315
my $data_directory = "$current_working_directory/resources/data";
316316
```
317317

318+
Note that by default the working directory of all Perl scripts run by PEB is the directory of the browser binary.
319+
318320
## Log Files
319321
If log files are needed for debugging of PEB or a PEB-based application, they can easily be turned on by manually creating ``{PEB_binary_directory}/logs``. If this directory is found during application startup, the browser assumes that logging is required and a separate log file is created for every browser session following the naming convention: ``{application_name}-started-at-{four_digit_year}-{month}-{day}--{hour}-{minute}-{second}.log``. PEB will not create ``{PEB_binary_directory}/logs`` on its own and if this directory is missing no logs will be written.
320322

0 commit comments

Comments
 (0)