[6580] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 205 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 30 19:15:10 1997

Date: Sun, 30 Mar 97 16: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, 30 Mar 1997     Volume: 8 Number: 205

Today's topics:
     Re: 'flock' equivelent for NT <rootbeer@teleport.com>
     Re: BETA version and "DB 1.86"(???, where?) (Paul Marquess)
     calling a Perl script from inetd <phillip.green@citicorp.com>
     Re: Capture Output <rootbeer@teleport.com>
     Debugging an 'open' statement <keng@wco.com>
     Re: Functions and operators < hansm@icgned.nl>
     Re: Has anyone heard the rumour that Microsoft have bou (Chris Spurgeon)
     Re: Has anyone heard the rumour that Microsoft have bou (Thomas A. Horsley)
     HELP with Perl search script! (Tom Knoblauch)
     Re: lowercase Function <rootbeer@teleport.com>
     Re: lowercase Function (Brian L. Matthews)
     Re: Microsoft Running Naked Through the Streets? (Lee)
     Re: Need help with basic database manipulation (Paul Marquess)
     Re: Objective C is cool. (Sam Glasby)
     Re: Perl Mail Parser Question <merlyn@stonehenge.com>
     Re: Perl mishandles some multidimensional array referen <merlyn@stonehenge.com>
     PERL mutiplications (Steven Sajous)
     Re: Quick Help <rootbeer@teleport.com>
     Selena Sol's BBS on NT? (Charles Wyatt)
     Re: Selena Sol's BBS on NT? <neiled@enteract.com>
     skipping around in file being read... <blongwor@student.umass.edu>
     Re: skipping around in file being read... <blongwor@student.umass.edu>
     suid perl script <root@eisa.p146.zaphod.rhein.de>
     Re: Unix 'Cat' equivelent < hansm@icgned.nl>
     Re: Unix and ease of use (WAS: Who makes more ...) shendrix@escape.widomaker.com
     unlink ($f) if ! -w $f; possible??? <ea1217@fen.baynet.de>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sun, 30 Mar 1997 12:19:40 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Geoffrey Hebert <soccer@microserve.net>
Subject: Re: 'flock' equivelent for NT
Message-Id: <Pine.GSO.3.96.970330121114.26610J-100000@kelly.teleport.com>

On Sat, 29 Mar 1997, Geoffrey Hebert wrote:

> Here is something I use:
> Concept is to use a tempory file indicating that the file is in use.
> 
>  if (-e "file.lock") {  # is the file in use
>           sleep 1;   # do anything if busy
>  }  
> 
> open (LOCKFILE,">file.lock"); # file is now busy

Noooooooooooooo!

Suppose that the lockfile doesn't exist when you do the test, but somebody
else creates it before you get to the open? All too easy to happen. 

Now imagine that the other process finishes and deletes the lockfile
before your process is done. Another process comes along and re-creates
it, thinking it has the lock. Yours finishes, and deletes the lockfile...
This could go on all day, especially if you have a busy server.

If your system doesn't have flock, you should probably make your own
flocking daemon. (Yes, it's a little expensive to keep a daemon running,
but you need only one.) Now your script needs to get permission from the
daemon, and the daemon ensures that only one process has permission at a
time.

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 30 Mar 1997 20:06:03 GMT
From: pmarquess@bfsec.bt.co.uk (Paul Marquess)
Subject: Re: BETA version and "DB 1.86"(???, where?)
Message-Id: <5hmh3b$grn@pheidippides.axion.bt.co.uk>

[ Posted & Mailed ]
David Combs (dkcombs@netcom.com) wrote:
: Sorry -- I found the link to it.  (I think the link
: was the ONLY mention of 86 in the entire file).

Our newsfeed doesn't have the first message in this thread, so I don't
know what file or what BETA version you are referring to. I take it the
link you have found is http://www.bostic.com/db

