[15499] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2909 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Apr 30 14:05:23 2000

Date: Sun, 30 Apr 2000 11:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <957117910-v9-i2909@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sun, 30 Apr 2000     Volume: 9 Number: 2909

Today's topics:
    Re: Array/Hash - Newbie Questions <mhughes@nyx.net>
    Re: Array/Hash - Newbie Questions (Tad McClellan)
        Check existance of module <mc@backwoods.org>
    Re: Check existance of module <rootbeer@redcat.com>
        confusing backtracking fjherna@europa3.com
    Re: confusing backtracking <rootbeer@redcat.com>
        Emacs modules for Perl programming (Jari Aalto+mail.perl)
    Re: how to get a reference to an object's method and us <rootbeer@redcat.com>
    Re: how to get a reference to an object's method and us <flavell@mail.cern.ch>
    Re: how to measure processing time by millisecond unit <flavell@mail.cern.ch>
    Re: how to recognize Server's filename (for spooled fil <care227@attglobal.net>
    Re: how to recognize Server's filename (for spooled fil <yoonjung@cs.tamu.edu>
        How to test perl CGI scripts on my computer first? <ryanc@nci1.net>
    Re: How to test perl CGI scripts on my computer first? <dave@dave.org.uk>
    Re: How to test perl CGI scripts on my computer first? <wyzelli@yahoo.com>
    Re: How to test perl CGI scripts on my computer first? (Tad McClellan)
    Re: How to test perl CGI scripts on my computer first? <flavell@mail.cern.ch>
        How to use the shared object compiled by perlcc? <yslee925@iris.seed.net.tw>
    Re: Info about Backtracking in Regex fjherna@my-deja.com
        Installing Perl pamfae@my-deja.com
    Re: Installing Perl Paul.Radford@tesco.net
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 30 Apr 2000 07:31:19 -0600
From: Monica Hughes <mhughes@nyx.net>
Subject: Re: Array/Hash - Newbie Questions
Message-Id: <390C35A7.AD2A6172@nyx.net>



Pete Beatty wrote:
> 
> I am trying to understand Arrays and Hashes.  I am using the following code.
> @stations = (
>   [ "A",  [  1, 99],["Test1", "Function_Name_1"],
>              [100,101],["Test2", "Function_Name_2"]  ],
>   [ "B",  [  1, 10],["B-Test", "Function_B_1"]    ],
>   [ "X", [ 10, 50],["X-Test", "xFunction1", "xFunction2"]  ]
>      );
> 
> $i = @stations;
> print "Stations Length=$i\n";        #reports 3
> foreach $code(@stations)
> {
>     @tmp = $code;
>     $i = @tmp;
>     print "Entry Length=$i\n";         # reports 1
>     print "$code[0]\n";                    # reports 'blank', Remove '[0]'
> reports array
>   # needs additional looping for sub arrays
> }
> 
> What I want to do is simply process this type of array.  I have tried using
> a Hash and was unable to get anything to work.  I really do not understand
> them.  I then converted the data (@stations) to an array (@) instead of hash
> (%).  Everything compiled OK.  I just do not understand.  Would some kind
> sole proved me with some basic code that will simply process each element,
> and all sub elements.  I would really appreciate similar code for both Array
> and Hash processing.  I could then being my indepth study of the the two.

I am a newbie, so check this out yourself or wait for one of the real
gurus to answer.  For me the most helpful place to look for answers to
array/hash questions has been the Data Structures Cookbook.  There's a
copy at: http://language.perl.com/pdsc/index.html
I think the part you will find most helpful is at:
http://language.perl.com/pdsc/pdsc-1-verbose.html


------------------------------

Date: Sun, 30 Apr 2000 10:15:41 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Array/Hash - Newbie Questions
Message-Id: <slrn8gog0d.72l.tadmc@magna.metronet.com>

On Sun, 30 Apr 2000 10:48:18 +0100, Pete Beatty <petebeatty@csi.com> wrote:

>I am trying to understand Arrays and Hashes.

[ snip code ]

You are really trying to understand _multi level_ arrays and hashes.

   perldoc perlreftut

   perldoc perlref

   perldoc perllol

   perldoc perldsc


>What I want to do is simply process this type of array.  I have tried using
>a Hash and was unable to get anything to work.  I really do not understand
>them.  


