[9648] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3242 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 24 08:07:57 1998

Date: Fri, 24 Jul 98 05:00:46 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 24 Jul 1998     Volume: 8 Number: 3242

Today's topics:
        "While" Loops.. Possible Perl Bug ? <marks@webleicester.co.uk>
    Re: 'eval' and 'require' <mgregory@asc.sps.mot.com>
    Re: 'eval' and 'require' <metcher@spider.herston.uq.edu.au>
    Re: *** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Pos birgitt@my-dejanews.com
        -I and Directory paths with spaces? <shawn@cartia.com>
    Re: 3c509 woes: Network card recommendations? <perlguy@inlink.com>
        ? perl win32 limitations <REPLY_TO_damonbrent@earthlink.net>
        ANNOUNCE: cpan-upload 1.3 (Neil Bowers)
        ANNOUNCE: orange 1.11 (Neil Bowers)
    Re: ANNOUNCE: orange 1.11 (Peter G. Strangman)
        best way of diffing two strings <RABM@prodigy.net>
        Code showing apparent "Perl While Bug" <marks@webleicester.co.uk>
        extracting price from string (again) dwiesel@my-dejanews.com
    Re: extracting price from string (again) <simonf@conduit.co.uk>
        future date in epoch time sjborden@my-dejanews.com
    Re: hashes in perl <perlguy@inlink.com>
    Re: hashes in perl (Gabor)
        How can I install GD.pm on Win32(9x/NT) <nekobe@hpl.me.tku.edu.tw>
    Re: Last Name First... ("Advent Dtp")
    Re: MsDev Automation with Perl eoloughlin@my-dejanews.com
    Re: Multiple Key Sort <quednauf@nortel.co.uk>
        Perl script in place of getty? <andyh@pavilion.co.uk>
        Perl SETUID <dlachuer@araxe.fr>
    Re: problem with NS cookies <leduc@kazibao.net>
    Re: question about the @_ variable merzky@my-dejanews.com
        rcmd <kamrani@ifi.uio.no>
        Server Side Includes (Hector Catre)
    Re: What's wrong? merzky@my-dejanews.com
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 24 Jul 1998 11:58:23 +0100
From: Mark Simonetti <marks@webleicester.co.uk>
Subject: "While" Loops.. Possible Perl Bug ?
Message-Id: <35B868CF.41C6@webleicester.co.uk>

I think I may have discovered a bug in perl involving the use of while
loops and associative arrays.

Basically, if I have a subroutine containing a while loop as such:

sub thing {
  my $fred = @_;
  my ($cmd, $prm);

  while(($cmd, $prm) = each(%$fred)) {
    return(1) if($cmd eq 'pants');
  }
}

Ok, its just some code I made up on the spot, but it helps to illustrate
the problem.. which is,

I call that sub routine, passing a hash pointer.
The "While" loop starts.
$cmd is found to equal 'pants'..
The subroutine returns 1.

Okay, bug time:

The subroutine is called again.. and instead of the while loop starting
from where it left off, it seems to carry on from where it left off !!

Anyone else found this ?  I seem to be able to get round the problem
using "foreach" blah blah..  Which I beleive is less efficient.

Mark.
--
=================================
Mark Simonetti
se96ms@dmu.ac.uk
marks@webleicester.co.uk
http://www.cms.dmu.ac.uk/~se96ms/
=================================

"I used to be indecisive, but now I'm not so sure."


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

Date: 24 Jul 1998 09:29:15 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Re: 'eval' and 'require'
Message-Id: <r8emvcm84s.fsf@asc.sps.mot.com>

Quite a few people write things like:

> Martin Gregory wrote in message ...
> >_Is_ there any safe way to test 'require'?
> 
> 
> You could check the return value from eval, which will be true iff the
> require'd file exists and ran succesfully:
> 
>   unless ( eval 'require "foo"' )
>   {
>      $@ ||= "foo did not return a true value";
>      die "ERROR: $@\n";
>   }
> 
> or:
> 
>    my $is_foo_available = eval 'require "foo"';

Many people said this.  It's a bit irritating that they didn't look and
see that this is exactly what the script that I posted did.

It's also a bit irritating that they say that it will work when it
blatantly does not - have you tried it with an empty foo file?

