<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>Perl Forum RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest threads from the 'Perl' forum at Programmer's Heaven, excluding replies.</description>
    <language>en</language>
    <copyright>Copyright 2008 Programmers Heaven</copyright>
    <pubDate>Mon, 01 Dec 2008 20:15:15 -0700</pubDate>
    <lastBuildDate>Mon, 01 Dec 2008 20:15:15 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>Perl Noob Help</title>
      <link>http://www.programmersheaven.com/mb/perl/382383/382383/perl-noob-help/</link>
      <description>I no very little about programming. I want to learn but I have no teachers and idea where is Ideal to start.  I started reading a couple of book on Perl but am uncertain if this is the right direction to take.  What is the most applicable language to general programing? Should I stick with Perl? Is there a cover all language?  Which language would be best for making applications?     &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I imagine these questions must sound annoying but any answers would help.&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Sun, 30 Nov 2008 16:00:12 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>Checking and Downloading mail messages</title>
      <link>http://www.programmersheaven.com/mb/perl/381215/381215/checking-and-downloading-mail-messages/</link>
      <description>Good day,&lt;br /&gt;
&lt;br /&gt;
I'm looking at writing a script that checks my gmail account for messages with a certain subject and then parsing it. &lt;br /&gt;
&lt;br /&gt;
Where I'm having problems is I can't seem to get either GMail::IMAPD&lt;br /&gt;
or Mail::Webmail::Gmail to connect and check the message list.&lt;br /&gt;
&lt;br /&gt;
Has anyone had success with either of these modules?&lt;br /&gt;
&lt;br /&gt;
Is there a better one oput there?&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
Sean&lt;br /&gt;</description>
      <pubDate>Wed, 15 Oct 2008 21:04:24 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>Help Needed - Perl Programming</title>
      <link>http://www.programmersheaven.com/mb/perl/376813/376813/help-needed---perl-programming/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
Can you help me in perl program.&lt;br /&gt;
&lt;br /&gt;
I need to convert Latex file(.tx3) to XML. and also To Check any file(*.*) contains ASCII Characters and Junk Characters. I need source code in perl to convert this. &lt;br /&gt;
&lt;br /&gt;
Reply me at bes_saran@yahoo.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Thanks &amp;amp; Regards,&lt;br /&gt;
&lt;br /&gt;
Saravanan&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Thu, 02 Oct 2008 20:32:23 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>PERL CODER NEEDED - SMALL JOB</title>
      <link>http://www.programmersheaven.com/mb/perl/376803/376803/perl-coder-needed---small-job/</link>
      <description>Hello to this Community from Germany.&lt;br /&gt;
&lt;br /&gt;
First time i will say hello to this Community. &lt;br /&gt;
&lt;br /&gt;
I would have there a small JOB to assigning. &lt;br /&gt;
I look for a Freelancer/Perlcoder that me a license inquiry for a Perl software far away, for which I already a valid lifelong license.&lt;br /&gt;
&lt;br /&gt;
The problem is, that the license data over a control server runs and this unfortunately ever more frequently times again down is. &lt;br /&gt;
Thus I do not come any longer into the Adminpanel and the software functions also not more, there functionality Domain &amp;amp; Inquiry is bound, which considerable.&lt;br /&gt;
&lt;br /&gt;
Finally I paid for the software. And that not too few. &lt;br /&gt;
Here it would be beautiful, if an experienced Coder these inquiries (Domainrestriction/license) permanently on on/1 to place could, &lt;br /&gt;
so that also finally times a Backup of this Scripts on external servers can be provided, &lt;br /&gt;
which is not possible unfortunately due to the Domainrestriction. &lt;br /&gt;
&lt;br /&gt;
Alone downloading each Backups (local) at present 3-4 hours cost me, due to the extensive Databases. (Flatfiles) &lt;br /&gt;
&lt;br /&gt;
For this I look for thus experienced Perl a programmer, who is finally helpful to me in this problem. &lt;br /&gt;
As said I already possess a valid lifelong license. &lt;br /&gt;
About the price one can converse with me gladly. Pay with Paypal. &lt;br /&gt;
&lt;br /&gt;
Inquiries ask by ICQ under number: &lt;strong&gt;363091889&lt;/strong&gt; or on &lt;strong&gt;nds-blog@e-mail.tl&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
Thank you and best greetings to the Community&lt;br /&gt;</description>
      <pubDate>Thu, 02 Oct 2008 10:25:47 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>pulling specific values from hash</title>
      <link>http://www.programmersheaven.com/mb/perl/375981/375981/pulling-specific-values-from-hash/</link>
      <description>Howdy I'm a beginner so my question is probably dumb but I appreciate any help thanks.&lt;br /&gt;
