[7700] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1326 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Nov 16 23:17:28 1997

Date: Sun, 16 Nov 97 20:00:25 -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           Sun, 16 Nov 1997     Volume: 8 Number: 1326

Today's topics:
     A Very Simple Perl Script <mgb@nbnet.nb.ca>
     Re: A Very Simple Perl Script (Jeremy D. Zawodny)
     Re: A wierd error: Premature end of script headers <jaydee@worsdall.demon.co.uk>
     Re: A wierd error: Premature end of script headers (Jeremy D. Zawodny)
     Can't build Wais-2.304  with freeWAIS-sf-2.2.10, perl5. (David Condon)
     Re: Chomp vs Chop <metcher@no.junk.mail>
     Re: continued match? (brian d foy)
     Re: Embedded Perl: SvNOK fails for SVt_PVNV (Ilya Zakharevich)
     exclusive file rights (Steve)
     Re: exclusive file rights (Jeremy D. Zawodny)
     Re: exclusive file rights (Jeremy D. Zawodny)
     Re: I am  having trouble reading in a variable from a f , snailgem@aol.com
     PERL for ALPHA/VMS jsbobcat@erols.com
     PIPE question <bradenb@ibm.net>
     PIPE tutorials <bradenb@ibm.net>
     PLEASE HELP, retreive output (Anh-tuan Hoang)
     Re: PLEASE HELP, retreive output (Jeremy D. Zawodny)
     print "Location: my_html.html\n\n"; <bradenb@ibm.net>
     Re: print "Location: my_html.html\n\n"; (Jeremy D. Zawodny)
     SEGV from perl 5.004_4, solaris 5.5.1 <rjc@liddell.cstr.ed.ac.uk>
     Re: Tracking people leaving a website (brian d foy)
     Re: Tracking people leaving a website (Jason Gloudon)
     Re: WANTED:simple Perl CGI script (brian d foy)
     Re: WANTED:simple Perl CGI script (Jeremy D. Zawodny)
     Re: Why no case statement in Perl? <metcher@no.junk.mail>
     Re: Why no case statement in Perl? <jscofield@mindspring.com>
     Re: Why no case statement in Perl? (Mike Heins)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 16 Nov 1997 23:24:36 GMT
From: Mike Butler <mgb@nbnet.nb.ca>
Subject: A Very Simple Perl Script
Message-Id: <64nvbk$p63$1@agate.nbnet.nb.ca>

Hello All,
I'm attempting to use Perl as a CGI script to do a very simple thing and I
was wondering if someone could help. I'm currently running RedHat Linux
on a standalone Apache Web server. I access the server from a browser
like so: http://localhost. Lets say I want to write a web page to take 
some text input from the client and when I press the submit button the 
CGI script simply echoes the text back at me. Sounds trivial I know but 
I'm just trying to get the hang of the HTML and CGI communication. 
Anyone out there that might be able to jot down a little code for me that
will accomplish this? I have written some perl scripts and HTML but I am
new to CGI and need a little boost to get me going.

Thanks
Mike Butler
 


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

Date: Mon, 17 Nov 1997 03:06:47 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: A Very Simple Perl Script
Message-Id: <3471b49a.82961241@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On 16 Nov 1997 23:24:36 GMT, Mike Butler <mgb@nbnet.nb.ca> wrote:

>I'm attempting to use Perl as a CGI script to do a very simple thing and I
>was wondering if someone could help. I'm currently running RedHat Linux
>on a standalone Apache Web server. I access the server from a browser
>like so: http://localhost. Lets say I want to write a web page to take 
>some text input from the client and when I press the submit button the 
>CGI script simply echoes the text back at me. Sounds trivial I know but 
>I'm just trying to get the hang of the HTML and CGI communication. 
>Anyone out there that might be able to jot down a little code for me that
>will accomplish this? I have written some perl scripts and HTML but I am
>new to CGI and need a little boost to get me going.

CGI.pm has a built-in function to do this. It's called dump() if
memory serves... That should make the script, oh, about 5 lines long.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Mon, 17 Nov 1997 01:36:47 +0000
From: Mark Worsdall <jaydee@worsdall.demon.co.uk>
Subject: Re: A wierd error: Premature end of script headers
Message-Id: <If3fHJAv+5b0Ewhy@worsdall.demon.co.uk>

