RE: Active Perl and custom (simple) modules - differences from linux?

2006-06-08 Thread Hicks, Robert
>-Original Message-

>I have developed a set of scripts on linux that run fine, but I'm
>testing out on Windows XP with Apache and ActivePerl, and I've hit a
>(probably very simple) problem.
>
>Put simply, I have a file db.pm which defines a function thus:
>
>
>sub db
>{
>my $user="xxx";
>my $password="xxx";
>my $database="xxx";
>my $hostname="localhost";
>
>my $dsn = "dbi:mysql:$database;$hostname";
>my $dbh = DBI->connect($dsn, $user, $password) or die $!;
>return $dbh;
>}
>
>
>and in my script switchboard.pl I have
>
>
>#!/usr/bin/perl
>
>use strict;
>use db;
>
>my $dbh=db;
>
>
>
>All this works fine on linux, but not on Windows.  I get:
>
>[error] [client 127.0.0.1] Bareword "db" not allowed while "strict
subs"
>in use at ...
>
>After a bit of searching around, I changed the line to: my $dbh=db();
>
>This causes a different error:
>
>[error] [client 127.0.0.1] Bareword "db" not allowed while "strict
subs"
>in use at ...
>[error] [client 127.0.0.1] Undefined subroutine &main::db called at ...
>
>
>Can anyone see what is wrong?

I believe that it cannot see your db.pm, so you need to add it to your
lib path.

Something like:

use lib qw( ./ );

HTH

:Robert

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: ActivePerl 5.8.7.815 released

2006-03-07 Thread Hicks, Robert
I would have thought the next one would have been based on Perl 5.8.8?
Or is it too soon for that one?

Robert

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: I need your opinion: perl vs php

2006-02-27 Thread Hicks, Robert
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:perl-win32-
> [EMAIL PROTECTED] On Behalf Of Peter Eisengrein
> Sent: Monday, February 27, 2006 8:12 AM
> To: perl-win32-users@listserv.ActiveState.com
> Subject: RE: I need your opinion: perl vs php
> 
> >
> > How wedded are you MySQL ? I personally would use it only for
> > situations where there was a single user connecting at a time
> > (or at most only a few) and data integrity is not important.
> > MySQL lacks too many features of a reliable database for me
> > to trust it.
> >

That is hogwash. There are many large websites using MySQL as a backend.
That may have been true in the 3 series but the 4 and 5 series are
really good.

See http://www.mysql.com/customers/ for a list.

I do not use MySQL, I use Oracle. There isn't anything that would make
me hesitate in using the current stable MySQL version though.

> 
> I don't want to get too far OT but I am in a similar situation as
Jaime and
> was also planning to use MySQL. This is the first time I've seen or
heard
> any comments like this and wanted to "poll the audience" to see what
people
> think and if Greg's sentiments are the norm.
> 
> Thanks

MySQL is fine. You are going to get an answer based mostly on the
posters db "prejudice". Pg is more like an "Oracle" where you really
need to have some db knowledge. MySQL is easier to use and admin (IMO).

Perl + MySQL (or Pg) and Template-Toolkit is a very sweet combination.
TT lets you separate design and code. If you are looking at a CGI setup
I would recommend CGI::Application + Template-Toolkit. I have had very
good results using TT alone and with CGI::Application.

Do some research, find out for yourself though.

Robert

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: When ActivePerl 5.8.8 out?

2006-02-23 Thread Hicks, Robert
> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:perl-win32-
> [EMAIL PROTECTED] On Behalf Of Jan Dubois
> Sent: Thursday, February 23, 2006 11:29 AM
> To: [EMAIL PROTECTED]; perl-win32-users@listserv.ActiveState.com
> Subject: RE: When ActivePerl 5.8.8 out?
> 
> On Wed, 22 Feb 2006, [EMAIL PROTECTED] wrote:
> > I'm waiting for the latest version, When ActivePerl 5.8.8 will be
out?
> 
> Soon :)
> 
I started to write "when it is ready".  :)

Robert

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: PPM error

2006-02-01 Thread Hicks, Robert
>From the ActiveState docs:

Under Windows XP

   1. Open the Control Panel and click the System icon.
  The System Properties dialog is displayed.
   2. On the Advanced tab, click on Environment Variables.
  The Environment Variables dialog is displayed.
   3. Click New in the System variables panel.
  The New Sytem Variable dialog is displayed.
   4. Add the setting HTTP_proxy, with your proxy name as the value.
You must include "http://"; and the proxy port, if applicable; for
example, "http://proxy:8080/";.
   5. If you require a user name and/or password to access your
proxy, click New again to add each of the settings HTTP_proxy_user and
HTTP_proxy_pass, with your user name and password as the respective
values.

Under Windows 200x

   1. Right click on My Computer.
   2. Click on Properties and select the Advanced tab.
   3. Click "Environment Variables".
  The "System Variables" dialog appears.

   4. Click New, and add the setting HTTP_proxy, with your proxy
name as the value (you must include "http://";), followed by a colon and
the proxy port, if applicable; e.g., "http://proxy:8080/";
   5. If you require a user name and/or password to access your
proxy, click New again to add each of the settings HTTP_proxy_user and
HTTP_proxy_pass, with your user name and password as the respective
values.

Under Windows NT

   1. Right click on My Computer.
   2. Click on Properties, select the Environment tab.
   3. Add the setting HTTP_proxy, with your proxy name as the value
(you must include "http://";), followed by a colon and the proxy port, if
applicable; for example, "http://proxy:8080/";
   4. If you require a user name and/or password to access your
proxy, add the settings HTTP_proxy_user and HTTP_proxy_pass, with your
user name and password as the respective values.

Under Windows 98/ME

   1. Select Start > Run to open the Run dialog, enter msconfig in
the Open field and then click OK.
  The System Configuration Utility dialog is displayed.
   2. Click on the Autoexec.bat tab, and add the following entries:
  * SET HTTP_proxy=http://";, followed by a colon and the proxy port, if applicable; e.g.,
SET HTTP_proxy=http://proxy:8080/
  * SET HTTP_proxy_user= (if required)
  * SET HTTP_proxy_pass= (if required)
   3. Click OK to save these settings.
  The System Settings Change dialog is displayed.
   4. Click Yes to restart your computer so that the changes take
effect.

Under Windows 95
In your AUTOEXEC.BAT file, place the following lines then reboot so
the changes can take effect:

   1. SET HTTP_proxy=http://";,
followed by a colon and the proxy port, if applicable; e.g., SET
HTTP_proxy=http://proxy:8080/
   2. SET HTTP_proxy_user= (if required)
   3. SET HTTP_proxy_pass= (if required)


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: Hello! Help me please!

2006-01-05 Thread Hicks, Robert
=== your code ===

use HTTP::Request;
use LWP::UserAgent;

$content=getContent('http://127.0.0.1/index.htm');
@html=split(/\n/,$content); 
for(@html)
{
  do
  {
    $2 and push(@link,$2);
  }while m
    {
  <\s*A\s+HRE\s*=\s*(['''])(.*?)\l\s*>
    }gsix;
  print "All links in this page:\n";
  for(@link)
  {
    print $_,"\n";
  }
  print "Visit all links in this page: \n";
  for(@link)
  {
    if(!(m~^http://~))
    {
  $url='http://127.0.0.1/'.$_ ;
  $content=getContent($url);
  print<<"EOF";
  content of this $url is:
  $content
  EOF
    }

==

I believe that if you inline a heredoc like that the contents of the heredoc 
have to be left aligned all the way to the left margin. If you find that too 
ugly you can factor out the heredocs into a constant and then use the constant 
name in the actual code.

Robert

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: True Story

2005-12-05 Thread Hicks, Robert
> -Original Message-
> I used to work in retail and one day I was visited by an entire
> family in camo. I stood there for awhile looking past them and finally
> one of them spoke. I jumped, looked him in the eye, and exclaimed,
> "Wow. I didn't see you guys!"
> 
> He didn't get it. :)
> 

Where I live, they would have shot you first and asked the question
later! : )

Robert

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs