---
product: Chilkat
product_version: 11.7.0
language: ckperl
language_label: Perl
document: language guide
---
> Chilkat 11.7.0 · language=ckperl · this file: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/ckperl/guide.md`
> Class pages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/ckperl/classes/<Class>.md`

# Chilkat for Perl — language guide — v11.7.0

## 1. Which Chilkat binding this is

This is the **Chilkat Perl module** (`use chilkat();`): classes `chilkat::CkHttp`, `chilkat::CkZip`, …, created with `chilkat::CkHttp->new()`; properties through `get_Xxx()` / `put_Xxx(...)`; string-producing methods also have a lowercase-initial form returning the string. A newer "Chilkat2 Perl" binding with a different spelling is in preparation (`perl2/`); code using `chilkat::CkHttp` and `put_Xxx` is this binding.

## 2. Install and requirements

One command picks the right build for your Perl (Windows, Linux, Alpine, macOS): [https://www.chilkatsoft.com/installPerlLinux.asp](https://www.chilkatsoft.com/installPerlLinux.asp) (Linux/Alpine), [https://www.chilkatsoft.com/installPerlMacOSX.asp](https://www.chilkatsoft.com/installPerlMacOSX.asp), [https://www.chilkatsoft.com/install_perl_windows.asp](https://www.chilkatsoft.com/install_perl_windows.asp) (Strawberry Perl).

## 3. Unlocking and object creation

```perl
use chilkat();

# Required once per process, before any other Chilkat object. Any string unlocks a 30-day trial.
my $glob = chilkat::CkGlobal->new();
my $success = $glob->UnlockBundle("Anything for 30-day trial");
if ($success != 1) {
    print $glob->lastErrorText() . "\r\n";
    exit;
}

my $http = chilkat::CkHttp->new();
```

- Unlocking only sets a flag in memory: no license files, no network call, so the call is repeated each time the program runs. Extra calls are harmless no-ops; the `Global` object can be discarded afterwards.
- If a program forgets to unlock, Chilkat runs in trial mode and stops working when the trial expires — always include the call, and use the purchased unlock code in production.
- `UnlockBundle` unlocks every class; per-class `UnlockComponent` methods exist only in old code.

## 4. Error model

Chilkat methods **do not die**. The note under each method on the class page says how it reports failure: a status method returns `0` (false); the lowercase-initial string form returns `undef` on failure while the uppercase form fills a `chilkat::CkString` and returns a status; object-returning methods return `undef`; for an int result check `get_LastMethodSuccess()`. `lastErrorText()` holds the diagnostic in every case.

Literals in Perl: true is `1`, false is `0`, null/none is `null`.

## 5. Strings, bytes and encodings

- Strings are Perl strings (UTF-8 when `put_Utf8(1)`, the default); a `charset` argument names the encoding of the *bytes* being produced or read.
- Binary data goes through `chilkat::CkByteData` / `chilkat::CkBinData` objects (`Bd` methods); `getBytes()` returns a binary Perl string.
- Methods with `2`/`3` suffixes or `Quick*` prefixes are distinct members, not overloads.

## 6. Object lifetime and threading

Objects are released when their Perl reference count drops to zero.

A Chilkat object may be used from any thread, but **one object must not be used by two threads at the same time**: create one object per thread or protect it with a lock. Objects are independent — there is no shared global state other than the unlock flag and the few `Global` settings.

## 7. Progress callbacks and async

This binding has **no progress callbacks**. For progress, percent-done or cancellation, use the `*Async` variant of a method (every method with an "Async variant" line on its class page has one). `XAsync` takes the same arguments, returns a `Task` immediately, and the result is read from the task after it finishes: run it, poll `Finished` (or wait), then `GetResultBool` / `GetResultString` / `GetResultBytes` etc.; `PercentDone` and `Cancel` are on the task. No new Async methods are added from 11.7.0 on.

## 8. Common mistakes an AI makes with this binding

1. Using property syntax (`$http->{Port} = 443`) — in this binding it is `$http->put_Port(443)`.
2. Writing `Chilkat::Http` or `chilkat::Http` (other bindings' spelling) — here it is `chilkat::CkHttp`.
3. Omitting `Global.UnlockBundle` (the program runs in trial mode and stops working after 30 days).
4. Inventing members by analogy with other libraries. If a member is not on the class page, it does not exist — look it up rather than guessing.
5. Using deprecated members that older examples still show. The class page lists each one with its replacement; `deprecated.md` lists them all.
6. Ignoring the failure path. Every Chilkat method reports failure (see each method's note); `LastErrorText` says why, and printing it is the first debugging step.
7. Using one Chilkat object from two threads at the same time. Create one object per thread, or protect it with a lock.

## 9. Instructions block for coding agents

Paste into `CLAUDE.md`, `.cursor/rules`, or Copilot instructions:

```
This project uses Chilkat 11.7.0 from Perl (the chilkat Perl module: use chilkat(); classes chilkat::CkHttp, ...).
- Reference: https://www.chilkatsoft.com/ai-docs/v/11.7.0/ckperl/ — read guide.md once, then classes/<Class>.md for each class used.
- Call chilkat::CkGlobal->new()->UnlockBundle(...) once at startup.
- Properties are methods: put_Xxx(v) to set, get_Xxx() to read.
- Chilkat methods never die: check the 0/undef result and print $obj->lastErrorText().
- Never use a member that is not on the class page; never use members listed as deprecated.
```

## 10. Classes

[Class index for Perl](https://www.chilkatsoft.com/ai-docs/v/11.7.0/ckperl/index.md)