In article <comdog-ya02408000R1611971900080001@news.panix.com>, brian d
foy <comdog@computerdog.com> writes
>In article <WbO5hbA1f2b0EwzD@worsdall.demon.co.uk>, Mark Worsdall 
><jaydee@worsdall.demon.co.uk> wrote:
>
>>What can cause this error? The script still seems to run, the error is
>>reported in the webservers error_log file.
>
>see the various FAQs referenced in the CGI Meta FAQ - especially the
>Perl section.
>
Already read it still no help:-) can you point me more closely to the
gaurded secret knowledge:-)
-- 
Mark Worsdall - Oh no, I've run out of underpants :(
Home:- jaydeeATworsdall.demon.co.uk  WEB site:- http://www.worsdall.demon.co.uk
Shadow:- webmasterATshadow.org.uk    WEB site:- http://www.shadow.org.uk


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

Date: Mon, 17 Nov 1997 03:05:23 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: A wierd error: Premature end of script headers
Message-Id: <3470b420.82839386@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Mon, 17 Nov 1997 01:36:47 +0000, Mark Worsdall
<jaydee@worsdall.demon.co.uk> wrote:

>In article <comdog-ya02408000R1611971900080001@news.panix.com>, brian d
>foy <comdog@computerdog.com> writes
>>In article <WbO5hbA1f2b0EwzD@worsdall.demon.co.uk>, Mark Worsdall 
>><jaydee@worsdall.demon.co.uk> wrote:
>>
>>>What can cause this error? The script still seems to run, the error is
>>>reported in the webservers error_log file.
>>
>>see the various FAQs referenced in the CGI Meta FAQ - especially the
>>Perl section.
>>
>Already read it still no help:-) can you point me more closely to the
>gaurded secret knowledge:-)

The error message results from your CGI script not sending a proper
set of HTTP headers.

Fix your script and the problem goes away.

If you ask me how to figure out what HTTP headers it wants, you're
probably wasting our time. You've got better access to that info that
I do, I'd bet. After all, you have the documentation for your web
server--I don't.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Sun, 16 Nov 97 19:11:03 GMT
From: dcondon@cmnh.org (David Condon)
Subject: Can't build Wais-2.304  with freeWAIS-sf-2.2.10, perl5.004_04
Message-Id: <64nk2o$oev$1@neelix.cmnh.org>

This is on BSD/OS 2.0.1. I have successfully built and tested perl5.004_04
with several other modules. At the moment, I still have to link the
modules statically. I have successfully built, though not installed, the
full freeWAIS-2.2.10 package. I have followed the instructions in
INSTALL for building a wais.h include file and installed it and libwais.a
under /usr/local/include and /usr/local/lib respectively. I have
unpacked Wais-2.304 into a directory ext/Wais under the new perl source
directory and run "perl Makefile.PL" in this directory.

I have attempted both of the following:

run "make waisperl" inside the ext/Wais directory as directed in the 
INSTALL file;

added "Wais" to list of extensions to be added to perl, rerun Configure;
make depend; make

In either case I get the errors included below. I can see an obvious origin 
for the first one on the list: Wais.xs #includes "perl.h" ahead of wais.h
and perl.h typedefs a "_union_ any", whereas wais.h (extracted from zutil.h)
typedefs a "_struct_ any". I guess also that there is nothing to define
"boolean" in the wais.h file built as directed.

Please help?

gcc -c -DWAIS_USES_STDIO -I/usr/local/include -O2    -DVERSION=\"2.304\" 
-DXS_VE
RSION=\"2.304\"  -I../.. -DTRACE=0 -g Wais.c
In file included from Wais.h:22,
                 from Wais.xs:26:
