Logo for page: Perl-tuts-1-30 Pix for page: Perl-tuts-1-30
 
 
*
Pages
Home
Perl
Perl modules
Tuts 31+
Tuts 1..30
Image::Magick
FAQs
DHTML Links
Links
Ron
Books
MSWindows
Linux
Unix
XWindows
Wine
Reel2Reel
Dogs
Aliens
SQL
Table of Contents
*
15-Oct-2000
javascript-demo-3.pl is a CGI script which demonstrates how to use JavaScript to track the positions of items as they are dragged around the browser's screen.
Source:
*
8-Oct-2000
html-calendar.pl demonstrates, very simply, how to install and test HTML::CalendarMonth.
The author of CalendarMonth, Matthew P. Sisk, has some outstanding demos at:
Source:
*
4-Sep-2000
This CGI library demonstrates how to use JavaScript within a Perl CGI script to link 2 menus to each other, so that when the user changes the selection on the 'base' menu, the 'linked' menu changes automatically to match.
Features:
- 2 Perl subs, 1 for returning the visible 'base' and 'linked' menu items to the caller, and 1 for returning 2 invisible integers corresponding to the 2 visible (base and linked) menu items
- 2 demo programs, 1 for each sub
Source:
*
26-Sep-2000
myschema.pl V 1.10 is a CGI script which displays the schema for any MySQL table. Features:
- List each column and its attributes
- For each column, lists all other tables in the same database which have a column with the same name. In effect, this lists those tables which have the given column as a foreign key, altho, of course, the similarity of name may just be coincidence
- The column names are sorted across the page
- The table names are sorted down the page
- Lastly, each table name is a submit button, so you can click on it to jump to the definition of that table
Source:
*
See also myadmin.pl in tutorial # 35.
Source:
*
26-Aug-2000
12-Mar-2001: Updated in preparation for a tutorial on DBIx::Recordset.
This shows you how to load a text file (here wine data) into MySQL. See my Links page for the URL of the MySQL home page.
Note: This tutorial assumes you've run secure-MySQL.pl from tutorial # 23, or something similar, to create the username/password = wine/lover.
import-wine.pl:
- See import-books.pl below for the general idea
export-wine.pl:
- See export-books.pl below for the general idea
Other files:
wine-list.txt: The input data (which doubles as a backup file)
wine-lib.pl: The Perl model of the Wine database
winemaker-lib.pl: The Perl model of the Winemaker database
db-lib-non-cgi.pl: The non-cgi version of my generic Perl-DBI interface.
Source:
*
26-Aug-2000
12-Mar-2001: Updated in preparation for a tutorial on DBIx::Recordset.
This shows you how to load a text file (here book data) into MySQL. See my Links page for the URL of the MySQL home page.
Note: This tutorial assumes you've run secure-MySQL.pl from tutorial # 23, or something similar, to create the username/password = book/lover.
import-books.pl:
- Drop existing tables
- Create new tables for Publishers and Books
- Read a text file
- Create records in the Publishers database, if not already there
- Create a link from the Book record to the corresponding Publisher record
- Create records in the Books database
export-books.pl:
- Export all records from the 2 databases into an HTML table. See my Books page for the output
Other files:
book-list.txt: The input data (which doubles as a backup file)
book-lib.pl: The Perl model of the Books database
publisher-lib.pl: The Perl model of the Publisher database
db-lib-non-cgi.pl: The non-cgi version of my generic Perl-DBI interface.
Source:
*
26-Aug-2000
Operations:
- Changing the root password
- Deleting users with empty usernames (anonymous users)
- Deleting users with empty passwords
Source:
*
23-Jun-2000
These demos show you how to use XML::XPath to split an XML file into several components.
XML::XPath can read from a file handle, so the test data is actually in the scripts, after the __END__ token.
Source:
*
20-Jun-2000
This demo shows you how to use XML::XQL to split an XML file into several components.
A sample data file is provided inside the program.
You need to install the modules DateManip and XML::XQL before xml-Splitter.pl will run.
Source:
*
24-May-2000
well-formed.pl reads an XML file to see if it is Well Formed. If so, the input is echoed to an output file.
If the input file is not well formed, XML::DOM::Parser will print an error message, and stop.
If any element has attributes, there is an option which echos those attributes after the end tag, as an XML comment.
There is a second option in the program to change the output format.
Source:
*
17-May-2000
This shows you how to recursively process the Windows registry.
A good use for this is to upgrade from Outlook Express to Outlook, because, I believe, the latter can be controlled by Perl via Win32::OLE, whereas Outlook Express can't. What better reason could there possibly be for upgrading :-).
Source:
*
13-May-2000
doctype-2-xsl.pl reads an XML file and extracts the DOCTYPE part. Then it converts that DOCTYPE into an XSL file which is tailored to the original XML file.
V 1.2 now updates the XML file, to add a 1-line reference to the generated XSL file, rather than just printing out the reference.
There are tools which can read the XML file and use that XSL file reference to format the display of the XML file as HTML. Simple!
Note: This program is quite simple-minded: It only correctly handles XML files which have elements (start tags) 2 deep. But it's a start.
Source:
*
16-Apr-2000
This demo uses OLE to extract each paragraph of an MS Word 2000 document into a text string, which is then printed. Two different methods are used to extract the paragraphs.
Source:
*
16-Apr-2000
This demo uses OLE to extract all text in an MS Word 2000 document, and save it in a text file.
Source:
*
20-Feb-2000
This program is the CGI equivalent of sql7-Demo-2.pl. See below for details.
sql7-Demo-3.pl was tested under Apache for Windows + mod_perl + Perl. For URIs to Apache, see:
Warning: Expect a few errors in your web server log when displaying certain system tables and views. They expect other parameters which are not supplied by this simple-minded program.
Requires:
Source:
*
20-Feb-2000
Use DBIx::MSSQLReporter to probe the structure of MS's SQL Server and Data Engine database servers.
This program assumes you're using one of these database servers: MS SQL Server or MS Data Engine.
This demo uses the table myTable created with sql7-Demo-1.pl. See tutorial # 12.
Requires:
ActiveState ppm file:
Source:
*
16-Feb-2000
MSDE is MS's free, cut-down version of SQL Server 7. It is shipped with some MS products.
The following text is copied verbatim from MS's SQL Server 7 Books Online. Since stumbling across it I have searched again many times, but, surprise, surprise, this material does not appear in the index, nor in the list of searchable words. If you can tell me how to find it once more, I will be extremely grateful.
Begin quotation.
Installing MSDE from Office 2000
Although MSDE is not part of Microsoft Office 2000 or Microsoft Access 2000 stand-alone setup, you can install MSDE from the Office 2000 CD-ROM by running Setupsql.exe, located in the \Sql\x86\Setup folder. The Office 2000 version of MSDE also contains additional Help files that are located in the \Windows\Help folder, the SQL Server Enterprise Manager Help (entmgr.chm), and the Replication Wizard Help (replwiz.chm), which you can use with the SQL Server database utilities available from the Access Tools menu.
Additional Resources
The MSDE General FAQ (http://msdn.microsoft.com/vstudio/msde/genfaq.asp) will give you an overview of MSDE technology and the benefits to Visual Studio developers.
The MSDE Technical FAQ (http://msdn.microsoft.com/vstudio/msde/techfaq.asp) provides detailed technical information on installing, developing, and deploying applications with MSDE for Visual Studio 6.0. You'll also find information on creating MSDE databases and tables, and connecting to MSDE databases.
Service Pack 1 for Microsoft SQL Server 7.0 and MSDE 1.0 (http://msdn.microsoft.com/vstudio/sp/sql7/default.asp) includes several fixes along with support for Windows NT 4.0, Terminal Server Edition (recommended for all installations).
Code Sample: Connecting to an MSDE database (http://msdn.microsoft.com/vstudio/msde/condwnld.asp). A Visual Basic 6.0 example application containing sample code that demonstrates how to connect and execute statements against an MSDE database.
End quotation.
Installing MSDE adds a Data Source Name (DSN): LocalServer.
AFAIK you don't need to edit this DSN in order to use MSDE, nor to use my demo programs sql7-Demo-[123].pl.
Also, MSDE, as installed, has several users. One is 'guest', with no password, so that's what my latest demo programs use. This means you don't have to use your Windows logon name, nor do you need to create a new NT user, just to use MSDE.
MSDE's list of users is in the table 'sysusers', which you can dump in text with sql7-Demo-2.pl, and in HTML with sql7-Demo-3.pl.
Warning: Remember to disable your virus checker before installing MSDE. I've see McAfee rendered unusable because it was left running.
*
20-Feb-2000
Specifically, demonstrate dropping a table, creating it, populating it, and retrieving the data.
The table is not deleted, so that you can use Enterprise Manager or Query Analyzer to examine the definition and contents of the table
Thanks to Robert Dorfman for the basic code.
Note: The table myTable created by sql7-Demo-1.pl is required by sql7-Demo-2.pl.
Source:
*
24-Nov-99
o It demonstrates:
- Using ImageMagick's convert to add a comment to a file.
This comment is not written onto the image, it is stored inside
the file, and can be extracted separately from the image.
Comments can be displayed with 'identify -verbose ...'
or via Perl::Magick. See demo1.pl.
- Using ImageMagick's identify to report details of images.
- Using Perl::Magick's Get('comment') to report the images' comment data.
Source:
*
1-Nov-99
This demonstrates how 2 Perl CGI scripts can communicate with each other, by using their URIs and by using cookies.
Read the extensive - if not voluminous - documentation in web1.pl to get started.
Source:
*
Note: In Word 2000, this demo produces lots of warning messages.
Source:
*
Note: In Word 2000, this demo produces lots of warning messages.
Source:
*
Note: In Word 2000, this demo produces lots of warning messages.
Source:
*
The point of this tutorial is to transfer data from Excel cells into Perl variables.
Source:
*
Source:
*
Specifically, we calculate the MD5 digest of the contents of all files in a directory and its subdirectories. The result is written to a file called MD5.txt, in each sub-directory.
Now, the next time the program is run, it re-calculates the hashes and compares them with the values read from MD5.txt. If there any changes, then at least 1 file has been added, edited or deleted.
The program's exit code is 0 if there are no changes, and 1 if there are.
The fact that there are changes could, for example, trigger a back-up.
Source:
*
*
Mail-Sender-Demo.pl uses Mail::Sender. It has been tested under Unix and WinNT and Win95. The tests used V 0.6.7 of Mail::Sender.
Mail-Sendmail-Demo.pl uses Mail::Sendmail. It has been tested under Unix and WinNT and Win95. The tests used V 0.77 of Mail::Sendmail.
Mail-Sendmail-Attachment-Demo.pl uses Mail::Sendmail. It has been tested under Unix and WinNT and Win95. The tests used V 0.77 of Mail::Sendmail.
Big hint: Attach files in the current directory. Files in other directories will work, but names like C:\Temp\x.txt will be listed as CTempx.txt. C:/Temp/x.txt will be treated in the same way.
Mail-MAPI-Demo.pl uses Win32::OLE and MAPI. It has been tested under WinNT. It doesn't work under Win95, for some reason.
Credit for this program belongs to Hernan Sanchez, who posted the code to the perl-win32-users mailing list.
Under Windows, the above 4 programs use win32-Mail-Lib.pl to determine the names of the SMTP server and of the sender.
Obviously, under Unix you must use other methods to determine these.
win32-Mail-Test.pl simply tests win32-Mail-Lib.pl.
Source:
*
15-Oct-2000
init-module.pl generates a new Perl module called Abc::Xyz using the Perl tool h2xs, and then patches both the source of the module and the file Makefile.PL. It then installs the new module ready for use.
test-module.pl 'uses' the new module, as you would with any other module, to show it was properly installed.
*
All Programs of mine are 'OSI Certified Open Source Software';
        you can redistribute them and/or modify them under the terms of
        The Artistic License, a copy of which is available at:
        http://www.opensource.org/licenses/index.html
*
 
Privacy Policy
Copyright: © 1998 to 2006 Ron Savage
Last updated: Wed, 7-Jun-2006
Top