The problem I have here is that i need to grab a specific value of the &lt;span style="color: Grey;"&gt;%locs&lt;/span&gt; hash based on what &lt;span style="color: Blue;"&gt;my&lt;/span&gt; &lt;span style="color: Orange;"&gt;$loc&lt;/span&gt; = &lt;br /&gt;
As you can see &lt;span style="color: Blue;"&gt;my&lt;/span&gt; &lt;span style="color: Orange;"&gt;$loc&lt;/span&gt; = &amp;lt;STDIN&amp;gt; so if the input is: "one" at the second prompt then i need the '\c$\files' value&lt;br /&gt;
&lt;br /&gt;
 &lt;span style="color: Blue;"&gt;my&lt;/span&gt; &lt;span style="color: Grey;"&gt;%locs&lt;/span&gt; = (one =&amp;gt; '\c$\files', two =&amp;gt; '\d$\stuff', three=&amp;gt; '\d$\things');	&lt;br /&gt;
 &lt;span style="color: Blue;"&gt;my&lt;/span&gt; &lt;span style="color: Grey;"&gt;%servers&lt;/span&gt; = (ksl =&amp;gt; '\\server1', krf =&amp;gt; '\\server2');&lt;br /&gt;
 &lt;br /&gt;
	&lt;span style="color: Blue;"&gt;my&lt;/span&gt; &lt;span style="color: Orange;"&gt;$server&lt;/span&gt; = &amp;lt;STDIN&amp;gt;;&lt;br /&gt;
	&lt;span style="color: Blue;"&gt;chomp&lt;/span&gt; &lt;span style="color: Orange;"&gt;$server&lt;/span&gt;;&lt;br /&gt;
	&lt;span style="color: Blue;"&gt;my&lt;/span&gt; &lt;span style="color: Orange;"&gt;$loc&lt;/span&gt; = &amp;lt;STDIN&amp;gt;;&lt;br /&gt;
	&lt;span style="color: Blue;"&gt;chomp&lt;/span&gt; &lt;span style="color: Orange;"&gt;$loc&lt;/span&gt;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Wed, 24 Sep 2008 23:55:51 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>Open Source Perl editor</title>
      <link>http://www.programmersheaven.com/mb/perl/374330/374330/open-source-perl-editor/</link>
      <description>Also, does anyone know a good site to download a Perl editor, like KATE which is actually my fav, for free??  Unfortunately I'm running windows right now, coding in editpad using the Perl interpreter through command prompt, because I am still working on Linux(suse) for this comp, so I don't know if I could run KATE or not, but I do know I need a good coding editor, preferably from opensource for little or no cost. Any ideas? &lt;br /&gt;</description>
      <pubDate>Wed, 20 Aug 2008 18:50:01 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>How can I append an existing @ element?</title>
      <link>http://www.programmersheaven.com/mb/perl/374325/374325/how-can-i-append-an-existing--element/</link>
      <description>Hey ya'll, new to perl and programming, so please grant me extreme mercy concerning some of the ridiculous questions I may ask in the process of mastering this language :)&lt;br /&gt;
&lt;br /&gt;
I am trying to append existing array elements with new data extracted from strings via regx. i.e. elements[0-3] of @array are labels name, phone, city, zipcode. The data being matched are, of course, these specific items sue,555 555 7687, atlanta, 55555; I was able to achieve the output I wanted by adding the new data as four new elements, but what I aim to do is to append the existing 4 elements with the new data. Any suggestions? Every time I try, I over write the existing "label" in the element, even though when assigning the new data, I assign the element back to itself such as $records[0] = ($records[0], $data) however using this technique I lose $records[0], the first part, and end up only with $data.&lt;br /&gt;</description>
      <pubDate>Wed, 20 Aug 2008 15:09:31 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>HELP:  It won't even start</title>
      <link>http://www.programmersheaven.com/mb/perl/374246/374246/help--it-wont-even-start/</link>
      <description>Hi, I am new here. I recently downloaded ActivePerl from www.activestate.com.  When I run the OLE browser, I receive the following message:&lt;br /&gt;
&lt;br /&gt;
***&lt;br /&gt;
Internet Explorer could not load the PerlScript engine. This is most likely due to the value of the "Initialize and script ActiveX controls not marked as safe" security setting of the "Local intranet" zone. PerlScript inside IE will only run on Windows XP SP2 and later if this setting is set to Enable. Setting it to Prompt doesn't seem to work. &lt;br /&gt;
***&lt;br /&gt;
&lt;br /&gt;
I adjusted the ActiveX controls as per these instructions, but the message still remains and I am unable to code.  I am at a loss at what to do and email correspondece to Technical Support has been ignored. I have followed installation instructions carefully.&lt;br /&gt;
&lt;br /&gt;
Please help me fix this so I can begin coding immediately.  My Operating System is Windows XP and my web browser is Internet Explorer 7.&lt;br /&gt;</description>
      <pubDate>Mon, 18 Aug 2008 14:32:06 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>HELP:  It won't even start</title>
      <link>http://www.programmersheaven.com/mb/perl/374245/374245/help--it-wont-even-start/</link>
      <description>Hi, I am new here. I recently downloaded ActivePerl from www.activestate.com.  When I run the OLE browser, I receive the following message:&lt;br /&gt;
&lt;br /&gt;
***&lt;br /&gt;
Internet Explorer could not load the PerlScript engine. This is most likely due to the value of the "Initialize and script ActiveX controls not marked as safe" security setting of the "Local intranet" zone. PerlScript inside IE will only run on Windows XP SP2 and later if this setting is set to Enable. Setting it to Prompt doesn't seem to work. &lt;br /&gt;
***&lt;br /&gt;
&lt;br /&gt;
I adjusted the ActiveX controls as per these instructions, but the message still remains and I am unable to code.  I am at a loss at what to do and email correspondece to Technical Support has been ignored. I have followed installation instructions carefully.&lt;br /&gt;
&lt;br /&gt;
Please help me fix this so I can begin coding immediately.  My Operating System is Windows XP and my web browser is Internet Explorer 7.&lt;br /&gt;</description>
      <pubDate>Mon, 18 Aug 2008 14:31:56 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>HELP: parsing unicode web sites</title>
      <link>http://www.programmersheaven.com/mb/perl/373829/373829/help-parsing-unicode-web-sites/</link>
      <description>I need help in parsing unicode webpages &amp;amp; downloading jpeg image files via Perl scripts.&lt;br /&gt;