/usr/local/include/wais.h:104: `any' defined as wrong kind of tag
/usr/local/include/wais.h:209: parse error before `boolean'
/usr/local/include/wais.h:209: warning: no semicolon at end of struct or union
/usr/local/include/wais.h:212: parse error before `}'
/usr/local/include/wais.h:212: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:290: parse error before `*'
/usr/local/include/wais.h:290: parse error before `surrogate'
/usr/local/include/wais.h:290: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:291: parse error before `*'
/usr/local/include/wais.h:292: parse error before `*'
/usr/local/include/wais.h:293: parse error before `*'
/usr/local/include/wais.h:325: parse error before `bitAtPos'
/usr/local/include/wais.h:325: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:332: parse error before `flag'
/usr/local/include/wais.h:333: parse error before `*'
/usr/local/include/wais.h:368: parse error before `boolean'
/usr/local/include/wais.h:368: warning: no semicolon at end of struct or union
/usr/local/include/wais.h:369: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:378: parse error before `}'
/usr/local/include/wais.h:378: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:382: parse error before `boolean'
/usr/local/include/wais.h:382: warning: no semicolon at end of struct or union
/usr/local/include/wais.h:383: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:384: parse error before `supportAccessControl'
/usr/local/include/wais.h:384: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:393: parse error before `}'
/usr/local/include/wais.h:393: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:400: parse error before `boolean'
/usr/local/include/wais.h:400: warning: no semicolon at end of struct or union
/usr/local/include/wais.h:407: parse error before `}'
/usr/local/include/wais.h:407: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:433: parse error before `boolean'
/usr/local/include/wais.h:433: warning: no semicolon at end of struct or union
/usr/local/include/wais.h:438: parse error before `}'
/usr/local/include/wais.h:438: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:449: parse error before `*'
/usr/local/include/wais.h:449: parse error before `search'
/usr/local/include/wais.h:453: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:454: parse error before `*'
/usr/local/include/wais.h:455: parse error before `*'
/usr/local/include/wais.h:456: parse error before `*'
/usr/local/include/wais.h:459: parse error before `*'
/usr/local/include/wais.h:459: parse error before `result'
/usr/local/include/wais.h:464: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:465: parse error before `*'
/usr/local/include/wais.h:466: parse error before `*'
/usr/local/include/wais.h:467: parse error before `*'
/usr/local/include/wais.h:468: parse error before `*'
/usr/local/include/wais.h:468: parse error before `*'
/usr/local/include/wais.h:468: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:470: parse error before `*'
/usr/local/include/wais.h:471: parse error before `boolean'
/usr/local/include/wais.h:472: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:473: parse error before `*'
/usr/local/include/wais.h:474: parse error before `*'
/usr/local/include/wais.h:475: parse error before `*'
/usr/local/include/wais.h:491: parse error before `*'
/usr/local/include/wais.h:491: parse error before `status'
/usr/local/include/wais.h:493: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:494: parse error before `*'
/usr/local/include/wais.h:495: parse error before `*'
/usr/local/include/wais.h:496: parse error before `*'
/usr/local/include/wais.h:501: parse error before `*'
/usr/local/include/wais.h:504: parse error before `*'
/usr/local/include/wais.h:507: parse error before `*'
/usr/local/include/wais.h:516: parse error before `*'
/usr/local/include/wais.h:889: parse error before `diagnosticRecord'
/usr/local/include/wais.h:889: warning: no semicolon at end of struct or union
/usr/local/include/wais.h:890: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:940: parse error before `*'
/usr/local/include/wais.h:946: parse error before `diagnosticRecord'
/usr/local/include/wais.h:946: warning: data definition has no type or storage 
c
lass
/usr/local/include/wais.h:947: parse error before `*'
/usr/local/include/wais.h:978: parse error before `*'
/usr/local/include/wais.h:1020: parse error before `transportCode'
/usr/local/include/wais.h:1020: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:1021: parse error before `transportDecode'
/usr/local/include/wais.h:1021: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:1192: parse error before `boolean'
/usr/local/include/wais.h:1198: parse error before `boolean'
/usr/local/include/wais.h:1517: `MAX_WORD_LENGTH' undeclared here (not in a 
func
tion)
/usr/local/include/wais.h:1517: size of array `key' has non-integer type
/usr/local/include/wais.h:1599: parse error before `clr_hashtable'
/usr/local/include/wais.h:1599: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:1603: parse error before `free_hashtable'
/usr/local/include/wais.h:1603: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:1609: parse error before `sort_hashtable'
/usr/local/include/wais.h:1609: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:1947: parse error before `boolean'
/usr/local/include/wais.h:1961: parse error before `filename_in_database'
/usr/local/include/wais.h:1962: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:1963: parse error before `filename_in_filename_file'
/usr/local/include/wais.h:1965: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:1974: parse error before `read_document_table_entry'
/usr/local/include/wais.h:1975: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:1980: parse error before `writeUserValToDocIDTable'
/usr/local/include/wais.h:1981: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:2038: parse error before `register_src_structure'
/usr/local/include/wais.h:2038: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:2049: parse error before `write_src_structure'
/usr/local/include/wais.h:2054: parse error before `boolean'
/usr/local/include/wais.h:2055: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:2057: parse error before `build_catalog'
/usr/local/include/wais.h:2057: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:2244: parse error before `boolean'
/usr/local/include/wais.h:2275: parse error before `boolean'
/usr/local/include/wais.h:2328: parse error before `boolean'
/usr/local/include/wais.h:2662: `MAX_FILE_NAME_LEN' undeclared here (not in a 
fu
nction)
/usr/local/include/wais.h:2662: size of array `filename' has non-integer type
/usr/local/include/wais.h:2663: `MAX_HEADLINE_LEN' undeclared here (not in a 
fun
ction)
/usr/local/include/wais.h:2663: size of array `headline' has non-integer type
/usr/local/include/wais.h:2664: `MAX_TYPE_LEN' undeclared here (not in a 
functio
n)
/usr/local/include/wais.h:2664: size of array `type' has non-integer type
/usr/local/include/wais.h:2665: `ANSI_DATE_LENGTH' undeclared here (not in a 
fun
ction)
/usr/local/include/wais.h:2665: size of array `date' has non-integer type
/usr/local/include/wais.h:2692: parse error before `run_search'
/usr/local/include/wais.h:2693: parse error before `*'
/usr/local/include/wais.h:2697: warning: data definition has no type or 
storage
class
/usr/local/include/wais.h:2739: `boolean' declared as function returning a 
funct
ion
/usr/local/include/wais.h:2739: warning: parameter names (without types) in 
func
tion declaration
/usr/local/include/wais.h:2747: `separator_function' declared as function 
return
ing a function
/usr/local/include/wais.h:2751: `wordDelimiter' declared as function returning 
a
 function
/usr/local/include/wais.h:2760: field `addseparatorwords' declared as a 
function
/usr/local/include/wais.h:2761: field `extraheaderweight' declared as a 
function
/usr/local/include/wais.h:2770: `wordDelimiter' declared as function returning 
a
 function
