<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>Windows Perl Scripting Forums &#187; Recent Posts</title>
<link>http://www.roth.net/forums/</link>
<description>Windows Perl Scripting Forums &#187; Recent Posts</description>
<language>en</language>
<pubDate>Fri, 12 Mar 2010 13:24:13 +0000</pubDate>

<item>
<title>freebsdboy on "Need help in Perl scripting to get system details in windows XP operating system"</title>
<link>http://www.roth.net/forums/topic.php?id=298#post-629</link>
<pubDate>Fri, 22 Jan 2010 07:06:47 +0000</pubDate>
<dc:creator>freebsdboy</dc:creator>
<guid isPermaLink="false">629@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;To get the list of installed software you'll need to use&#60;br /&#62;
Win32::TieRegistry&#60;br /&#62;
and look in&#60;br /&#62;
$Registry-&#38;gt;{&#34;LMachine/Software/Microsoft/Windows/CurrentVersion/Uninstall/&#34;};
&#60;/p&#62;</description>
</item>
<item>
<title>freebsdboy on "Need help in Perl scripting to get system details in windows XP operating system"</title>
<link>http://www.roth.net/forums/topic.php?id=298#post-628</link>
<pubDate>Fri, 22 Jan 2010 06:53:26 +0000</pubDate>
<dc:creator>freebsdboy</dc:creator>
<guid isPermaLink="false">628@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Here is some easy code to use.  We use it to help assist unattended installs know what drivers to install.&#60;/p&#62;
&#60;p&#62;use Win32::OLE qw(in with);&#60;br /&#62;
use Win32::Registry;&#60;/p&#62;
&#60;p&#62;# Pick a host that you have the necessary rights to monitor&#60;/p&#62;
&#60;p&#62;$host = &#34;localhost&#34;;&#60;br /&#62;
$path = 'c:\\temp';&#60;/p&#62;
&#60;p&#62;$WMI = Win32::OLE-&#38;gt;new('WbemScripting.SWbemLocator') &#124;&#124;&#60;br /&#62;
 die &#34;Cannot access WMI on local machine: &#34;, Win32::OLE-&#38;gt;LastError; &#60;/p&#62;
&#60;p&#62;$Services = $WMI-&#38;gt;ConnectServer($host) &#124;&#124;&#60;br /&#62;
 die &#34;Cannot access WMI on remote machine: &#34;, Win32::OLE-&#38;gt;LastError; &#60;/p&#62;
&#60;p&#62;# Gather Computer System Information&#60;/p&#62;
&#60;p&#62;$sys_set = $Services-&#38;gt;InstancesOf(&#34;Win32_ComputerSystem&#34;);&#60;br /&#62;
foreach $sys (in($sys_set))&#60;br /&#62;
 {&#60;br /&#62;
  $system_name         = $sys-&#38;gt;{'Caption'};&#60;br /&#62;
  $system_type         = $sys-&#38;gt;{'SystemType'};&#60;br /&#62;
  $system_manufacturer = $sys-&#38;gt;{'Manufacturer'};&#60;br /&#62;
  $system_model        = $sys-&#38;gt;{'Model'};&#60;br /&#62;
 }&#60;/p&#62;
&#60;p&#62;# Gather Processor Information&#60;br /&#62;
$processor_set = $Services-&#38;gt;InstancesOf(&#34;Win32_Processor&#34;);&#60;br /&#62;
foreach $proc (in($processor_set))&#60;br /&#62;
 {&#60;br /&#62;
  $proc_description    = $proc-&#38;gt;{'Caption'};&#60;br /&#62;
  $proc_manufacturer   = $proc-&#38;gt;{'Manufacturer'};&#60;br /&#62;
  $proc_mhz            = $proc-&#38;gt;{'CurrentClockSpeed'};&#60;br /&#62;
 }&#60;/p&#62;
&#60;p&#62;# Gather BIOS Information&#60;/p&#62;
&#60;p&#62;$bios_set = $Services-&#38;gt;InstancesOf(&#34;Win32_BIOS&#34;);&#60;br /&#62;
foreach $bios (in($bios_set))&#60;br /&#62;
 {&#60;br /&#62;
  $bios_info       = $bios-&#38;gt;{'Version'};&#60;br /&#62;
 }&#60;/p&#62;
&#60;p&#62;# Gather Time Zone Information&#60;/p&#62;
&#60;p&#62;$loc_set = $Services-&#38;gt;InstancesOf(&#34;Win32_TimeZone&#34;);&#60;br /&#62;
foreach $loc (in($loc_set))&#60;br /&#62;
 {&#60;br /&#62;
  $loc_timezone      = $loc-&#38;gt;{'StandardName'};&#60;br /&#62;
 }&#60;/p&#62;
&#60;p&#62;# Gather Operating System Information&#60;/p&#62;
&#60;p&#62;$os_set = $Services-&#38;gt;InstancesOf(&#34;Win32_OperatingSystem&#34;);&#60;br /&#62;
foreach $os (in($os_set))&#60;br /&#62;
 {&#60;br /&#62;
  $os_name         = $os-&#38;gt;{'Caption'};&#60;br /&#62;
  $os_version      = $os-&#38;gt;{'Version'};&#60;br /&#62;
  $os_manufacturer = $os-&#38;gt;{'Manufacturer'};&#60;br /&#62;
  $os_build        = $os-&#38;gt;{'BuildNumber'};&#60;br /&#62;
  $os_directory    = $os-&#38;gt;{'WindowsDirectory'};&#60;br /&#62;
  $os_locale       = $os-&#38;gt;{'Locale'};&#60;br /&#62;
  $os_totalmem     = $os-&#38;gt;{'TotalVisibleMemorySize'};&#60;br /&#62;
  $os_freemem      = $os-&#38;gt;{'FreePhysicalMemory'};&#60;br /&#62;
  $os_totalvirtmem = $os-&#38;gt;{'TotalVirtualMemorySize'};&#60;br /&#62;
  $os_freevirtmem  = $os-&#38;gt;{'FreeVirtualMemory'};&#60;br /&#62;
  $os_pagefilesize = $os-&#38;gt;{'SizeStoredInPagingFiles'};&#60;br /&#62;
 }&#60;/p&#62;
&#60;p&#62;# Now convert the system's Locale to a string&#60;br /&#62;
# Use the Rfc1766 Database stored in the Registry as a lookup table&#60;/p&#62;
&#60;p&#62;$main::HKEY_LOCAL_MACHINE-&#38;gt;Open(&#34;SOFTWARE\\Classes\\MIME\\Database\\Rfc1766&#34;,$Rfc1766);&#60;br /&#62;
$Rfc1766-&#38;gt;GetValues(\%Values);&#60;br /&#62;
foreach $key (keys %Values)&#60;br /&#62;
 {&#60;br /&#62;
  $key = $Values{$key};&#60;br /&#62;
  if ($$key[0] eq $os_locale)&#60;br /&#62;
   {&#60;br /&#62;
    ($lang, $country) = split(/\;/, $$key[2]);&#60;br /&#62;
    last;&#60;br /&#62;
   }&#60;br /&#62;
 }&#60;/p&#62;
&#60;p&#62;# make a file by the name of the system model and put all this in it.&#60;br /&#62;
$system_model = laptop if ($system_model eq '');&#60;br /&#62;
 open( FILE_HANDLE, &#34;&#38;gt;$path\\$system_model&#34;) or die &#34;Can't write to $path\\$system_model\n&#34; ;&#60;/p&#62;
&#60;p&#62;print FILE_HANDLE &#34;System Summary Information\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;--------------------------\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;OS Name\t\t\t\t$os_name\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;Version\t\t\t\t$os_version Build $os_build\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;OS Manufacturer\t\t\t$os_manufacturer\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;System Name\t\t\t$system_name\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;System Manufacturer\t\t$system_manufacturer\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;System Model\t\t\t$system_model\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;System Type\t\t\t$system_type\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;Processor\t\t\t$proc_description $proc_manufacturer ~$proc_mhz Mhz\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;BIOS Version\t\t\t$bios_info\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;Windows Directory\t\t$os_directory\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;Locale\t\t\t\t$country\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;Time Zone\t\t\t$loc_timezone\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;Total Physical Memory\t\t$os_totalmem KB\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;Available Physical Memory\t$os_freemem KB \n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;Total Virtual Memory\t\t$os_totalvirtmem KB\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;Available Virtual Memory\t$os_freevirtmem KB\n&#34;;&#60;br /&#62;
print FILE_HANDLE &#34;Page File Space\t\t\t$os_pagefilesize KB\n&#34;;&#60;br /&#62;
close (FILE_HANDLE);
&#60;/p&#62;</description>
</item>
<item>
<title>dineshkhanna on "Need help in Perl scripting to get the currently opened applications on desktop"</title>
<link>http://www.roth.net/forums/topic.php?id=299#post-627</link>
<pubDate>Wed, 20 Jan 2010 01:27:14 +0000</pubDate>
<dc:creator>dineshkhanna</dc:creator>
<guid isPermaLink="false">627@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hi ,&#60;br /&#62;
Need help in Perl scripting to get the currently opened applications on desktop.I am able to open the applications using “system” command.&#60;br /&#62;
I need to check whether the application is opened on desktop after executing the system command.&#60;br /&#62;
Please let me know if you need more info.&#60;br /&#62;
It will be great if you guide me in this.&#60;br /&#62;
Thanks,&#60;br /&#62;
Dinesh.
&#60;/p&#62;</description>
</item>
<item>
<title>dineshkhanna on "Need help in Perl scripting to get system details in windows XP operating system"</title>
<link>http://www.roth.net/forums/topic.php?id=298#post-626</link>
<pubDate>Wed, 20 Jan 2010 01:26:05 +0000</pubDate>
<dc:creator>dineshkhanna</dc:creator>
<guid isPermaLink="false">626@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Need help in Perl scripting to get system details in windows XP operating system.Currently I am using win32 class to get the system details like RAM size, processor speed  ,Hard disk capacity and fetching the list of installed software.I would like to write the Perl script to get the above system details without using win32 class.&#60;br /&#62;
I will be great if you could able to guide me to write the Perl script to get the above system details without using win32 class.&#60;br /&#62;
Below is the sample code which I am currently using to get Hard Disk capacity in Perl,&#60;br /&#62;
use strict;&#60;br /&#62;
use Win32::OLE('in');&#60;br /&#62;
use constant wbemFlagReturnImmediately =&#38;gt; 0x10;&#60;br /&#62;
use constant wbemFlagForwardOnly =&#38;gt; 0x20;&#60;br /&#62;
my @computers = ($_[0]);&#60;br /&#62;
foreach my $computer (@computers)&#60;br /&#62;
{&#60;br /&#62;
                                                my $objWMIService = Win32::OLE-&#38;gt;GetObject(&#34;winmgmts:\\\\$computer\\root\\CIMV2&#34;) or die &#34;WMI connection failed.\n&#34;;&#60;br /&#62;
                                                my $colItems = $objWMIService-&#38;gt;ExecQuery(&#34;SELECT * FROM Win32_DiskDrive&#34;, &#34;WQL&#34;,&#60;br /&#62;
                                                wbemFlagReturnImmediately &#124; wbemFlagForwardOnly);&#60;br /&#62;
                                                foreach my $objItem (in $colItems)&#60;br /&#62;
                                                {&#60;br /&#62;
                                                                print &#34;\n&#34;;&#60;br /&#62;
                                                                print &#34;Hard Disk capacity : $objItem-&#38;gt;{Size}\n&#34;;&#60;br /&#62;
                                                                print &#34;\n&#34;;&#60;br /&#62;
                                                }&#60;br /&#62;
                                }
&#60;/p&#62;</description>
</item>
<item>
<title>freebsdboy on "Win32-Daemin updated ppd for perl 5.10 ?"</title>
<link>http://www.roth.net/forums/topic.php?id=294#post-622</link>
<pubDate>Thu, 10 Dec 2009 13:50:07 +0000</pubDate>
<dc:creator>freebsdboy</dc:creator>
<guid isPermaLink="false">622@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;We use win32-daemon on our systems,  any chance their is a version that will install with the perl 5.10 release of activestate?&#60;/p&#62;
&#60;p&#62;I get&#60;br /&#62;
 The PPD does not provide code to install for this platform &#60;/p&#62;
&#60;p&#62;Thanks
&#60;/p&#62;</description>
</item>
<item>
<title>Rhodge09 on "PERL Craps Game"</title>
<link>http://www.roth.net/forums/topic.php?id=290#post-621</link>
<pubDate>Wed, 02 Dec 2009 21:06:10 +0000</pubDate>
<dc:creator>Rhodge09</dc:creator>
<guid isPermaLink="false">621@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Anyone help me
&#60;/p&#62;</description>
</item>
<item>
<title>Rhodge09 on "PERL Craps Game"</title>
<link>http://www.roth.net/forums/topic.php?id=290#post-620</link>
<pubDate>Wed, 02 Dec 2009 21:05:16 +0000</pubDate>
<dc:creator>Rhodge09</dc:creator>
<guid isPermaLink="false">620@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;If this helps i want something just like this..&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://ctech.smccme.edu/~zeke/cw/save/craps/craps.pl&#34; rel=&#34;nofollow&#34;&#62;http://ctech.smccme.edu/~zeke/cw/save/craps/craps.pl&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;if you want the code i have as of right now and you think you can help me a little at a time i'd appreciate it.
&#60;/p&#62;</description>
</item>
<item>
<title>KenjiIzce118 on "Per Scrip Dices Games Help."</title>
<link>http://www.roth.net/forums/topic.php?id=293#post-619</link>
<pubDate>Thu, 26 Nov 2009 09:59:00 +0000</pubDate>
<dc:creator>KenjiIzce118</dc:creator>
<guid isPermaLink="false">619@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hey everyone, I am having some trouble with a pearl scrip dices game has one one ever done or made a dices game using pearl?? if you have can you please show me a sample or help me get started?? Thank you
&#60;/p&#62;</description>
</item>
<item>
<title>KenjiIzce118 on "Per Scrip Dices Games Help."</title>
<link>http://www.roth.net/forums/topic.php?id=292#post-618</link>
<pubDate>Thu, 26 Nov 2009 09:58:18 +0000</pubDate>
<dc:creator>KenjiIzce118</dc:creator>
<guid isPermaLink="false">618@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hey everyone, I am having some trouble with a pearl scrip dices game has one one ever done or made a dices game using pearl?? if you have can you please show me a sample or help me get started?? Thank you
&#60;/p&#62;</description>
</item>
<item>
<title>KenjiIzce118 on "Per Scrip Dices Games Help."</title>
<link>http://www.roth.net/forums/topic.php?id=291#post-617</link>
<pubDate>Thu, 26 Nov 2009 09:57:21 +0000</pubDate>
<dc:creator>KenjiIzce118</dc:creator>
<guid isPermaLink="false">617@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hey everyone, I am having some trouble with a pearl scrip dices game has one one ever done or made a dices game using pearl?? if you have can you please show me a sample or help me get started?? Thank you
&#60;/p&#62;</description>
</item>
<item>
<title>Rhodge09 on "PERL Craps Game"</title>
<link>http://www.roth.net/forums/topic.php?id=290#post-616</link>
<pubDate>Mon, 23 Nov 2009 12:54:18 +0000</pubDate>
<dc:creator>Rhodge09</dc:creator>
<guid isPermaLink="false">616@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;This must have all the basics of the game completed and functioning. This means that the game must generate the two dice values and display an image for each individual dice. Set the correct conditions for the first throw to determine a win or a loss or the setting of a point. If the point is set the play must continue with consecutive throws until the point is matched or a 7 is thrown and a win or a loss is determined.
&#60;/p&#62;</description>
</item>
<item>
<title>Rhodge09 on "PERL Craps Game"</title>
<link>http://www.roth.net/forums/topic.php?id=290#post-615</link>
<pubDate>Mon, 23 Nov 2009 06:29:37 +0000</pubDate>
<dc:creator>Rhodge09</dc:creator>
<guid isPermaLink="false">615@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Ya i know how to do forms and all that stuff..i've tried it and it still wont work. &#60;/p&#62;
&#60;p&#62;its not that hard to do:&#60;/p&#62;
&#60;p&#62;sub form{&#60;br /&#62;
print &#34;&#60;/p&#62;
&#60;p&#62;form method=post action=''&#60;br /&#62;
&#34;&#34; input type='' name=''&#60;br /&#62;
/form&#38;gt;&#60;br /&#62;
&#34;;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;The problem is where to do i put it? How will this work if i just make a button. I dont think it will. I'm still waiting for an answer i've posted this in like 6 other threads all over and no one can get it.
&#60;/p&#62;</description>
</item>
<item>
<title>Dave on "PERL Craps Game"</title>
<link>http://www.roth.net/forums/topic.php?id=290#post-614</link>
<pubDate>Sun, 22 Nov 2009 23:35:06 +0000</pubDate>
<dc:creator>Dave</dc:creator>
<guid isPermaLink="false">614@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;You need to study how HTML and CGI works. This is all do-able and fairly straight forward. Look up how HTML forms work and create a form with a submit button and CGI variables.
&#60;/p&#62;</description>
</item>
<item>
<title>Rhodge09 on "PERL Craps Game"</title>
<link>http://www.roth.net/forums/topic.php?id=290#post-613</link>
<pubDate>Sun, 22 Nov 2009 06:25:57 +0000</pubDate>
<dc:creator>Rhodge09</dc:creator>
<guid isPermaLink="false">613@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Well say i need like some type of button and when i click it two numbers come up resembling a dice and it tells me if i win and if i do i get money and if i lose i lose money thats as simple as it needs to be. And when i get down to say 5 dollars then game over and when i hit 1,000 dollars then the game is over. Thats all that i want to happen.
&#60;/p&#62;</description>
</item>
<item>
<title>Dave on "Perl enclosing SQL fails"</title>
<link>http://www.roth.net/forums/topic.php?id=284#post-612</link>
<pubDate>Sun, 22 Nov 2009 01:32:56 +0000</pubDate>
<dc:creator>Dave</dc:creator>
<guid isPermaLink="false">612@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;What are you attempting to do? Your code is specifying a command line string where it should be specifying a file name.&#60;br /&#62;
If you really intend to read input from a DOS command try this (NOTE that the ~ needs to be a backtick char, but this editor doesn't let me actually enter a backtick):&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;foreach my $Line (~bsq -b &#38;lt;&#38;lt;EOSQL sp_help go EOSQL~ )
{
    print $Line;
}&#60;/code&#62;&#60;/pre&#62;</description>
</item>
<item>
<title>Dave on "PERL Craps Game"</title>
<link>http://www.roth.net/forums/topic.php?id=290#post-611</link>
<pubDate>Sun, 22 Nov 2009 01:14:57 +0000</pubDate>
<dc:creator>Dave</dc:creator>
<guid isPermaLink="false">611@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;The first thing you want to do is add a &#60;code&#62;&#38;lt;BR/&#38;gt;&#60;/code&#62; tag before every newline char (\n). So, for example:&#60;br /&#62;
&#60;code&#62;print &#38;quot;Most Rollcounts: $mostrolls\n&#38;quot;;&#60;/code&#62;&#60;br /&#62;
becomes:&#60;br /&#62;
&#60;code&#62;print &#38;quot;Most Rollcounts: $mostrolls &#38;lt;br/&#38;gt;\n&#38;quot;;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;The &#60;code&#62;&#38;lt;BR/&#38;gt;&#60;/code&#62; tag is HTML for a line break. This will solve your line break problem. From what you describe above it sounds like you may have other issues with the script. If so, please post more descriptive explanation.&#60;/p&#62;
&#60;p&#62;For what it is worth, you can improve performance by aggregating print/sprintf statements into a single printf statement. So this:&#60;br /&#62;
&#60;code&#62;print &#38;quot;Ave Rollcounts: &#38;quot; . sprintf(&#38;quot;%.3f&#38;quot;, $bigrollcount/$iterations) . &#38;quot;\n&#38;quot;;&#60;/code&#62;&#60;br /&#62;
becomes:&#60;br /&#62;
&#60;code&#62;printf( &#38;quot;Ave Rollcounts: %.3f\n&#38;quot;, $bigrollcount/$iterations);&#60;/code&#62;
&#60;/p&#62;</description>
</item>
<item>
<title>Rhodge09 on "PERL Craps Game"</title>
<link>http://www.roth.net/forums/topic.php?id=290#post-610</link>
<pubDate>Sat, 21 Nov 2009 10:18:41 +0000</pubDate>
<dc:creator>Rhodge09</dc:creator>
<guid isPermaLink="false">610@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;I put this at the top of the script and all that comes out is text on the webpage..this is the site :   &#60;a href=&#34;http://ctech.smccme.edu/~rhodge/cw/craps/cgi-bin/craps.pl&#34; rel=&#34;nofollow&#34;&#62;http://ctech.smccme.edu/~rhodge/cw/craps/cgi-bin/craps.pl&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;use CGI ':standard';&#60;br /&#62;
use CGI::Carp &#34;fatalsToBrowser&#34;;
&#60;/p&#62;</description>
</item>
<item>
<title>Dave on "PERL Craps Game"</title>
<link>http://www.roth.net/forums/topic.php?id=290#post-609</link>
<pubDate>Sat, 21 Nov 2009 10:11:14 +0000</pubDate>
<dc:creator>Dave</dc:creator>
<guid isPermaLink="false">609@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;The problem is less about you script and more with your web page. You need to learn how web pages work. In particular you need to learn about CGI programming.&#60;br /&#62;
In general a CGI script:&#60;br /&#62;
-runs on the server when a client browser requests the page&#60;br /&#62;
-the server runs the script fresh each time. In other words the script has no continuity across multiple requests.&#60;br /&#62;
-any script output needs to be formatted as HTML becuse your script's output will be sent to the client browser as a web page.&#60;br /&#62;
-any info you want &#34;remembered&#34; across execution then either pass data in as a parameter or us what are called CGI variables.
&#60;/p&#62;</description>
</item>
<item>
<title>Rhodge09 on "PERL Craps Game"</title>
<link>http://www.roth.net/forums/topic.php?id=290#post-608</link>
<pubDate>Fri, 20 Nov 2009 20:30:32 +0000</pubDate>
<dc:creator>Rhodge09</dc:creator>
<guid isPermaLink="false">608@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;This is my script it works fine but it comes out on my webpage as just text how can i change this around and make it so if i like click a button a 2 different numbers come up almost like the 2 dice and remember how much i make each roll. Is there anyway anyone can help me? I can show you what it looks like in the browser right now if you ask i can show you if that will help. Thanks i really need this because its a project i have to get finished.&#60;/p&#62;
&#60;p&#62;#!/usr/bin/perl&#60;/p&#62;
&#60;p&#62;#  How many games would you like to roll?&#60;br /&#62;
$iterations = 1000;&#60;/p&#62;
&#60;p&#62;for ($count = $iterations; $count &#38;gt;= 1; $count--) {&#60;/p&#62;
&#60;p&#62;print &#34;$count \n&#34;;&#60;/p&#62;
&#60;p&#62;# Bankroll per game.  Rules are set up for a $5 bet on a 3x/4x/5x table.&#60;br /&#62;
$bankroll = 200;&#60;/p&#62;
&#60;p&#62;$rollcount = 0;&#60;br /&#62;
$high = 200;&#60;/p&#62;
&#60;p&#62;$itson = 1;&#60;/p&#62;
&#60;p&#62;while ($itson == 1) {&#60;/p&#62;
&#60;p&#62;	$die1 = int(rand() * 6) + 1;&#60;br /&#62;
	$die2 = int(rand() * 6) + 1;&#60;br /&#62;
	$roll = $die1 + $die2;&#60;br /&#62;
	$rollcount = $rollcount + 1;&#60;/p&#62;
&#60;p&#62;	if ($roll == 7 &#124;&#124; $roll == 11) {&#60;br /&#62;
		$bankroll = $bankroll + 5;&#60;br /&#62;
		# print &#34;W $roll $bankroll $rollcount\n&#34;;&#60;br /&#62;
		if ($bankroll &#38;gt; $high) {&#60;br /&#62;
			$high = $bankroll;&#60;br /&#62;
			}&#60;br /&#62;
		}&#60;/p&#62;
&#60;p&#62;	elsif ($roll == 2 &#124;&#124; $roll == 3 &#124;&#124; $roll == 12) {&#60;br /&#62;
		$bankroll = $bankroll - 5;&#60;br /&#62;
		# print &#34;L $roll $bankroll $rollcount\n&#34;;&#60;br /&#62;
		}&#60;/p&#62;
&#60;p&#62;	else {&#60;br /&#62;
		$setnum = $roll;&#60;br /&#62;
		$notcrapped = 1;&#60;br /&#62;
		while ($notcrapped == 1) {&#60;/p&#62;
&#60;p&#62;			$die1 = int(rand() * 6) + 1;&#60;br /&#62;
			$die2 = int(rand() * 6) + 1;&#60;br /&#62;
			$roll = $die1 + $die2;&#60;br /&#62;
			$rollcount = $rollcount + 1;&#60;/p&#62;
&#60;p&#62;			if ($roll == $setnum) {&#60;br /&#62;
				$bankroll = $bankroll + 35;&#60;br /&#62;
				# print &#34;W $roll $bankroll $rollcount\n&#34;;&#60;br /&#62;
				if ($bankroll &#38;gt; $high) {&#60;br /&#62;
					$high = $bankroll;&#60;br /&#62;
					}&#60;br /&#62;
				$notcrapped = 0;&#60;br /&#62;
				}&#60;/p&#62;
&#60;p&#62;			if ($roll == 7) {&#60;/p&#62;
&#60;p&#62;				if ($setnum == 4 &#124;&#124; $setnum == 10) {&#60;br /&#62;
					$bankroll = $bankroll - 20;&#60;br /&#62;
					}&#60;/p&#62;
