A. Sinan Unur said:
You do not need a web server to be able to execute Perl scripts. If you
installed ActiveState Perl, it will associate files with .pl extension with
the perl binary and you will be able to execute them by double-clicking on
the script's icon or name in Explorer. However, I do not recommend this
unless your script actually use a GUI to interact with the user. Instead,
open a command window and execute scripts from there.
You can test CGI scripts from the command line as well but for best
results, I would recommend installing Apache on your machine. You can
configure it to only respond to requsts from your machine on a non-standard
port.
That would _probably_ require you to lower security settings which I
wouldn't recommend. But then, I don't really know.
Maybe you are looking for a Perl IDE. It is not my cup of tea, but I have
heard people mention Open PerlIDE:
http://open-perl-ide.sourceforge.net/
You might also want to look at:
http://faq.perl.org/perlfaq3.html#How_can_I_get_perl_t
http://faq.perl.org/perlfaq3.html#Can_I_write_useful_P
http://faq.perl.org/perlfaq9.html#My_CGI_script_runs_f
And maybe read the full FAQ if you are trying to become up to date.
Sinan
Hello again. First I'd like to thank everyone who replied. One of the
reasons for my late response is that I only have occasional Internet
access for now. The problem will be fixed in a few months, but for now
I am constrained to work offline most of the time. So I'm trying to do
as much as I can while offline.
What am I trying to do? Simple. I want to use AnyData to slurp my
inventory data from Excel (or jpeg IPTC info) and use it to replace
variables within an HTML catalog template. I want to automate the
process of building a separate web page for each inventory item; I
know from experience that Perl is well-suited for that task. I also
hoped that the project could be built and executed offline. I've
already tried some off-the-shelf Windows programs but they aren't as
flexible as I'd like. Since the project is largely visual, I prefer
not to depend on a command line implementation. It is important that I
see the results on a web page, so yes, I'm trying to run a cgi script
offline.
Based on the advice I've received in this thread I've overcome some of
my fright of installing a server and downloaded the Open Perl IDE and
the Indigostar Perl all-in-one IDE package. I think the Open Perl IDE
is the one I've used before, and found it adequate for my offline
needs. I also need to download nmake, among other things.
Comments:
ActivePerl documentation is too Linux/Unix oriented,and stingy with
info critical to Windows users. FAQ9 is the only one geared toward
Win32 development with Perl. I still have trouble getting Perl to
point to any directory that is off the c:\Perl\site\lib path. I'd like
to run some test files from my external hard drive but can't get the
pointing right.
When I tried to use PPM to install a module it informed me that I must
be connected to the Internet, even though the documentation hinted
that repositories could be located on my hard drive. It didn't mention
anything more on using PPM offline.
The latest version of Perl gave me a "pseudo-hashes deprecated" error
when I ran an AnyData test script that used to work years ago:
**********************************************************
#!/usr/bin/perl5 -w
$| = 1;
use FindBin;
use lib "$FindBin::Bin/perl/site/lib";
use CGI qw

standard);
use CGI::Carp qw(fatalsToBrowser);
use Fcntl qw

flock);
#use Text::CSV;
use AnyData;
# Create an HTML page to display a message.
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>Test</TITLE></HEAD><BODY>";
print "<H1>";
print "TEST";
print "</H1>";
print "<HR>";
print "Hooray! It works!";
print "<HR>";
$category = 'Watches';
$db_file = "bstoredb.csv";
$db_rows = adTie('CSV',$db_file,'r'); # tie database
to hash
$cat_rows = $db_rows->{{category=>$category}};
while(my $row = (each %$cat_rows))
{
print qq|$row<br>\n|; # this line causes pseudo-hash error
}
print "</BODY></HTML>";
*********************************************************
The "Hooray..." part displays on the command line, but the rest of the
display does not. I've downloaded the latest version of AnyData and
hope the POD examples show me how to avoid the pseudo-hashes errors.
Thanks again to all who replied. I'm going to get busy with Perl
tonight