/usr/local/include/wais.h:2830: `directoryp' declared as function returning a 
fu
nction
/usr/local/include/wais.h:2832: `filep' declared as function returning a 
functio
n
/usr/local/include/wais.h:2965: parse error before `cmpDocIDs'
/usr/local/include/wais.h:2965: warning: data definition has no type or 
storage
class
Wais.xs: In function `XS_Wais_generate_init_apdu':
Wais.xs:307: `init' undeclared (first use this function)
Wais.xs:307: (Each undeclared identifier is reported only once
Wais.xs:307: for each function it appears in.)
Wais.xs:308: parse error before `long'
Wais.xs:310: `true' undeclared (first use this function)
Wais.xs:310: `false' undeclared (first use this function)
Wais.xs:311: `userInfo' undeclared (first use this function)
Wais.xs:317: `result' undeclared (first use this function)
Wais.c: In function `XS_Wais__Init_new':
Wais.c:697: `RETVAL' undeclared (first use this function)
Wais.xs:530: `false' undeclared (first use this function)
Wais.c: In function `XS_Wais__Init_DESTROY':
Wais.c:734: `init_response' undeclared (first use this function)
Wais.c:738: parse error before `)'
Wais.xs:553: parse error before `)'
Wais.xs:558: parse error before `)'
Wais.c: At top level:
Wais.c:756: parse error before `void'
Wais.c: In function `XS_Wais__Init_ImplementationID':
Wais.c:765: `init_response' undeclared (first use this function)
Wais.c:766: parse error before `char'
Wais.c:770: parse error before `)'
Wais.xs:568: `RETVAL' undeclared (first use this function)
Wais.c: In function `XS_Wais__Init_ImplementationName':
Wais.c:791: `init_response' undeclared (first use this function)
Wais.c:792: parse error before `char'
Wais.c:796: parse error before `)'
Wais.xs:578: `RETVAL' undeclared (first use this function)
Wais.c: In function `XS_Wais__Init_ImplementationVersion':
Wais.c:817: `init_response' undeclared (first use this function)
Wais.c:818: parse error before `char'
Wais.c:822: parse error before `)'
Wais.xs:588: `RETVAL' undeclared (first use this function)
Wais.xs: In function `XS_Wais__Search_diagnostics':
Wais.xs:719: `info' undeclared (first use this function)
Wais.xs:720: parse error before `int'
Wais.xs:723: parse error before `)'
Wais.xs:725: `i' undeclared (first use this function)
Wais.xs: In function `XS_Wais__Search_header':
Wais.xs:745: `info' undeclared (first use this function)
Wais.xs:746: parse error before `int'
Wais.xs:749: parse error before `)'
Wais.xs:751: `i' undeclared (first use this function)
Wais.xs: In function `XS_Wais__Search_text':
Wais.xs:787: `info' undeclared (first use this function)
Wais.xs:788: parse error before `int'
Wais.xs:793: parse error before `)'
make: *** [Wais.o] Error 1