: Next question: WHICH ONE to use, 85 or 86?  The text
: sort of implies one should use 85...

Here is the official line 

    DB version 1.86 includes a new implementation of the hash access
    method that fixes a variety of hashing problems found in DB version
    1.85. We are making it available as an interim solution until DB
    2.0 is available.

    PLEASE NOTE: the underlying file format for the hash access method
    changed between version 1.85 and version 1.86, so you will have to
    dump and reload all of your databases to convert from version 1.85
    to version 1.86. If you do not absolutely require the fixes from
    version 1.86, we strongly urge you to wait until DB 2.0 is released
    before upgrading from 1.85.

: Am just learning Perl, and have downloaded new beta
: version of it, and INSTALL file says I have to
: have the dbm ALREADY installed BEFORE building Perl...

That is the most straughtforward way to do it.

: (Too bad you can't tell it about dbm at run time,
: but I guess it needs the .h files at build time.)

: I guess every time you grab another data-base pkg, or
: even another version of existing one, you have totally
: rebuild perl? 

No, this is the exception. The vast majority of modules can be built
after Perl has been installed.

The only reason you need to build DB_File with Perl is because the
Perl build script (Configure) figures out which version of Berkeley DB
you have.

Paul


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

Date: Sun, 30 Mar 1997 18:36:17 -0500
From: "Jairo A. Medina" <phillip.green@citicorp.com>
Subject: calling a Perl script from inetd
Message-Id: <333EF8F1.3889@citicorp.com>

Hola:

		I made a client/server system and I would like my servers to be run
from inetd. 

		Has anybody done something like that?, Can anybody tell me how to get
the socket handle once the connection is made and inetd call my script?

			Thanks in advance.

-- 
===============================================================
   Jairo Medina                 Phone: (609) 727-4600
   Bluestone                    Fax:   (609) 727-1318
   1000 Briggs Road             Email: jairo@bluestone.com
   Mt. Laurel, NJ 08054
                                Web: http://www.bluestone.com/
===============================================================


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

Date: Sun, 30 Mar 1997 11:57:07 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: SG <mcj@execulink.com>
Subject: Re: Capture Output
Message-Id: <Pine.GSO.3.96.970330115354.26610E-100000@kelly.teleport.com>

On 30 Mar 1997, SG wrote:

> 	Whenever I run the UNIX commans grep from my perl script, the
> output goes directly to the screen. I cannot read the output. 

Why are you running Unix grep from Perl instead of emulating it within
Perl? But, if you must start another process for this, you probably want
to use backticks instead of system. They're documented in perlop(1), under
'qx'. Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 30 Mar 1997 20:23:28 GMT
From: Ken Gaugler <keng@wco.com>
Subject: Debugging an 'open' statement
Message-Id: <5hmi40$9f9$2@news.wco.com>

Having trouble getting Gundavaram's 'search.pl' script to work on my
ISP's webspace.  It seems like no files get searched, so the script
returns nothing.  I think the problem may be in the statement:

open (SEARCH, "$fgrep -A2 -B2 -i -n -s $query $document_root/* |");

because I inserted some debug 'print' statements shortly after that
statement and they do not get executed.  Is there a good way to
debug this statement without altering the way the script functions?

Thanks!



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

Date: 30 Mar 1997 22:42:49 GMT
From: Hans Mulder< hansm@icgned.nl>
Subject: Re: Functions and operators
Message-Id: <5hmq99$8b5@news.euro.net>

Randal Schwartz <merlyn@stonehenge.com> wrote:

> >>>>> "Tom" == Tom Christiansen <tchrist@mox.perl.com> writes:
 
> Tom>     @a = ('a'..'z');
> Tom>     $a = time @a;   print "$a\n";   # takes no args, hence compiler error
> Tom>     $a = int @a;    print "$a\n";   # takes one scalar arg
> Tom>     $a = unlink @a; print "$a\n";   # takes a list of args
 
> Or this:
 
> 	%3 = ( fred => 5, barney => 2);
> 	$a = time %3; # no args, so time mod 3
> 	$a = int %3; # one arg, so scalar (hash bucket stats)
> 	$a = unlink %3; # list arg, so unlink qw(fred 5 barney 2)

I think the worst case of overloading is the {,} notation: in list context

    do{3,8}  has 2 elements: 3 and 8
    +{3,8}   has 1 element : a reference to an anonymous hash ( 3 => 8 )
    ${3,8}   has 1 element : $8
    $q{3,8}  has 1 element : $q{'3' . $SUBSEP . '8'}    (an element of %q)
    @q{3,8}  has 2 elements: $q{'3'} and $q{'8'}        (elements of %q)
    q{3,8}   has 1 element : the string '3,8'
    <q{3,8}> has 2 elements: 'q3' and 'q8'
    /q{3,8}/ has 1 element if $_ matches /qqq/, 0 otherwise

Is {,} a function or an operator?  Or several of each?

- HansM
 


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

Date: 30 Mar 1997 19:58:10 GMT
From: ces@well.com (Chris Spurgeon)
Subject: Re: Has anyone heard the rumour that Microsoft have bought Perl?
Message-Id: <5hmgki$3fd$1@was.hooked.net>

"Jonathan Tracey" <jont@uunet.pipex.com> writes:

>I have it on good authority that Microsoft have aquired the rights to
>future versions of Perl. If so how long before we get Visual Perl?
>Any thoughts.

>Jon..................
Yeah, I have lots of thoughts, but I'm not rude enough to express them
here.  Suffice it to say that this must be some new use of the term
"on good authority" that I'm not familiar with.


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

Date: 30 Mar 1997 15:15:12 -0500
From: Tom.Horsley@worldnet.att.net (Thomas A. Horsley)
Subject: Re: Has anyone heard the rumour that Microsoft have bought Perl?
Message-Id: <uwwqpnnlb.fsf@worldnet.att.net>

>Suffice it to say that this must be some new use of the term
>"on good authority" that I'm not familiar with.

Well, we were making jokes about it over in perl5-porters a few days ago.
That *must* be a good authority :-).


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

Date: Fri, 28 Mar 1997 07:05:22 GMT
From: tomk@infinityquest.com (Tom Knoblauch)
Subject: HELP with Perl search script!
Message-Id: <5hfivs$3h0$1@venus.ConnectI.com>


I am trying to write a small perl search script. 

I can only get the script to read the first if
Each following if is ignored.
Any suggestions?

snippet:

