All Scripts backed by 10 years in business, free support, free updates and a 30 day money back guarantee.
Download Purchase Programming F.A.Q. Support Contact
Commercial Perl Scripts
All Form Pro Updated
Count It
Form Mailer + Attachments
Client File Manager
Da Godfaddah
Dropbox Updated
FAQ Builder
HT Manager Updated
RegisterHT
Mailing List Server
Page Updater - Text
Page Updater Pro Updated
PS Guestbook Updated
PS Lightning Search Updated
Quick File Mailer
Quick MySQL
Select-A-File
Upload Center
Free Perl Scripts
Access Log Viewer
All Form
Epoch Converter
Error Log Viewer
Invoice Center
PS Upload
Question Manager
Quick CHMOD
QuickHT
Site File Finder
Site File Lister
SSI Tag Maker
Perl Modules
Monger Calendar
Monger File
Monger Mail
Monger Persist
JavaScript Generators
PopUp Windows
Meta Gen
RGB / Hex Converter
Page Colors
Sudoku
Tutorials and FAQs
Cookies
Using CuteFTP
Using WS_FTP
Installing Scripts
Debugging
Utilities
env_vars.pl
backup.pl
restore.pl
check_email.pl
date.pl
dayname.pl
fileage.pl
format_length.pl
format_url.pl
getfile.pl
parse.pl
redirect_html.pl
Free Services
Epoch Converter
TLD Registries
RGB/Hex FInder
Colour Checker
ASCII Codes
Policies
Terms and Conditions
Privacy Policy
Refund Policy
Site Map

Form Processor with no SPAM from robots.

Anti-spam, anti-robot, anti-flame, Guestbook for your website.

Manage Remote websites from your website. Allow clients to update sections of their own web pages.

Secure file manager with upload progress meter. A printer's best friend. Find out more.

Utility Name: getfile.pl
Platform: UNIX or Linux
Requires: Perl4 or higher


When I'm writing a short program I may have to open a file, extract it's contents and close it again a half dozen times. When I'm writing a longish program I may have to do this several hundred times. It seems a waste of time to keep typing:
if(open(FILE, "<$Data/file_name.txt")) {
    flock(FILE, '2');
    @file = ;
    close(FILE);
    chomp(@file);
}
Each time I type the above, that's 119 bytes I'm using. Multiply that by two hundred times and you have about 23Kb worth of characters. By using the getfile.pl utility you will save yourself time typing and server space.

To use this utility, load it with your other script that is calling it and CHMOD it to 755. The other script must have a require statement before the subroutine getfile() is called. The require statement looks like this:

require 'getfile.pl';

The way it works is you pass the script the path to the file you want opened and then assign the returned value to an array. Here are a few examples showing how the script is called:

  • By specifying the abs-path yourself:
    @new_array = getfile('/home/name/html/path/to/file.txt');

  • By passing the abs-path as a variable:
    @new_array = getfile($file_path); @new_array = getfile("$Data/$user/$file");

  ©2009 All rights reserved, PerlServices.net. Website hosting by LinuxHostingPlans.com