[11536] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5136 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 15 07:07:31 1999

Date: Mon, 15 Mar 99 04:00:18 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 15 Mar 1999     Volume: 8 Number: 5136

Today's topics:
        ActivePerl Win32 PPM and DBD-Sybase package <neil_marks@uk.ibm.com>
    Re: Are negative array indeces allowed? <Philip.Newton@datenrevision.de>
    Re: Bit vectors <sb@sdm.de>
    Re: Can a PARENT NOT wait on a CHILD Process? HOW? <zenin@bawdycaste.org>
    Re: Crypt-SSLeay - a general problem for us Windows fol <nkh@dksin.dk>
        hashes ???????? pdz@barclab.com
        Help...this worked under 4.036 but doesn't under 5.x (Oskar Itzinger)
    Re: Help...this worked under 4.036 but doesn't under 5. (Bart Lateur)
    Re: HELP: #$ARGV is -1 <Philip.Newton@datenrevision.de>
    Re: HTML parse problem <jimbo@soundimages.co.uk>
    Re: Module to find duplicate files? <Philip.Newton@datenrevision.de>
    Re: perl Development tools <ldrigger@olemiss.edu>
        Perl Keeps reading the A: drive gthia@rocketmail.com
    Re: Printing a Copyright character <Philip.Newton@datenrevision.de>
    Re: RAD or WYSIWIG for Perl ??? (Arved Sandstrom)
        Scalar/array question (John )
    Re: searching a flat file database <thrase@slip.net>
    Re: searching a flat file database Alister.clpm@minotaur.nu
    Re: Testing CGI scripts on a standalone c4jgurney@my-dejanews.com
        unlink a filename with spaces aonghus.onia@ucg.ie
    Re: unlink a filename with spaces <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: use and require compile time and runtime <zenin@bawdycaste.org>
        viewing contents of *.html files <amwalker@gate.net>
    Re: viewing contents of *.html files <Tony.Curtis+usenet@vcpc.univie.ac.at>
        Where to pull old version of DBD and DBI ? <marvinyn@ms12.hinet.net>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 15 Mar 1999 11:50:43 +0000
From: Neil Marks <neil_marks@uk.ibm.com>
Subject: ActivePerl Win32 PPM and DBD-Sybase package
Message-Id: <36ECF413.91B104C8@uk.ibm.com>

I've downloaded and attempted to install the above package with PPM, but
everytime I run ppm I get the following error messages:
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Writing D:\Perl\site\lib/auto/DBD-Sybase/.packlist
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.
Attribute VERSION=" missing an ending quote.

Yes... it's repeated several times... I've looked at the ppd file and it
appears to be correctly formatted. See extract below!
<SOFTPKG NAME="DBD-Sybase" VERSION="0,13,0,0">
 <TITLE>DBD-Sybase</TITLE>
 <ABSTRACT>DBI driver for Sybase datasources</ABSTRACT>
 <AUTHOR>Michael Peppler (mpeppler@mbay.net)</AUTHOR>
 <IMPLEMENTATION>
  <OS NAME="MSWin32" />
  <ARCHITECTURE NAME="MSWin32-x86-object" />
  <CODEBASE HREF="x86/DBD-Sybase.tar.gz" />
 </IMPLEMENTATION>
</SOFTPKG>

Does anyone have any clues as why this is happening??
Thanks,
Neil



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

Date: Mon, 15 Mar 1999 09:35:44 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Are negative array indeces allowed?
Message-Id: <36ECC660.C2739D30@datenrevision.de>

Abigail wrote:
> 
> Abigail
> --
> perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
> 0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
> =>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
> !$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'

Thanks for this bit of September code! Now I don't have to roll my own
to figure out the current date :)

Cheers,
Philip


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

Date: 15 Mar 1999 10:07:16 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Bit vectors
Message-Id: <7cim4k$13$1@solti3.sdm.de>

In article <36EB3132.9D87C99E@sprynet.com>, prauz <prauz@sprynet.com> wrote:

> I saw at amazon.com an interview with Tom Christiansen and he mentioned
> 'bit vectors' as a powerful, but little publicized feature of perl.
> Anyone info on them ?