As I later posted, this is a known bug, and I'm told its fixed in new
versions.

Martin.


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

Date: Thu, 23 Jul 1998 15:27:11 +1000
From: Jaime Metcher <metcher@spider.herston.uq.edu.au>
Subject: Re: 'eval' and 'require'
Message-Id: <35B6C9AF.8DE880B5@spider.herston.uq.edu.au>

eval will trap any fatal errors in the 'require'd code, and set $@. 
However, it is part of the normal operation of 'require' to abort the
program (or the eval) if the 'require'd code doesn't evaluate to some
true value.  Apparently this abort is not regarded as a fatal error, but
rather as correct behaviour.

Try:

eval 'require "foo";' || die "foo evaluated false.\n  Not only that, you
might like to check after this colon to see if foo actually bombed (no
news is good news): $@\n";

-- 
Jaime Metcher

Martin Gregory wrote:
> 
> Hi,
> 
> How come I can't use eval to test require?
> 
> I have this code:
> 
>  eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' # -*- Perl -*-
>     & eval 'exec perl -w -S $0 $argv:q'
>       if 0;
> 
>  eval 'require "foo";';
>  !$@ or die "ERROR: perl couldn't parse foo: $@\n";
> 
>  require "foo";
> 
> .. and I get
> 
>  [djarraba-mg]{jenna} foo.pl
>  foo did not return a true value at /home/mgregory/bin/foo.pl line 8.
>  [djarraba-mg]{jenna}
> 
> when I have an empty "foo" file.
> 
> _Is_ there any safe way to test 'require'?
> 
> (Note that I think that I have to use require because the file of
> interest is a user configuration file: needs to be executed at the
> right place in the program).
> 
> Thanks,
> 
> Martin.


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

Date: Fri, 24 Jul 1998 10:53:52 GMT
From: birgitt@my-dejanews.com
Subject: Re: *** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Posted Twice Weekly ***
Message-Id: <6p9p40$kb0$1@nnrp1.dejanews.com>

In article <6p8ru0$skv@bgtnsc03.worldnet.att.net>,
  "Terry Cora" <TerryLCora@worldnet.att.net> wrote:
> Great mini-FAQ, sorry for my off tipic post.
>
> gnat@frii.com wrote in message ...
> <snip>
> >
> >9. The latest version of the "Camel Book" ("Programming Perl"),
> >updated for version 5.003, is available from your bookstore or from
> >http://www.ora.com/
>
> Great book!! BTW you can save $7.99 off the $39.95 cover price and help
> support a great free cgi mail list that specializes in Perl by ordering it,
> or several other programming books through http://www.jann.com/Perl/ (use
> the link to go to Amazon.com and order from there - must use the above link
> in order to help support the list though).
>
> >
> >10. Remember, USENET newsgroups are based on the idea of mutual aid.
> >USENET only works if we put as much into it as we get out of it.  Good
> >luck with your Perl work.
>
> Hopefully, I have given some other newbies an extra $8.00 to spend toward
> paying someone to make their scripts correct.

Am I the only one who thinks that this post is not appropriate ?

Birgitt Funk


>
> >-Nathan Torkington, Perl mini-FAQ maintainer
> >--
>
>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 23 Jul 1998 19:22:17 -0700
From: Shawn Bohn <shawn@cartia.com>
Subject: -I and Directory paths with spaces?
Message-Id: <35B7EFD9.BA9AAB9C@cartia.com>

How can I specify the lib path using the command line parameter -I if
the path has spaces. Many WIN32 paths have spaces 
(e.g., C:\Program Files\My Documents\lib)

I have tried all the usual -I "C:\Program Files\My Documents\lib",
-I 'C:\Program Files\My Documents\lib' but to no avail.  All you get is
the path including->(C:\Program) (Files\My) (Document\lib), neatly 
broken at the spaces in the path.  I peeked into the source code and
notice that it indeed breaks at the spaces.  Is there a good reason that
the library path can't have spaces?  And should the source code be
expanded to handle spaces in the path names?

-Shawn 
_____________________________________________________________________
Shawn J. Bohn  				
Senior Information Engineer
				              
Cartia, Inc.                        "No theory is good unless one uses
WK:  (425) 602-3558                  it to go beyond."     -Andre Gide
FAX: (425) 602-3570
shawn@cartia.com
______________________________________________________________________


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

