Skip to content

Perl script basics

This guide covers the essentials for running Perl scripts on Ruachost servers, including permissions, file extensions, and execution.

  • Web-accessible scripts: Set permissions to 755 (read, write, execute for user; read and execute for group and others).
  • Command-line only scripts: Set permissions to 700 (read, write, execute for user; no permissions for group and others).
  • .cgi – Use for Perl scripts that generate web output accessible to the public.
  • .pl – Use for scripts run only from the command line or that do not generate web output.
  • To check the Perl version on your server, run perl -v over SSH.
  • To check the version from the command line:
perl -v
  • Absolute path: /usr/bin/perl
  • /usr/bin is in the default PATH, so you can usually run scripts like this:
perl filename
  • Always use ASCII mode when uploading Perl scripts via FTP.
  • Uploading in binary mode can cause errors such as:
Internal Server Error: Premature End of Script Headers (500)

For official Perl documentation, visit Perl Docs.