Download http://www.engelschall.com/u/sb/download/pkg/Bit-Vector-5.6.tar.gz
(or from http://www.perl.com/CPAN/authors/id/STBEY/Bit-Vector-5.6.tar.gz).

Unpack it with WinZip (on Win32 systems) or with
    gunzip -c Bit-Vector-5.6.tar.gz | tar xf -
(on Unix systems).

Then follow the installation instructions in INSTALL.txt.

This assumes that you already have Perl installed.
If not and in case you need assistance, mail me back.

Hope this helps.

Regards,
-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/download/    (Free Perl and C Software
    http://www.perl.com/CPAN/authors/id/STBEY/         for Download)
    New: Build'n'Play 2.1.0 (all-purpose Unix batch installation tool)
    http://www.oreilly.de/catalog/perlmodger/bnp.html


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

Date: 15 Mar 1999 08:21:01 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Can a PARENT NOT wait on a CHILD Process? HOW?
Message-Id: <921486280.344809@thrush.omix.com>

[posted & mailed]

info@multilinks.net wrote:
: Hi, I work with Agni who posted this info request.  I have been trying to
: figure out how to set non-buffering on the filehandle as you suggested.  I
: am trying
:
: open(LPR,"|$subprog", O_NONBLOCK) || die "can't fork $subprog: $!\n";

	First, O_NONBLOCK is an open(2) flag, you'd need to use Perl's
	sysopen() to access it.  Secondly and probably more important, it
	doens't have anything to do with buffering.  See setvbuf() in the
	IO::Handle module if you need that, but you probably don't (read
	on).

: but this is reporting "too many parameters".  I have also tried:
: open(LPR,"|$subprog") || die "can't fork $subprog: $!\n"; $|=1;

	Setting $| turns on auto-flushing (which isn't quite the same
	as non-buffered) for the currently selected file handle.  This may
	be good enough for your use, but you'd need to do it like this:

	open LPR, "|$subprog"
	    or die "can't fork '$subprog': $!, stopped";
	{
	    my $temp = select LPR;
	    $|++;
	    select $temp;
	}

: but this does not change the result - ie. the parent still waits on the
: child.

	Yep.

: Just to expand on what we are trying to do. I am using a web based input
: form. The parent takes in the info does some checking and sends it to the
: child to do a long process.  I want the parent to report a message back to
: the browser (Your request is being processed) before the child completes.

	You'll probably need to do something a bit more manual in this case
	then a simple piped open().  Something maybe like:

	local (*LPR, *FROM_PARENT);
	pipe FROM_PARENT, LPR;   
	my $pid = fork();
	defined $pid or die "fork(): $!";
	if ($pid == 0) {
	    unless (fork) {
	        open STDIN, "<&FROM_PARENT"
	            or die "dup(): $!";
	        close LPR
	            or die "close pipe: $!";
	        close STDOUT
	            or die "close: $!";
	        exec $subprog
	            or die "exec(): $!";
	    }
	    exit 0;
	}
	else {
	    close FROM_PARENT
	        or die "close pipe: $!";
	    waitpid $pid, 0;
	}

	print LPR "some stuff";
	close LPR
	    or die "close pipe: $!";

	__END__

	HTH

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Mon, 15 Mar 1999 09:36:47 +0100
From: "Niels K. Handest" <nkh@dksin.dk>
Subject: Re: Crypt-SSLeay - a general problem for us Windows folk!
Message-Id: <36ECC69F.3D0D@dksin.dk>

Witless wrote:
> 
> I have read many postings stating that the Crypt-SSLeay module is needed for
> HTTPS access. I do not have a C compiler on my Win98 system to build it, can
> someone with the binary please email it to me @ phtan@bigfoot.com

As I see it, this is actually a general problem for us Windows-folks:
How the *beeeb* do you install a perl-module on this platform. I've
looked a couple of places but so far I haven't been able to figure this
out. I have absolutely nothing against UNIX (its great!) but
occasionally I have to work on a Win98 machine.

Cpan itself -- while being a greate source -- is not much help in this
regard:

You've got to gunzip and tar -xf the downloaded file first. These tools
aren't readible available for Windows. Then you've got to run the
Makemaker.PL. The would be ok if not for the fact that you have to run
make afterwards. Make is not a general Windows-utility either.

Granted, I could possible find these tools somewhere on the Net. But why
not make installing a simple process in the first place?! As Larry is so
fond of saying: One of the virtues of a good programmet is to be lazy!
:^)

	- Niels