Date: Fri, 24 Jul 1998 11:36:04 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: 3c509 woes: Network card recommendations?
Message-Id: <35B871A4.E45DAD6E@inlink.com>

Are you looking for an ethernet card driver written in Perl?  I seemed
to have missed the relevance of your post in this newsgroup otherwise...

Brent


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

Date: Fri, 24 Jul 1998 05:32:32 -0400
From: "Brent Verner" <REPLY_TO_damonbrent@earthlink.net>
Subject: ? perl win32 limitations
Message-Id: <6p9k9j$f23$1@birch.prod.itd.earthlink.net>

observation:

on my win98 machine with win32-perl 5.004.02 (GS port)

$where = tell STDIN;

sets $where to -1.  on the linux server, $where would be the correct pointer
location.

question:

does the tell function work properly on NT machines?  is there a more
faithful win32 port than the GS port? (please don't recommend the
ActiveState port)

thanks,

brent



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

Date: Fri, 24 Jul 1998 11:31:22 GMT
From: neilb@cre.canon.co.uk (Neil Bowers)
Subject: ANNOUNCE: cpan-upload 1.3
Message-Id: <EwLK0A.Jw9@cre.canon.co.uk>

cpan-upload is a script which automates the process of uploading a file to
CPAN using PAUSE, the Perl Authors Upload SErver. Before using this script
you must register with PAUSE, to get a username and password.

Version 1.3 of cpan-upload is making its way round CPAN:

	http://www.perl.com/CPAN/authors/id/NEILB/cpan-upload-1.3.tar.gz

Changes in this version:
	* switched to new host for PAUSE
	* now use Pod::Usage and HTTP::Request::Common
	* updated use of App::Config
	* prerequisities specified in Makefile.PL

neilb
--
Truth is tough. It will not break, like a bubble, at the touch, nay,
you may kick it about all day like a football,
and it will be round and full at evening.
					-- Oliver Wendell Holmes, Jr.


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

Date: Fri, 24 Jul 1998 11:02:55 GMT
From: neilb@cre.canon.co.uk (Neil Bowers)
Subject: ANNOUNCE: orange 1.11
Message-Id: <EwLIov.I9v@cre.canon.co.uk>

orange is a script for sending short text messages to an Orange cell phone [*].
It works by posting a message to a CGI form on the Orange site.

A new version has just been added to CPAN, see:

	http://www.cre.canon.co.uk/~neilb/orange/
	http://www.perl.com/CPAN/authors/id/NEILB/orange-1.11.tar.gz

This release adds no new functionality:

	* switched to using HTTP::Request::Common and Pod::Usage
	* take advantage of new features in App::Config
	* added explicit dependency info in Makefile.PL

neilb

[*] Orange is a cell-phone service provider in the UK.
--
You know you've achieved perfection in design,
Not when you have nothing more to add,
But when you have nothing more to take away. 
				-- Antoine de Saint Exupery.


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

Date: Fri, 24 Jul 1998 11:08:58 GMT
From: Peter@adelheid.demon.co.uk (Peter G. Strangman)
Subject: Re: ANNOUNCE: orange 1.11
Message-Id: <35c76b03.27364019@news.wlv.ac.uk>

On Fri, 24 Jul 1998 11:02:55 GMT, neilb@cre.canon.co.uk (Neil Bowers)
wrote:

> orange is a script for sending short text messages to an Orange cell phone [*].
> It works by posting a message to a CGI form on the Orange site.

So why are you telling us in uk.telecom? uk.telecom.mobile
is the appropriate group.

-- 
Peter G. Strangman              | Fuer d' Floeh gibts a Pulver
Peter@adelheid.demon.co.uk      | fuer d' Schuach gibts a Wix,
http://www.adelheid.demon.co.uk | fuer'n Durst gibts a Wasser -
XLIV-DCCCII-CCXII-DCCCXXXI      | bloss fuer d' Dummheit gibts nix.
                                |     (Anon. aus Bayern)


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

Date: Fri, 24 Jul 1998 07:39:48 -0400
From: "news" <RABM@prodigy.net>
Subject: best way of diffing two strings
Message-Id: <6p9rn2$38ho$1@newssvr04-int.news.prodigy.com>