&#60;p&#62;				if ($setnum == 5 &#124;&#124; $setnum == 9) {&#60;br /&#62;
					$bankroll = $bankroll - 25;&#60;br /&#62;
					}&#60;/p&#62;
&#60;p&#62;				if ($setnum == 6 &#124;&#124; $setnum == 8) {&#60;br /&#62;
					$bankroll = $bankroll - 30;&#60;br /&#62;
					}&#60;/p&#62;
&#60;p&#62;				# print &#34;L $roll $bankroll $rollcount\n&#34;;&#60;br /&#62;
				$notcrapped = 0;&#60;br /&#62;
				}&#60;br /&#62;
			}&#60;br /&#62;
		}	&#60;/p&#62;
&#60;p&#62;# Game ends when you have less than $5&#60;br /&#62;
	if ($bankroll &#38;lt; 5) {&#60;br /&#62;
		$losses = $losses + 1;&#60;br /&#62;
		$itson = 0;&#60;br /&#62;
		}&#60;/p&#62;
&#60;p&#62;# It also ends if youmake $1000&#60;br /&#62;
	if ($bankroll &#38;gt;= 1000) {&#60;br /&#62;
		$wins = $wins + 1;&#60;br /&#62;
		$itson = 0;&#60;br /&#62;
		}&#60;/p&#62;