====================
Niels K. Handest
Work e-mail: nkh@dksin.dk
Home e-mail: Niels.K.H@ndest.dk


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

Date: Mon, 15 Mar 1999 10:52:22 GMT
From: pdz@barclab.com
Subject: hashes ????????
Message-Id: <7ciop4$ga1$1@nnrp1.dejanews.com>

Can anyone explain how hashes works, and how to use them.
Thanks

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 15 Mar 1999 10:27:43 GMT
From: oskar@opec.org (Oskar Itzinger)
Subject: Help...this worked under 4.036 but doesn't under 5.x
Message-Id: <7cin50$ll7$1@fleetstreet.Austria.EU.net>


Under Perl 4.0.36, the following piece of code worked
and would set eg, with an argument of -xac, both variables
$A and $AC:

while ( $ARGV[0] =~ /^-/ ) {            
    $_ = shift ;
    if( /-x(.*)/ ){
        if( $1 =~ /^a/ ){ $A++; }
        if( $1 =~ /^ab/ ){ $AB++; }
        if( $1 =~ /^ac/ ){ $AC++; }
        if( $1 =~ /^ad/ ){ $AD++; }
        next ; }
}

Under Perl 5.x, only variable $A is set.

What changed in Perl 5.x which causes the different
behavior?

Thanks.

/oskar



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

Date: Mon, 15 Mar 1999 10:58:17 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Help...this worked under 4.036 but doesn't under 5.x
Message-Id: <36ece395.5136750@news.skynet.be>

Oskar Itzinger wrote:

>Under Perl 4.0.36, the following piece of code worked
>and would set eg, with an argument of -xac, both variables
>$A and $AC:
>
>while ( $ARGV[0] =~ /^-/ ) {            
>    $_ = shift ;
>    if( /-x(.*)/ ){
>        if( $1 =~ /^a/ ){ $A++; }
>        if( $1 =~ /^ab/ ){ $AB++; }
>        if( $1 =~ /^ac/ ){ $AC++; }
>        if( $1 =~ /^ad/ ){ $AD++; }
>        next ; }
>}
>
>Under Perl 5.x, only variable $A is set.

You should save the contents of $1 to an uncorruptable variable. I
expect $1 to be changed (reset to undef) with every succesful pattern
match.

If this did indeed work in 4.036, this should have been mentioned in the
4<->5 compatibility problems docs (perltrap.pod). At least, I couldn't
find it.

  while ( $ARGV[0] =~ /^-/ ) {            
      $_ = shift ;
      if( /-x(.*)/ ){
          my $submatch = $1;
          if( $submatch =~ /^a/ ){ $A++; }
          if( $submatch =~ /^ab/ ){ $AB++; }
          if( $submatch =~ /^ac/ ){ $AC++; }
          if( $submatch =~ /^ad/ ){ $AD++; }
          next ; }
  }

	Bart.


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

Date: Mon, 15 Mar 1999 09:52:49 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: HELP: #$ARGV is -1
Message-Id: <36ECCA61.2FE8B791@datenrevision.de>

Mark Sholund wrote:
> 
> Okay, I was wrong, it's almost the length of @ARGV.  That's the result of
> responding while going out the door.  $#ARGV is the index of the last
> element in @ARGV so I was one off.

No; to be pedantic: you were abs($[-1) off :)

Cheers,
Philip


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

Date: 15 Mar 1999 08:03:32 +0000
From: Jim Brewer <jimbo@soundimages.co.uk>
Subject: Re: HTML parse problem
Message-Id: <u7lsj41t7.fsf@jimbosntserver.soundimages.co.uk>

