Chilkat2 Perl
=============

Chilkat2 Perl is the Perl-style Chilkat API: the module "Chilkat2", classes in the Chilkat2:: namespace
(Chilkat2::Http, Chilkat2::JsonObject, ...), one accessor per property ($http->ConnectTimeout(30)), character
strings in and out, closures for progress callbacks, and an optional RaiseError mode in which a failed call
dies with a Chilkat2::Error.  It is independent of the classic Chilkat Perl module (use chilkat;
chilkat::CkHttp->new()); the two can be installed side by side.

Requirements: Strawberry Perl 5.30, 5.32, 5.36, 5.38, 5.40 or 5.42 (64-bit; 5.30 and 5.32 also 32-bit).
Each archive is built for ONE perl version and architecture: chilkat2-perl-<5.xx>-<x86_64|x86>-mingw32.  Check
yours with:

  perl -MConfig -e "printf qq(%vd %s\n), $^V, $Config{archname}"

A library built for another perl refuses to load, with the reason.


Easiest: the installer
----------------------

  curl -fsSL https://chilkatdownload.com/perl/install-perl2 -o install-perl2
  perl install-perl2

finds out which build the perl running it needs, downloads it, verifies it, and installs it (curl.exe is
part of Windows 10 and later).


Install this archive
--------------------

  perl Makefile.PL
  gmake
  gmake test
  gmake install

Makefile.PL checks that the library loads into the perl running it.  Nothing is compiled.

What is in this archive
-----------------------

  lib/Chilkat2.pm                     the module (loads the library, defines Chilkat2::Error)
  lib/Chilkat2/*.pm                   the documentation of each class:  perldoc Chilkat2::Http
  lib/auto/Chilkat2/Chilkat2.dll      the compiled library (code-signed; Makefile.PL names it for your perl)
  Makefile.PL, test.pl                install and check
  license / SBOM files

To use it without installing:  perl -I C:\path\to\this\archive\lib your_script.pl


Using it
--------

  use strict;
  use warnings;
  use Chilkat2;

  my $http = Chilkat2::Http->new(ConnectTimeout => 10);
  $http->on(PercentDone => sub { my ($pct) = @_; print "$pct%\n"; return 0 });
  my $html = $http->QuickGetStr('https://www.chilkatsoft.com/');
  if (!defined $html) {
      print $http->LastErrorText, "\n";
      exit;
  }
  print length($html), " characters\n";

A failed call returns false (or undef for a string or object result), with the reason in
$obj->LastErrorText.  Create an object with RaiseError => 1 to have failed calls die with a Chilkat2::Error
instead (which stringifies to the LastErrorText).

Unlocking: call Chilkat2::Global->new->UnlockBundle('<your unlock code>') once at startup.  Without a
purchased unlock code Chilkat runs as a 30-day trial.

Documentation and examples: https://www.chilkatsoft.com/