You can often apply this simplistic approach to understanding
hashes:

   hashes are like arrays indexed by strings instead of numbers

So, instead of using '@' you use '%'

    instead of subscripting using [number] you use {string}


>Would some kind
>sole 


I'm not a fish, but I'll answer anyway  :-)


>proved me with some basic code that will simply process each element,
>and all sub elements.


For seeing the structure of multilevel data structures, see:

   perldoc Data::Dumper



---------------------------------
#!/usr/bin/perl -w
use strict;

my @stations = (
  [ "A",  
    [ 1, 99],
    ["Test1", "Function_Name_1"],
    [100, 101],
    ["Test2", "Function_Name_2"]  
  ],
  [ "B",  
    [  1, 10],
    ["B-Test", "Function_B_1"]    
  ],
  [ "X", 
    [ 10, 50],
    ["X-Test", "xFunction1", "xFunction2"]  
  ]
);


foreach my $aref1 ( @stations ) {          # first level anon arrays
   foreach my $aref2 ( @$aref1 ) {         # (maybe) second level
      if (ref $aref2) {
         foreach my $data ( @$aref2 ) {
            print "   $data\n";
         }
         print "\n";     # blank line between subarrays
      }
      else { 
         print "$aref2\n"   # NOT a reference
      }
   }
   print "-----------\n";
}
---------------------------------

output:

A
   1
   99

   Test1
   Function_Name_1

   100
   101

   Test2
   Function_Name_2

-----------
B
   1
   10

   B-Test
   Function_B_1

-----------
X
   10
   50

   X-Test
   xFunction1
   xFunction2

-----------



-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Sun, 30 Apr 2000 09:18:16 -0400
From: MC <mc@backwoods.org>
Subject: Check existance of module
Message-Id: <390C3298.A7E6F07C@backwoods.org>

How can I have a perl script check if a given module is installed and use it if
availailable or continue without it if its not there?

MC


------------------------------

Date: Sun, 30 Apr 2000 10:11:03 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Check existance of module
Message-Id: <Pine.GSO.4.10.10004300947260.1278-100000@user2.teleport.com>

On Sun, 30 Apr 2000, MC wrote:

> How can I have a perl script check if a given module is installed and
> use it if availailable or continue without it if its not there?

You probably want eval.

    eval q{ use Maybe qw/ :standard /; };
    if ($@) {
	print "Can't use module Maybe: $@\n";
	print "Well, I'll have to get along without it...\n";
	# Probably use another eval here to load replacement
	# functions, or whatever.
    }

The code alluded to in the comments above may not be trivial to write,
depending upon the module. I'm guessing that you may be wanting to write a
CGI program, although I may have guessed wrong. If you're wanting to make
a CGI program which exits cleanly even if some code isn't available, this
may help:

    #!/usr/bin/perl -w

    # Check for some required modules by loading their code
    # at compile time
    BEGIN {
	for (qw/ strict CGI Zibblefritz LWP::Simple /) {
	    eval qq{ use $_ (); };
	    if ($@) {
		print "Content-type: text/plain\n\n";
		print "Module '$_' failed to load: $@\n";
		exit;
	    }
	}
    }

    use strict;

    use CGI qw/ :standard /;
    use Zibblefritz;
    use LWP::Simple;

    print "Content-type: text/plain\n\n";
    print "All okay!\n";

That code won't catch all possible errors, but it should let you verify a
module's existence in most cases. Enjoy!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Sun, 30 Apr 2000 10:47:05 GMT
From: fjherna@europa3.com
Subject: confusing backtracking
Message-Id: <8eh2v8$1kd$1@nnrp1.deja.com>

Hi all,
I am really confused about this regex the string and the
resulting match.

 Let's consider the Regex:  /x([^/]|[^x]/)*x/
and the string:  /x d x//5 /x e x/

I have tested the Regex against the string (in Perl) and it
matches the full string, but when trying to explain
what backtrackings are done, I came to the conclusion
that the Regex will only match:  /x d x/

In order to explain the backtring I have considered
the following:

Numbering the Regex components from left to right:
/ will be 1st component of regex
x will be 2nd component of regex
Alternation will be the 3rd component of regex
x will be 4th component of regex
/ will be the 5th component of regex