ehood@medusa.acs.uci.edu (Earl Hood) writes:

> >The ISO SGML Standards, for a start. The quotes may be omitted when
> >the attribute value contains only text characters (also as defined by
> >ISO SGML) with no intervening white space. Attribute values which
> 
> Not completely accurate.  The literal start/end characters (commonly
> the quote characters) can be ommitted if the attribute value is
> comprised only of NAME characters.  Hence, according to the SGML
> standard, quotes may need to be used even if there is no whitespace.

You are correct, my error. I was trying to point out the ommission of
quotes (or start/end characters if defined otherwise) is an optional
feature to designed to minimize markup. Which probably has its genesis
in the days when all markup was applied by hand. Unlike today's SGML
environments that do the work behind the scenes without the author's
intervention.

> Nope.  When it comes to the various attribute value list types
> (name list, number list, et al), the SPACE character is used to
> separate values.
> 
> If you are talking about CDATA attributes, SGML has not concept
> of a list for these attributes, so any "list" notation is up to
> the application.

How the comma crept in is beyond me. I did mean whitespace. I did mean
attribute list in SGML terms. Doing two many things at one time. Which
for me is one.

> 
> >Further, standards are standards. HTML and XML are both SGML
> >applications.
> 
> Wrong (you need to some reading up).
> 
> HTML can be expressed as an SGML application.
> XML is a formal subset of SGML.

I mean appplication in the generic sense of the word. As in HTML and
XML both apply SGML to solve a particular class of problem. Not that
XML is itself an SGML application. Simply that any SGML solution is
bounded by the SGML standard when applying SGML to any
problem. Whether, in this particular case, that problem is the
definition of a markup language or the creation of a formal subset.
-- 
Jim Brewer
e-mailed courtesy copies are unappreciated, please refrain.


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

Date: Mon, 15 Mar 1999 09:14:42 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Module to find duplicate files?
Message-Id: <36ECC172.DC202A30@datenrevision.de>

Tad McClellan wrote:
> 
>    Judging by his code, I think he is trying to find duplicate
>    *filenames*, not duplicate files as he said.

That's right. Checking whether files with the same name have the same
size and contents would be the cherry, on the cake, though.

>    Of course, he should expect to get what he specified, even
>    if what he specified is not what he wants  :-)

:) <rueful grin>

Thanks for your help.

Cheers,
Philip


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

Date: Thu, 11 Mar 1999 19:10:16 -0600
From: Les <ldrigger@olemiss.edu>
Subject: Re: perl Development tools
Message-Id: <36E86978.CDBBA1F@olemiss.edu>

Ted wrote:
> 
> I'm looking for some good perl development tools to run on my linux box. I
> am obviously a newbie at both perl and linux, so any suggestions would be
> much appreciated. Thanks
> 
> thanks,
> Ted
> 
> ted@fatkids.com
> ted@slapfactory.com
> eroden1@uic.edu


I recommend learning vi/vim. I use vim on Linux, Win95 and WinNT.
It took some effort on my part, coming from UltraEdit and such, but 
it was well worth it.

Some of vim's benefits that I like:
1) Syntax coloring
2) Highly configurable
3) Free
4) Works on multiple platforms
5) Free

Les


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

Date: Mon, 15 Mar 1999 08:03:49 GMT
From: gthia@rocketmail.com
Subject: Perl Keeps reading the A: drive
Message-Id: <7ciet1$7l6$1@nnrp1.dejanews.com>

After creating a perl program and run it in
Win95 (using Perl for Win32 Build 316),  my
floppy drive keeps spinning first and then
starts the normal execution of the perl program.

Does anybody know why? Sort of irritating as the
drive spining is quite noisy.

Please reply via email.

Thanks a million!

George

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 15 Mar 1999 09:39:42 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Printing a Copyright character
Message-Id: <36ECC74E.91D0C1D6@datenrevision.de>