--
David Condon, Librarian                 |      dcondon@cmnh.org
Cleveland Museum of Natural History     |
1 Wade Oval Drive, University Circle    |      +1 (216) 231-4600 ext.222
Cleveland, Ohio 44106-1767              |      Fax: +1 (216) 231-5919


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

Date: Mon, 17 Nov 1997 11:34:50 +1100
From: Jaime Metcher <metcher@no.junk.mail>
Subject: Re: Chomp vs Chop
Message-Id: <346F912A.9B3D7804@no.junk.mail>

Mark Mielke wrote:
snip
> how can you NOT want to be sure? Just assuming your some smartass programmer
> and you'll never make a mistake is not good enough. Use techniques that do
> not ALLOW for programming error... :-)
> 
snip

I just have to say that I'm still a little breathless after reading this
in a perl newsgroup.  It's like the Queen of England using the "F" word
in a speech...shocking, but what a delicious moment. :-)

Jaime Metcher


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

Date: Sun, 16 Nov 1997 22:59:55 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: continued match?
Message-Id: <comdog-ya02408000R1611972259550001@news.panix.com>

In article <stoffer-1611972244050001@loke.netcetera.dk>, stoffer@netcetera.dk (Gustav Kristoffer Ek) wrote:

>hi, anyone who can tell me how to make a continued match, like $4 =~ m//;
>without using $4 ?

you mean like

   $after_match = $';

   $after_match =~ m//;

or do you mean like

   m/\G$pattern/g;

?

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 17 Nov 1997 03:23:13 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Embedded Perl: SvNOK fails for SVt_PVNV
Message-Id: <64odb1$ep2$1@agate.berkeley.edu>

In article <347250d4.43754615@news3.ibm.net>,
Jan Dubois <jan.dubois@ibm.net> wrote:
> An SVt_PVNV is a SV that has been upgraded to hold either a string or a number.
> This is an optimisation of the Perl interpreter to avoid continously allocating
> and freeing SVs. You have to check them with SvNOK before you can call SvNV (or
> with SvPOK before calling SvPV). If it is not SvNOK then it it doesn't hold a
> double currently. (Well, it holds a double, but considers it's value invalid at
> this very moment). It may or may not hold a string.

Wrong.  You can alway call any Sv?V (except maybe SvRV?) without any
prior check.  Whatever is the value there, it will be promoted to
double automatically (including undef).

Ilya


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

Date: Mon, 17 Nov 1997 01:20:02 GMT
From: syarbrou@ais.net (Steve)
Subject: exclusive file rights
Message-Id: <34729bb2.23250998@news.ais.net>

I have a Perl script that maintains a list of accesses.  It is not a
standard log where it appends to the end of the
log, but one that reads in the log then compares the new access
command to the ones in the log.  If it finds a match, it increments
the number onefor that command and rewrites all the data to the log
one at a time.

I'm getting a lot of bad data, some of which is numbers going from
2000 uses to 230 or so.  I am making an assumption that this is caused
from multiple writes and reads at once.  How do you go about locking
access to the file so nothing else can access it while reading and
writing?  The program does the following and I would like it locked
for the entire process(any other suggestions are welcom):

Reads in log
closes log

processes data

opens log
writes log


Thanks,

Steve


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

Date: Mon, 17 Nov 1997 03:09:17 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: exclusive file rights
Message-Id: <3473b53a.83121682@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Mon, 17 Nov 1997 01:20:02 GMT, syarbrou@ais.net (Steve) wrote:

>from multiple writes and reads at once.  How do you go about locking
>access to the file so nothing else can access it while reading and
>writing?  The program does the following and I would like it locked
>for the entire process(any other suggestions are welcom):

This is covered in the Perl documentation. Search for the work 'lock'
and you're bound to find it.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Mon, 17 Nov 1997 03:13:57 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: exclusive file rights
Message-Id: <3475b65a.83409206@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Mon, 17 Nov 1997 03:09:17 GMT, jzawodn@wcnet.org (Jeremy D.
Zawodny) wrote:

>This is covered in the Perl documentation. Search for the work 'lock'
>and you're bound to find it.

Meanwhile, I'll work on proofreading.

work = word

*sigh*

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Sun, 16 Nov 1997 22:41:09 -0500
From: , snailgem@aol.com
Subject: Re: I am  having trouble reading in a variable from a file
Message-Id: <346FBCD4.65A9@aol.com>

