> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Perl script basics

> Discover how to run Perl scripts on Hosting.com servers, including setting permissions and choosing the right FTP mode.

This article provides essential information about running Perl scripts on hosting.com servers.

## What permissions do I need to set for my Perl script files?

The correct permissions for Perl script files depends on the script's particular function:

* For Perl script files that are publicly accessible through the web, you should set the file permissions to **755** (read, write, and execute permissions for the user, and read and execute permissions for the group and world). You do **not** need to give the world write permissions to the Perl script.

* For Perl script files that you only run on the command line, you should set the file permissions to **700** (read, write, and execute permissions for the user, and no permissions for the group and world).

<Note>
  A Perl script may need to open a file for write access. For example, guestbooks and bulletin boards often must write data to a particular file. Files that must be writable by Perl scripts can use the default file permissions of 644 (read and write permissions for the user, and read permissions for the group and world).
</Note>

## What file extensions can I use for my Perl script files?

Perl script files can have a .pl or .cgi extension. However, like file permissions, the file extension depends on the script's particular function:

* Perl script files that generate web output accessible to the public should use the .cgi extension.

* Perl script files that you only run from the command line, and script files which do not generate web output, should use the .pl extension.

## What version of Perl is installed on hosting.com servers?

Our servers currently use Perl version 5.16.

To determine the Perl version from the command line, you can type the following command:

```bash theme={null}
perl -v
```

## What is the path to the Perl executable?

The absolute path to the Perl executable on our servers is **/usr/bin/perl**. The /usr/bin directory is in the default path, however, so generally you do not need to include the full path when you run Perl scripts from the command line. Just type the following command, replacing *filename* with the name of your script file:

```bash theme={null}
perl filename
```

## What is the correct FTP transfer mode for Perl scripts?

When you use FTP to upload Perl scripts to your site, always use ASCII mode. If you upload scripts in binary mode, they do not work and you receive an "Internal Server Error: Premature End of Script Headers" message (500 Internal Server Error) when you view the page.

## More information

To view the official online Perl documentation, please visit [http://www.perl.org/docs.html](http://www.perl.org/docs.html).

## Related articles

* [Troubleshooting Perl scripts](/docs/troubleshooting-perl-scripts)

* [Configuring file permissions in File Manager](/docs/file-permissions)
