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: format_length.pl
Platform: UNIX or Linux
Requires: Perl4 or higher


This utility takes the input and verifies that it's length is between the minimum number of characters and maximum number of characters. A length precisely equal to the minimum number of characters or precisely equal to the maximum number of characters will be considered valid and not manipulated.

When would you use this? The best example is a script that is requesting the user select a User Name between x and xx characters in length. This utility will ensure that the name input is exactly between those values. It is different than using the substring because the substring won't default on a minimum number of characters and you would have to write the length checking and length testing statements and conditionals and an error would cause a fault. Using this utility takes all that checking away and worry away. It simply returns a value that is within the specified parameters.

To call the script you pass it three variables. The input to be checked, the minimum number of characters and the maximum number of characters. Here are a few examples of calls to the program showing the input, the call and the output.

EX.1
$input = "jimbob";
$output = format_length($input, 5, 10);
$output will print out "jimbob";

EX.2
$input = "jimbob";
$output = format_length($input, 2, 4);
$output will print out "jimb";

EX.3
$input = "jimbob";
$output = format_length($input, 10, 15);
$output will print out "jimbobjimbob";

EX.4
$input = "jb";
$output = format_length($input, 5, 10);
$output will print out "jbjbjbjb";

NOTE: If you do not specify a minimum and or maximum number of characters, the utilities default setting is the number "6" for minimum and "10" for maximum.

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