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.

MongerFile

MongerFile is an object oriented module that will permit you to more easily manipulate files from your Perl program.

MongerFile is a self contained module that does not require any othermodules to function. It was written to be placed in your webspace with the program calling it. It does NOT have to be installed on the server. Simply place it in the same directory as the program calling it.

MongerFile combines the speed and power of many of the Perl Services utility scripts into an object oriented approach. It may seem daunting at first but it's really easy to use and once you get the hang of it, you'll see how it can speed up the performance of your own scripts!

Below is the full list of functions you can use with MongerFile along with a description of how to use it. If you have any problems implementing this, please use the "Ask us..." link to submit your question:

BEGIN TRANSCRIPT
================================================
##########################################################################################
#
#	This module was written to be placed into the directory you are working in
#	as opposed to installing it on the server. To use this module, place it in the
#	same directory as the script calling it. You can use any of the methods so long
#	as you have the following anywhere before the first call to the module:
#
#	use MongerFile;
#
##########################################################################################
#
#	First, create a new file object. This object will refer directly to the file you
#	want to work on. Assume the absolute path to the file is included in the variable
#	$filepath (i.e. $filepath = '/usr/home/html/directory/somefile.txt';)
#
#	my $file = new MongerFile($filepath);
#
#	Note: The file you are referencing does not have to exist. If it does not exist,
#	you will have to create the file using append() or write().
#
##########################################################################################
#
#	Available Methods: (We will assume the object points to a text file that does
#	already exist. All methods except for append() and write() will work on binary files).
#
#	$file->age;
#	This returns the age of the file in seconds, since it was created on the server.
#	You can modify this call in the following manner to retrieve different age values:
#	$file->age('s'); #Returns the same as the above, number of seconds old.
#	$file->age('m'); #Returns the age of the file in minutes
#	$file->age('h'); #Returns the age of files in hours
#	$file->age('d'); #Returns the age of files in days
#	$file->age('w'); #Returns the age of files in weeks
#	$file->age('y'); #Returns the age of files in years
#		i.e.:   $ageinhours = $file->age('h');
#
#	The above calls will all return decimal values. If you want to get an integer only,
#	then turn on the integer function this way (it works on any of the above):
#	$file->age('m', 1); #Returns a whole number age of the file in minutes.
#
#	If you would prefer to get the age of the file since it was last modified, then
#	use the following call (it works on any of the above);
#	$file->age('d', 0, 1);
#	$file->age('m', 1, 1);
#
#
#	$file->append($data);
#	$file->append(@data);
#	This will append the contents of the submitted argument to the end of a file
#	without erasing the original content of the file.
#
#
#	$file->backup_off;
#	$file->backup_on;
#	MongerFile automatically backs up all text files it modifies. This can be turned
#	on and off with subsequent calls to these two methods.
#
#
#	$file->compare($another_file_path);
#	This method compares the current file agains another file which you specify the
#	absolute path to. If the two files are identical, the method returns a true value
#	otherwise it returns a null value.
#	
#
#	$file->copy($newname);
#	This method takes the existing file and creates a new copy of it, leaving the first
#	copy intact (unlike the rename() function in Perl). The method must be passed the
#	full absolute path to the new file including the new file name. ie.
#	$file->copy('/usr/home/html/somedirectory/my_new_file.txt');
#
#
#	$file->erase;
#	This method will delete the contents of a file without removing the file.
#
#
#	$file->get;
#	This method returns the contents of the file and should be called in one of two
#	ways:
#	my @contents = $file->get;
#		This will return the file as one file line to one element of the array.
#
#	The second type of call is like this:
#	my $contents = $file->get;
#		This will return the entire contents of the file as one long string.
#
#
#
#	$file->no_chomp;
#	When you call the get method of a file, it automatically chomps the newline characters
#	off the end of each line. If you don't want to have the newline characters removed,
#	then modify the call to get() with a call to no_comp() like this:
#	$file->no_comp;
#	my @contents = $file->get;
#
#
#
#	$file->size;
#	This returns the size of the file in bytes. You can modify this to return the size
#	of the file in other formats:
#	$file->size('b'); #Returns the size of the file in bits (8 bits = 1 byte)
#	$file->size('k'); #Returns the size of the file in Kilobytes
#	$file->size('m'); #Returns the size of the file in Megabytes
#	$file->size('g'); #Returns the size of the file in Gigabytes
#	$file->size('t'); #Returns the size of the file in Terrabytes (okay, it was late, I was tired).
#
#
#
#	$date = $file->created; #Returns a test string showing the date and time file was created.
#
#
#	$date = $file->modified #Returns a test string showing the date and time file was created.
# 
#
#	$date =	$file->created_gmt #Returns a test string showing the date and time (GMT) file was created.
#
#
#	$date = $file->modified_gmt #Returns a test string showing the date and time (GMT) file was created.
#
#
#	$file->printfile;
#	Calling this method will get the contents of the file and print it to STDOUT.
#	i.e.:	print "Content-type: text/html\n\n";
#		$file->printfile;
#
#
#	$file->type;
#	Calling this method will return a value that tells you what type of file you are
#	working on (i.e.: $type = $file->type). The values returned are:
#		Return 1 on ASCII/Text file
#		Return 2 on Binary file
#		Return 3 on directory
#		Return 4 on any other file type
#		Return 0 on non existance
#
#
#	$file->unlink;
#	Destroys the file by unchaining it from the directory tree, just like the
#	Perl call for unlink();
#
#
#	$file->write($string);
#	$file->write(@lotsofstrings);
#	The write method will add the contents to a file. It will overwrite any content
#	already in the file so that previous data will be lost.
#
#	If the file does not exist when write() is called, it will create the file.
#
###########################################################################################

END TRANSCRIPT
===================================================


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