📄 appb_07.htm
字号:
<html><head><title>Databases (Learning Perl, 3rd Edition)</title><link rel="stylesheet" type="text/css" href="../style/style1.css" /><meta name="DC.Creator" content="Randal L. Schwartz and Tom Phoenix" /><meta name="DC.Format" content="text/xml" scheme="MIME" /><meta name="DC.Language" content="en-US" /><meta name="DC.Publisher" content="O'Reilly & Associates, Inc." /><meta name="DC.Source" scheme="ISBN" content="0596001320L" /><meta name="DC.Subject.Keyword" content="stuff" /><meta name="DC.Title" content="Learning Perl, 3rd Edition" /><meta name="DC.Type" content="Text.Monograph" /></head><body bgcolor="#ffffff"><img alt="Book Home" border="0" src="gifs/smbanner.gif" usemap="#banner-map" /><map name="banner-map"><area shape="rect" coords="1,-2,616,66" href="index.htm" alt="Learning Perl, 3rd Edition" /><area shape="rect" coords="629,-11,726,25" href="jobjects/fsearch.htm" alt="Search this book" /></map><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="appb_06.htm"><img alt="Previous" border="0" src="../gifs/txtpreva.gif" /></a></td><td align="center" valign="top" width="228"><a href="index.htm"></a></td><td align="right" valign="top" width="228"><a href="appb_08.htm"><img alt="Next" border="0" src="../gifs/txtnexta.gif" /></a></td></tr></table></div><h2 class="sect1">B.7. Databases</h2><p>If you've got a<a name="INDEX-1202" />database, Perl canwork with it. This section describes some of the common types ofdatabases.</p><a name="lperl3-APP-B-SECT-7.1" /><div class="sect2"><h3 class="sect2">B.7.1. Direct System Database Access</h3><p>Perl can directly access some <a name="INDEX-1203" />system databases, sometimes with thehelp of a module. These are databases like the<a name="INDEX-1204" /><a name="INDEX-1205" />WindowsRegistry (which holds machine-level settings), or the<a name="INDEX-1206" /><a name="INDEX-1207" />Unix password database (which lists whichusername corresponds to which number, and related information), aswell as the <a name="INDEX-1208" />domain-name database (which lets youtranslate an IP number into a machine name, and vice versa).</p></div><a name="lperl3-APP-B-SECT-7.2" /><div class="sect2"><h3 class="sect2">B.7.2. Flat-file Database Access</h3><p>If you'd like to access your own <a name="INDEX-1209" />flat-file databases from Perl, thereare modules to help you with doing that (seemingly a new one everymonth or two, so any list here would be out of date). You can even doquite a bit without a module, with what we give in <a href="ch16_01.htm">Chapter 16, "Simple Databases"</a>.</p></div><a name="lperl3-APP-B-SECT-7.3" /><div class="sect2"><h3 class="sect2">B.7.3. Relational Database Access</h3><p><a name="INDEX-1210" />Relational databases include Sybase,Oracle, Informix, mysql, and others. These are complex enough thatyou generally do need to know about modules to use them. But if youuse the <a name="INDEX-1211" /><a name="INDEX-1212" />DBI module, whose name stands for"database-independent," you can minimize your dependenceupon any one type of database -- then, if you have to move frommysql to Oracle, say, you might not even need to change anything atall in your program.</p></div><hr width="684" align="left" /><div class="navbar"><table width="684" border="0"><tr><td align="left" valign="top" width="228"><a href="appb_06.htm"><img alt="Previous" border="0" src="../gifs/txtpreva.gif" /></a></td><td align="center" valign="top" width="228"><a href="index.htm"><img alt="Home" border="0" src="../gifs/txthome.gif" /></a></td><td align="right" valign="top" width="228"><a href="appb_08.htm"><img alt="Next" border="0" src="../gifs/txtnexta.gif" /></a></td></tr><tr><td align="left" valign="top" width="228">B.6. Pragmas</td><td align="center" valign="top" width="228"><a href="index/index.htm"><img alt="Book Index" border="0" src="../gifs/index.gif" /></a></td><td align="right" valign="top" width="228">B.8. Other Operators and Functions</td></tr></table></div><hr width="684" align="left" /><img alt="Library Navigation Links" border="0" src="../gifs/navbar.gif" usemap="#library-map" /><p><p><font size="-1"><a href="copyrght.htm">Copyright © 2002</a> O'Reilly & Associates. All rights reserved.</font></p><map name="library-map"><area shape="rect" coords="1,0,85,94" href="../index.htm"><area shape="rect" coords="86,1,178,103" href="../lwp/index.htm"><area shape="rect" coords="180,0,265,103" href="../lperl/index.htm"><area shape="rect" coords="267,0,353,105" href="../perlnut/index.htm"><area shape="rect" coords="354,1,446,115" href="../prog/index.htm"><area shape="rect" coords="448,0,526,132" href="../tk/index.htm"><area shape="rect" coords="528,1,615,119" href="../cookbook/index.htm"><area shape="rect" coords="617,0,690,135" href="../pxml/index.htm"></map></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -