<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Nano&#039;s Blog</title>
	<atom:link href="http://www.nanohe.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nanohe.net/blog</link>
	<description>Hello World!</description>
	<lastBuildDate>Mon, 08 Mar 2010 02:10:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Typeof() and GetType() in C#</title>
		<link>http://www.nanohe.net/blog/2010/03/typeof-and-gettype-in-c/</link>
		<comments>http://www.nanohe.net/blog/2010/03/typeof-and-gettype-in-c/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 02:05:14 +0000</pubDate>
		<dc:creator>nano</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[cs]]></category>

		<guid isPermaLink="false">http://www.nanohe.net/blog/?p=310</guid>
		<description><![CDATA[
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace testNameSpace
{

    class testClass
    {
        public static void Main()
        {
            System.Type type0 = typeof(int);
       [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: csharp;">
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace testNameSpace
{

    class testClass
    {
        public static void Main()
        {
            System.Type type0 = typeof(int);
            Console.WriteLine(&quot;{0}&quot;, type0);

            int i = 0;
            System.Type type1 = i.GetType();
            Console.WriteLine(&quot;{0}&quot;, type1);

        }
    }
}
</pre>
<p><strong>output</strong></p>
<blockquote><p>System.Int32<br />
System.Int32</p></blockquote>
<p><strong>More:</strong><br />
MSDN : http://msdn.microsoft.com/en-us/library/58918ffs(VS.80).aspx</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanohe.net/blog/2010/03/typeof-and-gettype-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pear install HTML_QuickForm</title>
		<link>http://www.nanohe.net/blog/2010/01/pear-install-html_quickform/</link>
		<comments>http://www.nanohe.net/blog/2010/01/pear-install-html_quickform/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 15:04:19 +0000</pubDate>
		<dc:creator>nano</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[php pear]]></category>

		<guid isPermaLink="false">http://www.nanohe.net/blog/?p=303</guid>
		<description><![CDATA[pear.php.net
root@mysite:~# pear install &#8211;onlyreqdeps HTML_QuickForm
PHP Warning:  Module &#8216;imap&#8217; already loaded in Unknown on line 0
PHP Warning:  Module &#8216;mcrypt&#8217; already loaded in Unknown on line 0
WARNING: &#8220;pear/HTML_QuickForm&#8221; is deprecated in favor of &#8220;pear/HTML_QuickForm2&#8243;
WARNING: &#8220;pear/HTML_Common&#8221; is deprecated in favor of &#8220;pear/HTML_Common2&#8243;
downloading HTML_QuickForm-3.2.11.tgz &#8230;
Starting to download HTML_QuickForm-3.2.11.tgz (102,201 bytes)
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..done: 102,201 bytes
downloading HTML_Common-1.2.5.tgz &#8230;
Starting to download HTML_Common-1.2.5.tgz [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://pear.php.net/">pear.php.net</a></p>
<p>root@mysite:~# pear install &#8211;onlyreqdeps HTML_QuickForm<br />
PHP Warning:  Module &#8216;imap&#8217; already loaded in Unknown on line 0<br />
PHP Warning:  Module &#8216;mcrypt&#8217; already loaded in Unknown on line 0<br />
WARNING: &#8220;pear/HTML_QuickForm&#8221; is deprecated in favor of &#8220;pear/HTML_QuickForm2&#8243;<br />
WARNING: &#8220;pear/HTML_Common&#8221; is deprecated in favor of &#8220;pear/HTML_Common2&#8243;<br />
downloading HTML_QuickForm-3.2.11.tgz &#8230;<br />
Starting to download HTML_QuickForm-3.2.11.tgz (102,201 bytes)<br />
&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..done: 102,201 bytes<br />
downloading HTML_Common-1.2.5.tgz &#8230;<br />
Starting to download HTML_Common-1.2.5.tgz (4,585 bytes)<br />
&#8230;done: 4,585 bytes<br />
install ok: channel://pear.php.net/HTML_Common-1.2.5<br />
install ok: channel://pear.php.net/HTML_QuickForm-3.2.11<br />
root@mysite:~#</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanohe.net/blog/2010/01/pear-install-html_quickform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kohana Installation Tutorial</title>
		<link>http://www.nanohe.net/blog/2010/01/kohana-installation-tutorial/</link>
		<comments>http://www.nanohe.net/blog/2010/01/kohana-installation-tutorial/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 15:11:13 +0000</pubDate>
		<dc:creator>nano</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[kohana]]></category>
		<category><![CDATA[localhost]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.nanohe.net/blog/?p=297</guid>
		<description><![CDATA[Step1.
Download kohana from : http://v3.kohanaphp.com (Version:3.0.3.zip);
Step2.
Uncompress kohana_3.0.3  and copy kohana folder to C:\xampp\htdocs and rename kohana to &#8216;home&#8217;
Step3.
start XAMPP apache service from XAMPP control panel
Step4.
Input: http://localhost/home/index.php
Show error below
cURL Enabled       Kohana requires cURL for the Remote class. 
Step5.
Open C:\xampp\php\php.ini file and remove &#8216;;&#8217; from 
extension=php_curl.dll in php.ini
Step6.
Restart Apache service.
Step7.
Input: [...]]]></description>
			<content:encoded><![CDATA[<p>Step1.<br />
Download kohana from : http://v3.kohanaphp.com (Version:3.0.3.zip);<br />
Step2.<br />
Uncompress kohana_3.0.3  and copy kohana folder to C:\xampp\htdocs and rename kohana to &#8216;home&#8217;<br />
Step3.<br />
start XAMPP apache service from XAMPP control panel<br />
Step4.<br />
Input: http://localhost/home/index.php<br />
Show error below<br />
<strong>cURL Enabled       Kohana requires cURL for the Remote class. </strong><br />
Step5.<br />
Open C:\xampp\php\php.ini file and remove &#8216;;&#8217; from </p>
<pre class="brush: php;">extension=php_curl.dll in php.ini</pre>
<p>Step6.<br />
Restart Apache service.<br />
Step7.<br />
Input: http://localhost/home/index.php again.<br />
Show <strong>Your environment passed all requirements.<br />
Remove or rename the install.php file now.</strong><br />
Step8. Rename install.php to other_Name.php<br />
input: http://localhost/home/index.php again.<br />
Show <strong>Kohana_Request_Exception [ 0 ]: Unable to find a route to match the URI: home/index.php</strong><br />
Step9.<br />
Open C:\xampp\htdocs\home\application\bootstrap.php<br />
find </p>
<pre class="brush: php;">Kohana::init(array('base_url' =&gt; '/kohana/'));</pre>
<p>Modify the <strong>/kohana/</strong> to <strong>/home/</strong><br />
Step10.<br />
input: http://localhost/home/index.php again.<br />
Show <strong>hello, world!</strong><br />
congratulations!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanohe.net/blog/2010/01/kohana-installation-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to delete Offline Folder (.OST) file</title>
		<link>http://www.nanohe.net/blog/2010/01/how-to-delete-offline-folder-ost-file/</link>
		<comments>http://www.nanohe.net/blog/2010/01/how-to-delete-offline-folder-ost-file/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 11:48:24 +0000</pubDate>
		<dc:creator>nano</dc:creator>
				<category><![CDATA[collections]]></category>
		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://www.nanohe.net/blog/?p=295</guid>
		<description><![CDATA[The below procedure tested on winxp and outlook2003.
Sometimes an OST file becomes corrupted beyond repair or repair is not desirable. In this case, it can be deleted. After it had been deleted, you may need to recreate it as a new file as described above before Outlook will work properly.
•	Quit Outlook if it is running.
•	From [...]]]></description>
			<content:encoded><![CDATA[<p><em>The below procedure tested on winxp and outlook2003.</em></p>
<p>Sometimes an OST file becomes corrupted beyond repair or repair is not desirable. In this case, it can be deleted. After it had been deleted, you may need to recreate it as a new file as described above before Outlook will work properly.<br />
•	Quit Outlook if it is running.<br />
•	From the <strong>Start</strong> menu, go to <strong>Run</strong>.<br />
•	In the Run window, enter this command in the &#8220;Open:&#8221; field and click OK:<br />
o	<strong>&#8220;%USERPROFILE%\Local Settings\Application Data\Microsoft\Outlook\</strong>&#8221;<br />
To find the exact path, please follow the steps 1-4 for Outlook 2002/2003/2007 or steps 1-3 for Outlook 2000 outlined above to get to <strong>Offline Folder File Settings</strong>. You can find the .ost file location in the File box. You may want to cut-and-paste that information for accuracy and ease.<br />
•	In the Explorer window, locate the OST file to deleted. Select it and press delete on your keyboard or use the <strong>Delete</strong> icon on the toolbar</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanohe.net/blog/2010/01/how-to-delete-offline-folder-ost-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change the default startup directory for Command Prompt?</title>
		<link>http://www.nanohe.net/blog/2010/01/how-to-change-the-default-startup-directory-for-command-prompt/</link>
		<comments>http://www.nanohe.net/blog/2010/01/how-to-change-the-default-startup-directory-for-command-prompt/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 06:13:11 +0000</pubDate>
		<dc:creator>nano</dc:creator>
				<category><![CDATA[collections]]></category>
		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://www.nanohe.net/blog/?p=293</guid>
		<description><![CDATA[When you open a Command Prompt window (CMD.EXE), it defaults to your user profile home directory. If you wish to change the default startup directory for Command Prompt, use the steps listed in this article.
Set the default startup directory
Click Start, Run and type Regedit.exe
Navigate to the following branch: 
HKEY_CURRENT_USER \ Software \ Microsoft \ Command [...]]]></description>
			<content:encoded><![CDATA[<p>When you open a Command Prompt window (<strong>CMD.EXE</strong>), it defaults to your user profile home directory. If you wish to change the default startup directory for Command Prompt, use the steps listed in this article.</p>
<p><strong>Set the default startup directory</strong></p>
<p>Click Start, Run and type Regedit.exe<br />
Navigate to the following branch: </p>
<blockquote><p>HKEY_CURRENT_USER \ Software \ Microsoft \ Command Processor</p></blockquote>
<p>In the right-pane, double-click Autorun and set the startup folder path as its data, preceded by &#8220;CD /d &#8220;. If Autorun value is missing, you need to create one, of type <strong>REG_EXPAND_SZ</strong> or <strong>REG_SZ</strong> in the above location. </p>
<blockquote><p>
Example:  To set the startup directory to <strong>D:\learning\perl</strong>, set the Autorun value data to <strong>CD /d D:\learning\perl</strong></p>
<p>You may also use a batch file so that it executes the contents automatically upon launching the Command Prompt. To view the entire list of arguments supported by <strong>CMD.EXE</strong> and their description, type <strong>CMD /?</strong> at the Command Prompt.</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.nanohe.net/blog/2010/01/how-to-change-the-default-startup-directory-for-command-prompt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The shift and unshift Operators</title>
		<link>http://www.nanohe.net/blog/2010/01/the-shift-and-unshift-operators/</link>
		<comments>http://www.nanohe.net/blog/2010/01/the-shift-and-unshift-operators/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 02:39:26 +0000</pubDate>
		<dc:creator>nano</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.nanohe.net/blog/?p=287</guid>
		<description><![CDATA[The shift and unshift operators perform the corresponding actions on the &#8220;start&#8221; of the array (or the &#8220;left&#8221; side of an array, or the portion with the lowest subscripts).
push and pop operators do things to the &#8220;end&#8221; of an array(or the &#8220;right&#8221; sidce of an array).
The foreach control involved to the sample code below.

#!C:\Perl\bin\perl.exe
use strict;
use [...]]]></description>
			<content:encoded><![CDATA[<p>The shift and unshift operators perform the corresponding actions on the &#8220;start&#8221; of the array (or the &#8220;left&#8221; side of an array, or the portion with the lowest subscripts).<br />
push and pop operators do things to the &#8220;end&#8221; of an array(or the &#8220;right&#8221; sidce of an array).</p>
<p>The <strong>foreach</strong> control involved to the sample code below.</p>
<pre class="brush: perl;">
#!C:\Perl\bin\perl.exe
use strict;
use warnings;

my @array = qw# dino fred barney #;
# print @array;
foreach my $array (@array) {
$array = &quot;\t$array&quot;; # put a tab in front of each element of @rocks
$array.= &quot;\n&quot;; # put a newline on the end of each
print $array;
}

my $m = shift(@array); # $m gets &quot;dino&quot;, @array now has (&quot;fred&quot;, &quot;barney&quot;)
my $n = shift @array; # $n gets &quot;fred&quot;, @array now has (&quot;barney&quot;)
shift @array; # @array is now empty
# print a empty array
foreach my $array (@array) {
$array = &quot;\t$array&quot;; # put a tab in front of each element of @rocks
$array.= &quot;\n&quot;; # put a newline on the end of each
print $array; # nothing printed
}

my $o = shift @array; # $o gets undef, @array is still empty
unshift(@array, 5); # @array now has the one-element list (5)
unshift @array, 4; # @array now has (4, 5)
my @others = 1..3;
unshift @array, @others; # @array now has (1, 2, 3, 4, 5)
foreach my $array (@array) {
$array = &quot;\t$array&quot;; # put a tab in front of each element of @rocks
$array.= &quot;\n&quot;; # put a newline on the end of each
print $array;
}
</pre>
<p>Output:</p>
<pre class="brush: perl;">

D:\learning\perl&gt;hi.pl
        dino
        fred
        barney
        1
        2
        3
        4
        5

D:\learning\perl&gt;
</pre>
<p><em>- from Learning Perl 5E</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanohe.net/blog/2010/01/the-shift-and-unshift-operators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XAMPP for windows</title>
		<link>http://www.nanohe.net/blog/2010/01/xampp-for-windows/</link>
		<comments>http://www.nanohe.net/blog/2010/01/xampp-for-windows/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 16:32:21 +0000</pubDate>
		<dc:creator>nano</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[cgi]]></category>
		<category><![CDATA[localhost]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.nanohe.net/blog/?p=285</guid>
		<description><![CDATA[new version of XAMPP 1.7.3, including:
Apache 2.2.14 (IPv6 enabled) + OpenSSL 0.9.8l
MySQL 5.1.41 + PBXT engine
PHP 5.3.1
phpMyAdmin 3.2.4
Perl 5.10.1
FileZilla FTP Server 0.9.33
Mercury Mail Transport System 4.72
Download and Install XAMPP 1.7.3
Destination folder: c:\
The perl cgi script could located in
C:\xampp\htdocs\hello.cgi (or hello.pl) recommend.
C:\xampp\cgi-bin\hello.cgi (or hello.pl)
Link: http://www.apachefriends.org/en/xampp-windows.html
]]></description>
			<content:encoded><![CDATA[<p>new version of <strong>XAMPP 1.7.3</strong>, including:<br />
Apache 2.2.14 (IPv6 enabled) + OpenSSL 0.9.8l<br />
MySQL 5.1.41 + PBXT engine<br />
PHP 5.3.1<br />
phpMyAdmin 3.2.4<br />
Perl 5.10.1<br />
FileZilla FTP Server 0.9.33<br />
Mercury Mail Transport System 4.72</p>
<p>Download and Install XAMPP 1.7.3<br />
Destination folder: <strong>c:\</strong></p>
<p>The perl cgi script could located in<br />
C:\xampp\htdocs\hello.cgi (or hello.pl) <em>recommend.</em><br />
C:\xampp\cgi-bin\hello.cgi (or hello.pl)</p>
<p>Link: http://www.apachefriends.org/en/xampp-windows.html</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanohe.net/blog/2010/01/xampp-for-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginning Perl and MySQL Tutorial</title>
		<link>http://www.nanohe.net/blog/2010/01/beginning-perl-and-mysql-tutorial/</link>
		<comments>http://www.nanohe.net/blog/2010/01/beginning-perl-and-mysql-tutorial/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 07:41:22 +0000</pubDate>
		<dc:creator>nano</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.nanohe.net/blog/?p=276</guid>
		<description><![CDATA[Step1.
Download &#038; install MySQL.
mysql-essential-5.1.36-win32.zip
Download Link: http://download.cnet.com
Step2.
Setting a root password for MySQL
1. Start your command line by going to the Start Menu > Run and typing cmd (or type command if you are using an older version of windows)
2. Change directory to where you installed mysql to:
C:\> cd C:\mysql\bin 
3. Switch to mysql command line:
C:\mysql\bin> mysql [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Step1.</strong><br />
<strong>Download &#038; install MySQL.</strong><br />
mysql-essential-5.1.36-win32.zip<br />
Download Link: http://download.cnet.com</p>
<p><strong>Step2.</strong><br />
<strong>Setting a root password for MySQL</strong><br />
1. Start your command line by going to the Start Menu > Run and typing cmd (or type command if you are using an older version of windows)<br />
2. Change directory to where you installed mysql to:</p>
<blockquote><p>C:\> cd C:\mysql\bin </p></blockquote>
<p>3. Switch to mysql command line:</p>
<blockquote><p>C:\mysql\bin> mysql -u root mysql</p></blockquote>
<p>4. Then set a default password:</p>
<blockquote><p>mysql> SET PASSWORD FOR root@localhost=PASSWORD(&#8216;newpass&#8217;);</p></blockquote>
<p>where &#8220;<strong>newpass</strong>&#8221; is the password you want to use </p>
<p><strong>Adding more users</strong><br />
Start your command line by going to the Start Menu > Run and typing cmd (or type command if you are using an older version of windows)<br />
Change directory to where you installed mysql to:</p>
<blockquote><p>C:\> cd C:\mysql\bin </p></blockquote>
<p>Switch to mysql command line (if you have not set a root password remove the -p switch when you type it in):</p>
<blockquote><p>C:\mysql\bin> mysql -u root -p mysql </p></blockquote>
<p>Then then add your new user:</p>
<blockquote><p>mysql> GRANT ALL PRIVILEGES ON *.* TO rachel@localhost IDENTIFIED BY &#8217;summer&#8217;;</p></blockquote>
<p>where &#8220;<strong>rachel</strong>&#8221; is the username and &#8220;<strong>summer</strong>&#8221; is the password you want to use. You can also limit users to specific database, allow only certain remote hosts to connect all using the GRANT statement. However, that is outside the scope of this tutorial so search for more info on using GRANT if you are interested in those features. </p>
<p><em>- from www.ricocheting.com</em></p>
<p><strong>Step3.</strong><br />
let&#8217;s create a database called perltest and in that database, we will create a simple table called samples and populate it with some data. Here is the SQL you&#8217;ll need to create the table and fill in a few records, just connect to your MySQL database and run them. </p>
<pre class="brush: perl;">
CREATE DATABASE perltest;
USE perltest;
CREATE TABLE samples (
id int(10) unsigned NOT NULL auto_increment,
name varchar(128) NOT NULL default '',
phone varchar(128) NOT NULL default '',
PRIMARY KEY (id)
);
INSERT INTO samples VALUES (1, 'Some Person', '555-5555');
INSERT INTO samples VALUES (2, 'Another Person', '222-2222');
</pre>
<p><strong>Step4. </strong><br />
Sample Script</p>
<pre class="brush: perl;">
#!/usr/bin/perl -w

use strict;
use warnings;
use DBI;

my $dbh = DBI-&gt;connect('dbi:mysql:perltest','root','myroot')
or die &quot;Connection Error: $DBI::errstr\n&quot;;
my $sql = &quot;select * from samples&quot;;
my $sth = $dbh-&gt;prepare($sql);
$sth-&gt;execute
or die &quot;SQL Error: $DBI::errstr\n&quot;;
while (my @row = $sth-&gt;fetchrow_array) {
print &quot;@row\n&quot;;
}
</pre>
<p><strong>Dissection.</strong></p>
<pre class="brush: perl;">
$dbh = DBI-&gt;connect('dbi:mysql:DATABASE_NAME', USERNAME, PASSWORD)&lt;/blockquote&gt;
</pre>
<p>The <strong>die</strong> option provides an alternative to the program simply not working if a connection is not established. Basically, the connect it tried, and if it fails, your script will die and display an error message that should help you debug. Once we&#8217;ve established a connection to the MySQL database, we will need to create a string of SQL and then prepare it to query the database.</p>
<pre class="brush: perl;">
$sql = &quot;select * from samples&quot;;
$sth = $dbh-&gt;prepare($sql);
</pre>
<p>Next we query the database with our prepared SQL query, or exit the program and display some debugging information if the MySQL query fails to execute. </p>
<pre class="brush: perl;">
$sth-&gt;execute
or die &quot;SQL Error: $DBI::errstr\n&quot;;
</pre>
<p>Finally we use the fetchrow_array function to fetch each row of the results from the MySQL database and print them one to a line. </p>
<pre class="brush: perl;">
while (@row = $sth-&gt;fetchrow_array) {
print &quot;@row\n&quot;;
}
</pre>
<p>If the program is successful, you should see the following output:</p>
<pre class="brush: perl;">
1 Some Person 555-5555
2 Another Person 222-2222
</pre>
<p><em>- from perl.about.com</em></p>
<p><strong>[Tips]</strong><br />
DBD-mysql<br />
I run the script using ActivePerl 5.10.1 on Winxp.<br />
The <strong>DBD-mysql </strong> package didn&#8217;t installed by default. You need install it via Perl Package Manager.<br />
More about DBD-mysql<br />
A MySQL driver for the Perl5 Database Interface (DBI)<br />
	Version:	4.011<br />
	Released:	2009-04-14<br />
	Author:	Patrick Galbraith
<patg@patg.net>
	CPAN:	http://search.cpan.org/dist/DBD-mysql-4.011/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanohe.net/blog/2010/01/beginning-perl-and-mysql-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The each Function</title>
		<link>http://www.nanohe.net/blog/2010/01/the-each-function/</link>
		<comments>http://www.nanohe.net/blog/2010/01/the-each-function/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 09:09:01 +0000</pubDate>
		<dc:creator>nano</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.nanohe.net/blog/?p=265</guid>
		<description><![CDATA[If you wish to iterate over (that is, examine every element of) an entire hash, one of the usual ways is to use the each function, which returns a key-value pair as two-element list.

#!C:\Perl\bin\perl.exe
use strict;
use warnings;

# declare a new hash
my %some_hash;

%some_hash = (&#34;foo&#34;, 35, &#34;bar&#34;, 12.4, 2.5, &#34;hello&#34;,
      &#34;wilma&#34;, 1.72e30, [...]]]></description>
			<content:encoded><![CDATA[<p>If you wish to iterate over (that is, examine every element of) an entire hash, one of the usual ways is to use the each function, which returns a key-value pair as two-element list.</p>
<pre class="brush: perl;">
#!C:\Perl\bin\perl.exe
use strict;
use warnings;

# declare a new hash
my %some_hash;

%some_hash = (&quot;foo&quot;, 35, &quot;bar&quot;, 12.4, 2.5, &quot;hello&quot;,
      &quot;wilma&quot;, 1.72e30, &quot;betty&quot;, &quot;bye&quot;);

my $key;
my $value;

while ( ($key, $value) = each %some_hash)
{
  print &quot;$key =&gt; $value\n&quot;;
}

print &quot;\n&quot;;
foreach $key (sort keys %some_hash) {
  $value = $some_hash{$key};
  print &quot;$key =&gt; $value\n&quot;;
  # Or, we could have avoided the extra $value variable:
  #  print &quot;$key =&gt; $hash{$key}\n&quot;;
}
</pre>
<p>Output</p>
<pre class="brush: perl;">
betty =&gt; bye
bar =&gt; 12.4
wilma =&gt; 1.72e+030
foo =&gt; 35
2.5 =&gt; hello

2.5 =&gt; hello
bar =&gt; 12.4
betty =&gt; bye
foo =&gt; 35
wilma =&gt; 1.72e+030
</pre>
<p><em>-from Learning Perl 5E</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanohe.net/blog/2010/01/the-each-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Hash As a Whole</title>
		<link>http://www.nanohe.net/blog/2010/01/the-hash-as-a-whole/</link>
		<comments>http://www.nanohe.net/blog/2010/01/the-hash-as-a-whole/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 09:01:05 +0000</pubDate>
		<dc:creator>nano</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.nanohe.net/blog/?p=262</guid>
		<description><![CDATA[The order is jumbled because Perl keeps the key-value pairs in an order that’s conven-
ient for Perl so that it can look up any item quickly. 
Elements of a hash are printed out in their internal order, which can not be relied upon and will change as elements are added and removed. If you need [...]]]></description>
			<content:encoded><![CDATA[<p>The order is jumbled because Perl keeps the key-value pairs in an order that’s conven-<br />
ient for Perl so that it can look up any item quickly. </p>
<p>Elements of a hash are printed out in their internal order, which can not be relied upon and will change as elements are added and removed. If you need all of the elements of a hash in some sort of order, sort the keys, and use that list to index the hash. </p>
<p>If you are looking for a structure that holds its elements in order, either use an array, or use one of the ordered hash&#8217;s on CPAN.</p>
<p>the only ordering you can rely upon from a list context hash expansion is that key => value pairs will be together.</p>
<p>use the keys function to get a list of the keys. They will most likely be in the same order as they&#8217;re stored in the hash itself, although there&#8217;s no guarantee. If the order matters, then you either shouldn&#8217;t be using a hash in the first place, or you should use the keys function to get a list, put the items in the desired order, and then loop through that list, accessing each corresponding hash item.</p>
<pre class="brush: perl;">
#!C:\Perl\bin\perl.exe
use strict;
use warnings;

# declare a new hash
my %some_hash;

%some_hash = (&quot;foo&quot;, 35, &quot;bar&quot;, 12.4, 2.5, &quot;hello&quot;,
      &quot;wilma&quot;, 1.72e30, &quot;betty&quot;, &quot;bye&quot;);

my @any_array;
@any_array = %some_hash;

print %some_hash;
print &quot;\n&quot;;
print &quot;\n&quot;;
print @any_array;
print &quot;\n&quot;;
print &quot;\n&quot;;

my @keys;
@keys = keys %some_hash;
for my $k (sort @keys)
{
    print $k, $some_hash{$k};
}
print &quot;\n&quot;;
print &quot;\n&quot;;
print map {$_, $some_hash{$_}} sort keys %some_hash;
</pre>
<p>Output</p>
<pre class="brush: perl;">

D:\learning\perl&gt;test.pl
bettybyebar12.4wilma1.72e+030foo352.5hello

bettybyebar12.4wilma1.72e+030foo352.5hello

2.5hellobar12.4bettybyefoo35wilma1.72e+030

2.5hellobar12.4bettybyefoo35wilma1.72e+030
D:\learning\perl&gt;
</pre>
<p><em>-from StackOverflow.com</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nanohe.net/blog/2010/01/the-hash-as-a-whole/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