What's the diff between the 2 ?

>  Besides, you should be using CGI.pm
> nowadays, really.


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

Date: Sun, 16 Nov 1997 21:32:22 -0500
From: jsbobcat@erols.com
Subject: PERL for ALPHA/VMS
Message-Id: <346FACB1.A364FA6C@erols.com>

I know Perl is available for Alpha / OpenVMS but I can't find a site
which has it.  Do you know where I could find this free version?

Please respond via newsgroup (to benefit others) and e-mail.  I check my
e-mail more frequently than this newsgroup and do not have to filter
through over 700 messages a day.   Thank you.



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

Date: Mon, 17 Nov 1997 21:48:19 -0500
From: jerome bradenbaugh <bradenb@ibm.net>
Subject: PIPE question
Message-Id: <347101F3.46D8@ibm.net>

I want to open a pipe to an external program, send some parameters, then
listen for results.

The external program I want to pass the parameters must be called from
the web server, like so:

$searchprog = "/s97_cgi.exe?results=this&terms=that";

open (SEARCH, |$searchprog) || die;

When I do this, I get a return value of something like this "this is not
a recognized program or internal command"

I think I have the wrong syntax. Any ideas on how to fix it?

Win NT is the OS. Microsoft IIS is the server software.

Please respond to sysdev5@hotmail.com    

Thank you.

Jerry Bradenbaugh


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

Date: Mon, 17 Nov 1997 21:50:17 -0500
From: jerome bradenbaugh <bradenb@ibm.net>
Subject: PIPE tutorials
Message-Id: <34710269.40A0@ibm.net>

Does anyone know of a comprehensive tutorial of using PIPE to
communicate with external programs?



Please respond to sysdev5@hotmail.com


Thank you.



Jerry Bradenbaugh


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

Date: 17 Nov 1997 00:27:52 GMT
From: hoang@step.polymtl.ca (Anh-tuan Hoang)
Subject: PLEASE HELP, retreive output
Message-Id: <64o328$19lm@service.polymtl.ca>

Hi verybody,

I don't know if somebody can help me. It's has been a long time I try to
find out how to solve this problem. The problem is : I try to execute an
Unix program and try to retreive the output and put into a string. I try
with "system" and also with backtice `` but the only thing they return is
an number 26250 , it is a kind of exist status number. I don't want this
number but only the output of the program I execute by perl.
So anyhelp will be very appreciate.

Thanks.

Anh-Tuan



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

Date: Mon, 17 Nov 1997 03:08:07 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: PLEASE HELP, retreive output
Message-Id: <3472b4fc.83059953@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On 17 Nov 1997 00:27:52 GMT, hoang@step.polymtl.ca (Anh-tuan Hoang)
wrote:

>I don't know if somebody can help me. It's has been a long time I try to
>find out how to solve this problem. The problem is : I try to execute an
>Unix program and try to retreive the output and put into a string. I try
>with "system" and also with backtice `` but the only thing they return is
>an number 26250 , it is a kind of exist status number. I don't want this
>number but only the output of the program I execute by perl.
>So anyhelp will be very appreciate.

Look at opening a pipe from STDOUT of the command you're running. Read
the data from there.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Mon, 17 Nov 1997 21:52:43 -0500
From: jerome bradenbaugh <bradenb@ibm.net>
Subject: print "Location: my_html.html\n\n";
Message-Id: <347102FB.47B3@ibm.net>

Using Win NT and Microsoft IIS, MSIE redirects to the page of my choice
with the following code:

print "Location: my_html.html\n\n";


However, NN won't cooperate. Any ideas how to workaround?


Please respond to sysdev5@hotmail.com


Thank you.


Jerry Bradenbaugh


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

Date: Mon, 17 Nov 1997 03:15:42 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: print "Location: my_html.html\n\n";
Message-Id: <3476b6a7.83486016@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Mon, 17 Nov 1997 21:52:43 -0500, jerome bradenbaugh
<bradenb@ibm.net> wrote:

>Using Win NT and Microsoft IIS, MSIE redirects to the page of my choice
>with the following code:
>
>print "Location: my_html.html\n\n";
>
>
>However, NN won't cooperate. Any ideas how to workaround?

Yes, use the proper HTTP response code for a redirect.

Or, use CGI.pm, which solves the problem for you. :-)

CGI.pm has a built-in method called redirect() which works with all
standards compliant browsers.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: 17 Nov 1997 03:33:32 +0000
From: Richard Caley <rjc@liddell.cstr.ed.ac.uk>
Subject: SEGV from perl 5.004_4, solaris 5.5.1
Message-Id: <eyh3ekww5wz.fsf@liddell.cstr.ed.ac.uk>


