Click the animation to see a screencast of programming this "Hello, World!" program with Perl in a matter of minutes:
Same video on Peertube: https://s.q37.info/bvvjj7gk.
Click to see the corresponding source code
use Atlas;
my $BODY = '
<fieldset>
<input id="Input" xdh:onevent="Submit" value="World"/>
<button xdh:onevent="Submit">Hello</button>
<hr/>
<fieldset>
<output id="Output">Greetings displayed here!</output>
</fieldset>
</fieldset>
';
sub acConnect {
my ($hello, $dom) = @_;
$dom->inner("", $BODY);
$dom->focus("Input");
}
sub acSubmit {
my ($hello, $dom) = @_;
my $name = $dom->getValue("Input");
$dom->begin("Output", "<div>Hello, $name!</div>");
$dom->setValue("Input", "");
$dom->focus("Input");
}
my %CALLBACKS = (
"" => \&acConnect,
"Submit" => \&acSubmit
);
Atlas::launch(\%CALLBACKS);
# You can replace 'github.com' with 'framagit.org'.
# DON'T copy/paste this and above line!
git clone https://github.com/epeios-q37/atlas-perl
cd atlas-perl/examples
perl -I ../atlastk Hello/Hello.pl
If you want to take your code to the next level, from CLI to GUI, then you found the right toolkit.
With the Atlas toolkit, you transform your programs in modern web applications (SPA) without the usual hassles:
- no JavaScript to write; only HTML(/CSS) and Perl,
- no front and back end architecture to bother with,
- no web server (Apache, Nginx…) to install,
- no need to deploy your application on a remote server,
- no incoming port to open on your internet box or routeur.
The Atlas toolkit is written in pure Perl, with no native code and no dependencies, allowing the Atlas toolkit to be used on all environments where Perl is available.
And simply by running them on a local computer connected to internet, applications using the Atlas toolkit will be accessible from the entire internet on laptops, smartphones, tablets…
The atlastk
directory contains the Perl source code of the Atlas toolkit.
The examples
directory contains some examples.
To run an example, launch, from within the examples
directory, perl -I../atlastk <Name>/main.pl
, where <Name>
is the name of the example (Blank
, Chatroom
…).