![]() |
Free Stuff |
P6_EnumFormFlds.pl
Enumerate all fields in all forms in a HTML document.
P6_EnumFormFlds.pl.PL /v HtmlIn XmlOut
[/v] = Enable verbose output to console.
HtmlIn = Name of HTML document containing forms to parse.
XmlOut = Name of XML document to create.
Relative or unqualified file names are resolved relative to the CWD. Unlike most of my Perls, this one generates no separate log. The generated XML document IS the log.
Properly formed HTML document containing one or more forms.
XML document containing metadata about all forms, including all inputs in each form.
Since anonymous forms and inputs are both legal, both forms and controls are identified by their ordinal positions within the document. Names, if present, are shown with the other attributes in the order in which they occur in the tags.
This script was written and tested on a Windows machine with a Windows version of Perl. It was tested against Perl version 5.6.1, which is freely available at http://www.activestate.com/Products/Download/Register.plex?id=ActivePerl. The code is completely portable, however, and self contained, requiring no modules other than ones that are included in the standard Perl distribution.
However, the script calls two functions, disp_time_med_p6c and
elapsed_time_to_text_p6c, that are part of an unpublished Perl module that I wrote for
internal use. Both functions are fully documented.
Date Who What ========== === ========================================================================================= 08/25/2003 DAG Initial release.
Following is complete documentation for two functions that I imported from unpublished Perl modules so that I can distribute this script separately.
Display time for reports in Medium format.
$string = disp_time_med_p6c ( [ $pprefix ] , [ $psuffix ] , [ $pwhat ] , [ $ptz ] ) ; print FILEHANDLE $string ;
The first argument, $pprefix, is the prefix to include in the string before the time. You may pass an
empty string if all you want returned is the time string.
The second argument, $psuffix, is the suffix to append to the string after the time. You may pass an
empty string if all you want returned is the time string.
The third argument, $pwhat, specifies whether to return the date and time, only the date, or only the
time. Permissible values are:
1 = Date and Time
2 = Date only
3 = Time only
If the argument is null or undefined, date and time are both returned.
The fourth argument, $ptz, is the time zone to use. Set it to True (1) for GMT.
Otherwise, the returned time string will be local time.
Note: At present, the time zone is hard coded as US Central.
None of the arguments is mandatory.
The disp_time_med_p6c prototype is (;$$$$).
The return value from disp_time_med_p6c is a time and date string suitable for display on a report or
writing into a log file.
The disp_time_med_p6c function can be used to display either local time or GMT.
This function was incorporated as is from Perl module P6consulting::P6timelib, available
separately. That module contains several other generally useful time functions.
Used File::Listing from the standard distribution as a template, as this function, and its companion,
disp_time_long_p6c were the first two functions that I wrote that I intended to keep in a Perl module.
Convert an elapsed time in seconds to a format suitable for display on screen, in a log file, or on a report.
use P6consulting::P6timelib qw ( elapsed_time_to_text_p6c ) ; $string = elapsed_time_to_text_p6c ( $elapsedseconds ) ; print FILEHANDLE $string ;
The first (and only) argument to elapsed_time_to_text_p6c is the elapsed time in seconds.
The single argument is required.
The return value from elapsed_time_to_text_p6c is a list as follows:
$days = Elapsed time, Days
$hours = Elapsed time, Hours
$minutes = Elapsed time, Minutes
$seconds = Elapsed time, Seconds
The elapsed_time_to_text_p6c function can be used to display elapsed times that are, of necessity,
computed in seconds.
The elapsed_time_to_text_p6c prototype is ($).
This function began life as a function which I wrote from scratch for Summarize.PL, a program that
I used to compute elapsed time from the logs generated by some timing tests.
The original program is part of Caltex project number 1039. The only changes for this library are a new, hopefully more descriptive name for the function, and a prototype.
The function name was given a _p6c suffix when I moved it from package P6utils to this package, in
keeping with my recently established rules for naming library functions to avoid namespace collisions.
David A. Gray, MBA
North Richland Hills, Texas, USA
http://www.wizardwrx.com
Use this form to contact the author.
Copyright (c) 2003 David A. Gray, MBA. All rights reserved world wide.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
This software is freeware. However, in the unlikely event that you need basic
support, you may make your request by email. Please use
this form to submit your inquiry. Your inquiry will be
handled on a best efforts basis, and any information you send us about your
specific situation will be treated as confidential. We do, however, reserve the
right to incorporate any ideas we get from our correspondence with you into
future versions of P6_EnumFormFlds.pl or other software either for internal use or for sale.
Should we do so, we shall give full credit to its source in the accompanying
documentation.
Note: Basic support is limited to installation and basic operation of the Perl script. Help with program modifications are subject to our usual consulting fees.
|
The MD5 digest of this file is |
|
| Home | More Free Software |