&#60;p&#62;	}&#60;/p&#62;
&#60;p&#62;if ($high &#38;gt; $biggest) {&#60;br /&#62;
	$biggest = $high;&#60;br /&#62;
	}&#60;/p&#62;
&#60;p&#62;if ($rollcount &#38;gt; $mostrolls) {&#60;br /&#62;
	$mostrolls = $rollcount;&#60;br /&#62;
	}&#60;/p&#62;
&#60;p&#62;$bigrollcount = $bigrollcount + $rollcount;&#60;br /&#62;
$bighigh = $bighigh + $high;&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;print &#34;$iterations Iterations \n&#34;;&#60;br /&#62;
print &#34;Ave Rollcounts: &#34; . sprintf(&#34;%.3f&#34;, $bigrollcount/$iterations) . &#34;\n&#34;;&#60;br /&#62;
print &#34;Ave Rollcounts Hours: &#34; . sprintf(&#34;%.3f&#34;, int($bigrollcount/$iterations)/180) . &#34;\n&#34;;&#60;br /&#62;
print &#34;Most Rollcounts: $mostrolls\n&#34;;&#60;br /&#62;
# Most Rollcounts Days assumes 3 rolls/minute.&#60;br /&#62;
print &#34;Most Rollcounts Days: &#34; . sprintf(&#34;%.3f&#34;, ($mostrolls/180)/24) .&#34;\n&#34;;&#60;br /&#62;
print &#34;Ave Most Won: &#34; . ($bighigh/$iterations) . &#34;\n&#34;;&#60;br /&#62;
print &#34;Biggest Win: $biggest\n&#34;;&#60;br /&#62;
print &#34;$wins Wins &#124; $losses Losses&#34;;
&#60;/p&#62;</description>
</item>
<item>
<title>Dave on "Could not install service"</title>
<link>http://www.roth.net/forums/topic.php?id=285#post-607</link>
<pubDate>Tue, 17 Nov 2009 19:55:18 +0000</pubDate>
<dc:creator>Dave</dc:creator>
<guid isPermaLink="false">607@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;To perform any service maintenance (eg. install, remove, configure, start, stop, etc) you must be elevated. Make sure that the DOS window you use is elevated: Right click-&#38;gt;Run As Administrator.&#60;br /&#62;
Or&#60;br /&#62;
Click on the Start button and type (in the search box) &#34;cmd&#34;. When you see the search result with &#34;cmd.exe&#34; hold CTRL + SHIFT and hit enter. This is the same as &#34;Run As Administrator&#34;. &#60;/p&#62;
&#60;p&#62;Once you are in an elevated cmd process then try your script.
&#60;/p&#62;</description>
</item>
<item>
<title>SUBHASHINI B on "HOW DO YOU REDIRECT OUTPUT IN PERL"</title>
<link>http://www.roth.net/forums/topic.php?id=286#post-603</link>
<pubDate>Thu, 12 Nov 2009 22:35:59 +0000</pubDate>
<dc:creator>SUBHASHINI B</dc:creator>
<guid isPermaLink="false">603@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hello,&#60;br /&#62;
I have used the system command to execute a unix command in perl.Is there a way to redirect this output onto a file in perl.PLease do help.&#60;/p&#62;
&#60;p&#62;regards&#60;br /&#62;
Subhashini B
&#60;/p&#62;</description>
</item>
<item>
<title>andy on "Could not install service"</title>
<link>http://www.roth.net/forums/topic.php?id=285#post-602</link>
<pubDate>Wed, 11 Nov 2009 14:23:13 +0000</pubDate>
<dc:creator>andy</dc:creator>
<guid isPermaLink="false">602@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;i tried to install a Service many times but it won't work.&#60;/p&#62;
&#60;p&#62;There is always this error:&#60;br /&#62;
Failed to install the service [Scheduler]: Der Vorgang wurde erfolgreich beendet.&#60;/p&#62;
&#60;p&#62;Ok, it's a germen version of Windows Vista, so here's the translation:&#60;br /&#62;
Failed to install the service [Scheduler]: The action finished successful.&#60;/p&#62;
&#60;p&#62;But in the service list there is no entry for that service.&#60;/p&#62;
&#60;p&#62;I used that code:&#60;br /&#62;
&#60;a href=&#34;http://www.roth.net/forums/topic.php?id=187&#34; rel=&#34;nofollow&#34;&#62;http://www.roth.net/forums/topic.php?id=187&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Some idea what i could do?&#60;/p&#62;
&#60;p&#62;Thanks for help&#60;br /&#62;
Andy
&#60;/p&#62;</description>
</item>
<item>
<title>rochip on "Perl enclosing SQL fails"</title>
<link>http://www.roth.net/forums/topic.php?id=284#post-601</link>
<pubDate>Tue, 20 Oct 2009 18:30:12 +0000</pubDate>
<dc:creator>rochip</dc:creator>
<guid isPermaLink="false">601@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;I wrote a simple perl script as follows:&#60;/p&#62;
&#60;p&#62;#!/bin/perl -w&#60;/p&#62;
&#60;p&#62;open (FH,&#34;bsq -b &#38;lt;&#38;lt;EOSQL sp_help go EOSQL &#124;&#34;);&#60;br /&#62;
while(&#38;lt;FH&#38;gt;){&#60;br /&#62;
 print;&#60;br /&#62;
}&#60;br /&#62;
close FH;&#60;/p&#62;
&#60;p&#62;but when I execute the script I receive the following error message:&#60;/p&#62;
&#60;p&#62;&#38;lt;&#38;lt; was unexpected at this time.&#60;/p&#62;
&#60;p&#62;Please note I am running the script on Cygwin Environment with Perl v5.0.&#60;/p&#62;
&#60;p&#62;Any suggestions are much appreciated.
&#60;/p&#62;</description>
</item>
<item>
<title>Chad on "Win32::Daemon and multiple processes"</title>
<link>http://www.roth.net/forums/topic.php?id=25#post-599</link>
<pubDate>Sun, 13 Sep 2009 16:05:43 +0000</pubDate>
<dc:creator>Chad</dc:creator>
<guid isPermaLink="false">599@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hmm...I ran into this issue as well. I'll probably have to cave and use PerlSvc too. Where is the source for the daemon.dll though?
&#60;/p&#62;</description>
</item>
<item>
<title>artyaffe on "Excel Conditional Formatting using OLE"</title>
<link>http://www.roth.net/forums/topic.php?id=282#post-598</link>
<pubDate>Tue, 08 Sep 2009 21:25:31 +0000</pubDate>
<dc:creator>artyaffe</dc:creator>
<guid isPermaLink="false">598@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;I'm using Perl 5.8.9 and the following code doesn't seem to work. I'm pretty sure it's something I'm doing wrong. 700 lines of this program do just what I want them to do, but these three lines don't. I'm trying to set an excel Conditional Format.&#60;/p&#62;
&#60;p&#62;$WS is a Worksheet; $i is an integer - row number.&#60;br /&#62;
&#60;code&#62;&#60;br /&#62;
$WS-&#38;gt;Cells($i,11)-&#38;gt;FormatConditions -&#38;gt;Delete;&#60;br /&#62;
$WS-&#38;gt;Cells($i,11)-&#38;gt;FormatConditions-&#38;gt;Add(xlExpression,,&#34;=AND(J$i&#38;gt;0,K$i=0)&#34;);&#60;br /&#62;
$WS-&#38;gt;Cells($i,11)-&#38;gt;FormatConditions(1)-&#38;gt;Interior-&#38;gt;{ColorIndex} = xlYellow;&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Help!
&#60;/p&#62;</description>
</item>
<item>
<title>Liam72 on "Service to monitor serial port"</title>
<link>http://www.roth.net/forums/topic.php?id=281#post-597</link>
<pubDate>Sun, 23 Aug 2009 13:08:26 +0000</pubDate>
<dc:creator>Liam72</dc:creator>
<guid isPermaLink="false">597@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hi Dave,&#60;br /&#62;
I'm new to perl but I'm trying to write a script to monitor the serial port of a PC running Windows XP. I want this to run as a service that checks for input on serial port once every second (using the Win32::SerialPort module). When the serial port receives a signal a batch file is called, but the service continues monitoring the serial port.&#60;br /&#62;
Could your DirMon.pl sript be updated to handle this type of service?
&#60;/p&#62;</description>
</item>
<item>
<title>peter65 on "Updated: Win32::Daemon v20080324 beta"</title>
<link>http://www.roth.net/forums/topic.php?id=206#post-596</link>
<pubDate>Thu, 13 Aug 2009 02:16:37 +0000</pubDate>
<dc:creator>peter65</dc:creator>
<guid isPermaLink="false">596@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hi Dave,&#60;br /&#62;
you have forgotten to publish your bugfixes to Win32::Daemon since one and a half year! Please do it now.&#60;br /&#62;
Regards,&#60;br /&#62;
Peter
&#60;/p&#62;</description>
</item>
<item>
<title>Frylock on "Updated: Win32::Daemon v20080324 beta"</title>
<link>http://www.roth.net/forums/topic.php?id=206#post-595</link>
<pubDate>Wed, 12 Aug 2009 12:26:09 +0000</pubDate>
<dc:creator>Frylock</dc:creator>
<guid isPermaLink="false">595@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Quote from KES&#60;/p&#62;
&#60;p&#62;How to manually install:&#60;/p&#62;
&#60;p&#62;create  C:\Perl\site\lib\Win32\Daemon&#60;/p&#62;
&#60;p&#62;copy  test/* to C:\Perl\site\lib\Win32\Daemon&#60;/p&#62;
&#60;p&#62;copy daemon.htm history.txt Win32-daemon.ppd to  C:\Perl\site\lib\Win32\Daemon&#60;/p&#62;
&#60;p&#62;create  C:\Perl\site\lib\auto\Win32\Daemon\&#60;/p&#62;
&#60;p&#62;copy bin/* to  C:\Perl\site\lib\auto\Win32\Daemon\&#60;/p&#62;
&#60;p&#62;And you get working Win32::Daemon  for 5.10&#60;/p&#62;
&#60;p&#62;End Quote&#60;/p&#62;
&#60;p&#62;There was only one step missing from this, and it took me forever to find, you need to also copy over DAEMON.PM from the daemon_5.10 folder to C:\Perl\site\lib\Win32 folder&#60;/p&#62;
&#60;p&#62;Without this step, it doesn't recognize that Daemon is installed, at least not on my windows box. Hope this helps some other people
&#60;/p&#62;</description>
</item>
<item>
<title>BitMonkey on "Win32::Daemon 64 bit perl"</title>
<link>http://www.roth.net/forums/topic.php?id=186#post-594</link>
<pubDate>Mon, 03 Aug 2009 18:48:46 +0000</pubDate>
<dc:creator>BitMonkey</dc:creator>
<guid isPermaLink="false">594@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;jkstill - were you using 32-bit Perl or 64-bit Perl when you used the SysWOW64 cmd.exe?
&#60;/p&#62;</description>
</item>
<item>
<title>bryanscs on "Convert lower case to upper case at certain condition"</title>
<link>http://www.roth.net/forums/topic.php?id=280#post-593</link>
<pubDate>Fri, 31 Jul 2009 01:23:48 +0000</pubDate>
<dc:creator>bryanscs</dc:creator>
<guid isPermaLink="false">593@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hi,im new in perl,&#60;/p&#62;
&#60;p&#62;If i have a senteces like tis&#60;br /&#62;
&#34;abc def,ghi jkl,mno pqr&#34;&#60;br /&#62;
i wish to convert it to&#60;br /&#62;
&#34;ABC def,GHI jkl,MNO pqr&#34;&#60;br /&#62;
izzit related to the regular expression?&#60;br /&#62;
how should i do for the questino above?
&#60;/p&#62;</description>
</item>
<item>
<title>eigenfunctions on "Help installing Admin-Misc on Perl 5.10"</title>
<link>http://www.roth.net/forums/topic.php?id=235#post-592</link>
<pubDate>Tue, 28 Jul 2009 10:06:37 +0000</pubDate>
<dc:creator>eigenfunctions</dc:creator>
<guid isPermaLink="false">592@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;I'd like to know too. Win32::AdminMisc is very useful, but so is Perl 5.10.&#60;/p&#62;
&#60;p&#62;Can anyone help?
&#60;/p&#62;</description>
</item>
<item>
<title>marouf on "perl script to copy files from restricted location as admin"</title>
<link>http://www.roth.net/forums/topic.php?id=279#post-591</link>
<pubDate>Wed, 22 Jul 2009 13:47:08 +0000</pubDate>
<dc:creator>marouf</dc:creator>
<guid isPermaLink="false">591@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hello,&#60;br /&#62;
I'm newbe both on the forum and scripting. I'm trying to develop perl script will be used by normal users to copy files from a restricted location using admin id and encrypted password.&#60;br /&#62;
Any idea, help or sample script is greatly appreciated.&#60;br /&#62;
marouf
&#60;/p&#62;</description>
</item>
<item>
<title>Anonymous on "Win32::Perms::ResolveSid"</title>
<link>http://www.roth.net/forums/topic.php?id=278#post-590</link>
<pubDate>Tue, 30 Jun 2009 23:14:09 +0000</pubDate>
<dc:creator>Anonymous</dc:creator>
<guid isPermaLink="false">590@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Always fails with error code 0x000003e5 (Overlapped I/O operation is in progress).
&#60;/p&#62;</description>
</item>
<item>
<title>Anonymous on "Win32::Perms::ResolveSid"</title>
<link>http://www.roth.net/forums/topic.php?id=278#post-589</link>
<pubDate>Tue, 30 Jun 2009 10:45:05 +0000</pubDate>
<dc:creator>Anonymous</dc:creator>
<guid isPermaLink="false">589@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;I have script form Chapter 11 of Win32 Perl Programming, by David Roth. There is always error in line 09 .&#60;br /&#62;
I change var $Account so:&#60;br /&#62;
$Account ='\\\\$machine\\$user';&#60;br /&#62;
$Account ='$domain\\$user';&#60;br /&#62;
$Account ='$user';&#60;br /&#62;
No effect. There is always error in line 09 .&#60;br /&#62;
Where is my mistake?&#60;/p&#62;
&#60;p&#62;01. use Win32::Perms;&#60;br /&#62;
02. my $Domain = Win32::DomainName();&#60;br /&#62;
03. my $User = Win32::LoginName();&#60;br /&#62;
04. my $Account = sprintf( &#34;%s%s&#34;, ( &#34;&#34; ne $Domain )?&#60;br /&#62;
&#34;$Domain\\&#34;:&#34;&#34;, $User );&#60;br /&#62;
05. my %Sid = (&#60;br /&#62;
06.  text  =&#38;gt; &#34;&#34;,&#60;br /&#62;
07.  binary =&#38;gt; &#34;&#34;&#60;br /&#62;
08. );&#60;br /&#62;
09. if( $Sid{text} = Win32::Perms::ResolveSid( $Account, $Sid{binary} ) )&#60;br /&#62;
10. {&#60;br /&#62;
11.  print &#34;You are logged in as $Account.\n&#34;;&#60;br /&#62;
12.  print &#34;Your SID is: $Sid{text}\n&#34;;&#60;br /&#62;
13.  print &#34;Your binary SID is: '$Sid{binary}'\n&#34;;&#60;br /&#62;
14. }&#60;br /&#62;
15. else&#60;br /&#62;
16. {&#60;br /&#62;
17.  print &#34;\tCouldn't lookup the SID for $Domain\\$User: $^E\n&#34;;&#60;br /&#62;
18. }
&#60;/p&#62;</description>
</item>
<item>
<title>ceilingcat on "default folders for own scripts"</title>
<link>http://www.roth.net/forums/topic.php?id=277#post-588</link>
<pubDate>Fri, 19 Jun 2009 15:45:16 +0000</pubDate>
<dc:creator>ceilingcat</dc:creator>
<guid isPermaLink="false">588@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Is there a 'path' statement to tell Perl where I am storing my scripts.&#60;br /&#62;
Currently I am storing them in c:\perl\bin. This is messy.
&#60;/p&#62;</description>
</item>

</channel>
</rss>