&lt;br /&gt;
I read &lt;a href="http://www.cs.utk.edu/cs594ipm/perl/crawltut.html"&gt;http://www.cs.utk.edu/cs594ipm/perl/crawltut.html&lt;/a&gt; about using LWP or HTTP or get($url) functions &amp;amp; libraries. But the content returned is always garbled. I have used get($url) on a non-unicode webpage and the content is returned in perfect ascii.&lt;br /&gt;
&lt;br /&gt;
But now I want to parse &lt;a href="http://www.tom365.com/movie_2004/html/5507.html"&gt;http://www.tom365.com/movie_2004/html/5507.html&lt;/a&gt; and the page I get back is garbled encoded. I have read about Encode but don't know how to use it.&lt;br /&gt;
&lt;br /&gt;
I need a Perl script to parse that above page and extract the URL for the image in this pattern:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class="movie"&amp;gt;&amp;lt;img src="http://pic.tom365.com/imgs/tongjifan.jpg" class="mp" /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If anyone knows how to do this parsing unicode webpages then I'd be very grateful.&lt;br /&gt;
&lt;br /&gt;
Thank you&lt;br /&gt;</description>
      <pubDate>Thu, 31 Jul 2008 06:56:49 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>Extracting specific variables from a fixed-width data file</title>
      <link>http://www.programmersheaven.com/mb/perl/373119/373119/extracting-specific-variables-from-a-fixed-width-data-file/</link>
      <description>I have a data file with a 6 fixed-width columns. These columns alternate between variables (width=25) and their corresponding values (width=15). There are a total of 125 variables, however I only need 6 of them and their values for future plotting purposes.&lt;br /&gt;
&lt;br /&gt;
How do I extract ONLY the variables and values i need from this rather large table and print them in a plottable format? Is there a script I can use that will find/locate specific keys in a data file?&lt;br /&gt;
&lt;br /&gt;
Thank you!&lt;br /&gt;</description>
      <pubDate>Thu, 03 Jul 2008 11:19:23 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>open a program in perl, write to it and then obtain its output</title>
      <link>http://www.programmersheaven.com/mb/perl/373099/373099/open-a-program-in-perl-write-to-it-and-then-obtain-its-output/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I'm trying to open a program in Perl (say the R language). I'd like to be able to send code to this other program once it launches, and then gather the output back in Perl. Is there some way to do this?&lt;br /&gt;
&lt;br /&gt;
Thanks very much.&lt;br /&gt;
&lt;br /&gt;
L.&lt;br /&gt;</description>
      <pubDate>Wed, 02 Jul 2008 20:43:05 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>Analysing text files to obtain statistics on their content.</title>
      <link>http://www.programmersheaven.com/mb/perl/372885/372885/analysing-text-files-to-obtain-statistics-on-their-content/</link>
      <description>Analysing text files to obtain statistics on their content &lt;br /&gt;