I have a program which causes perl to get a segmentation fault. The
direct cause seems to be that I am acessing a blessed object and the
package it's been blessed into is recorded as (null) (that is, if I
print ref($it) in the debugger it prints (null), which I presume means
it really is a null pointer).

The object is fine earlier in the program, and it's proving hard to
track down what actually does the damage, so I thought I'd ask to see
if anyone else had had a similar problem and knew what the problem was
and/or could suggest a workaround.

The perl was compiled with gcc version 2.7.2.1, with an obvious
configuration (ie. more or less everything defaulted). The perl
program doesn't do anything too exotic. It does use sysread and
syswrite and dbmopen.

Thanks in advance for any help.

-- 
rjc@cstr.ed.ac.uk			_O_
					 |<



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

Date: Sun, 16 Nov 1997 19:10:30 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Tracking people leaving a website
Message-Id: <comdog-ya02408000R1611971910300001@news.panix.com>

In article <346e3d52.525031460@news.indigo.ie>, alex1@#nospam#.usa.net (Peter Schoon) wrote:

>Does anybody know of the existence of a perl script that tracks users
>leaving a webpage and where they are going ie.
>http://www.whatever.com/redirect?url=www.yahoo.com
>Call me lazy and I know it's a small programming job but I just don't
>want to go and do it and then find out somebody else has done it and
>is just giving it away.


you would have to make all references to a script that redirects the
users to the appropriate URL [1].  other than that HTTP is not designed
to do that sort of thing.

[1]
see for instance, 
<URL:http://www.jamaicatravel.com/link_bank/get_links/default/jamaica>
for a demonstration of this technique.  i wouldn't recommend it unless
you have a processor to spare :)

-- 
brian d foy                                  <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)*  <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>


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

Date: 17 Nov 1997 00:03:21 GMT
From: jgloudon@bbn.remove.com (Jason Gloudon)
Subject: Re: Tracking people leaving a website
Message-Id: <64o1k9$fsk$1@daily.bbnplanet.com>

Peter Schoon (alex1@#nospam#.usa.net) wrote:
: Does anybody know of the existence of a perl script that tracks users
: leaving a webpage and where they are going ie.
: http://www.whatever.com/redirect?url=www.yahoo.com
: Call me lazy and I know it's a small programming job but I just don't
: want to go and do it and then find out somebody else has done it and
: is just giving it away.
: Thanks PPL.
: Peter

Try ask a group like comp.unix.security about this, as it should not be
possible.

Jason Gloudon


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

Date: Sun, 16 Nov 1997 19:07:32 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: WANTED:simple Perl CGI script
Message-Id: <comdog-ya02408000R1611971907320001@news.panix.com>

In article <eli$9711152206@qz.little-neck.ny.us>, Eli the Bearded <usenet-tag@qz.little-neck.ny.us> wrote:

>brian d foy <comdog@computerdog.com> wrote:

>> fondly remembers finger

>:r! lynx -dump gopher://panix.com:79/@

>If they haven't, a redirect to that gopher protocol hack might be
>better than `who` in a CGI.

fondly remembers gopher too.  is anywhere still running gopher? :).  

however i think it would be better, processor wise, to do the `who`
than redirect - otherwise one is wasting the CGI process.

but, even after considering that, i wouldn't do this anyway.  i consider
the logged-on list to be sensitive info not for outside eyes :)

>Elijah
>------
>Altavista just gave me a count of 7 for "$RTFM_post{'brian d foy'}++;"

i'm trying to win that distinction in this week's stats...

-- 
brian d foy                                  <comdog@computerdog.com>
AFetb_crosspost{'brian d foy'}++;


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

Date: Mon, 17 Nov 1997 03:03:30 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: WANTED:simple Perl CGI script
Message-Id: <346fb3e9.82784808@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Sun, 16 Nov 1997 19:07:32 -0500, comdog@computerdog.com (brian d
foy) wrote:

>>Altavista just gave me a count of 7 for "$RTFM_post{'brian d foy'}++;"
>
>i'm trying to win that distinction in this week's stats...

It's not all it's cracked up to be...

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Mon, 17 Nov 1997 11:06:08 +1100
From: Jaime Metcher <metcher@no.junk.mail>
Subject: Re: Why no case statement in Perl?
Message-Id: <346F8A70.49349ADD@no.junk.mail>