foreach (@lines)  {
 ($ad_id, $date_1, $realname, $address, $city, $state, $zip, $country,
$age, $age_group, $race, $religion, $sex_pref, $email, $reference,
$marital, $education, $smoke, $header, $other, $server_protocol,
$remote_host, $remote_addr) = split(/::/);


 if  ($age_group == $DATA{'age_group'})  { 
 if  ($reference == $DATA{'reference'})  {


## have also used

 if  ($age_group == $DATA{'age_group'} &&  $reference ==
$DATA{'reference'})




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

Date: Sun, 30 Mar 1997 11:58:48 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: /8*x <SYSOP.bbs@CHS.Dorm10.NCTU.edu.tw>
Subject: Re: lowercase Function
Message-Id: <Pine.GSO.3.96.970330115745.26610F-100000@kelly.teleport.com>

On 30 Mar 1997, =AF=B8=AA=F8 wrote:

>         tr/A-Z/a-z/ ;

I'm surprised to see that suggested by someone whose name is '=AF=B8=AA=F8'=
=2E

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 30 Mar 1997 14:33:33 -0800
From: blm@halcyon.com (Brian L. Matthews)
Subject: Re: lowercase Function
Message-Id: <5hmpnt$3bj$1@halcyon.com>

In article <3HjXCd$8ir@CHS.Dorm10.NCTU.edu.tw>,
x <SYSOP.bbs@CHS.Dorm10.NCTU.edu.tw> wrote:
|        tr/A-Z/a-z/ ;

I can see someone from the US suggesting this (although it doesn't
even really work for English), but I would think someone from Taiwan
would know better.

Brian
-- 
Brian L. Matthews				Illustration Works, Inc.
	For top quality, stock commercial illustration, visit:
		  http://www.halcyon.com/artstock


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

Date: Sun, 30 Mar 1997 22:22:56 GMT
From: DeathToSpam@dev.null.com (Lee)
Subject: Re: Microsoft Running Naked Through the Streets?
Message-Id: <333ee79f.59377475@news.earthlink.net>

I think its time to retire to some remote island....before this
nightmare really begins<s>

nvp@bill-graham.nfic.com (Nate Patwardhan) wrote:

@>-->---I R A Aggie (fl_aggie@hotmail.com) wrote:
@>-->---James> In article <5hc0e7$ger$1@bob-marley.nfic.com>,
nvp@bill-graham.nfic.com
@>-->---James> (Nate Patwardhan) wrote:
@>-->---
@>-->---+ I've heard rumours that Microsoft is running naked through
the
@>-->---+ streets.  Well I suppose it's their perogative, as they own
the
@>-->---+ streets they're running naked through.
@>-->---
@>-->---James> Hey, as long as no one forces me to watch Bill G. run
nekkid thru
@>-->---James> the streets...
@>-->---
@>-->---It's rumoured that running through the streets will become the
@>-->---industry standard.  :-)
@>-->---
@>-->---Nate Patwardhan
@>-->---nvp@nfic.com
@>-->---nvp@shore.net
@>-->---

--Lee

Internet/Intranet Counsulting and Design:
http://www.designwest.com
Nurses' Call:
http://www.nurse.org/Nurses_Call/


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

Date: 30 Mar 1997 20:31:06 GMT
From: pmarquess@bfsec.bt.co.uk (Paul Marquess)
Subject: Re: Need help with basic database manipulation
Message-Id: <5hmiia$q3r@pheidippides.axion.bt.co.uk>

[Posted & Mailed]
bartels@a1.western.tec.wi.us wrote:
: I have the following bit of script. ("scriptlet"?) I don't understand all the
: things I need to do to do some simple database manipulation.

: Anyway, the "if" command is always returning false. What I want to do is
: simple, look in the database file, and see if the proper record is there, if it
: is, then assign the value to the variable. If not, create a record. Next, test
: if the value is too high. If it is, do some more stuff.

: Can anybody help? I'm sure I'm just not doing some testing correctly.


:         # Test Data Record
:         $numkey = $User . "_num";
:         $datekey = $User . "_date";
:         dbmopen(%DATAFILE,"/usr/local/records/database",644);
:         if (defined $DATAFILE{$numkey}) {
:                 $num_records = $DATAFILE{$numkey};
:                 print "num records is defined.\n";
:                 }
:         else    {
:                 print "num records is not defined.\n";
:                 $num_records = 0;
:                 $DATAFILE{$numkey} = 0;
:                 $DATAFILE{$datekey} = $date;
:         }
:         if ($num_records > 5) {
:                 print "num records is greater than 5.\n";
:                 $DATAFILE{$numkey} = $num_records + 1;
:                 $DATAFILE{$datekey} = $date;
:         }
:         dbmclose(%DATAFILE);

Try testing what dbmopen returns. You might not be opening the database
at all.

        dbmopen(%DATAFILE,"/usr/local/records/database",644)
	    or die "cannot open database: $!\n" ;

Paul


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

Date: 30 Mar 1997 12:04:07 -0700
From: sglasby@primenet.com (Sam Glasby)
Subject: Re: Objective C is cool.
Message-Id: <5hmdf7$698@nnrp1.news.primenet.com>

In article <333AEC76.5559C4FE@uniserve.com>,
Da Borg  <vladi_mip@uniserve.com> wrote:
>Keith Alphonso wrote:
>> [Objective C is proprietary]
>> Can't really make too many comments about that though!
>
>That is not correct. Objective-C is not proprietary and comes
>with any regular Linux distribution on the same conditions as
>the rest of GNU tools:
[SNIP]
>
>Objective-C was indeed developed by Next people but since it was
>based on GNU code, it was released after a FSF letter to NextStep
>lawyers. As a matter of fact, the subject has been recently 
>discussed in gnu.misc.discuss. 
>
>From what I know, Objective-C is a nice dialect of C but 
>there are not many applications based on the language. 
>I think I may give it a try one day after I am
>good enough in "regular" ANSI C.

	I recommend it.  (You may need an additional
tarball (or RPM, or .deb) or two, for FoundationKit
and documentation.)

	Objective C adds ~2 new syntax elements to 
ANSI C, can be combined with C++ for bridge classes /
wrappers and the like, and adds a very sharp
run-time system for messaging and dynamic (run-time) 
type resolution of the classes of objects.

	It is an astounding language, and in my
opinion, more true to design precepts/tone of
ANSI (and K&R) C than is C++ from various compiler/library
vendors.

-- 
Sam Glasby <sglasby@primenet.com> 
    Pagan, RPG designer, and user of Linux and Emacs


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

Date: 30 Mar 1997 11:55:57 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: mconst@soda.CSUA.Berkeley.EDU (Michael Constant)
Subject: Re: Perl Mail Parser Question
Message-Id: <8cwwqpw6o2.fsf@gadget.cscaper.com>

>>>>> "Michael" == Michael Constant <mconst@soda.CSUA.Berkeley.EDU> writes:

Michael>     perl -ne 'print if /^Subject:/ or not /^From / .. /^$/'

Although it couldn't have happened here, one must use caution when
combining ".." with other conditionals.  If the first part ahead of
the "or" here also matches one of the begin or end-points, the ".."
never gets a chance to "look" at the line, and will miss the start or
end point.  It's much safer to swap it around:

	print if not /^From / .. /^$/ or /^Subject:/;

(From personal experience.... ugh!)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 519 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: 30 Mar 1997 12:10:39 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: pduff@airmail.net (Patrick Duff)
Subject: Re: Perl mishandles some multidimensional array references???
Message-Id: <8cu3ltw5zk.fsf@gadget.cscaper.com>

>>>>> "Patrick" == Patrick Duff <pduff@airmail.net> writes:

Patrick> But I used that heuristic in the original version of the
Patrick> sample code (see my earlier message) and it failed.  What
Patrick> actually works correctly (at the beginning of this message)
Patrick> seems counter-intuitive to me in light of the above 8-line
Patrick> analysis.  So the moral seems to be when working with
Patrick> multidimensional arrays, you have to just play around with
Patrick> all the possibilities until one works!

You probably keep seeing it as counterintuitive because you keep
talking about "multidimensional arrays".  Perl has *no* such beast.

Patrick> Does anyone care to expand on the above analysis to come up with a
Patrick> heuristic for determining the correct syntax ( $ or @ or %, and ( ) or
Patrick> [ ] or { } ) to use in all circumstances when specifying arrays and
Patrick> hashes with varying numbers of dimensions?

Well, once again, it's simpler when you stop thinking of
"multidimensional arrays and hashes".  Perl doesn't have any of those.

Perl has lists of scalars, and hashes with scalar values.  Some of
those scalars can be references, which you must *explicitly
dereference* to get at an object that it points at.  If you start with
that, the syntax becomes rather apparent.  Calling it what it isn't
just gets ya more confused.

Again, the easiest way to get the syntax is to start with the seven
kinds of variable access, and what they can contain:

	$S = scalar
	$L[scalar] = scalar
	$H{scalar} = scalar
	@L[list] = list
	@H{list} = list
	%H = list (key/value pairs)

Now, in this list, any "L" can be replaced with {LISTREF}, and any H
can be replaced with {HASHREF}, which therefore dereferences them.
And then there's two transforms to make things easier to read and
write.

	LISTREF->[scalar] = scalar ... same as ${LISTREF}[scalar]
	HASHREF->{scalar} = scalar ... same as ${HASHREF}{scalar}

Now, anything with a scalar *value* can perhaps be a listref or
hashref, so we apply all these rules recursively.  And one other
simplification rule, that a scalar containing a list/hash-ref does not
need to be braced, which allows $$VAR_WITH_HREF{scalar}, although
that's better written as $VAR_WITH_REF->{scalar}.  And the other
simplification rule is that -> can be dropped between subscripty
things.

Whew!  But the short answer is, "there are no multidimensional arrays"
and "there are no lists of lists".  That's all just smoke and mirrors,
and you got some smoke in your eyes.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 519 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Sun, 30 Mar 1997 22:26:41 GMT
From: steve@golf.com (Steven Sajous)
Subject: PERL mutiplications
Message-Id: <333ee7fc.4398780@news1.alterdial.uu.net>

I have two variables in a mutliplication as such:

$total = $var1 * $var2

with:
$var1 = 19.95
$var2 = 1

I get $total = 19.950000000000000297 or some other garbage

How do I just get $total = 19.95?
Please e-mail me at steve@golf.com. Thanx


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

Date: Sun, 30 Mar 1997 12:02:04 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Mark C Seigle <mianzo+@cs.cmu.edu>
Subject: Re: Quick Help
Message-Id: <Pine.GSO.3.96.970330115948.26610G-100000@kelly.teleport.com>

On Sun, 30 Mar 1997, Mark C Seigle wrote:

> Subject: Quick Help

Well, it shouldn't take too long to read the frequent posting about
choosing good subject lines. :-)

> I need a quick command that will take a scalar or an array and convert
> it to lowercase. 

Does your system let you search through the perlfunc(1) man page for the
word 'lowercase'? Is that faster than waiting for replies from Usenet? :-)

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Sun, 30 Mar 1997 15:33:31 -0600
From: cwyatt@cris.com (Charles Wyatt)
Subject: Selena Sol's BBS on NT?
Message-Id: <859757292.6874@dejanews.com>