I have two strings $one and $two. I'd like to know the index of the first
character that is different in the two strings (e.g., "abcdef" vs "abxyef"
=>
3rd). I could do it fortran style:

$i=0;$i++ until substr($one,$i,1) ne substr($two,$i,1);

but that seems likely there is a more efficient way I just haven't thought
of????

-- Vinny Murphy




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

Date: Fri, 24 Jul 1998 12:07:27 +0100
From: Mark Simonetti <marks@webleicester.co.uk>
Subject: Code showing apparent "Perl While Bug"
Message-Id: <35B86AEF.167E@webleicester.co.uk>

Try this with perl (latest version)..
It should display "Woohoo" twice right ?

#!/usr/local/bin/perl -w
# Proggy to show while bug

my $hash = {};

$$hash{'test1'} = 'pants';
$$hash{'test2'} = 'wibble';
$$hash{'test3'} = 'wobble';

&test($hash, 'wibble');
&test($hash, 'pants');

sub test {
  my($donkey, $srch) = @_;
  my($prm1, $prm2);

  while(($prm1, $prm2) = each(%$donkey)) {
    if($prm2 eq $srch) {
      print "Woohoo !\n";
      return(1);
    }
  }

  print "ahh pants !\n";
}

# End

--
=================================
Mark Simonetti
se96ms@dmu.ac.uk
marks@webleicester.co.uk
http://www.cms.dmu.ac.uk/~se96ms/
=================================

"I used to be indecisive, but now I'm not so sure."


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

Date: Fri, 24 Jul 1998 09:22:56 GMT
From: dwiesel@my-dejanews.com
Subject: extracting price from string (again)
Message-Id: <6p9jpe$25b$1@nnrp1.dejanews.com>

Hi again,

Thank you for all you answers. I've tried a lot of things that you suggested
but... it still does not work. The problem is that when I asked you the first
time I didn't think it was necessary to tell you the whole $string. But now I
realise that it is.

The string could either look like this

$string = "add_|9163604728|author_name|book_tile||400.00|V";

or like this

$string = "add_|9163604728|author_name|book_tile|||400.00|V";

I want $1 to be '400.00' or '400' (it doesn't matter)

This is what I've tried

$string =~ /\|{2,3}(.+?)\|V/;
$string =~ /\|\|+(\d{3,4}).00\|V/;   # Always ends with '.00'

but it doesn't work.

// Daniel

> I have a small problem. I have a string could look either like this
>
> $string = 'product||500.00||';
>
> or like this
>
> $string = 'product|||500.00||';
>
> I want to extract the price from $string. I have done it like this...

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 24 Jul 1998 11:19:01 +0100
From: "Simon Fairey" <simonf@conduit.co.uk>
Subject: Re: extracting price from string (again)
Message-Id: <35b85ec8.0@nnrp1.news.uk.psi.net>

Heheheh *sigh*

Ok I make one suggestion and one assumption :-)

Assumption: This is the complete line containing essentially 6 fields.

Suggestion: Split the line and extract the required field as follows:

    $price = (split /\|+/, $string )[4];

Are we getting there...or is there more to tell ;-)

Have Fun

