subs(3pm)

subs3pm

Perl pragma to predeclare sub names

Usage

    use subs qw(frob);
    frob 3..10;

Overview

This will predeclare all the subroutine whose names are in the list, allowing you to use them without parentheses even before they're declared.

Unlike pragmas that affect the $^H hints variable, the use vars and use subs declarations are not BLOCK-scoped. They are thus effective for the entire file in which they appear. You may not rescind such declarations with no vars or no subs.

See the section on Pragmatic Modules in the perlmodlib manpage and the section on strict subs in the strict manpage.

Releases

6 releases since Debian 1.1 (Buzz); the text changed 4 times.

  1. 1.1
  2. 1.2–1.3
  3. 2.0
  4. 2.1
  5. 2.2

From perl-5.004-doc 5.004.05-6 in Debian 2.2 (Potato). Also shipped by perl-5.005-doc. Parsed by carta from the page's man source.