Hello!

I wonder if anyone has successfully ported Selena Sol's (Gunter
Birznieks') "Basic BBS" scripts/libraries to an NT/Win95 Perl WIN32
environment?

I've changed all of the directory paths, as I normally do when I port
scripts, but other than that, I can't really determine what else should be
changed!

Upon passing from the bbs_entrance.cgi to the bbs_forum.cgi scripts, I
receive "document contains no data" from my browser, rather than the forum
itself.

Any suggestions much appreciated -- I've already checked out all the FAQ's
I could find!

Thanks much,

Chuck Wyatt

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 30 Mar 1997 23:57:54 GMT
From: "Neil Edmondson" <neiled@enteract.com>
Subject: Re: Selena Sol's BBS on NT?
Message-Id: <01bc3d66$6dfa25c0$ad9a70cf@nedmondson.iclretail.com>

Did you try checking / posting this on Selena Sol's BBS?  

IME "no data" indicates an access problem.  File permissions / paths.

> 
> I wonder if anyone has successfully ported Selena Sol's (Gunter
> Birznieks') "Basic BBS" scripts/libraries to an NT/Win95 Perl WIN32
> environment?
> 



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

Date: Sun, 30 Mar 1997 14:03:30 -0500
From: Brett Longworth <blongwor@student.umass.edu>
Subject: skipping around in file being read...
Message-Id: <333EB8FF.4842@student.umass.edu>