Numbering the String positions from left to right:
/ will be the 1st position of the string
x will be the 2nd position of the string
SPACE will be the 3rd position of the string
d will be the 4th position
SPACE will be the 5th position
etc...

Now the steps in matching:
1.- 1st Regex Component "/" at 1st string position "/". It matches.
2.- 2nd Regex Comp. "x" at 2nd string posit. "x". It matches.
3.- 3rd Regex Comp.; it is an ALTERNATION with two options.
    3a.- Alternation "^/" at 3rd string posit. "SPACE". It matches.
4.- 3rd Regex Comp.
    4a.- Alternation "^/" at 4th string posit. "d". It matches.
5.- 3rd Regex Comp.
    5a.- Alternation "^/" at 5th string posit. "SPACE". It matches.
6.- 3rd Regex Comp.
    6a.- Alternation "^/" at 6th string posit. "x". It matches.
7.- 3rd Regex Comp.
    7a.- Alternation "^/" at 7th string posit. "/". It fails.
    7b.- Alternation "[^x]/" at 7th "/"
                             & 8th string posit. "/". It matches
8.- 3rd Regex Comp.
    8a.- Alternation "^/" at 9th string posit. "5". It matches.
9.- 3rd Regex Comp.
    9a.- Alternation "^/" at 10th string posit. "SPACE". It matches.
10.- 3rd Regex Comp.
    10a.- Alternation "^/" at 11th string posit. "/". It fails
    10b.- Alternation "[^x]/" at 11th "/"  (first part matches)
                             & 12th string posit. "/". (second
                             part fails). Alternation fails.
   Overal alternation fails.
   Match engine attempts next Regex component.
11.- 4th Regex Comp. "x" at 11th string posit. "/". It fails.
12.- 4th Regex Comp. "x" at 10th string posit. "SPACE". It fails.
13.- 4th Regex Comp. "x" at  9th string posit. "5". It fails.
14.- 4th Regex Comp. "x" at  8th string posit. "/". It fails.
15.- 4th Regex Comp. "x" at  7th string posit. "/". It fails.
16.- 4th Regex Comp. "x" at  6th string posit. "x". It matches.
17.- 5th Regex Comp. "/" at  7th string posit. "/". It matches.
 That is the end of Regex, so it is an Overall Regex Match and
that is all for a traditional NFA.

I must be missing something but I am not able to find it.

I have look at those places mentioned recently about Regex and
one Regex Book, but still unsolved.

Sorry for the length of the message.

Thanks in advance,

--
Javi,
Valencia (Spain)


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Sun, 30 Apr 2000 09:42:29 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: confusing backtracking
Message-Id: <Pine.GSO.4.10.10004300848090.1278-100000@user2.teleport.com>

On Sun, 30 Apr 2000 fjherna@europa3.com wrote:

>  Let's consider the Regex:  /x([^/]|[^x]/)*x/
> and the string:  /x d x//5 /x e x/

Okay, but let's quote the pattern so that folks won't think that the
slashes on the outside are the m// operator. Your pattern is inside the
braces of m{/x([^/]|[^x]/)*x/}. With comments, your pattern looks like
this:

    m{
	/x		# those two characters
	(
	  [^/]		# a char other than slash
	  |		# or
	  [^x]/		# a char other than x, followed by a slash
	)*		# zero or more times
	x/		# those two characters
    }x

> I have tested the Regex against the string (in Perl) and it
> matches the full string, but when trying to explain
> what backtrackings are done, I came to the conclusion
> that the Regex will only match:  /x d x/

I didn't understand your explanation, but here's one of my own. :-)

You know, it would be really cool if someone could make a program which
would trace the execution of a regular expression through a string in an
easy-to-understand visual way. Or at least, in this case, show how the
pattern managed to match the string. Well, I'll do my best on the latter.

Here is your string, broken into the pieces used by the RE engine in my
brain. (That engine is not completely compatible with Perl's, but it'll
have to do. :-)

    '/x'		# those two characters
    ' '  'd'  ' '  'x'	# some non-slash characters (alt. 1)
    '//'		# a non-x followed by a slash (alt. 2)
    '5'			# another non-slash character (alt. 1)
    ' /'		# another non-x followed by a slash (alt. 2)
    'x'  ' '  'e'  ' '	# more non-slash characters (alt. 1)
    'x/'		# those two characters