Phil R Lawrence wrote:
> 
> > I often use the case statement in other languages.  Anyone know the
> reason
> > there is none in Perl?  It seems odd to be limited to If-elsif-else
> > statements.
> 
> I found the following in Camel 2nd Ed p.104:
> 
> "The bare block is particularly nice for doing case structures (multiway
> switches).
> 
>         SWITCH: {
>                 if (/^abc/) { $abc = 1; last SWITCH }
>                 if (/^def/) { $def = 1; last SWITCH }
>                 if (/^xyz/) { $xyz = 1; last SWITCH }
>                 $nothing = 1;
>         }
> "

Is this actually any different to:

                 if (/^abc/) { $abc = 1; }
                 elsif (/^def/) { $def = 1; }
                 elsif (/^xyz/) { $xyz = 1; }
                 else { $nothing = 1; }

?  The if..elsif..else approach seems to be vaguely scorned, yet it's
less typing and means what it says.

Jaime Metcher


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

Date: Sun, 16 Nov 1997 20:53:40 -0500
From: "Jim Scofield" <jscofield@mindspring.com>
Subject: Re: Why no case statement in Perl?
Message-Id: <64o806$bvt@camel12.mindspring.com>

Jaime Metcher wrote in message <346F8A70.49349ADD@no.junk.mail>...
>Phil R Lawrence wrote:
>>
>> > I often use the case statement in other languages.  Anyone know the
>> reason
>> > there is none in Perl?  It seems odd to be limited to If-elsif-else
>> > statements.
>>
>> I found the following in Camel 2nd Ed p.104:
>>
>> "The bare block is particularly nice for doing case structures (multiway
>> switches).
>>
>>         SWITCH: {
>>                 if (/^abc/) { $abc = 1; last SWITCH }
>>                 if (/^def/) { $def = 1; last SWITCH }
>>                 if (/^xyz/) { $xyz = 1; last SWITCH }
>>                 $nothing = 1;
>>         }
>> "
>
>Is this actually any different to:
>
>                 if (/^abc/) { $abc = 1; }
>                 elsif (/^def/) { $def = 1; }
>                 elsif (/^xyz/) { $xyz = 1; }
>                 else { $nothing = 1; }
>
>?  The if..elsif..else approach seems to be vaguely scorned, yet it's
>less typing and means what it says.
>
>Jaime Metcher

Actually, there is a difference here.  In C and Perl, the right side if an
if only gets executed if true.   So, let's say that /^abc/ evaluates to
true.  In the top example, all three if statements will get evaluated.  In
the bottom example, the first will be true, which will set $abc = 1, and
then skip the rest of the block.

For this example, it means very little.  But lets say that you have many
different cases to test and this is code that will get executed frequently.
Then it will make some difference.  How much?  Not really sure.  Probably
not a whole lot really, but some would argue that it would.

Jim Scofield
jscofield@mindspring.com




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

Date: 17 Nov 1997 03:28:50 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: Why no case statement in Perl?
Message-Id: <64odli$4j3$1@vixen.cso.uiuc.edu>

Jim Scofield (jscofield@mindspring.com) wrote:
: Jaime Metcher wrote in message <346F8A70.49349ADD@no.junk.mail>...
: >Phil R Lawrence wrote:
: >>
: >>
: >>         SWITCH: {
: >>                 if (/^abc/) { $abc = 1; last SWITCH }
: >>                 if (/^def/) { $def = 1; last SWITCH }
: >>                 if (/^xyz/) { $xyz = 1; last SWITCH }
: >>                 $nothing = 1;
: >>         }
: >> "
: >
: >Is this actually any different to:
: >
: >                 if (/^abc/) { $abc = 1; }
: >                 elsif (/^def/) { $def = 1; }
: >                 elsif (/^xyz/) { $xyz = 1; }
: >                 else { $nothing = 1; }
: >
: >?  The if..elsif..else approach seems to be vaguely scorned, yet it's
: >less typing and means what it says.
: >
: >Jaime Metcher
: 
: Actually, there is a difference here.  In C and Perl, the right side if an
: if only gets executed if true.   So, let's say that /^abc/ evaluates to
: true.  In the top example, all three if statements will get evaluated.  In
: the bottom example, the first will be true, which will set $abc = 1, and
: then skip the rest of the block.
: 

I think the 'last SWITCH' has something to say about that. The two
are functionally identical.

-- 
Regards,
Mike Heins

This post reflects the
opinion of my employer.


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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 1326
**************************************

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