Hiya,

Yet again, this seems like a FAQ, but I couldn't find it there or in the
manual.  How does one skip forwards or backwards in the file being
read?  for instance, what if I wanted to get something a few lines below
a regex, or in this particular case, start a while loop on the next line
after a match. 

profuse thanks,
-Brett


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

Date: Sun, 30 Mar 1997 17:06:10 -0500
From: Brett Longworth <blongwor@student.umass.edu>
Subject: Re: skipping around in file being read...
Message-Id: <333EE3C6.2830@student.umass.edu>

Brett Longworth wrote:
> 
> Hiya,
> 
> Yet again, this seems like a FAQ, but I couldn't find it there or in the
> manual.  How does one skip forwards or backwards in the file being
> read?  for instance, what if I wanted to get something a few lines below
> a regex, or in this particular case, start a while loop on the next line
> after a match.
> 
> profuse thanks,
> -Brett

Found my own answer without even needing to skip around, AND while
looking for something else found the seek function which does this (sort
of).  Sorry for wasting time and bandwidth.

-Brett


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

Date: 30 Mar 1997 23:50:37 +0200
From: root <root@eisa.p146.zaphod.rhein.de>
Subject: suid perl script
Message-Id: <afnlqcb6.fsf@eisa.p146.zaphod.rhein.de>

