icon Top 9 categories map      RocketAware > Perl >

do EXPR

Tips: Browse or Search all pages for efficient awareness of Perl functions, operators, and FAQs.



Home

Search Perl pages


Subjects

By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Math
Integer, Floating point, Matrix, Statistics, Boolean, ...

Processing
Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Communications
Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...

    
do BLOCK
Not really a function. Returns the value of the last command in the sequence of commands indicated by BLOCK. When modified by a loop modifier, executes the BLOCK once before testing the loop condition. (On other statements the loop modifiers test the conditional first.)

do SUBROUTINE(LIST)
A deprecated form of subroutine call. See the perlsub manpage.

do EXPR
Uses the value of EXPR as a filename and executes the contents of the file as a Perl script. Its primary use is to include subroutines from a Perl subroutine library.

    do 'stat.pl';

is just like

    eval `cat stat.pl`;

except that it's more efficient, more concise, keeps track of the current filename for error messages, and searches all the -I libraries if the file isn't in the current directory (see also the @INC array in Predefined Names). It's the same, however, in that it does reparse the file every time you call it, so you probably don't want to do this inside a loop.

Note that inclusion of library modules is better done with the use() and require() operators, which also do error checking and raise an exception if there's a problem.

Source: Perl builtin functions
Perl builtin functions
Perl builtin functions
Copyright: Larry Wall, et al.
Next: dump LABEL
Next: do EXPR
Next: do SUBROUTINE

Previous: do SUBROUTINE
Previous: do BLOCK
Previous: die LIST



(Corrections, notes, and links courtesy of RocketAware.com)


[Overview Topics]

Up to: PERL
Up to: PERL
Up to: PERL




Rapid-Links: Search | About | Comments | Submit Path: RocketAware > Perl > perlfunc/do.htm
RocketAware.com is a service of Mib Software
Copyright 2000, Forrest J. Cavalier III. All Rights Reserved.
We welcome submissions and comments