Simon
dwiesel@my-dejanews.com wrote in message
<6p9jpe$25b$1@nnrp1.dejanews.com>...
>Hi again,
>
>Thank you for all you answers. I've tried a lot of things that you
suggested
>but... it still does not work. The problem is that when I asked you the
first
>time I didn't think it was necessary to tell you the whole $string. But now
I
>realise that it is.
>
>The string could either look like this
>
>$string = "add_|9163604728|author_name|book_tile||400.00|V";
>
>or like this
>
>$string = "add_|9163604728|author_name|book_tile|||400.00|V";
>
>I want $1 to be '400.00' or '400' (it doesn't matter)
>
>This is what I've tried
>
>$string =~ /\|{2,3}(.+?)\|V/;
>$string =~ /\|\|+(\d{3,4}).00\|V/;   # Always ends with '.00'
>
>but it doesn't work.
>
>// Daniel
>
>> I have a small problem. I have a string could look either like this
>>
>> $string = 'product||500.00||';
>>
>> or like this
>>
>> $string = 'product|||500.00||';
>>
>> I want to extract the price from $string. I have done it like this...
>
>-----== Posted via Deja News, The Leader in Internet Discussion ==-----
>http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




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

Date: Fri, 24 Jul 1998 11:30:56 GMT
From: sjborden@my-dejanews.com
Subject: future date in epoch time
Message-Id: <6p9r9g$oqn$1@nnrp1.dejanews.com>

Does anyone  have any ideas how to take a future date (i.e. 12/31/98) and
convert it to epoch time?

Thank you.
Sue

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 24 Jul 1998 11:30:45 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: hashes in perl
Message-Id: <35B87065.795CE02@inlink.com>

Neil Frenette wrote:
> 
> When I write a key-value pair to a hash, then write another
> key-value pair to the same hash, same key, different value.
> 
> Which value gets stored in the hash ???

Have you tried it???


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

Date: 24 Jul 1998 11:54:50 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: hashes in perl
Message-Id: <slrn6rgtip.1de.gabor@localhost.vmunix.com>

In comp.lang.perl.misc, Jason Holland <jason.holland@dial.pipex.com> wrote :
# Neil Frenette wrote:
# > 
# > When I write a key-value pair to a hash, then write another
# > key-value pair to the same hash, same key, different value.
# > 
# > Which value gets stored in the hash ???
# 
# The last one overwrites the previous one.
# 
# Note: I use this technique to delete duplicate array members, like this:
# 
# 	sub uniq {
# 		my @array = shift;
# 		my %hash;
# 		foreach ( @array ) {
# 			$hash{$_} = 1;
# 		} 
# 		@array = undef;
# 		foreach ( keys( %hash ) ) {
# 			if( $hash{$_} ) {
# 				push( @array, $_ );
# 			}
# 		}
# 		return(1);
# 	}

That's a lot of code to do something that can be done with two lines.
Plus, your code won't work.  Check your logic. :)

@foo = qw(hello world hello all you hello me nice day and all);

@foo{@foo} = (1) x @foo;
@foo = keys %foo; # the order will most likely be different than in the
                  # original

# 
# Every time you assign to a hash element, the previous data is destroyed.
# 
# Bye!


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

Date: Fri, 24 Jul 1998 17:52:32 +0800
From: nekobe <nekobe@hpl.me.tku.edu.tw>
Subject: How can I install GD.pm on Win32(9x/NT)
Message-Id: <35B85960.48CFB0A9@hpl.me.tku.edu.tw>

I want to use perl CGI on IIS & PWS
so, i've install
1.Perl for Win32 Intel/x86 binary
2.PerlScript Intel/x86 binary
3.Perl for ISAPI  Intel/x86 binary

I try to copy GD.pm to perl lib directory.

Now, how can I use GD.pm to product a gif image for web?
and why if I write that line "use GD;"
my browser will show me that "'D:\InetPub\wwwroot\gd.pl' script produced
no output "
How can I solve this question?



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

Date: Fri, 24 Jul 1998 09:48:15 GMT
From: adtp@cix.compulink.co.uk ("Advent Dtp")
Subject: Re: Last Name First...
Message-Id: <EwLF8F.EDz@cix.compulink.co.uk>

In article <35b7785a.643405@news.ioa.com>, al@ioa.com (Al Gordon) wrote:

> Gurus, help!
> 
> I have a text tab-delimeted file that follows a format something like
> this:
> 
> field 1<tab>field 2<tab>field 3<tab> ... etc.
> 
> The third field contains names of businesses and individuals.
> Businesses might be something like:  "Joe Smith Corp." (without the
> quotes) and individuals are listed like "Smith, Joe" or "Smith, Joe
> W." (again, without the quotes).
> 
> I need to convert the "lastname, firstname" formatted text in the file
> to "firstname lastname" (both without quotes).  The business names in
> the third field will not contain commas (or at least I hope they
> don't).
> 
> I know that Perl is the perfect tool for the job, but I'm not
> proficient enough in it to knock out what should be a simple task.
> 
> Anyone feel like helping out?  It'd be appreciated.  I'm against a
> deadline to get this done today, so that the file can be converted and
> imported into a customer database.  :P
> 
> Thanks in advance.
> 
> 

Sorry, can't resist the one-liner:

perl -pi -e 's/^([^\t]*\t[^\t]*\t)([^\t,]*), (?!Inc)([^\t]*)/$1$3 $2/' fn


Dave Hartnoll.


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

Date: Fri, 24 Jul 1998 09:10:13 GMT
From: eoloughlin@my-dejanews.com
Subject: Re: MsDev Automation with Perl
Message-Id: <6p9j1k$1ik$1@nnrp1.dejanews.com>

In article <35b78c4d.0@news.new-era.net>,
  scott@softbase.com wrote:
> eoloughlin@my-dejanews.com wrote:
>
> > I'm trying to do an automated nightly build with DevStudio using perl & OLE.
>
> Easy! Well, once you know how!
 .
 .
 .
> $p = $ds->Documents->Open($dswfile);
> $ds->RebuildAll();
> $ds->Quit();
>

Thanks Scott, but I'm already doing something along those lines.
My problem is that we've got several projects in every workspace,
where there's one (or more) main project relevant to the
workspace and other projects are inserted to allow build
dependencies be specified.

It would be too error prone to request that people always keep the
active project set to the 'main' project in the workspace so what
I want to do is to set the active project through OLE before doing
the Build/RebuildAll() step.

So far, I've been unable to do this without getting an OLE error,
which I don't know how to interpret. See my original post for how
I attempted to do this.

If anyone knows how to interpret the value returned by
Win32::OLELastError (in the context of DevStudio), I'd appreciate
some pointers.

Ed O'Loughlin.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 24 Jul 1998 10:42:32 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Multiple Key Sort
Message-Id: <35B85708.6696EA59@nortel.co.uk>

M.J.T. Guy wrote:
> 
> What do you mean?   Do you mean "What rule does sort use to decide
> which pairs of elements to compare?"    If so, read up about qsort()
> in any textbook.     Knuth Volume 3 "Sorting and Searching" will tell
> you FMTYEWTK on the subject.
> 
*** OFF TOPIC *** OFF TOPIC *** OFF TOPIC *** OFF TOPIC ***

For anyone who doesn't study (has studied) computing:

http://www-jime.open.ac.uk/97/1/

Especially:
4.2.1.
      Bill has a bug 
 4.2.2.
      Bill spots the
      bug 
 4.2.3.
      Bill fixes the
      bug 
 4.2.4.
      Bill needs
      help 
 4.2.5.
      Ingrid to the
      rescue 
 4.2.6.
      Bill shows off 

There is a list of explanations + java applets illustrating the qsort
algorithm through branching trees, showing which function is called
where with which arguments. Check those out, there are quite informative
and interesting, if you don't know this stuff already (like me :)
 ...


-- 
____________________________________________________________
Frank Quednau               
http://www.surrey.ac.uk/~me51fq
________________________________________________


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

Date: Fri, 24 Jul 1998 12:19:54 +0100
From: "Andy Holyer" <andyh@pavilion.co.uk>
Subject: Perl script in place of getty?
Message-Id: <6p9qmd$7qr$1@grind.server.pavilion.net>

I've written up a simple BBS in Perl5, which we want to have sitting
permanently on a number of modem lines of our FreeBSD box. The "correct" way
to do this is to make the script as an entry in /dev/ttys instead of getty.

I've got a line like this in /etc/ttys:

ttyd3 "/usr/somedir/script -arg -arg" unknown dialup on secure

All that happens in the moment is that I get:

init: getty repeating too quickly on port ....

- so the script is crashing out. The thing I need some hints on is why. My
guesses so far are these:

1) init doesn't spawn processes via a shell, so the #!/usr/local/bin/perl
line doesn't work

Possible, but putting "/usr/local/bin/perl5 /usr/somedir/script" in ttys
doesn't work either.

2) The script is failing for some other reason (lack of environment, etc.)

