[10543] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4135 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 2 20:07:27 1998

Date: Mon, 2 Nov 98 17: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           Mon, 2 Nov 1998     Volume: 8 Number: 4135

Today's topics:
    Re: "Account Manager Beta" crack? bhoylma@uswest.com
    Re: "Account Manager Beta" crack? <eashton@bbnplanet.com>
    Re: "Account Manager Beta" crack? (Tad McClellan)
    Re: 2Q: Perl modules & htaccess (Jye Tucker)
        Amsterdampm meeting 2nd Nov <l.brocard@elsevier.nl>
    Re: Easy Question: Rounding Numbers <arnej@fc.hp.com>
    Re: FTP from Win32 (David Whitmarsh)
        help: counting <marx@idiom.com>
    Re: help: counting (Brand Hilton)
    Re: HTTP header error:  can't open perl script <gellyfish@btinternet.com>
    Re: Interesting challenge:  Reformatting text to 80 cha <r28629@email.sps.mot.com>
    Re: Netscape equivalent of ASP <eashton@bbnplanet.com>
    Re: Not to start a language war but.. <jorendorff@ixl.com>
    Re: Not to start a language war but.. (Sam Holden)
    Re: Not to start a language war but.. <arcege@shore.net>
    Re: Not to start a language war but.. <greg@cosc.canterbury.ac.nz>
        Perl 5.004 install problem on Ultrix 4.4 <sean@mail.nwmissouri.edu>
        Problem with writing to a log file <m0317@ix.netcom.com>
    Re: Q:Creating a perl executable w/ a limited lifespan? <gellyfish@btinternet.com>
    Re: Question regarding CGI.pm <gellyfish@btinternet.com>
    Re: Raw socket programming in Perl (Jeff Medcalf)
    Re: Raw socket programming in Perl <carvdawg@patriot.net>
    Re: Reference Safety <rootbeer@teleport.com>
    Re: Reference Safety <zenin@bawdycaste.org>
    Re: Shell built-in commands in a perl script? (Brand Hilton)
    Re: Shell built-in commands in a perl script? <gellyfish@btinternet.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 02 Nov 1998 23:31:33 GMT
From: bhoylma@uswest.com
Subject: Re: "Account Manager Beta" crack?
Message-Id: <71lfcl$3kj$1@nnrp1.dejanews.com>

In article <71l5mo$lbl$1@nnrp1.dejanews.com>,
  hujsan@my-dejanews.com wrote:
> Please, is there a crack for the script "Account Manager Beta" wich you can
> find on:
[...]
> I really need it, can4t afford it...
>
> Martin
>

Dude, you are a complete ZERO!  I can only hope that you those like you get
their just desserts somewhere down the road.

By the way, send me your full name, address, telephone number, credit card
informaton, and social security number.  I'd like to have you investigated.

Sheesh.

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


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

Date: Tue, 03 Nov 1998 00:48:05 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: "Account Manager Beta" crack?
Message-Id: <363E5030.F0E7914D@bbnplanet.com>

hujsan@my-dejanews.com wrote:

> Please, is there a crack for the script "Account Manager Beta" wich you can
> find on:

One would think that since this is a newsgroup for programmers that this
would not be an amenable place to request such things. alt.2600 is
generally a place for those that would steal that which is not
rightfully theirs. If you are going to be a criminal, at least have a
little sense in going about the job.

-- 
e.

After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia.  - U. Eco -


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

Date: Mon, 2 Nov 1998 18:16:58 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: "Account Manager Beta" crack?
Message-Id: <q1il17.bl4.ln@flash.net>

hujsan@my-dejanews.com wrote:
: Please, is there a crack for the script "Account Manager Beta" 

: I really need it, can4t afford it...


   ... so you are going to steal it?


   Asking programmers to help you steal the work of another
   programmer is not likely to work.

   Go hold up a gas station, then pay the programmer his due.


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


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

Date: Tue, 03 Nov 1998 10:01:22 +1000
From: jye@buckconsultants.com.au (Jye Tucker)
Subject: Re: 2Q: Perl modules & htaccess
Message-Id: <jye-ya02408000R0311981001220001@qld.nnrp.telstra.net>

In article <363E0601.D176B9@wfubmc.edu>, Steve miles <smiles@wfubmc.edu> wrote:

> Hi everyone. I have two questions:
> 
> 1. What can you type at the telnet command line to get a list of Perl
> modules installed on your system? (I'm just using a hosting company...)
> 
> 2. When creating a password protected membership site, is there any way
> of getting around having to use .htaccess and it's password file for the
> membership database? Is there a way to use Perl to let the person sign
> in via a HTML form instead of the .htaccess popup and still be able to
> have the contents of an entire directory protected? (Of course I'm
> assuming you will still use an .htaccess file for the protected
> directories, but I'm just looking for a way around the popup member
> entrance...)

Hi Steve,

1. From the perlmodlib manpage...

--o--
To find out all the modules installed on your system, including those
without documentation or outside the standard release, do this:

           % find `perl -e 'print "@INC"'` -name '*.pm' -print
--o--

2. I just wrote a script to perform exactly the same thing that you are
looking at. There is a .htaccess file in the protected directory to prevent
anyone from getting in if they know the URL to that directory. 

It basically just reads the username and password from a form, reads a
config file (my version generates a different page for each username), and
makes its own HTTP request using the LWP module and the authorization_basic
function.

Hope that gives you a good start,

Jye


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

Date: Mon, 02 Nov 1998 16:25:25 +0100
From: Leon Brocard <l.brocard@elsevier.nl>
To: nl-pm@amsterdam.pm.org
Subject: Amsterdampm meeting 2nd Nov
Message-Id: <363DCEE5.54FA9A9E@elsevier.nl>

The 3rd meeting of the Amsterdam Perl Mongers will take place at
6pm on Tues 3rd November in Maximiliaan Cafe, Amsterdam.

For more information, check out the Amsterdam Perl Mongers website
at http://amsterdam.pm.org/ - this hasn't been updated recently,
although there _are_ some amusing photos of the last meeting...

During this meeting, the following activities are planned: 

o Guru-in-session (Leon & JP). Ask us anything, we'll try to
  answer. Give us enough beer and we'll also answer
  non-perl related questions. 
o perl 5.005_02 features. 
o Competition info. 
o Meet other perl users. This activity takes place during 
  the entire event, and requires the participation of everyone.
  You'll get to meet everyone else, eventually...
o (whatever YOU organise!). 

We'll be meeting briefly at 18:00 at the Maximiliaan Cafe at
6-8 Kloveniersburgwal and then head off to the same fun 
(unnamed?) Chinese restaurant we went to last time. Dinner 
is optional, as...

The main meeting will take place at 20:00 at the Maximiliaan
Cafe. Look out for geeky types bearing Perl books and 
drinking lotsa beer.

Contact address: monger@amsterdam.pm.org

Leon, who may buy people drinks if they bring JAPH's...
--
 .signature in mourning due to dead laptop


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

Date: Mon, 02 Nov 1998 16:23:37 -0700
From: Arne Jamtgaard <arnej@fc.hp.com>
Subject: Re: Easy Question: Rounding Numbers
Message-Id: <363E3EF9.FB7@fc.hp.com>

Larry Rosler wrote:

> In article <71l7f1$bv6$2@news-2.news.gte.net> on Mon, 02 Nov 1998
> 15:15:31 -0600, Chris <chris_N0SPAM@trsilvius-co.com> says...

> > result= (int (10^dec * source + .5)) / 10^dec

> > So in your example,
> > = (int (10 * 12.591237489 +.5)) / 100
> > = (int (125.91237489 + .5) /100
> > = (int (126.41237489) /100
> > = (126) / 100
> > = 12.6

> Does (126) / 100 really equal 12.6?

No, it equals 1.26.

But hey, you're within one order of magnitude... :)

Arne


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

Date: Tue, 03 Nov 1998 00:25:39 GMT
From: spamtrap.david.whitmarsh@dial.pipex.com (David Whitmarsh)
Subject: Re: FTP from Win32
Message-Id: <363e5504.97940832@news.dial.pipex.com>

helphand@pacbell.net wrote:

>  I cannot get it working on a machine that has multiple connections, 
>in particular a dailout one with a fixed IP number and DNS server
>specified. In this configuration, Net::FTP falls apart on any get,
>put, or dir command (but it does open and login ok) ... it takes a
>ridiculous amount of time to return any results, to the point that I
>thought it was hung.. but I left it running one time and discovered it
>actually does eventually complete.
>

I regulary use Net::FTP on a laptop that is sometimes connected to a
LAN and also uses a dialout network connection. It works with both
whether one or both are active at any time. I.P address for the
dialout is dynamic, but fixed for the LAN, the LAN uses one of the
reserved non-routed address ranges.

I don't use DNS on my LAN at the moment, but I have had in the past.

When using DNS on two networks, win95 does seem to get confused and
tries to do lookups on the the network you aren't connected to, and
only tries the other after a long time-out interval. Try changing the
order of DNS servers in your tcp/ip config. That may not be it, but
I'll bet it is DNS related in some way.

Good luck,


David 

************************************

David Whitmarsh

remove "spamtrap." from email address before replying

Sparkle Computer Co Ltd

Sybase C C++ perl UNIX NT

************************************


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

Date: Mon, 02 Nov 1998 17:31:33 -0600
From: "Marcus J. Foody" <marx@idiom.com>
Subject: help: counting
Message-Id: <363E40D5.600@idiom.com>

I have posted this message a couple of times recently and I'm still
having difficulty.  

I have a data file that consists of record headers and record items. 
For every record head there may be one or more record items associated
with it.  The record items are directly below its associated record
head.   I need to count each record header and its coresponding record
items and as soon as a new record head appears the counter should reset.

Below is an example of my data file:
|REC HEAD|016967|19980628|709|021447|097|19980628|MERCER FREIGHT
|REC ITEMS|1|2|2|EACH|500.00|1|1000.00|PRODUCT DESCRIPTION|ADDITIONAL
COMMENTS
|REC HEAD|016968|19980629|709|020148|098|19980629|MERCER FREIGHT
|REC ITEMS|1|1|1|EACH|1500.00|1|1500.00|PRODUCT DESCRIPTION|ADDITIONAL
COMMENTS
|REC ITEMS|2|4|4|EACH|250.00|2|1000.00|PRODUCT DESCRIPTION|ADDITIONAL
COMMENTS
|REC HEAD|016969|19980630|709|020349|099|19980630|MERCER FREIGHT
|REC ITEMS|1|1|1|EACH|2000.00|2|2000.00|PRODUCT DESCRIPTION|ADDITIONAL
COMMENTS

My counter should read this:
counter:
 1  	|REC HEAD|016967|19980628|709|021447|097|19980628|MERCER FREIGHT
 2  	|REC ITEMS|1|2|2|EACH|500.00|1|1000.00|PRODUCT
DESCRIPTION|ADDITIONAL COMMENTS
 1  	|REC HEAD|016968|19980629|709|020148|098|19980629|MERCER FREIGHT
 2  	|REC ITEMS|1|1|1|EACH|1500.00|1|1500.00|PRODUCT
DESCRIPTION|ADDITIONAL COMMENTS
 3  	|REC ITEMS|2|4|4|EACH|250.00|2|1000.00|PRODUCT
DESCRIPTION|ADDITIONAL COMMENTS
 1  	|REC HEAD|016969|19980630|709|020349|099|19980630|MERCER FREIGHT
   |REC ITEMS|1|1|1|EACH|2000.00|2|2000.00|PRODUCT
DESCRIPTION|ADDITIONAL COMMENTS


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

Date: 3 Nov 1998 00:54:45 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: help: counting
Message-Id: <71lk8l$bh19@mercury.adc.com>

In article <363E40D5.600@idiom.com>, Marcus J. Foody <marx@idiom.com> wrote:
>I have posted this message a couple of times recently and I'm still
>having difficulty.  
>
>I have a data file that consists of record headers and record items. 
>For every record head there may be one or more record items associated
>with it.  The record items are directly below its associated record
>head.   I need to count each record header and its coresponding record
>items and as soon as a new record head appears the counter should reset.
>
>Below is an example of my data file:
>|REC HEAD|016967|19980628|709|021447|097|19980628|MERCER FREIGHT
>|REC ITEMS|1|2|2|EACH|500.00|1|1000.00|PRODUCT DESCRIPTION|ADDITIONAL
>COMMENTS
>|REC HEAD|016968|19980629|709|020148|098|19980629|MERCER FREIGHT
>|REC ITEMS|1|1|1|EACH|1500.00|1|1500.00|PRODUCT DESCRIPTION|ADDITIONAL
>COMMENTS
>|REC ITEMS|2|4|4|EACH|250.00|2|1000.00|PRODUCT DESCRIPTION|ADDITIONAL
>COMMENTS
>|REC HEAD|016969|19980630|709|020349|099|19980630|MERCER FREIGHT
>|REC ITEMS|1|1|1|EACH|2000.00|2|2000.00|PRODUCT DESCRIPTION|ADDITIONAL
>COMMENTS
>
>My counter should read this:
>counter:
> 1  	|REC HEAD|016967|19980628|709|021447|097|19980628|MERCER FREIGHT
> 2  	|REC ITEMS|1|2|2|EACH|500.00|1|1000.00|PRODUCT
>DESCRIPTION|ADDITIONAL COMMENTS
> 1  	|REC HEAD|016968|19980629|709|020148|098|19980629|MERCER FREIGHT
> 2  	|REC ITEMS|1|1|1|EACH|1500.00|1|1500.00|PRODUCT
>DESCRIPTION|ADDITIONAL COMMENTS
> 3  	|REC ITEMS|2|4|4|EACH|250.00|2|1000.00|PRODUCT
>DESCRIPTION|ADDITIONAL COMMENTS
> 1  	|REC HEAD|016969|19980630|709|020349|099|19980630|MERCER FREIGHT
>   |REC ITEMS|1|1|1|EACH|2000.00|2|2000.00|PRODUCT
>DESCRIPTION|ADDITIONAL COMMENTS


while (<>) {
  $counter = 1 if (split(/\|/))[1] eq 'REC HEAD';
  $counter++ if (split(/\|/))[1] eq 'REC ITEMS';
  print $counter, $_;
}

-- 
 _____ 
|///  |   Brand Hilton  bhilton@adc.com
|  ADC|   ADC Telecommunications, ATM Transport Division
|_____|   Richardson, Texas


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

Date: 2 Nov 1998 22:45:01 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: HTTP header error:  can't open perl script
Message-Id: <71lcld$r2$1@gellyfish.btinternet.com>

On Mon, 02 Nov 1998 15:26:51 -0500 E-Mail Transponder <alpha@alphasys.net> wrote:
> Hi,
> 
> I am using FrontPage98 on a WIN95 platform that later I upgrade to a NT
> server.
> 
> I got the following error message when I tried to use a cgi program:
> 
> The spceified CGI application misbehaved by not returning a complete set
> of HTTP headers.  The headers it did return are:
> 
> Can't open perl script "??????????i?????": Invalid argument.
> 

Of course this nothing to do with Perl in particular - it would have happened
to any interpreter you used - If you search DejaNews on this group for your
error message you will find the solution.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: Mon, 02 Nov 1998 18:03:29 -0600
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: Interesting challenge:  Reformatting text to 80 chars.
Message-Id: <363E4851.E2D910AD@email.sps.mot.com>

Larry Rosler wrote:
> Two reasons come to mind immediately:
> 
> 1.  Might not have a Unix system installed (hard to believe, eh?)
> 
> 2.  Might not have a C compiler installed  (hard to believe, eh?)

my system admin always removes (hides!?) the C compiler after building
Perl <sigh>.

> But everyone who reads here presumably has Perl installed.  (I don't
> know if a C compiler is required to install that particular module,
> TEXT::Wrap, though, but I doubt it.)

fortunately.

-tk


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

Date: Tue, 03 Nov 1998 00:55:52 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Netscape equivalent of ASP
Message-Id: <363E5202.53A85186@bbnplanet.com>

sam berman wrote:

> ChiliSoft provides a product that allows Netscape servers to support
> ASP.  You may wish to look into it.

Chilisoft only runs on Solaris currently (UNIX wise) and it doesn't use
Perl at all. Also, it only works with Enterprise 3+ and Fasttrack
Servers. I think they also have an Apache version released or about to
be released. We have several customers who use this product with
reasonable success, but the performance is much less than Perl cgi's.

http://www.chilisoft.com

-- 
e.

After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia.  - U. Eco -


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

Date: Mon, 02 Nov 1998 17:24:17 -0800
From: Jason Orendorff <jorendorff@ixl.com>
Subject: Re: Not to start a language war but..
Message-Id: <363E5B41.FD1F9DCC@ixl.com>


>  if (not open ARTICAL,"<$filename") {
>    warn "Can't open artical file $filename because $!";
>    next;
>  }

Equivalent Python code:

  try:
      article = open(filename, 'r')
  except IOError, oops:
      sys.stderr.write("Can't open article file %s because %s" %
                       (filename, oops.strerror))
      continue

-- 
Jason


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

Date: 2 Nov 1998 23:36:25 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Not to start a language war but..
Message-Id: <slrn73sgfp.s5o.sholden@pgrad.cs.usyd.edu.au>

On Mon, 02 Nov 1998 17:24:17 -0800, Jason Orendorff <jorendorff@ixl.com> wrote:
>
>>  if (not open ARTICAL,"<$filename") {
>>    warn "Can't open artical file $filename because $!";
>>    next;
>>  }
>
>Equivalent Python code:
>
>  try:
>      article = open(filename, 'r')
>  except IOError, oops:
>      sys.stderr.write("Can't open article file %s because %s" %
>                       (filename, oops.strerror))
>      continue

Except of course that warn does not have to output to stderr...

$SIG{__WARN__} can do whatever it likes with it (useful in things such
as CGI (though you should just use CGI.pm)).

This leaves the caller free to handle the warning however it wants.

So the equivelant python is...?

-- 
Sam

It has been discovered that C++ provides a remarkable facility for
concealing the trival details of a program--such as where its bugs are.
	--David Keppel


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

Date: Tue, 03 Nov 1998 00:37:29 GMT
From: "Michael P. Reilly" <arcege@shore.net>
Subject: Re: Not to start a language war but..
Message-Id: <dfs%1.591$%C5.115701@news.shore.net>

In comp.lang.python Sam Holden <sholden@pgrad.cs.usyd.edu.au> wrote:
: On Mon, 02 Nov 1998 17:24:17 -0800, Jason Orendorff <jorendorff@ixl.com> wrote:
:>
:>>  if (not open ARTICAL,"<$filename") {
:>>    warn "Can't open artical file $filename because $!";
:>>    next;
:>>  }
:>
:>Equivalent Python code:
:>
:>  try:
:>      article = open(filename, 'r')
:>  except IOError, oops:
:>      sys.stderr.write("Can't open article file %s because %s" %
:>                       (filename, oops.strerror))
:>      continue

: Except of course that warn does not have to output to stderr...

: $SIG{__WARN__} can do whatever it likes with it (useful in things such
: as CGI (though you should just use CGI.pm)).

: This leaves the caller free to handle the warning however it wants.

: So the equivelant python is...?

import sys, cStringIO
real_stderr = sys.stderr
sys.stderr = cStringIO.StringIO() # can be any object that mimics a
                                  # file object (with a write method)

Then the internal commands that write to stderr will be redirected to
this new object.  The "real_stderr" is to revert back, if necessary.
This is better for CGI script, because you can do:
  sys.stderr = sys.stdout

  -Arcege



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

Date: Tue, 03 Nov 1998 13:43:28 +1300
From: Greg Ewing <greg@cosc.canterbury.ac.nz>
Subject: Re: Not to start a language war but..
Message-Id: <363E51B0.46F5@cosc.canterbury.ac.nz>

Russ Allbery wrote:
> 
> Right.  That's exactly my point.  If I want conceptual error information
> propagated along with my error (and in general I definitely *do* want
> that), I'd have to throw my own exception.  That, at least to me,
> significantly reduces the usefulness of Python's automatic exception
> throwing, since if I want production-quality error reporting I can't use
> that anyway.

Yes, you can. All you need to do is catch the exception
at those places where conceptual information is available
and pass on a new, value-added exception. E.g.:

  def frobnicate_file(filename):
    try:
      f = open(filename, "r")
      begin_frobnicating(f)
      frobnicate_further(f)
      finish_frobnicating(f)
      close(f)
    except e:
      raise FrobnicationError(filename, e)

In this example you get the conceptual information that
the error occurred while attempting a frobnication, and
you can look in the original exception object to find out
more if you want, yet you don't have to test the result
of every individual file operation in all the functions
called by frobnicate_file.

-- 
Greg Ewing, Computer Science Dept, | The address below is not spam-
University of Canterbury,	   | protected, so as not to waste
Christchurch, New Zealand	   | the time of Guido van Rossum.
greg@cosc.canterbury.ac.nz


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

Date: Mon, 2 Nov 1998 18:38:39 -0600
From: "Sean Sheil" <sean@mail.nwmissouri.edu>
Subject: Perl 5.004 install problem on Ultrix 4.4
Message-Id: <71lj1k$ctu$1@USENET.nwmissouri.edu>

I am getting the following errors when performing the make.  I have looked
at ipc.h and can find only 1 instance of the supposed declarations.  What am
I missing?

Sean


`sh  cflags libperl.a util.o`  util.c
          CCCMD =  cc -DPERL_CORE -c -std -Olimit
3245 -DLANGUAGE_C -DLOCALE_ENVIRON_REQUIRED -O2
as1: Warning: util.c, line 2838: Floating exception in conversion to binary

`sh  cflags libperl.a sv.o`  sv.c
          CCCMD =  cc -DPERL_CORE -c -std -Olimit 3245 -DLANGUAGE_C -O2
cfe: Warning: /usr/include/float.h:101: Macro FLT_MAX redefined

`sh  cflags libperl.a doio.o`  doio.c
          CCCMD =  cc -DPERL_CORE -c -std -Olimit 3245 -DLANGUAGE_C -O2
cfe: Error: /usr/include/sys/ipc.h, line 30: redeclaration of 'ipc_perm';
previous declaration at line 30 in file '/usr/include/sys/ipc.h' struct
ipc_perm { -------^
cfe: Error: /usr/include/sys/ipc.h, line 31: Duplicate member 'uid'
        uid_t   uid;
        -----   ^
cfe: Error: /usr/include/sys/ipc.h, line 32: Duplicate member 'gid'
        gid_t   gid;
        -----   ^
cfe: Error: /usr/include/sys/ipc.h, line 33: Duplicate member 'cuid'
        uid_t   cuid;
        -----   ^
cfe: Error: /usr/include/sys/ipc.h, line 34: Duplicate member 'cgid'
        gid_t   cgid;
        -----   ^
cfe: Error: /usr/include/sys/ipc.h, line 35: Duplicate member 'mode'
        mode_t  mode;
        ------  ^
cfe: Error: /usr/include/sys/ipc.h, line 36: Duplicate member 'seq'
        unsigned short seq;
        ---------------^
cfe: Error: /usr/include/sys/ipc.h, line 37: Duplicate member 'key'
        long    key;
        ----    ^
cfe: Error: /usr/include/sys/sem.h, line 107: redeclaration of 'semid_ds';
previ
ous declaration at line 107 in file '/usr/include/sys/sem.h'
 struct semid_ds {
 -------^
cfe: Error: /usr/include/sys/sem.h, line 108: Duplicate member 'sem_perm'
        struct ipc_perm sem_perm;
        --------------- ^
cfe: Error: /usr/include/sys/sem.h, line 109: Duplicate member 'sem_base'
        struct sem      *sem_base;
        ----------      -^
cfe: Error: /usr/include/sys/sem.h, line 110: Duplicate member 'sem_nsems'
        unsigned short  sem_nsems;
        --------------  ^
cfe: Error: /usr/include/sys/sem.h, line 111: Duplicate member 'sem_otime'
        time_t          sem_otime;
        ------          ^
cfe: Error: /usr/include/sys/sem.h, line 112: Duplicate member 'sem_ctime'
        time_t          sem_ctime;
        ------          ^
cfe: Error: /usr/include/sys/sem.h, line 122: redeclaration of 'sem';
previous d
eclaration at line 109 in file '/usr/include/sys/sem.h'
 struct sem {
 -------^
cfe: Error: /usr/include/sys/sem.h, line 123: Duplicate member 'semval'
        unsigned short semval;
        ---------------^
cfe: Error: /usr/include/sys/sem.h, line 124: Duplicate member 'sempid'
        pid_t    sempid;
        ---------^
cfe: Error: /usr/include/sys/sem.h, line 125: Duplicate member 'semncnt'
        unsigned short semncnt;
        ---------------^
cfe: Error: /usr/include/sys/sem.h, line 126: Duplicate member 'semzcnt'
        unsigned short semzcnt;
        ---------------^
cfe: Error: /usr/include/sys/sem.h, line 127: Duplicate member 'semnwakup'
        unsigned short semnwakup;
        ---------------^
cfe: Error: /usr/include/sys/sem.h, line 136: redeclaration of 'sem_undo';
previ
ous declaration at line 136 in file '/usr/include/sys/sem.h'
 struct sem_undo {
 -------^
cfe: Error: /usr/include/sys/sem.h, line 137: Duplicate member 'un_np'
        struct sem_undo *un_np;
        --------------- -^
cfe: Error: /usr/include/sys/sem.h, line 138: Duplicate member 'un_cnt'
        short           un_cnt;
        -----           ^
cfe: Error: /usr/include/sys/sem.h, line 139: redeclaration of 'undo';
previous
declaration at line 139 in file '/usr/include/sys/sem.h'
        struct undo {
        -------^
cfe: Error: /usr/include/sys/sem.h, line 140: Duplicate member 'un_aoe'
                short   un_aoe;
                -----   ^
cfe: Error: /usr/include/sys/sem.h, line 141: Duplicate member 'un_num'
                short   un_num;
                -----   ^
cfe: Error: /usr/include/sys/sem.h, line 142: Duplicate member 'un_id'
                int     un_id;
                ---     ^
cfe: Error: /usr/include/sys/sem.h, line 143: Duplicate member 'un_ent'
        }       un_ent[1];
        -       ^
cfe: Error: /usr/include/sys/sem.h, line 149: redeclaration of 'seminfo';
previo
us declaration at line 149 in file '/usr/include/sys/sem.h'
 struct seminfo {
 ------ ^
cfe: Error: /usr/include/sys/sem.h, line 150: Duplicate member 'semmap'
        int     semmap,
        ---     ^
cfe: Fatal: Too many errors,... goodbye.
*** Error code 1





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

Date: Mon, 2 Nov 1998 18:24:48 -0500
From: "Matt McHugh" <m0317@ix.netcom.com>
Subject: Problem with writing to a log file
Message-Id: <71lf8d$pus@dfw-ixnews3.ix.netcom.com>

Hello all,

I'm very new to perl and I just finished writing one of my first perl
scripts but I'm having difficulty sending any of the errors to a log file.
I thought my syntax was correct, but nothing ever gets written and there are
errors.  Basically it checks the return value of ping and if there isn't a
response from the host it records that error in a file which gets opened in
the beginning of the script.

Does anyone have any ideas?


Thanks

Here's the script:

#!/usr/local/bin/perl -w

open (NOTFOUND, ">>/usr/mmchugh/notfound") ||
        die "/usr/mmchugh/notfound is not found";
open (AIPHOSTS, "/usr/scripts/perl/hosts1") ||
        die "/usr/mmchugh/hosts not found ";
while (<AIPHOSTS>) {

        if (/(^[^;\$\s]+)/) {
                $ret = system ("/usr/sbin/ping $1 5 > /dev/null 2>&1") ;
                if ($ret) { print "$1 not found\n"; }
                }
}




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

Date: 2 Nov 1998 22:57:21 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Q:Creating a perl executable w/ a limited lifespan?
Message-Id: <71ldch$rm$1@gellyfish.btinternet.com>

On 2 Nov 1998 12:28:17 -0800 dtropea@ctron.com wrote:
> I am creating a perl script that will generate an executable. I do not
> want anyone to run this executable after a certain date (i have not
> decided a date yet) - this program has a limited lifespan. What do i need to put
> into the perl script that will not allow its generated executable to run after
> this date.
> 
> Is there some kind of a trigger mechanism i could put into the script
> that will signal when the date is reached to no longer allow the
> executable to run. All i am giving out is the executable not the
> complete program.
> 

This will work until this time tommorow:

if ( time < 910133461 )
  {
    print "Hello\n";
  }

Of course one could always alter the clock on your computer.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: 2 Nov 1998 22:26:42 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Question regarding CGI.pm
Message-Id: <71lbj2$qv$1@gellyfish.btinternet.com>

In comp.lang.perl.misc Greg Coit <gbc1@axe.humboldt.edu> wrote:
> I'm trying to debug a script I wrote (with the help of CGI.pm) which
> generates a web page with a form.  Up to know, Ive always been able to
> pop in the following code to find out what params are being passed after
> the submit button is pressed (per the CGI.pm man page):
> 
> $query=new CGI;
> print "<H2>Current Values</H2> $query\n<P>";
> 
> but instead of a list of the parameters (which is the normal response),
> i get this:
> 
> Current Values
> 
> CGI=HASH(0x140145c78)
> 
<this used to work under 5.003_02>

I would have thought that this would never have worked but I havent got a
copy of 5.003_02 to try out.  This is certainly the behaviour I would have
expected to see. 

The working equivalent would be :

my $query = new CGI;

print $query->header,start_html;

print "<H2>Current Values: </H2>\n";

foreach ($query->param())
  {
    print "$_ = ",$query->param($_),"<BR>\n";
  }

print $query->end_html;

I would recommend going back to the documentation for CGI.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: Tue, 03 Nov 1998 00:20:11 GMT
From: gwyn@caerdroia.org (Jeff Medcalf)
Subject: Re: Raw socket programming in Perl
Message-Id: <%_r%1.2657$I86.11030890@news.rdc1.tx.home.com>

In article <71l8v6$qhc$1@nnrp1.dejanews.com>,
	keydet89@yahoo.com writes:
> my $sourc_port = "1025";
> 
> tcp_storm($target_box,$target_port,$source_box,$source_port);

The problem is left as an exercise for the reader.  Running this with perl -w
would probably have uncovered the problem (assuming that you didn't use
$sourc_port accidentally somewhere else).

-jeff

-- 
/-------------------------------------------------------------------------\
| Jeff Medcalf  )0( | gwyn@caerdroia.org | http://www.caerdroia.org/~gwyn |
+-------------------+--------------------+--------------------------------+
| Four boxes to be used in defense of liberty:                            |
| soap, ballot, jury, ammo - use in that order - Ed Howdershelt           |
\-------------------------------------------------------------------------/


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

Date: Mon, 02 Nov 1998 19:52:09 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: Raw socket programming in Perl
Message-Id: <363E0D69.B7C5A93E@patriot.net>

Okay, Jeff...

Thanks for pointing out a spelling error.  However, the same problem persists...
the script runs fine, but a NetXRay capture reveals that an IP packet, vice TCP,
is sent.  All of the values read from the packet capture have nothing to do with
what was included in the script when the packet was constructed...

Jeff Medcalf wrote:

> In article <71l8v6$qhc$1@nnrp1.dejanews.com>,
>         keydet89@yahoo.com writes:
> > my $sourc_port = "1025";
> >
> > tcp_storm($target_box,$target_port,$source_box,$source_port);
>
> The problem is left as an exercise for the reader.  Running this with perl -w
> would probably have uncovered the problem (assuming that you didn't use
> $sourc_port accidentally somewhere else).
>
> -jeff
>
> --
> /-------------------------------------------------------------------------\
> | Jeff Medcalf  )0( | gwyn@caerdroia.org | http://www.caerdroia.org/~gwyn |
> +-------------------+--------------------+--------------------------------+
> | Four boxes to be used in defense of liberty:                            |
> | soap, ballot, jury, ammo - use in that order - Ed Howdershelt           |
> \-------------------------------------------------------------------------/





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

Date: Mon, 02 Nov 1998 19:12:50 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Reference Safety
Message-Id: <Pine.GSO.4.02A.9811021110070.2661-100000@user2.teleport.com>

On Mon, 2 Nov 1998, Jerome O'Neil wrote:

> I have been working with large hashes, and am concerned about scoping
> issues when passing their references arround.  If one sub returns a hash
> reference for use in another sub, at what point does the reference fall
> out of scope?  Or am I just being paranoid?

You're just being paranoid. :-)

The rule is simple:

    If you have a reference, it's valid.

(Of course, we're talking hard references here, as you had in your
example code.) Hope this helps!

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


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

Date: 02 Nov 1998 19:46:22 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Reference Safety
Message-Id: <910035932.643415@thrush.omix.com>

Jerome O'Neil <jeromeo@atrieva.com> wrote:
: I have been working with large hashes, and am concerned about scoping
: issues when passing their references arround.  If one sub returns a hash
: reference for use in another sub, at what point does the reference fall
: out of scope?

	I don't think it's scope you're worried about here, but more likely
	the total life span of the data.  Data dies when its reference count
	goes to zero.

: Or am I just being paranoid?

	Yes, but let's examine this.

: Example:  What situation would cause the reference returned by
: getahashref() to go away?

	Don't worry about the reference, worry about the data it points to.

: #/usr/local/bin/perl -w
: use strict;
: useahashref();

	This calls getahashref() first, so let's start there.

: sub getahashref(){
:         my(%hash) = (
: 		     # This hash is really big!
:                     );

	The symbol %hash now has a ref count of 1.

:         return \%hash;

	You created another reference to %hash, so its count goes up to 2
: }

	The real symbol %hash went out of scope, so its cound goes down 1 to
	1.

: sub useahashref(){
:         my($ref) = getahashref();

	The ref created by the earily \%hash is now in $ref.  Count still 1.

:  	foreach(keys($%ref)){
: 		# Were doing some cool stuff here.
: 	}

	No ref count change.

: }

	$ref goes out of scope, so we decrement the ref count of the %hash
	that it pointed to by 1, which brings it to 0.  Now perl free()'s
	its space for future use.

	Welcome to reference counting garbage collection.  This works far
	better then a "real" GC, until you do this:

	$a = \$b;
	$b = \$a;

	See the perlref page for details as to why.

-- 
-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: 2 Nov 1998 23:07:48 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: Shell built-in commands in a perl script?
Message-Id: <71le04$9qv15@mercury.adc.com>

In article <363E0994.41C6@gcg.com>,
Steve Goldstein  <steveg_nospam@gcg.com> wrote:
>I want to use the shell built-in "source" command in my perl script. 
>How do I do it? 
>
>If  I use  
>    system("source <filename>") or `source <filename>` 
>in my script, I get the error message: 
>Can't exec "source": No such file or directory...

Maybe you could give a little context here.  What are you really
trying to do?  Someone else already told you how to spawn a shell and
send commands to it, but does that really accomplish what you want?  I
only ask because have a hunch that that's not gonna solve your
problem.

So, are you trying to do?  What's in the file you want to source?
Environment variable settings?  Are you trying to propagate those
settings into the Perl script, or into the parent environment?

-- 
 _____ 
|///  |   Brand Hilton  bhilton@adc.com
|  ADC|   ADC Telecommunications, ATM Transport Division
|_____|   Richardson, Texas


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

Date: 2 Nov 1998 23:05:31 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Shell built-in commands in a perl script?
Message-Id: <71ldrr$tl$1@gellyfish.btinternet.com>

On Mon, 02 Nov 1998 13:35:48 -0600 Steve Goldstein <steveg_nospam@gcg.com> wrote:
> I want to use the shell built-in "source" command in my perl script. 
> How do I do it? 
> 
> If  I use  
>     system("source <filename>") or `source <filename>` 
> in my script, I get the error message: 
> Can't exec "source": No such file or directory...

You would need to do :

system("/usr/bin/bash -c 'source <file>'")

but I cant see any real purpose because the environment will disappear as
soon as the shell exits - you will probably want to examine the FAQ about
altering the environment in the way that your use of 'source' would
suggest.

/J\
-- 
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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