i wanted to run an suid perl script on a linux pc,
but i get the error message:
Can't do setuid

what i have done:

root@eisa:/local/www/cgi-sbin # ls -l /usr/bin/*perl
-rwxr-xr-x   1 root     root        12175 Aug 21  1996 /usr/bin/find2perl*
-rwxr-xr-x   1 root     root       487916 Aug 21  1996 /usr/bin/perl*
-rws--x--x   1 root     root       488672 Aug 21  1996 /usr/bin/suidperl*

joerg@eisa:/local/www/cgi-sbin > perl -v

This is perl, version 5.003 with EMBED
	built under linux at Aug 21 1996 12:57:07
	+ suidperl security patch


joerg@eisa:/local/www/cgi-sbin > ls -l ps2.pl
-r-sr-xr-x   1 root     root          168 Mar 30 22:20 ps2.pl

joerg@eisa:/local/www/cgi-sbin > cat ps2.pl
#!/usr/bin/perl -w

    if ($< == $>) {
 print "Not set id.\n";
    } else {
#
    }
 print "Set id! \$< is $< and \$> is $>.\n";

joerg@eisa:/local/www/cgi-sbin > ps2.pl
Can't do setuid

what to do.
please answere by mail because my news account is on a slow slip account.
thanks.
thanks for tips

jj

-- 
Jvrg Jenderek	email:joerg_jenderek@zaphod.rhein.de	phone: + 49 228 232028
Quirinstra_e 9	email:joerg_jenderek@T-online.de	fax  : + 49 228 234755
D-53129 Bonn	www  :http://home.t-online.de/home/joerg_jenderek
Germany


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

Date: 30 Mar 1997 23:04:19 GMT
From: Hans Mulder< hansm@icgned.nl>
Subject: Re: Unix 'Cat' equivelent
Message-Id: <5hmrhj$8b5@news.euro.net>

silmaril@best.com (Josh Purinton) wrote:

> Quoth Mike Campbell:
> >bill@sover.net.no.junkmail (Bill) writes:
> >>    Here's a quick and easy cat clone:
> >> #!/usr/bin/perl -w
> >>   while (<>) {
> >>       print;
> >>   }

> >perl -e 'print while (<>);'
 
> Unfortunately, Mike, your version is not quite like 'cat' in that it fails
> to print the last line if all it contains is '0'. 
 
> echo -n 0 | perl -e 'while(<>) { print }'	# prints 0
> echo -n 0 | perl -e 'print while(<>)'		# prints nothing
 
> There is magic in the first version which makes it "expand" to:
> 	while(<>) { ... } 	=>	while(defined($_ = <>)) { ... }
 