Staffan Liljas wrote:
> 
> Jonathan Stowe wrote:
> >
> > On Fri, 12 Mar 1999 12:11:38 -0500 Dave Abramowitz wrote:
> > > Is there a way to print the copyright character (the c inside a circle)?
> >
> > The ISO 8859-1 character code for that character is 169.
> >
> > The Perl function for printing a character from its value is chr().
> 
> And in html, &copy; should work.

If, of course, the browser which will end up rendering your HTML under-
stands the entity &copy; -- I believe not all do.

Cheers,
Philip


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

Date: Mon, 15 Mar 1999 06:51:10 -0400
From: Arved_37@chebucto.ns.ca (Arved Sandstrom)
Subject: Re: RAD or WYSIWIG for Perl ???
Message-Id: <Arved_37-1503990651100001@dyip-104.chebucto.ns.ca>

In article <7cgn67$qkb$1@samsara0.mindspring.com>, "Steve Davis"
<stevo@steve.com> wrote:

> RAD or WYSIWIG for Perl ???
> 
> Does it exist??

WYSIWYG doesn't exist per se, not if you're thinking of stuff like
VisualBasic, but if you're thinking of building GUI's (not the same thing,
of course), there are plenty of options for those. Begs the question,
exactly what do you mean by WYSIWYG when you're not doing GUI's? :-)

RAD? Interpreted code, easy to stub stuff and test fragments, a gadzillion
modules available to do this and that, yada yada. This isn't RAD enough
for you?

To me it sounds like your mindset is in GUI land. WYSIWYG + RAD there is
synonymous with application frameworks. The most application framework I
need when using Perl is h2xs and a pencil and paper. :-)

Arved


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

Date: Mon, 15 Mar 1999 11:34:33 GMT
From: kjc@nospam.co.uk (John )
Subject: Scalar/array question
Message-Id: <36ecef46.11096488@news.freeserve.net>

Just wondered if anyone knows
how after i read a file into an
array and then modify the elements
so they are in double quotes?

Example :

line 1 of file is :
Hello world
Line 2:
Hello again
etc...

But i want then in the array as "Hello  world"
and "Hello again" respectively.

John









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

Date: Mon, 15 Mar 1999 00:16:29 -0800
From: Paul Cameron <thrase@slip.net>
To: William Herrera <wherrera@lynxview.com>
Subject: Re: searching a flat file database
Message-Id: <36ECC1DD.D3686F45@slip.net>

William Herrera wrote:

> On Sun, 14 Mar 1999 14:15:44 -0500, "Winfield Henry"
> <winfieldh@mindspring.com> wrote:
>
> >I have made a great perl/cgi script to search and ascii txt file '|'
> >delimited. Works great using a single word/phrase search key. What I need to
> >be able to do is break up the search key and search for the words
> >individually. Heres an example using cars. the database would look like
> >
> >year|make|model|color
> >
> >The input search string would be
> >
> >'1990 ford explorer'
>
> Ah, the custom database seach. Just wrote one two weeks ago.
>
> You need to read the perlfaq6 FAQ on this under
> /perl/html/lib/pod/perlfaq6.html#How_do_I_efficiently_match_many_
>
> The AND is easy if you can keep the order the same, just link the
> phrase in a regex that allows stuff between the words in the search.

What do you mean ? When you say AND, you mean boolean and ? What are you and'ing together ? What
'order' are you talking about ? What phrase are you linking ? What kind of regex are you generating ?
Does it have any nasty exponential backtracking properties ? Do you often have conversations without
any context whatsoever ? :-)

> If you find a really fast way (read: doesn't require any extra loops)
> of doing the same when the words in the seach may be in _any_ order,
> let me know. I have a way, but it is slow and looks too much like the
> way the FAQ says is to be avoided :(.

I'd really like to help you with your problem if I could ... but you are not making any sense. Can you
please explain your problem more thoroughly ?

I'll make some guesses:

1) You have an array of words which you want matched in a string,
   in the order the words are in the array.

One way (tmtowtdi) is this:

$search = "Catbert Dilbert Dogbert Ratbert PHB";

@search = qw(catbert dogbert phb);

$func_text = join " && ", map "\$search =~ m[\\G.*\\b$_\\b]gi", @search;
$func = eval "sub { my \$return = $func_text; pos \$search = 0; \$return }";
die "Could not compile: $@\n$func_text\n" if $@;

print "Matched\n" if &$func;

Now, if @search contained 'catbert phb dogbert', then this wouldn't match at all, since phb comes after
dogbert in the string, not before.

This seems reasonably fast. Using Benchmark.pm, it was 3.8s for 100000 iterations. Funky.

Oh, and make sure the stuff in @search is really text, slipping code to do evil things to your system
in there is quite easy (use quotemeta, or tr?).

2) You have an array of words, and you want all words to be matched in the
   string