&lt;br /&gt;
You are to write a Perl program that analyses text files to obtain statistics on their content. The program should operate as follows: &lt;br /&gt;
&lt;br /&gt;
1) When run, the program should check if an argument has been provided. If not, the program should prompt for, and accept input of, a filename from the keyboard. &lt;br /&gt;
&lt;br /&gt;
2) The filename, either passed as an argument or input from the keyboard, should be checked to ensure it is in MS-DOS format. The filename part should be no longer than 8 characters and must begin with a letter or underscore character followed by up to 7 letters, digits or underscore characters. The file extension should be optional, but if given is should be ".TXT" (upper- or lowercase). &lt;br /&gt;
&lt;br /&gt;
If no extension if given, ".TXT" should be added to the end of the filename. So, for example, if "testfile" is input as the filename, this should become "testfile.TXT". If "input.txt" is entered, this should remain unchanged. &lt;br /&gt;
&lt;br /&gt;
3) If the filename provided is not of the correct format, the program should display a suitable error message and end at this point. &lt;br /&gt;
&lt;br /&gt;
4) The program should then check to see if the file exists using the filename provided. If the file does not exist, a suitable error message should be displayed and the program should end at this point. &lt;br /&gt;
&lt;br /&gt;
5) Next, if the file exists but the file is empty, again a suitable error message should be displayed and the program should end. &lt;br /&gt;
&lt;br /&gt;
6) The file should be read and checked to display crude statistics on the number of characters, words, lines, sentences and paragraphs that are within the file. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I am very new to Perl and have managed to compile this code using examples from various books. Could anyone oversee this coding and see how it could be improved. &lt;br /&gt;
&lt;br /&gt;
#!/usr/bin/perl &lt;br /&gt;
&lt;br /&gt;
use strict; &lt;br /&gt;
use warnings; &lt;br /&gt;
&lt;br /&gt;
if ($#ARGV == -1) #no filename provided as a command line argument. &lt;br /&gt;
{ &lt;br /&gt;
print("Please enter a filename: "); &lt;br /&gt;
$filename = &amp;lt;STDIN&amp;gt;; &lt;br /&gt;
chomp($filename); &lt;br /&gt;
} &lt;br /&gt;
else #got a filename as an argument. &lt;br /&gt;
{ &lt;br /&gt;
$filename = $ARGV[0]; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
#perform the specified checks &lt;br /&gt;
#check if filename is valid, exit if not &lt;br /&gt;
if ($filename !~ m^/[a-z]{1,7}\.TXT$/i) &lt;br /&gt;
{ &lt;br /&gt;
die("File format not valid\n");) &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
if ($filename !~ m/\.TXT$/i) &lt;br /&gt;
{ &lt;br /&gt;
$filename .= ".TXT"; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
#check if filename is actual file, exit if it is. &lt;br /&gt;
if (-e $filename) &lt;br /&gt;
{ &lt;br /&gt;
die("File does not exist\n"); &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
#check if filename is empty, exit if it is. &lt;br /&gt;
if (-s $filename) &lt;br /&gt;
{ &lt;br /&gt;
die("File is empty\n"); &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
my $i = 0; &lt;br /&gt;
my $p = 1; &lt;br /&gt;
my $words = 0; &lt;br /&gt;
my $chars = 0; &lt;br /&gt;
&lt;br /&gt;
open(READFILE, "&amp;lt;$data1.txt") or die "Can't open file '$filename: $!"; &lt;br /&gt;
&lt;br /&gt;
#then use a while loop and series of if statements similar to the following &lt;br /&gt;
while (&amp;lt;READFILE&amp;gt;) { &lt;br /&gt;
chomp; #removes the input record Separator &lt;br /&gt;
$i = $.; #"$". is the input record line numbers, $i++ will also work &lt;br /&gt;
$p++ if (m/^$/); #count paragraphs &lt;br /&gt;
$my @t = split (/\s+/); #split sentences into "words" &lt;br /&gt;
$words += @t; #add count to $words &lt;br /&gt;
$chars += tr/ //c; #tr/ //c count all characters except spaces and add to $chars &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#display results &lt;br /&gt;
print "There are $i lines in $data1\n"; &lt;br /&gt;
print "There are $p Paragraphs in $data1\n"; &lt;br /&gt;
print "There are $words in $data1\n"; &lt;br /&gt;
print "There are $chars in $data1\n"; &lt;br /&gt;
&lt;br /&gt;
close(READFILE); &lt;br /&gt;</description>
      <pubDate>Wed, 25 Jun 2008 03:50:46 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>Perl CGI help...</title>
      <link>http://www.programmersheaven.com/mb/perl/372704/372704/perl-cgi-help/</link>
      <description>Hi all, I'm having a frustrating error that I'm somewhat confused about. I'm writing a simple perl script as a cgi for a login. I've run through a lot of tests to try to figure out where the error is, but so far it's not been successful. The perl code is as follows:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
#!/usr/bin/perl -wT&lt;br /&gt;
&lt;br /&gt;
use CGI;&lt;br /&gt;
use CGI::Cookie;&lt;br /&gt;
use CGI qw(:standard);&lt;br /&gt;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);&lt;br /&gt;
use Fcntl qw(:flock :seek);&lt;br /&gt;
use Fcntl;&lt;br /&gt;
use strict;&lt;br /&gt;
&lt;br /&gt;
my (&lt;br /&gt;
$name, #username they type in&lt;br /&gt;
$pass, #password they type in&lt;br /&gt;
$sys_name, #username in the member file&lt;br /&gt;
$sys_pass, #password in the member file&lt;br /&gt;
@members, #array of all members&lt;br /&gt;
$dirto_members_list, #directory to members file&lt;br /&gt;
$valid_name, #variable to determine name validity&lt;br /&gt;
$valid_pass, #variable to determine password validity&lt;br /&gt;
$cookie #cookie used to dtermine if they're logged in or not&lt;br /&gt;
);&lt;br /&gt;
&lt;br /&gt;
$name = param('username');&lt;br /&gt;
$pass = param('password');&lt;br /&gt;
&lt;br /&gt;
print header;&lt;br /&gt;
print start_html('Login Status');&lt;br /&gt;
&lt;br /&gt;
##################################################
#######################&lt;br /&gt;
# Check the name &amp;amp; password in the members file&lt;br /&gt;
##################################################
#######################&lt;br /&gt;
&lt;br /&gt;
$dirto_members_list = "/home/hopefulc/public_html/cgi-bin/koh_members_list.cgi";&lt;br /&gt;
&lt;br /&gt;
open (MEM, $dirto_members_list) || die("The File could not be opened!"); #open the members file&lt;br /&gt;
flock (MEM, LOCK_SH);&lt;br /&gt;
seek (MEM, 0, SEEK_SET);&lt;br /&gt;
@members = &amp;lt;MEM&amp;gt;;&lt;br /&gt;
chomp (@members);&lt;br /&gt;
&lt;br /&gt;
close(MEM); #close the members file&lt;br /&gt;
&lt;br /&gt;
$valid_name = 0;&lt;br /&gt;
$valid_pass = 0;&lt;br /&gt;
&lt;br /&gt;
foreach my $mem (@members)&lt;br /&gt;
{&lt;br /&gt;
($sys_name, $sys_pass) = split (/\|..\|/, $mem);&lt;br /&gt;
&lt;br /&gt;
if ($name eq $sys_name)&lt;br /&gt;
{&lt;br /&gt;
$valid_name = 1;&lt;br /&gt;
&lt;br /&gt;
if ($pass eq $sys_pass)&lt;br /&gt;
{&lt;br /&gt;
$valid_pass = 1;&lt;br /&gt;
print "Congratulations $name, you logged in!\n&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;\n";&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
print "Sorry, you didn't type in the correct password.\n&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;\n";&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
##################################################
########################&lt;br /&gt;
&lt;br /&gt;
print end_html;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tests that I've run through include checking the file permissions and setting them to 0755, carefully checking the spelling in the files, checking the html form, and I also ran a slightly modified version of this code from the command line successfully.&lt;br /&gt;
The annoying Internal Server error that is in the Apache error log is as follows:&lt;br /&gt;
&lt;br /&gt;
[Mon Jun 16 17:56:46 2008] [error] [client 76.193.171.114] File does not exist: /home/hopefulc/public_html/500.shtml&lt;br /&gt;
&lt;br /&gt;
The error seems very simple, except that I know the file does exist. If anyone has any suggestions to help it would be very much appreciated...&lt;br /&gt;</description>
      <pubDate>Tue, 17 Jun 2008 03:48:38 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>script to watch for new record inserted into mysql table</title>
      <link>http://www.programmersheaven.com/mb/perl/372595/372595/script-to-watch-for-new-record-inserted-into-mysql-table/</link>
      <description>Hi there I'm trying to write a simple script to watch for new a record being inserted into a Mysql Table and grab certain ones and process them and insert them into another table.&lt;br /&gt;
&lt;br /&gt;
I've got it working using a loop and a wait function but there has to be a better wait so it doesn't miss any records that get inserted.&lt;br /&gt;
&lt;br /&gt;
Any ideas?&lt;br /&gt;
&lt;br /&gt;
Sean&lt;br /&gt;</description>
      <pubDate>Wed, 11 Jun 2008 13:23:21 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>help with split function</title>
      <link>http://www.programmersheaven.com/mb/perl/372262/372262/help-with-split-function/</link>
      <description>Is it possible to use a form to decide how many fields there are in a database. The reason is that i have several databases with different field counts and it would be great not to have to go into the script and change split line according to what file i use.&lt;br /&gt;
&lt;br /&gt;
Example: I know there are 3 fields in database1.txt and those fields are seperated by the pipe delimiter. Can I type "first,second,third" in a form named fields and have it inserted in the split function.&lt;br /&gt;
&lt;br /&gt;
($$FORM{'fields'}) = split(/\|/,$list);&lt;br /&gt;
print "First name: $first&amp;lt;br&amp;gt;Last name: $second&amp;lt;p&amp;gt;\n";&lt;br /&gt;
&lt;br /&gt;
I Know there's got to be a way somehow but i can't find it. I tried all kinds of clever, ugly and unorthodox methods to do this to no avail. Came close with this. But it only shows the first field only. Any help would be appreciated. Thanks.&lt;br /&gt;
&lt;br /&gt;
@kkk = "$FORM{'fields'}";&lt;br /&gt;
foreach $i (@kkk) {&lt;br /&gt;
($$i) = split(/\|/,$list);&lt;br /&gt;
}&lt;br /&gt;
print "First name: $first&amp;lt;br&amp;gt;Last name: $second&amp;lt;p&amp;gt;\n";&lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Thu, 29 May 2008 09:39:42 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>copy function</title>
      <link>http://www.programmersheaven.com/mb/perl/371802/371802/copy-function/</link>
      <description>use File::Copy;&lt;br /&gt;
mkdir '../test1';&lt;br /&gt;
mkdir '../test1/test2';&lt;br /&gt;
mkdir '../test3';&lt;br /&gt;
&lt;br /&gt;
copy ( '../test1' , '../test3');&lt;br /&gt;
&lt;br /&gt;
#why doesn't test2 get copied into test 3?</description>
      <pubDate>Thu, 08 May 2008 12:55:01 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>Need help with grabbing links</title>
      <link>http://www.programmersheaven.com/mb/perl/371222/371222/need-help-with-grabbing-links/</link>
      <description>I need help in grabbing links.. I use WWW::Mechanize to grab links from sites and it worked very well until i got into this site:&lt;br /&gt;
http://sleepywood.net/forum/memberlist.php?ltr=A&amp;amp;pp=0&amp;amp;sort=username&amp;amp;order=asc&lt;br /&gt;
&lt;br /&gt;
I tried to use WWW:Mechanize with that link but it doesnt work, I only get the links from the header menu.. Maybe because the links that i need is in a table?&lt;br /&gt;
&lt;br /&gt;
Please your tips would really help me alot thnx..&lt;br /&gt;</description>
      <pubDate>Tue, 15 Apr 2008 11:16:32 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>Reading Data from a file</title>
      <link>http://www.programmersheaven.com/mb/perl/370846/370846/reading-data-from-a-file/</link>
      <description>Hello,&lt;br /&gt;
&lt;br /&gt;
The main goal is to read data from files. In here I read data from the group and passwd file on a linux box. I want to isolate some data, such as groups and specific users to generate new group and passwd file on a different system.&lt;br /&gt;
&lt;br /&gt;
The problem happening in the CleanFiles function. When I call it twice, the second time it returns data of the previous call as well as the data from this call. I am trying to understand why the data passed in a previous call stay and are return with the data of the next call.&lt;br /&gt;
&lt;br /&gt;
I have tried to call the function 3 times and the third time I get the data of the two previous calls as well as the data from the last call.&lt;br /&gt;
&lt;br /&gt;
Any suggestion? I am relatively new to Perl.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;

#!/usr/bin/perl

###################
#Packages required#
###################

use strict;
use List::MoreUtils qw(uniq);
use Data::Dumper;
use warnings;

############
#Parameters#
############

#First we define the path to the file we use
#do not put any /
my $dac02_location = "/Users/tuxy94/Scripts/tmp/dac03_conf";
my $dac03_location = "/Users/tuxy94/Scripts/tmp/dac03_conf/etc";

#name of the groups
my @group = ('jai','smbuser','domadm');
#number of max user on the system
my $i = 8;
#name of additional machines that are in passwd but not in group
my @add_machines=('dacsrv01', 'dacwks01', 'dacwks02', 'dacwks03', 'dacwks04', 'dacwks05', 'daceufo201', 'dacluxe02', 'dacluxe03');
#special users to also update the password for
my @special_users=('root','nagios');

###########
#Functions#
###########

#To parse the data and store it in a hash
sub DataParsing{
    my ($file, @fields) = @_;

    my %data = ();
    my $item;

    open(DATA_PARSING, $dac02_location."/".$file) or die "Cannot open the file!";

    while(&amp;lt;DATA_PARSING&amp;gt;){
        chomp;

        foreach $item (@fields){
            if($_ =~ /$item/){
                $data{$item}=[split('[:,]',$_)];
                $data{$item.'_raw'} = $_;
            }
        }
    }

    close(DATA_PARSING);

    return %data;
}

#Clean the file group and return an array with clean data to construct the new one
sub CleanFiles{
    my ($file, @lines) = @_;

    my @data_file = ();

print "Dump of data_file in function:\n";
print Dumper(@data_file);

#@data_file is well reset each time I call the function but still
#the data from the previous call are in the second call result...
#WHY???
#I think it is the container DATA_CLEANING that is not proprelly empti
+ed
#How to check this?

    open(DATA_CLEANING, $dac03_location."/".$file) or die "Cannot open the file!";

    #Store the text in an array, easier to work with
    while(&amp;lt;DATA_CLEANING&amp;gt;){
        chomp;
        push(@data_file,$_);
        #print "$_\n";
    }
    close(DATA_CLEANING);

    foreach my $index (reverse 0 .. $#data_file){
        foreach my $item (@lines){
            if ($data_file[$index] =~ /$item/){
                splice @data_file, $index, 1;
                #print "The item to be spliced: $item\n";
            }
        }
    }

    return @data_file;
}

#function to generate the new config files
sub CreateConfig{
    my ($file,@data) = @_;
    my $item;

    $file = $file.".new";

    open(NFILE,"&amp;gt;$file");
    foreach $item (@data){
        print NFILE "$item\n";
    }
    close(NFILE);

    return $file;
}

###########
#Instances#
###########

#hash of the group with the group name as reference
my %group = DataParsing('group', @group);
#print "$group{jai}[2]\n";

#put the usernames in an array to get info out of passwd
my $item;
my @username = ();
foreach $item (@group){
    for ($a = $i+1; $a &amp;gt; 2; $a--){
        if($group{$item}[$a] ne ''){
            push(@username,$group{$item}[$a])
        }
    }
}

#array containing all of the user that need to be added on system
my @usernames = uniq(@username,@add_machines);

my @special_usernames = uniq(@usernames,@special_users);
#hash of the user in passwd with username as reference
my %passwd = DataParsing('passwd',@special_usernames);

#hash of the password in shadow with username as reference
my %shadow = DataParsing('shadow',@special_usernames);

##################################################
######
##################################################
######

my @group_clean_data = CleanFiles('group',@group);

my @passwd_clean_data = CleanFiles('passwd',@special_usernames);

print "Print of the group_clean_data outside of function:\n";
print Dumper(@group_clean_data);

print "Print of passwd_clean_data outside of function:\n";
print Dumper(@passwd_clean_data);


&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
The output I get is:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
Dump of data_file in function:
Dump of data_file in function:
Print of the group_clean_data outside of function:
$VAR1 = 'root:x:0:';
$VAR2 = 'daemon:x:1:';
$VAR3 = 'bin:x:2:';
$VAR4 = 'sys:x:3:';
$VAR5 = 'adm:x:4:';
$VAR6 = 'tty:x:5:';
$VAR7 = 'disk:x:6:';
$VAR8 = 'lp:x:7:';
$VAR9 = 'mail:x:8:';
$VAR10 = 'news:x:9:';
$VAR11 = 'uucp:x:10:';
$VAR12 = 'man:x:12:';
$VAR13 = 'proxy:x:13:';
$VAR14 = 'kmem:x:15:';
$VAR15 = 'dialout:x:20:reyndce';
$VAR16 = 'fax:x:21:';
$VAR17 = 'voice:x:22:';
$VAR18 = 'cdrom:x:24:reyndce';
$VAR19 = 'floppy:x:25:reyndce';
$VAR20 = 'tape:x:26:';
$VAR21 = 'sudo:x:27:';
$VAR22 = 'audio:x:29:reyndce';
$VAR23 = 'dip:x:30:';
$VAR24 = 'www-data:x:33:apache';
$VAR25 = 'backup:x:34:';
$VAR26 = 'operator:x:37:';
$VAR27 = 'list:x:38:';
$VAR28 = 'irc:x:39:';
$VAR29 = 'src:x:40:';
$VAR30 = 'gnats:x:41:';
$VAR31 = 'shadow:x:42:';
$VAR32 = 'utmp:x:43:';
$VAR33 = 'video:x:44:reyndce';
$VAR34 = 'sasl:x:45:';
$VAR35 = 'plugdev:x:46:reyndce';
$VAR36 = 'staff:x:50:';
$VAR37 = 'games:x:60:';
$VAR38 = 'users:x:100:';
$VAR39 = 'nogroup:x:65534:';
$VAR40 = 'crontab:x:101:';
$VAR41 = 'Debian-exim:x:102:';
$VAR42 = 'ssh:x:103:';
$VAR43 = 'reyndce:x:1000:';
$VAR44 = 'mysql:x:104:';
$VAR45 = 'ssl-cert:x:105:';
$VAR46 = 'postfix:x:106:';
$VAR47 = 'postdrop:x:107:';
$VAR48 = 'nagios:x:1001:';
$VAR49 = 'nagcmd:x:1002:nagios,www-data';
$VAR50 = 'bind:x:108:';
$VAR51 = 'ntp:x:109:';
$VAR52 = 'apache:x:72:';
$VAR53 = 'slocate:x:110:';
Print of passwd_clean_data outside of function:
$VAR1 = 'daemon:x:1:';
$VAR2 = 'bin:x:2:';
$VAR3 = 'sys:x:3:';
$VAR4 = 'adm:x:4:';
$VAR5 = 'tty:x:5:';
$VAR6 = 'disk:x:6:';
$VAR7 = 'lp:x:7:';
$VAR8 = 'mail:x:8:';
$VAR9 = 'news:x:9:';
$VAR10 = 'uucp:x:10:';
$VAR11 = 'man:x:12:';
$VAR12 = 'proxy:x:13:';
$VAR13 = 'kmem:x:15:';
$VAR14 = 'fax:x:21:';
$VAR15 = 'voice:x:22:';
$VAR16 = 'tape:x:26:';
$VAR17 = 'sudo:x:27:';
$VAR18 = 'dip:x:30:';
$VAR19 = 'www-data:x:33:apache';
$VAR20 = 'backup:x:34:';
$VAR21 = 'operator:x:37:';
$VAR22 = 'list:x:38:';
$VAR23 = 'irc:x:39:';
$VAR24 = 'src:x:40:';
$VAR25 = 'gnats:x:41:';
$VAR26 = 'shadow:x:42:';
$VAR27 = 'utmp:x:43:';
$VAR28 = 'sasl:x:45:';
$VAR29 = 'staff:x:50:';
$VAR30 = 'games:x:60:';
$VAR31 = 'users:x:100:';
$VAR32 = 'nogroup:x:65534:';
$VAR33 = 'crontab:x:101:';
$VAR34 = 'Debian-exim:x:102:';
$VAR35 = 'ssh:x:103:';
$VAR36 = 'mysql:x:104:';
$VAR37 = 'ssl-cert:x:105:';
$VAR38 = 'postfix:x:106:';
$VAR39 = 'postdrop:x:107:';
$VAR40 = 'bind:x:108:';
$VAR41 = 'ntp:x:109:';
$VAR42 = 'apache:x:72:';
$VAR43 = 'slocate:x:110:';
$VAR44 = 'daemon:x:1:1:daemon:/usr/sbin:/bin/sh';
$VAR45 = 'bin:x:2:2:bin:/bin:/bin/sh';
$VAR46 = 'sys:x:3:3:sys:/dev:/bin/sh';
$VAR47 = 'sync:x:4:65534:sync:/bin:/bin/sync';
$VAR48 = 'games:x:5:60:games:/usr/games:/bin/sh';
$VAR49 = 'man:x:6:12:man:/var/cache/man:/bin/sh';
$VAR50 = 'lp:x:7:7:lp:/var/spool/lpd:/bin/sh';
$VAR51 = 'mail:x:8:8:mail:/var/mail:/bin/sh';
$VAR52 = 'news:x:9:9:news:/var/spool/news:/bin/sh';
$VAR53 = 'uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh';
$VAR54 = 'proxy:x:13:13:proxy:/bin:/bin/sh';
$VAR55 = 'www-data:x:33:33:www-data:/var/www:/bin/sh';
$VAR56 = 'backup:x:34:34:backup:/var/backups:/bin/sh';
$VAR57 = 'list:x:38:38:Mailing List Manager:/var/list:/bin/sh';
$VAR58 = 'irc:x:39:39:ircd:/var/run/ircd:/bin/sh';
$VAR59 = 'gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh';
$VAR60 = 'nobody:x:65534:65534:nobody:/nonexistent:/bin/sh'
;
$VAR61 = 'Debian-exim:x:100:102::/var/spool/exim4:/bin/false';
$VAR62 = 'statd:x:101:65534::/var/lib/nfs:/bin/false';
$VAR63 = 'identd:x:102:65534::/var/run/identd:/bin/false';
$VAR64 = 'sshd:x:104:65534::/var/run/sshd:/usr/sbin/nologin
';
$VAR65 = 'mysql:x:103:104:MySQL Server,,,:/var/lib/mysql:/bin/false';
$VAR66 = 'postfix:x:105:106::/var/spool/postfix:/bin/false'
;
$VAR67 = 'bind:x:106:108::/var/cache/bind:/bin/false';
$VAR68 = 'ntp:x:107:109::/home/ntp:/bin/false';



&lt;/pre&gt;&lt;br /&gt;</description>
      <pubDate>Thu, 03 Apr 2008 04:46:49 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>Help in connecting to JDBC using perl</title>
      <link>http://www.programmersheaven.com/mb/perl/370465/370465/help-in-connecting-to-jdbc-using-perl/</link>
      <description>I am using the following code and i get the below error &lt;br /&gt;
&lt;br /&gt;
use DBI; &lt;br /&gt;
use DBD::JDBC; &lt;br /&gt;
&lt;br /&gt;
my $url="JDBC:gfsql://cqserver=fiappl03itf:30305"; &lt;br /&gt;
my $hostname="fiappl03itf.fmrco.com"; &lt;br /&gt;
my $port=30305; &lt;br /&gt;
my $dsn ='jdbc:gfsql'; &lt;br /&gt;
my &lt;br /&gt;
$dbh= DBI-&amp;gt;connect("DBI::$dsn;hostname=$hostname;port=$port;
url=$url;jdbc_character_set=ASCII") or &lt;br /&gt;
&lt;br /&gt;
die "Couldn't connect to database: " . DBI-&amp;gt;errstr; &lt;br /&gt;
&lt;br /&gt;
$sth = $dbh-&amp;gt;prepare("select cusip,source from TT_VIEW"); &lt;br /&gt;
$sth-&amp;gt;execute(); &lt;br /&gt;
while ($row = $sth-&amp;gt;fetch()) { &lt;br /&gt;
print $row; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
I am getting the below error. &lt;br /&gt;
&lt;br /&gt;
Can't connect to data source jdbc:gfsql;hostname=fiappl03itf.fmrco.com;port=303
05;url=JDBC:gfsql://cqserver=fiappl03itf:30305;jdb
c_character_set=ASCII, no database driver specified and DBI_DSN env var not set at jdbc_conn.pl line 16 &lt;br /&gt;
&lt;br /&gt;</description>
      <pubDate>Wed, 19 Mar 2008 08:42:39 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>foreach and variables problem</title>
      <link>http://www.programmersheaven.com/mb/perl/370341/370341/foreach-and-variables-problem/</link>
      <description>Kind of new to Perl, having a problem with a foreach loop reading a log file - each line in the logfile has a format of datastring=datanumber and I'm splitting on the "=" - the curious thing that I'm having a problem with no matter how many lines in the log file - I only get variable return from each datastring in the log file and just the last datanumber in the log file?&lt;br /&gt;
&lt;br /&gt;
/----------------------------------&lt;br /&gt;
&lt;br /&gt;
#!c:\Perl\bin\perl.exe&lt;br /&gt;
use Net::SNMP;&lt;br /&gt;
use CGI qw(:standard);&lt;br /&gt;
&lt;br /&gt;
$LOGFILE = "stormon.log";&lt;br /&gt;
open(LOGFILE) or die("Could not open log file.");&lt;br /&gt;
foreach $line (&amp;lt;LOGFILE&amp;gt;) {&lt;br /&gt;
    &lt;br /&gt;
    ($hostip, $driveid,) = split('=',$line);&lt;br /&gt;
&lt;br /&gt;
	($session,$error) = Net::SNMP-&amp;gt;session(Hostname =&amp;gt; $hostip,&lt;br /&gt;
        	                               Community =&amp;gt; "public");&lt;br /&gt;
die "session error: $error" unless ($session);&lt;br /&gt;
&lt;br /&gt;
# This gets hostname from System OID&lt;br /&gt;
		$result = $session-&amp;gt;get_request("1.3.6.1.2.1.1.5.0");&lt;br /&gt;
		$hostname = ($result-&amp;gt;{"1.3.6.1.2.1.1.5.0"});&lt;br /&gt;
&lt;br /&gt;
# This gets Drive Letter &amp;amp; Label from Host OID&lt;br /&gt;
$result = $session-&amp;gt;get_request("1.3.6.1.2.1.25.2.3.1.3." . $driveid . "");&lt;br /&gt;
$drivename = ($result-&amp;gt;{"1.3.6.1.2.1.25.2.3.1.3." . $driveid . ""});&lt;br /&gt;
&lt;br /&gt;
die "request error: ".$session-&amp;gt;error unless (defined $result);&lt;br /&gt;
&lt;br /&gt;
print ( $hostname," , ", $drivename," \n" ) ;&lt;br /&gt;
&lt;br /&gt;
$session-&amp;gt;close;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
close(LOGFILE);&lt;br /&gt;
&lt;br /&gt;
/-------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
For a return I get&lt;br /&gt;
&lt;br /&gt;
hostname1 , &lt;br /&gt;
hostname2 , drivelabel&lt;br /&gt;
&lt;br /&gt;
Played with the variables and this should work, but I can't see were its breaking.&lt;br /&gt;
&lt;br /&gt;
TIA  Mike&lt;br /&gt;</description>
      <pubDate>Fri, 14 Mar 2008 17:28:40 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>Looping through array with foreach</title>
      <link>http://www.programmersheaven.com/mb/perl/368964/368964/looping-through-array-with-foreach/</link>
      <description>Here's what I want to do.  &lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
foreach (@array)
{
  if #condition is true
  delete #current array element in loop
}
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
So how do I get the current element in the loop?  "Delete $_" doesn't work...&lt;br /&gt;</description>
      <pubDate>Sun, 27 Jan 2008 13:17:50 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>socket, send and script crash</title>
      <link>http://www.programmersheaven.com/mb/perl/368945/368945/socket-send-and-script-crash/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
I'm really fed up with this one. After hours of using google and testing arround, still no solution. My nerves are at their end at the moment, so I hope anyone here could help me. My script is as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sourcecode"&gt;
anakin.pl
#!/usr/bin/perl

# anakin.pl
#
# main file for the anakin-chatserver system
#
# version: 0.0.1
# @created: 2008-01-25
# @modified: 2008-01-26

use strict;
use IO::Socket;
use IO::Select;

print "anakin chat system (version 0.0.1) starting up...\n";
print "binding reading socket...\n";
my $listenRead = IO::Socket::UNIX-&amp;gt;new(
        Local =&amp;gt; '/tmp/anakinread.sock',
        Listen =&amp;gt; 1,
        Reuse =&amp;gt; 0,
        Blocking =&amp;gt; 0) or die $!;
print "anakin chat system (version 0.0.1) running - bound on local unix domain socket...\n";

my $selectread = IO::Select-&amp;gt;new($listenRead);
my @ready;

while(1) {
   for my $socketread ($selectread-&amp;gt;can_read) {
           if($socketread == $listenRead) {
               my $new = $listenRead-&amp;gt;accept;
               print "[anakin:] got new connection with handle " . $new-&amp;gt;fileno . "\n";
               my $line="";
               $new-&amp;gt;recv ($line,255);
               if ($line eq "reading_connection") {
                        print "[anakin:] established a reading connection for handle " . $new-&amp;gt;fileno . " peername: " . $new-&amp;gt;peername . "\n";
                        $selectread-&amp;gt;add ($new);
               } else {
                        print "[anakin:] got data from handle " . $new-&amp;gt;fileno . " - Will broadcast it to reading clinets\n";
                        print "[anakin:] client broadcasts: " . $line . "\n";

                        for my $eachsocket ($selectread-&amp;gt;handles) {
                                if ($eachsocket==$listenRead) {
                                        next;
                                } else {
                                        print "[anakin:] sending data to client...\n";
                                        $eachsocket-&amp;gt;send ($line . "\r\n") or print "other side closed connection...\n";
                                }
                        }

                        $new-&amp;gt;close;
               }
           }
   }
}
&lt;/pre&gt; &lt;br /&gt;
&lt;br /&gt;
Simple script, wich opens a unix domain socket and accepts reading and writing connections - a chat script at all. The tricky thing is the line, which sends the written data to the connected clients. Imho the "or print" command, would take care of, if the client has disconnected and can not receive data anymore, but everytime this case is given, the script crashes... What do I have to do, to determinate, if the client has disconnected? Error handling in perl seems to come from stone age or some what...</description>
      <pubDate>Sat, 26 Jan 2008 11:37:47 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>Making a CGI proxy</title>
      <link>http://www.programmersheaven.com/mb/perl/368735/368735/making-a-cgi-proxy/</link>
      <description>I would like to make a web page just like this one:&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.surf2acess.info/"&gt;http://www.surf2acess.info/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
How would I do this in perl?  I've looked into HTTP::Proxy, but I don't want a continuously running script, I just want something that executes, gets the required data, and closes.  Also, I need cookies to be supported. &lt;br /&gt;</description>
      <pubDate>Thu, 17 Jan 2008 22:13:05 -0700</pubDate>
      <category>Perl</category>
    </item>
    <item>
      <title>regular expressions</title>
      <link>http://www.programmersheaven.com/mb/perl/368734/368734/regular-expressions/</link>
      <description>Hi,&lt;br /&gt;
&lt;br /&gt;
How to check one or more letter strings follow by two or more digit numbers.&lt;br /&gt;
If I have $line contains data:&lt;br /&gt;
&lt;br /&gt;
new YOR CiTy   55&lt;br /&gt;
boston 66&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I have the code below but it only checks from 1 to 3 letter strings but I want to check more than 3 letter strings. How can I do it?&lt;br /&gt;
&lt;br /&gt;
$line !~ /^\s*([a-zA-Z]+)\s*([a-zA-Z]+)\s*([a-zA-Z]+)\s*\d{2,}$/)&lt;br /&gt;
&lt;br /&gt;
Many thanks,&lt;br /&gt;
Tony&lt;br /&gt;</description>
      <pubDate>Thu, 17 Jan 2008 22:12:16 -0700</pubDate>
      <category>Perl</category>
    </item>
  </channel>
</rss>