Everything except for the first and last chunks matches one or the other
alternitives from inside the parens.

Your confusion may have to do with this: If the engine matches one of a
set of alternatives, via the vertical bar, it saves the remaining
alternatives as possible backtracking points. That's how it was able to
match the ' /' (above) as a unit rather than as a non-slash character.

Does that help any?

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: 30 Apr 2000 14:27:43 GMT
From: <jari.aalto@poboxes.com> (Jari Aalto+mail.perl)
Subject: Emacs modules for Perl programming
Message-Id: <perl-faq/emacs-lisp-modules_957104767@rtfm.mit.edu>

Archive-name: perl-faq/emacs-lisp-modules
Posting-Frequency: 2 times a month
URL: http://home.eu.org/~jari/ema-keys.html
Maintainer: Jari Aalto <jari.aalto@poboxes.com>

Announcement: "What Emacs lisp modules can help with programming Perl"

    Preface

        Emacs is your friend if you have to do anything comcerning software
        development: It offers plug-in modules, written in Emacs lisp
        (elisp) language, that makes all your programmings wishes come
        true. Please introduce yourself to Emacs and your programming era
        will get a new light.

    Where to find Emacs

        XEmacs/Emacs, is available to various platforms:

        o   Unix:
            If you don't have one, bust your sysadm.
            http://www.gnu.org/software/emacs/emacs.html
            http://www.xemacs.org/
            Emacs resources at http://home.eu.org/~jari/emacs-elisp.html

        o   W9x/NT:
            http://www.gnu.org/software/emacs/windows/ntemacs.html