Well, you could split the string by anything not a character, stuff all the words in a hash, and check
if each word you want searched for exists in this hash, or you could simply do what is in perlfaq6 (the
example from MRE).

Or you could look on page 181 of PCB for nice tutorial on it.

But, come to think of it, you should probably already know how to do that, since you referred the other
person to perlfaq6.

Cheers, Paul.



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

Date: Mon, 15 Mar 1999 10:29:42 GMT
From: Alister.clpm@minotaur.nu
Subject: Re: searching a flat file database
Message-Id: <36ef4c52.46603284@158.152.254.70>

"Winfield Henry" <winfieldh@mindspring.com> wrote:

>I'll have to say Perl is really a neat language and I am enjoying learning it.
>I have made a great perl/cgi script to search and ascii txt file '|'
>delimited. Works great using a single word/phrase search key. What I need to
>be able to do is break up the search key and search for the words
>individually. Heres an example using cars. the database would look like

>year|make|model|color
>The input search string would be
>'1990 ford explorer'

You could use DBI/DBD::CSV and so on, but if there will only be a
couple hundred or so records I'd recommend 'Sprite.pm' (and a 5 minute
guide to SQL).  More than 500 or so records you'd probably want a
'real' database anyway (MySQL always come high on that list), probably
still with DBI and the relevant driver.

I also put together a sample car database system, with Sprite (and
CGI.pm) - and had some relatively complicated searches within the hour
of first installing Sprite (it's also a drop in and it's working
module, one .PM, the DBI's are good, but nowhere near as easy to
install).

I'm also using Selena Sol's CSV style DB to great effect on a couple
of sites, but it's a lot more work to get it going properly.

Alister
-- 
  Here in the UK, the LINX is currently considering [a warning] to inform 
customers ... about the type of material that can be found on the Internet.
  At the latest meeting I suggested:  "WARNING: May contain nuts!"
richard@turnpike.com (Richard Clayton) Msg-ID: <Sd4f.73b4@netfunny.com>


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

Date: Mon, 15 Mar 1999 09:37:30 GMT
From: c4jgurney@my-dejanews.com
Subject: Re: Testing CGI scripts on a standalone
Message-Id: <7cikcp$cqg$1@nnrp1.dejanews.com>

In article <RSt6zBALNl62EwCc@goforit.demon.co.uk>,
  Doc <Doc@goforit.demon.co.uk> wrote:
> I am new to CGI scripting and am writing a script to produce web pages
> from a database - no problem there.  But, I would like to be able to
> test the programme on my PC rather than have to use my provider's
> server!

It's really easy to get a server up and running on your PC (provided you have
TCP/IP installed on it - which you can get from the OS CD).

Check out either Apache http://www.apache.org/

or Xitami http://www.imatix.com/

Both are free.

Xitami is the easier of the two to set up (it ran straight from the
installation file) but Apache is probably what your provider is using. The
only other difference I've found is that Apache requires the shebang line
(#!) and xitami doesn't.

Good Luck

Jeremy Gurney
SAS Programmer - Proteus Molecular Design Ltd.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Mon, 15 Mar 1999 09:56:45 GMT
From: aonghus.onia@ucg.ie
Subject: unlink a filename with spaces
Message-Id: <7cilgq$dm5$1@nnrp1.dejanews.com>

is it possible to unlink a file with a name ($file) that contains spaces

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 15 Mar 1999 11:13:03 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: unlink a filename with spaces
Message-Id: <83k8wjgixc.fsf@vcpc.univie.ac.at>

Re: unlink a filename with spaces, aonghus
<aonghus.onia@ucg.ie> said:

aonghus> is it possible to unlink a file with a name
aonghus> ($file) that contains spaces [?]

Yes!

You mean to say it was easier to post this article
than actually write a one-line perl program to try
this out yourself?

tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: 15 Mar 1999 08:34:51 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: use and require compile time and runtime
Message-Id: <921487109.710448@thrush.omix.com>

Kevin Howe <khowe@performance-net.com> wrote:
: The advantage of USE is that it happens at "compile time" instead of "run
: time" like REQUIRE does. What the heck is the difference?
: What is "compile time" and why is it better?

	#!/usr/local/bin/perl -w
	...code blagh blagh blagh code...
	...more code...
	require "some_file.pl";

	The file "some_file.pl" is not read or parsed or anything until
	the execution of your program actually gets to that part of the
	code, ala at "run time".

	#!/usr/local/bin/perl -w
	...code blagh blagh blagh code...
	...more code...
	use SomeModule;

	The file "SomeModule.pm" is read and parsed *before* any lines of
	your program are run at all, ala at "compile time".  Compile time is
	the time when the perl interpreter is reading your code and figuring
	what it should do, but has not actually run it yet.

	See also:
		perldoc -q "What's the difference between require and use?"

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Mon, 15 Mar 1999 05:47:58 -0500
From: Aaron Walker <amwalker@gate.net>
Subject: viewing contents of *.html files
Message-Id: <36ECE55E.BCF0B736@gate.net>

I have a simple perl CGI script that views a file given in
QUERY_STRING...
for example:  to view a file called /home/john/lala.txt, you would type
in:
http://servername/cgi-bin/viewfile.pl?file=/home/john/lala.txt

this is the source:
--
#!/usr/bin/perl
require("cgi-lib.pl");

print "Content-type: text/html\n\n";

&ReadParse(*input);
open(FILE, $input{'file'});
@contents = <FILE>;
close(FILE);

print @contents;
--

now this works fine and dandy, unless the file I want to view is a html
file.  I don't want to view the HTML itself, but rather the actual html
source.  Is this possible to do?  If so, how?

Thanks for the help,
Aaron Walker



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

Date: 15 Mar 1999 12:05:04 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: viewing contents of *.html files
Message-Id: <83r9qrt3mn.fsf@vcpc.univie.ac.at>

Re: viewing contents of *.html files, Aaron
<amwalker@gate.net> said:

Aaron> I have a simple perl CGI script that views a
Aaron> file given in QUERY_STRING...  for example:
Aaron> to view a file called /home/john/lala.txt,
Aaron> you would type in:
Aaron> http://servername/cgi-bin/viewfile.pl?file=/home/john/lala.txt

Think very carefully about this - do you really want
to allow people to download arbitrary files from the
machine hosting the server?  (e.g. /etc/passwd).

Aaron> this is the source: -- #!/usr/bin/perl
Aaron> require("cgi-lib.pl");

CGI.pm is preferred these days...

Aaron> print "Content-type: text/html\n\n";

Aaron> &ReadParse(*input); open(FILE,
Aaron> $input{'file'}); @contents = <FILE>;
Aaron> close(FILE);

Unchecked open().

Aaron> print @contents; --

Aaron> now this works fine and dandy, unless the
Aaron> file I want to view is a html file.  I don't
Aaron> want to view the HTML itself, but rather the
Aaron> actual html source.  Is this possible to do?
Aaron> If so, how?

You're outputting a stream of type text/html.
Therefore the other end (e.g. browser) is going to
interpret whatever comes down that socket as an HTML
document.

A type of text/plain is probably what you want.

    use CGI;
    print header('text/plain');

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Mon, 15 Mar 1999 15:40:50 +0800
From: Marvine YN <marvinyn@ms12.hinet.net>
Subject: Where to pull old version of DBD and DBI ?
Message-Id: <36ECB982.4BF3@ms12.hinet.net>

Where to pull old version as the following :

DBI before 0.81 version
DBD before 0.44 version


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 5136
**************************************

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