> The second version only expands to:
> 	... while(<>) 		=>	... while($_ = <>)
 
> Running a modern beta of Perl with the -w switch will warn you about the
> second version: 

That's a meaning of the word "modern" I was not previosuly aware or.

> 	Value of <HANDLE> construct can be "0"; test with defined() at
> 	-e line 1.
 
> Personally, I think Perl should be changed so they're the same.

Yes, that's annoying.

Larray has promised he'll fix it in version 5.001, due to be
released in 1994.

Hope this helps,

-- HansM


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

Date: 30 Mar 1997 17:10:52 -0500
From: shendrix@escape.widomaker.com
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <shendrix.859759553@escape>

Stephane Plattner <NOSPAMplas@fmi.ch> writes:

>What do you mean by that? The IBM PC was open? Was it possible to
>install any kind of hardware and software? Motorola processors, Amiga
[ snip ]

That is not what open means.

>Sure, but not because the PC is open, but because it has become a
>de-facto standard. Except the CD-ROM there was not a real innovation on
>the PC market in the last two three/years. Sure, processors got faster,

CD-ROM is over 10 years old.

>memory modules became smaller but more powerfull, screens became bigger,
>etc., and surprisingly you still have to pay 4000-5000 bucks for a
>"good" PC nowadays, as you had to pay two/three years ago.

I have a good one for far less than that.  Some people just don't know
how to shop.

>The PS/2 is not dead, because it was closed, but because of the bad
>maketing of IBM (same as OS/2). If Bill Gates would have taken care of
>the PS/2, then believe me most people would use microchannel
>architecture PC's. 

I'll make the argument that if the architecture had been as freely
accessible as ISA, it would not have died despite IBM marketing.  It was
much harder to get information from IBM about the PS/2 systems than any
previous system.

>And which owns the bigger market share? DOS/Windows you find EVERYWHERE,
>for UNIX you need to go into an academic environment or some highly
>IT-specialized companies doing highly IT specialized stuff.

What?  You don't use the phone?  Tons of UNIX machines control that
stuff.

You find DOS/Windows everywhere on people's desktops (not mine, thank
God) but UNIX is just about woven into the fabric of society.  A lot of
those Wintel and mac boxes are connected to database systems... which
usually run UNIX if they are not mainframe-based.

Like to read books?  Tons of publishers use UNIX systems.

Like movies?  Guess what they edit on and process with?  The Mac?  Sure,
but the heavy stuff is done with UNIX systems.

UNIX is everywhere, just not as overtly in your face.  It was designed
with a different purpose than your desktop OS.  The change that has come
about is desktop machines are now powerful enough to run an OS like UNIX
(and VMS, and...).  In that regard, the growth of UNIX on the desktop
has been phenomental when you think about what it is normally used for.

-- 
csh - shendrix@widomaker.com - http://www.widomaker.com - Linux 2.0.25
----------------------------------------------------------------------
"An Irishman is never drunk as long as he can hold onto one blade
of grass and not fall off the face of the earth."


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

Date: Sun, 30 Mar 1997 23:09:14 +0100
From: Achim Bursian <ea1217@fen.baynet.de>
Subject: unlink ($f) if ! -w $f; possible???
Message-Id: <333EE48A.45C3@fen.baynet.de>

Hi, there!
I checked some library modules, e.g. File::Path, and
after studying this, I think the following code should work:

	open TST, ">test";  close TST;  # touch file
	chmod 0444, 'test';             # make it read-only
	unlink('test') || die "$!";     # do a 'rm -f' on it
	print "ok\n";
	
I can not check it on a UNIX machine, but under NT with
perl 5.003_07 build 304 it dies with
  "Permission denied at mytest.pl line 4."
The file is there with the read-only bit set.
  
Help! Am I wrong, or is the NT implementation wrong?
Does this code work on unix?


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

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

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