Emacs Perl Modules

    Cperl -- Perl programming mode

        .ftp://ftp.math.ohio-state.edu/pub/users/ilya/perl
        .<olson@mcs.anl.gov>           Bob Olson (started 1991)
        .<ilya@math.ohio-state.edu>    Ilya Zakharevich

        Major mode for editing perl files. Forget the default
        `perl-mode' that comes with Emacs, this is much better. Comes
        starndard in newest Emacs.

    TinyPerl -- Perl related utilities

        .http://home.eu.org/~jari/tiny-tools-beta.zip
        .http://home.eu.org/~jari/emacs-tiny-tools.html

        If you ever wonder how to deal with Perl POD pages or how to find
        documentation from all perl manpages, this package is for you.
        Couple of keystrokes and all the documentaion is in your hands.

        o   Instant function help: See documentation of `shift', `pop'...
        o   Show Perl manual pages in *pod* buffer
        o   Load source code into Emacs, like Devel::DProf.pm
        o   Grep through all Perl manpages (.pod)
        o   Follow POD manpage references to next pod page with TinyUrl
        o   Coloured pod pages with `font-lock'
        o   Separate `tiperl-pod-view-mode' for jumping topics and pages
            forward and backward in *pod* buffer.
        o   TinyUrl is used to jump to URLs (other pod pages, man pages etc)
            mentioned in POD pages. (It's a general URL minor mode)

    TinyIgrep -- Perl Code browsing and easy grepping

        [TinyIgrep is included in the tgz mentioned above]

        To grep from all installed Perl modules, define database to
        TinyIgrep. There is example in the tgz (ema-tigr.ini) that shows
        how to set up datatbases for Perl5, Perl4 whatever you have
        installed

        TinyIgrep calls Igrep.el to run the find for you, You can adjust
        recursive grep options, ignored case, add user grep options.

        You can get `igrep.el' module from <kevinr@ihs.com>. Ask for copy.
        Check also ftp://ftp.ihs.com/pub/kevinr/

    TinyCompile -- Browsing grep results in Emacs *compile* buffer

        TinyCompile is minor mode for *compile* buffer from where
        you can collapse unwanted lines, shorten the file URLs

            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file1:NNN: MATCHED TEXT
            /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/file2:NNN: MATCHED TEXT

            -->
            cd /asd/asd/asd/asd/ads/as/da/sd/as/as/asd/
            file1:NNN: MATCHED TEXT
            file1:NNN: MATCHED TEXT

End



------------------------------

Date: Sun, 30 Apr 2000 08:39:05 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: how to get a reference to an object's method and use it?
Message-Id: <Pine.GSO.4.10.10004300837040.1278-100000@user2.teleport.com>

On Sun, 30 Apr 2000, steve wrote:

> The reason I wanted to get a reference to a CGI.pm object's method is
> I need to process either POST or GET in the same script depending on
> query->request_method()  .  To get POST parameters, I call
> query->param()  and for GET parameters I call query->url_param(). So I
> figure, I'd set a reference to either the param()  or the url_param()
> method depending if it's a POST or GET and work from the reference.

That sounds like way too much work. Doesn't param() work automatically in
either case? Unless I'm missing something....

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Sun, 30 Apr 2000 18:04:51 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: how to get a reference to an object's method and use it?
Message-Id: <Pine.GHP.4.21.0004301752410.29786-100000@hpplus01.cern.ch>

On Sun, 30 Apr 2000, steve wrote:

[much quotage, now radically snipped]

> Tom Phoenix wrote:

> > Instead, use the function-oriented interface:

> I think I'll take your suggestion and use the function-oriented interface:

No dispute there...

> I am a long time cgi-lib.pl user, but for no particular reason decided to
> try CGI.pm for my current project.

You should, you should.

> I really don't care for the OO feature of CGI.pm and it's size.

Its size isn't really an issue.  It has various tricks up its sleeve
to promote efficiency.  If your scripts have response-time problems
then you need to be looking at other parts of the setup in order to
solve that.

> The reason I wanted to get a reference to a CGI.pm object's method is
> I need to process either POST or GET in the same script depending
> on   query->request_method()  .  To get POST parameters, I call
> query->param()   and for GET parameters I call  query->url_param().

I think you've taken a wrong path at some point and can't see the wood
for the trees.  If you're using GET and POST in a normal way, then
CGI.pm will give you your query parameters transparently, you don't
need to even check which method is in use, just use them.

There's an obscure bit in the CGI.pm documentation, "Mixing POST and
URL Parameters", that discusses the use of a query string in
conjunction with POST, which it appears you must have been looking at.  
I'd say quite simply "don't do that", and then you won't need to worry
about it.

Did you even need to look at the param() string yourself anyway?
CGI.pm parses it for you and offers it to you in a more digestible
form, which is ideal for many purposes.  Perhaps if you'd say more
about what you're trying to achieve, rather than concentrating on some
details of how you're struggling to achieve it, you might get some
better advice on that.

good luck



------------------------------

Date: Sun, 30 Apr 2000 15:03:19 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: how to measure processing time by millisecond unit
Message-Id: <Pine.GHP.4.21.0004301315020.23859-100000@hpplus01.cern.ch>

On Sun, 30 Apr 2000 jbellack@my-deja.com wrote:

> > Please support your claim.  While it's certainly possible to achieve
> > that in a well-controlled environment, we're talking here about real
> > life server job mix situations, as I understand it.
> 
> Well, it seemed to me that Andrea was saying that time measurements
> below one second weren't useful in a real-world situation.

I recognize that I had overstated the case, sorry.  Certainly it is
possible to produce figures that are useful on a sub-second
granularity in appropriate situations.  I reiterate however that
millisecond granularity on some arbitrary real-world system whose
configuration we haven't discussed, would be inadvisable.

> The data we collected was most valuable in 100ms intervals,

No contest.

> but I would
> prefer to have a benchmark that has extra significant digits that I can
> ignore,

That's why I recommended designing a benchmark that does not depend on
measuring individual time intervals to millisecond accuracy.

Apropos benchmarking, I'm reminded of a particularly classic occasion,
I guess it would have been around 15 years back, where there had been
concern about one program that was taking about 3-4 days to run on
what was then a powerful (and expensive!) central mainframe.  
Considerable effort had been put, we were told, into producing
execution profiles of the program, then hand-optimising some of the
bottlenecks, and had achieved a saving of 10-20% overall.  Then along
came someone who understood the problem itself, and realised that the
algorithm being used was entirely unsuitable.  The program was
re-written from scratch to a more appropriate algorithm, and a run of
the new program took significantly less than 1 hour (about 40 minutes
if my memory serves me right).

> > And pay attention to your posting style.  
[..]
> I responded to this comment in private.

I note that you claim not to be a clueless AOL type, but in fact to
have been disregarding the netiquette in this way since 1991.  Deja
seems to tell a curious story, but it would be inappropriate to pursue
that line of discussion. Mention of the killfile was no "vague threat"
as you put it; it was a promise, of more comfortable usenetting for
both sides.

-- 

Partake of distilled wisdom of Usenet - read the FAQs.
Before you ask.






------------------------------

Date: Sun, 30 Apr 2000 11:20:56 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: how to recognize Server's filename (for spooled files) in  file-upload using cgi-lib(2.18)
Message-Id: <390C4F58.5FC4AAD5@attglobal.net>

You'l get a much warmer response in the newsgroup
comp.infosystems.www.authoring.cgi

This question is better suited to that group.

HTH

yoon wrote:
> 
> I found that if I can use CGI.param,I can do the same things as what I
> wanted by looking at the documentation.
> However, I would like to why I can't get the server's file name when I used
> cgi.lib.
> 
> Thanks!


------------------------------

Date: Sun, 30 Apr 2000 05:31:35 -0500
From: "yoon" <yoonjung@cs.tamu.edu>
Subject: Re: how to recognize Server's filename (for spooled files) in file-upload using cgi-lib(2.18)
Message-Id: <8eh1ij$rf2$1@news.tamu.edu>

I found that if I can use CGI.param,I can do the same things as what I
wanted by looking at the documentation.
However, I would like to why I can't get the server's file name when I used
cgi.lib.

Thanks!





------------------------------

Date: Sun, 30 Apr 2000 07:05:15 -0400
From: "Ryan & Treena Carrier" <ryanc@nci1.net>
Subject: How to test perl CGI scripts on my computer first?
Message-Id: <390c132e_1@news.cybertours.com>

I'm trying to figure out how to set my computer up so I can write some CGI
scripts in Perl and test them on my computer before posting them to my
internet web server.

I've tried setting up Personal Web Server (I'm running Windows 98) but my
computer locks up when trying to start the Transaction Server, so I had to
uninstall it.

HELP!




------------------------------

Date: Sun, 30 Apr 2000 15:52:16 +0100
From: Dave Cross <dave@dave.org.uk>
Subject: Re: How to test perl CGI scripts on my computer first?
Message-Id: <c0iogssadetk7v46u89kr6m1rm8q74ngts@4ax.com>

On Sun, 30 Apr 2000 07:05:15 -0400, "Ryan & Treena Carrier"
<ryanc@nci1.net> wrote:

>I'm trying to figure out how to set my computer up so I can write some CGI
>scripts in Perl and test them on my computer before posting them to my
>internet web server.
>
>I've tried setting up Personal Web Server (I'm running Windows 98) but my
>computer locks up when trying to start the Transaction Server, so I had to
>uninstall it.

You sohlud really be asking this question in a CGI newsgroup - or
perhaps one that deals with PC-based web servers.

The best solution would be to install Linux on your PC as this comes
with both Apache and Perl together with many other useful tools.

The next best approach would be to download and install the Win32
version of Apache from <http://www,apache.org> and ActivePerl from
<http://www.activestate.com>.

hth,

Dave...

-- 
<http://www.dave.org.uk>  SMS: sms@dave.org.uk
YAPC::Europe - London, 22 - 24 Sep <http://www.yapc.org/Europe/>

"There ain't half been some clever bastards" - Ian Dury [RIP]


------------------------------

Date: Mon, 1 May 2000 00:33:40 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: How to test perl CGI scripts on my computer first?
Message-Id: <GXXO4.7$237.1122@vic.nntp.telstra.net>


Dave Cross <dave@dave.org.uk> wrote in message
news:c0iogssadetk7v46u89kr6m1rm8q74ngts@4ax.com...
> On Sun, 30 Apr 2000 07:05:15 -0400, "Ryan & Treena Carrier"
> <ryanc@nci1.net> wrote:
>
> The best solution would be to install Linux on your PC as this comes
> with both Apache and Perl together with many other useful tools.
>

What Crap!

"Your application doesn't work, so change your operating system!"

Not only do you have to cope with learning a programming language and an
interface, but a completely different OS as well!

There are plenty of Windows based Web servers to choose from which can be
installed and work just fine.  PWS just happens to be one of the worst.

The next piece of advice is good, (ie apache for win32 or microweb or xitami
etc etc etc).  Also Perlbuilder gives a cgi testing environment as does
cgi.pm (it provides for command line testing).

After that little rant, the other comment is also true, this is really a
better question for a server based group.  (BTW Activestate's FAQ - supplied
with the install - has a usefule section on configuring various servers to
run with Perl).

Wyzelli




------------------------------

Date: Sun, 30 Apr 2000 09:25:32 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How to test perl CGI scripts on my computer first?
Message-Id: <slrn8god2c.72l.tadmc@magna.metronet.com>

On Sun, 30 Apr 2000 07:05:15 -0400, Ryan & Treena Carrier <ryanc@nci1.net> wrote:
>I'm trying to figure out how to set my computer up so I can write some CGI
>scripts in Perl and test them on my computer before posting them to my
>internet web server.


Since you are using CGI.pm, you can get one level of testing
by running your CGI program from the command line, and entering
form values yourself (or redirect them from a file).

To get the most realistic testing environment, you need to
get a WWW server installed.


>I've tried setting up Personal Web Server (I'm running Windows 98) but my
>computer locks up when trying to start the Transaction Server, so I had to
>uninstall it.


Try:     http://www.apache.org/dist/binaries/win32/


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Sun, 30 Apr 2000 17:49:03 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: How to test perl CGI scripts on my computer first?
Message-Id: <Pine.GHP.4.21.0004301732020.29786-100000@hpplus01.cern.ch>


This is really the wrong group for this discussion, but as others
are putting their spoke in, then I'll risk adding my 2p ...

On Sun, 30 Apr 2000, Dave Cross wrote:

> The best solution would be to install Linux on your PC as this comes
> with both Apache and Perl together with many other useful tools.

Given a level playing field, that might very well be the case, but I
doubt that it's particularly helpful to the questioner.

> The next best approach would be to download and install the Win32
> version of Apache from 
                 <http://www.apache.org>   (typo corrected)

   - specifically http://www.apache.org/docs/windows.html

That would definitely be my recommendation.  There's a bit of a
learning curve, but it's not so bad if you focus on your specific
requirements, and leave alone all of the myriad options that Apache
_can_ support.  I had ActiveState Perl and Win32 Apache downloaded and
installed and running a "hallo world" CGI script in half an hour or so
on Win95.  Admittedly I have previous unix-based Apache experience,
but I'm not aware of having actually needed that.

Main thing is that one would be learning skills that are portable to
other situations, since Apache is so widely used and supported, and
has so many options available that you might later discover you
wanted to use.

By reputation, PWS is crabby and quite untypical of web servers in
general, so whatever one learns in coming to terms with it would seem
to be a dead-end. I can't speak to that personally, but I see no
reason to _not_ go with Apache, if you don't have a definite reason
that justifies choosing some other server.  The caveat on the Apache
pages that the Win32 port is "not as stable" is nothing to worry
about, it is just an illustration of what high standards the Apache
folks set themselves.

good luck to the O.P, cheers




------------------------------

Date: Sun, 30 Apr 2000 20:35:33 +0800
From: "Li, Yi-Shin" <yslee925@iris.seed.net.tw>
Subject: How to use the shared object compiled by perlcc?
Message-Id: <8eh88q$cra@netnews.hinet.net>

In my system (perl 5.6 and 5.005.03), the doc of
perlcc says :

Typing 'perlcc a.p' compiles the code inside a.p into a
standalone executable, and perlcc A.pm will compile into a
shared object, A.so, suitable for inclusion into a perl
program via "use A".

I could compile the A.pm into A.so, but I can't use
it with the command "use A". Is it the problem of me
or perlcc ?

Here is the example code of mine :
----------------------------
(test.pl)
use DynaLoader;
use A;
print A::True(),"\n";
----------------------------
(A.pm)
package A;
sub True { return(1); }
1;
----------------------------

Step1: perlcc A.pm ==> successly create A.so
Step2: mv A.pm B.pm
Step3: perl test.pl ==> error, message:

Can't locate A.pm in @INC (@INC contains:
/usr/local/lib/perl5/5.6.0/i586-linux
/usr/local/lib/perl5/5.6.0 /usr/local/lib/perl5/site_perl/5.6.0/i586-linux
/usr/
local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl .) at test.pl
lin
e 2.
BEGIN failed--compilation aborted at test.pl line 2.

---------------------------
My question is "How to use the .so file created by perlcc ?"

Thanks in Advance,

==
yslee




------------------------------

Date: Sun, 30 Apr 2000 10:41:54 GMT
From: fjherna@my-deja.com
Subject: Re: Info about Backtracking in Regex
Message-Id: <8eh2lh$14g$1@nnrp1.deja.com>

In article
<Pine.GSO.4.10.10004280704560.21722-100000@user2.teleport.com>,
  Tom Phoenix <rootbeer@redcat.com> wrote:
> On Fri, 28 Apr 2000, Javier Hernandez wrote:
> > I am interesting in understanding the
backtracking process
> > in Regex.
> > I am actually reading "Mastering Regular
Expressions" but
> Okay; just what do you need to know that's not
covered in MRE? It's a
> pretty thorough book, although there's always
more depth to the problem.

Hi Tom,
Thanks for replying.
I have not problem with MRE book, in fact I am
reading it now
and my problem is at page 170 where Jeffrey left
open at
"backtracking that can be confusing" and I am
really confused
about it.
I have followed all links I have found about regex
but still
I can not understand it. I wondered if I could
find another
place where to understand better backtring.

Best regards,


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Sun, 30 Apr 2000 12:16:52 GMT
From: pamfae@my-deja.com
Subject: Installing Perl
Message-Id: <8eh87f$6m2$1@nnrp1.deja.com>

Hello,

I am sorry if this question has been asked five million times. Believe
me, I searched for help before asking.

I have installed activestate perl build 613 to my win98 operating
system. In program manager the only thing I see is "Documentation". I
don't know what my next step is.

I went to the ActiveState site, as well as many other areas with FAQs
and none seem to offer basic 'what do I do next' information.

Also, activestate says the build needs a ppm fix. I downloaded that,
and followed directions as nearly as I could without progress. Could
someone please inform me exactly what to do next?

Do I have to use the compiler/interpreter from a dos command prompt? I
tried doing that with ppmfix and got error messages. But I think that
is my own ignorance of dos, because I couldn't get a simple text file
to display either.

(I was under the impression that you just typed the path of the file,
and it's name if it's text, for DOS to print out? No?) Please help me.

Thank you.


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: Sun, 30 Apr 2000 13:30:54 GMT
From: Paul.Radford@tesco.net
Subject: Re: Installing Perl
Message-Id: <8ehcie$aon$1@nnrp1.deja.com>

In article <8eh87f$6m2$1@nnrp1.deja.com>,
  pamfae@my-deja.com wrote:
> Hello,
>
> I am sorry if this question has been asked five million times. Believe
> me, I searched for help before asking.
>
> I have installed activestate perl build 613 to my win98 operating
> system. In program manager the only thing I see is "Documentation". I
> don't know what my next step is.
>
> I went to the ActiveState site, as well as many other areas with FAQs
> and none seem to offer basic 'what do I do next' information.
>
> Also, activestate says the build needs a ppm fix. I downloaded that,
> and followed directions as nearly as I could without progress. Could
> someone please inform me exactly what to do next?
>
> Do I have to use the compiler/interpreter from a dos command prompt? I
> tried doing that with ppmfix and got error messages. But I think that
> is my own ignorance of dos, because I couldn't get a simple text file
> to display either.
>
> (I was under the impression that you just typed the path of the file,
> and it's name if it's text, for DOS to print out? No?) Please help me.
>
> Thank you.
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

If the installation was correct you should be able to double click a
*.pl file and windows will start perl with this script.

Did you use 'perl <Drive>\<Path>\<Script>` from a DOS prompt. If you
did check that perl.exe is in your path statement.  To do that
type 'echo %path%' at a DOS prompt the list of directories which is now
shown should contain the one in which the perl.exe resides.

If you need futher help feel free to mail me.  I'm no expert but I'll
try and help.


Sent via Deja.com http://www.deja.com/
Before you buy.


------------------------------

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 2909
**************************************


home help back first fref pref prev next nref lref last post