# CPAN mirror (pkg.shecan.ir)

> Mirror of CPAN (cpan.metacpan.org, including BackPAN) for cpanm, Carton and the cpan shell: the package indexes and all distributions.

- Upstream: cpan.metacpan.org
- Mirror URL: <https://mirror-cpan.pkg.shecan.ir>
- Clients: cpanm
- Service status: <https://pkg.shecan.ir/status.json> (key `cpan`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/cpan/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/cpan.json>

## Limitations

- cpanm must be run with --mirror-only; otherwise it resolves modules through the MetaCPAN API (fastapi.metacpan.org), which is not mirrored.
- Only CPAN files (indexes, distributions, CHECKSUMS); MetaCPAN search, its API and directory listings are not served.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### cpanm: temporary (one command or the current shell; nothing saved)

Run (linux, macos)

```sh
cpanm --mirror https://mirror-cpan.pkg.shecan.ir --mirror-only Try::Tiny
```

### cpanm: persistent (user- or system-wide configuration)

Run (linux, macos)

```sh
export PERL_CPANM_OPT="--mirror https://mirror-cpan.pkg.shecan.ir --mirror-only"
```

Undo / restore the default (linux, macos)

```sh
unset PERL_CPANM_OPT
sed -i.bak -E '/^export (PERL_CPANM_OPT)=/d' ~/.bashrc ~/.zshrc ~/.profile 2>/dev/null || true
```