I can't work out how to get error messages from init client processes - is
there an easy way.

I've gone through the script and all relative paths are now absolute ones.

3) init routines just have to be in C

I'd rather not take this route, but if it must be, it must be. Any
suggestions?

Many thanks in advance for any help.



--
Andy Holyer, Lewes, UK



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

Date: Fri, 24 Jul 1998 11:34:04 +0200
From: Damien Lachuer <dlachuer@araxe.fr>
Subject: Perl SETUID
Message-Id: <35B8550C.A729A93@araxe.fr>

Hello everyone.

I'd like to known what is exactely perl-suid, where I can find it and
how
to use it. (I know I must look at the documentation, but I don't have
found
a good one)

Thank you.



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

Date: Fri, 24 Jul 1998 12:21:44 +0200
From: Francoise Leduc <leduc@kazibao.net>
To: Calle Dybedahl <qdtcall@esb.ericsson.se>
Subject: Re: problem with NS cookies
Message-Id: <35B86038.CA416D60@kazibao.net>

yes it's PERL problem !!! my problem is that I can't modify a javascript
cookie with PERL when the client browser is Netscape...
Any solution ?


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

Date: Fri, 24 Jul 1998 09:02:17 GMT
From: merzky@my-dejanews.com
Subject: Re: question about the @_ variable
Message-Id: <6p9iin$tt$1@nnrp1.dejanews.com>

