Any Perl that works offline from WinXP desktop?

M

M.L.

Hi. I haven't used Perl for a while and am just trying to get back
into the groove. I'm looking for a Perl program that will allow me to
execute Perl scripts offline on my WinXP desktop. I'd like to be able
to read and write to files on my desktop without installing a server
or being connected to the Internet.

I looked at the ActiveState Perl program and noticed an implementation
of Perlscript via HTML. Can that Perlscript write to and store files
on my desktop? I remember a program called WinPerl that let me
execute Perl from my desktop but I can't find that app anymore. Any
help here will be appreciated. Thanks.
 
A

A. Sinan Unur

Hi. I haven't used Perl for a while and am just trying to get back
into the groove. I'm looking for a Perl program that will allow me to
execute Perl scripts offline on my WinXP desktop. I'd like to be able
to read and write to files on my desktop without installing a server
or being connected to the Internet.

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.
I looked at the ActiveState Perl program and noticed an implementation
of Perlscript via HTML.
http://aspn.activestate.com/ASPN/docs/ActivePerl/Components/Windows/PerlScr
ipt.html

Can that Perlscript write to and store files on my desktop?

That would _probably_ require you to lower security settings which I
wouldn't recommend. But then, I don't really know.
I remember a program called WinPerl that let me execute Perl
from my desktop but I can't find that app anymore.

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
 
J

Jürgen Exner

M.L. said:
Hi. I haven't used Perl for a while and am just trying to get back
into the groove. I'm looking for a Perl program that will allow me to
execute Perl scripts offline on my WinXP desktop. I'd like to be able
to read and write to files on my desktop without installing a server
or being connected to the Internet.

The Perl interpreter doesn't need a "server" (what kind of server?) or an
"Internet connection" to run. Why would you think it does? After all, Perl
is not PHP.
Just install a standard Perl installation and run your programs. Or do you
also require a 'server' to compile and run C programs?
I looked at the ActiveState Perl program and noticed an implementation
of Perlscript via HTML. Can that Perlscript write to and store files
on my desktop?

Why do you want to complicate things? Using PerlScript adds a least two
additional layers of complexity to your Perl development, not to mention
that Perl and PerlScript are two different (although related) programming
languages.
I remember a program called WinPerl that let me
execute Perl from my desktop but I can't find that app anymore. Any
help here will be appreciated. Thanks.

Why don't you just use the standard simple straightforward perl interpreter?

jue
 
M

Matt Garrish

M.L. said:
Hi. I haven't used Perl for a while and am just trying to get back
into the groove. I'm looking for a Perl program that will allow me to
execute Perl scripts offline on my WinXP desktop. I'd like to be able
to read and write to files on my desktop without installing a server
or being connected to the Internet.

You've never needed a server to run Perl scripts. What exactly is it you're
trying to do? Run cgi scripts without a server? If so, and in particular if
you're using the CGI module, you can test them from the command line. Please
see the documentation:

http://stein.cshl.org/WWW/software/CGI/#debugging

Matt
 
B

Brian McCauley

M.L. said:
Hi. I haven't used Perl for a while and am just trying to get back
into the groove. I'm looking for a Perl program that will allow me to
execute Perl scripts offline on my WinXP desktop.

All that is required is the Perl interpreter.

However I'm guessing to me that you are confusing Perl and CGI. If you
are looking for a browser that can execute CGI scripts locally then
that's anther matter (and lot related to Perl). But if you want to run
GCI scripts you are probably better off installing a web server.
I'd like to be able
to read and write to files on my desktop without installing a server
or being connected to the Internet.

The desktop is just a directory. A program running on you local
computer can open files in a directly. And what do you have against
installing a web server. You've got WinXP for cying out loud! If you've
got enough excess resource to run that sort of bloat-ware why shy away
from adding a small web server program?
I looked at the ActiveState Perl program and noticed an implementation
of Perlscript via HTML. Can that Perlscript write to and store files
on my desktop?

Perlscript is not very widely used. It can be used to implement client
side scripting in HTML. However client side scripting in HTML pages is
generally not allowed to interact with your local filesystem -
otherwise web sites could read all your files.
I remember a program called WinPerl that let me
execute Perl from my desktop but I can't find that app anymore. Any
help here will be appreciated. Thanks.

If you put a Perl script (with a .pl suffix) on your desktop and have
ActivePerl intalled then simply double clicking on it will execute it.

However I suspect that you mean something else when you say "execute
Perl from my desktop". Tell us what that is and we may be able to help you.
 
M

M.L.

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 :)
 
E

Eric Schwartz

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.

Er, perlfaq9 is all about networking. I don't see anything
Windows-specific in it. And hey, I dunno, having the documentation in
HTML format, accessible right off your Start menu sounds fairly
Windows-ish to me, but then, I don't use it, so perhaps I'm just
biased.
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.

I don't understand what you mean by "pointing to a directory" ? If
you mean loading modules, 'use lib' works just as well on Windows as
it does anywhere else. If you mean binaries, well, perl.exe doesn't
care what paths you pass to it, so I'm very confused as to what you
could be having trouble with. A specific command line, or snippet of
code, and the error message it generates would help.
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.

I quote, from the ActivePerl FAQ, which took me maybe 20 seconds to
find from the moment I went to http://www.activestate.com/:

"To use these package repositories you start PPM v3 and at the prompt type:

repository add NAME URL

where NAME is a name by which you want to reference the repository
from PPM and URL is the URL to the repository."

Clearly "repository add Local file:///path/to/local/repository/" is
what you'd want.

As for creating a repository, maybe 10 seconds with Google searching
for "ppm create local repository" gave me

http://aspn.activestate.com/ASPN/Mail/Message/ppm/2103534

Which points out that a ppm repository is just a collection of files,
so you just need to fetch all of them somehow (rsync, wget,
LWP::Simple, whatever), and then see above for using them.

No offense intended, but given that it took me less than a minute,
total, to figure out the answers to your questions, and I don't even
use ActivePerl, I can only conclude you didn't look very hard. As a
rule, clpm regulars don't respond well to questions that evince a lack
of effort on the querent's part to answer the questions themselves.

And if you have a problem with something, a specific error message is
worth a thousand times what a vague statement like "I still have
trouble getting Perl to point to any directory that is off the
c:\Perl\site\lib path". Without code, and the actual error message
Perl prints out, we can only guess, and my ESP's been on the fritz for
a few decades now.

I'll let someone more familiar with AnyData critique your code, though
I would point out that these days, you should 'use warnings;' instead
of -w, and you should always 'use strict;'. FWIW, that's a very good
example-- a short snippet of code, and the exact error message it
generates is invaluable.

-=Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top