In article <6p7t9d$rd0$1@nnrp2.crl.com>,
  "Larry" <larryq@nospam.tuttle.com> wrote:
> Hi all,
>
>     I've got a little subroutine that does something like the following:
>
> sub MySub
>
> {
>     $tempvar=@_;
>     print length($tempvar);
> }
> the subroutine gets called like so:
>
> $hello="hello world";
> &MySub($hello);
>
> What's strange is that the print $length($tempvar) statement above always
> prints out a "1".  So my question is how can I get the actual length of my
> string out of that length() function?  Just a basic question, but I've left
> my Perl book at home!
>
   my ($tempvar) = $_[0];

should do it. A array evaluated in scalar context gives number of
elements... - 1 :-)

Andre.


--
Andre Merzky
pinocchio@earthling.net
http://pino.home.pages.de/

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Fri, 24 Jul 1998 12:22:06 +0200
From: Kamran Iranpour <kamrani@ifi.uio.no>
Subject: rcmd
Message-Id: <35B8604E.1A90@ifi.uio.no>

Someone said that I can use "rcmd" in perl. But I cant
find that in the perl book and don't know the syntax.

Is there anything like that in Perl ?

Thanks

Kamran


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

Date: Fri, 24 Jul 1998 12:19:52 GMT
From: hector@followme.com (Hector Catre)
Subject: Server Side Includes
Message-Id: <6p9j67$btj$1@nntp3.uunet.ca>

I'm having trouble activating a server side include

My server administrator said that only file extensions with .shtml will be 
parsed, which lead to the following line:

<!--#exec cgi="/cgi-bin/test.shtml"-->

instead of :

<!--#exec cgi="/cgi-bin/test.cgi"-->

but this doesn't work. 

What the hech if the differance when they say that only  .shtml files will be 
parsed?

Hector Catre
hector@followme.com


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

Date: Fri, 24 Jul 1998 09:24:57 GMT
From: merzky@my-dejanews.com
Subject: Re: What's wrong?
Message-Id: <6p9jte$271$1@nnrp1.dejanews.com>

In article <6yUeANs1w-B@khms.westfalen.de>,
  kaih=6yUeANs1w-B@khms.westfalen.de (Kai Henningsen) wrote:
> merzky@physik.hu-berlin.de  wrote on 21.07.98 in
<6p30ab$c1u$1@nnrp1.dejanews.com>:
>
> > Anyway, ex does not explain Wilsons error message. This rather comes from
> > the space in the first line, which prevents from calling perl at all. This
> > actually seems to work on some systems/shells. Does anyone know who is
> > interpreting this?
>
> Under Linux, the kernel does, and it gets it right with as well as without
> the space, so that isn't it.
>
> *How* is he running this script?
>
> $ ./ex       # this should work
> $ . ex       # this should give "print not found

Hmm, if I do a '. ex' on linux, it gives me a '/bin/.: permission denied',
since /bin is first in path, and has a '.'. But yep, some shells use '.'
as source, and this will give 'print: command not found', thats right.

This seems more reasonable than all the answers saying: 'do not call
you program ex!', since if it would actually call /bin/ex and not
the script, there wouldn'b be an error message..:-)

Andre.

> Kai
> --
> http://www.westfalen.de/private/khms/
> "... by God I *KNOW* what this network is for, and you can't have it."
>   - Russ Allbery (rra@stanford.edu)
>


--
Andre Merzky
pinocchio@earthling.net
http://pino.home.pages.de/

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

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

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