[8703] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2320 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 14 17:07:18 1998

Date: Tue, 14 Apr 98 14:00:30 -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           Tue, 14 Apr 1998     Volume: 8 Number: 2320

Today's topics:
    Re: [Q] find largest value in key of associative array? (Craig Berry)
    Re: Bill Gates should be invited to O'Reilly's "Free So (Andreas Borchert)
    Re: Can I install perl5.004_04 myself? (A. Deckers)
        checking file 'lock' in NT (Ali Mehdizadeh)
    Re: Chicago.pm Meeting April 10 (DONUTS & DANCING GIRLS (David Adler)
    Re: Easy way to count lines in a file (Mark-Jason Dominus)
    Re: Easy way to count lines in a file <brianm@kodak.com>
    Re: File download problem in IE4.0 bidyut@yahoo.com
        FileHandle woes: can't use indirect object method invoc <mgregory@asc.sps.mot.com>
    Re: Getting the name of an SMTP server (Martin Vorlaender)
    Re: greed <jdf@pobox.com>
    Re: greed <jdf@pobox.com>
    Re: HELP: Trying to create a search application <david.x.corcoran@boeing.com>
    Re: Hide or Encrypt perl source code <tchrist@mox.perl.com>
    Re: Hide or Encrypt perl source code <tchrist@mox.perl.com>
    Re: How could I improve my perl script's speed ? <jay@rgrs.com>
        how to post to usenet with a perl cgi... auctionmaster@auctionaddict.com
        IO::Handle error. <pranav@recycler.com>
        Learning Perl <sundeep@cadence.com>
    Re: Numeric validation <tchrist@mox.perl.com>
        Password encryption and /etc/shadow file. <marcelo@msm.cl>
    Re: Perl Libraries @INC Problems (Jonathan Stowe)
    Re: Perl writes to DOS window instead of browser <david.x.corcoran@boeing.com>
    Re: Perl/CGI - stale scripts (Mark-Jason Dominus)
        Problems compiling util.c of 5.004_04 for Solaris 2.6. (Adam Preble)
    Re: Recursive Calls in Perl ? <jdf@pobox.com>
    Re: Recursive Calls in Perl ? (Andrew M. Langmead)
    Re: RMS should be invited to O'Reilly's "Free Software  (Peter Seebach)
    Re: RMS should be invited to O'Reilly's "Free Software  (Peter Seebach)
        suprise results from exit and backticks <mgregory@asc.sps.mot.com>
        sybperl: obtaining return code from stored procedure donat@wwa.com
    Re: wc -l in perl is?????? (Craig Berry)
    Re: where are the examples in the newer (blue) camel bo <tchrist@mox.perl.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 14 Apr 1998 20:02:08 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: [Q] find largest value in key of associative array?
Message-Id: <6h0fc0$kvk$2@marina.cinenet.net>

John T. Stapleton (stapes@ryn.mro.dec.com) wrote:
: I know that in the example that Stephen gave all the keys were positive,
: but if they were all negative, your solution would not work.
: 
: undef $max;		# in case defined from a previous iteration
: for $key (%aa) {

This loops over all the keys *and* values...which doesn't seem to be what 
the original poster intended.  To use this idiom you need 'keys %aa'.

:     if (! defined $max) {
: 	$max = $key;
: 	next;
:     }
:     if ($key > $max) {
: 	$max = $key;
:     }
: }

Why pay for all those in-loop conditionals?  Since you're doing 'keys 
%aa' already (as mentioned above, just write

  @keys = keys %aa;
  $max  = shift @keys;

  foreach $key (@keys) {
    $max = $key if $key > $max;
  }

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 14 Apr 98 19:46:50 GMT
From: borchert@turing.mathematik.uni-ulm.de (Andreas Borchert)
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <3533bd2a.0@news.uni-ulm.de>

On Tue, 14 Apr 1998 14:18:23 GMT, Tor Iver Wilhelmsen <toriw@online.no> wrote:
> On 14 Apr 98 06:36:26 GMT, borchert@turing.mathematik.uni-ulm.de
> (Andreas Borchert) uttered:
> 
> >Sometimes the associated reference documentation is in separate files,
> >sometimes it is even mixed with the program code (see embedded POD for
> >Perl, for example). Independent from this, it is an integral part of
> >software.
> 
> But the presence of non-free documentation (such as O'Reilly's books)
> does not prevent the existence of free documentation (the generated
> documentation in whatever format pod2X generates).

Sure. And do not have problems with that. Later up in the thread it
was stated (without examples) that there are cases where the only
available documentation was non-free.

Andreas.

-- 
Andreas Borchert, Universitaet Ulm, SAI, Helmholtzstr. 18, 89069 Ulm,  Germany
E-Mail: borchert@mathematik.uni-ulm.de
WWW:	http://www.mathematik.uni-ulm.de/sai/borchert/
PGP key available via ``finger borchert@laborix.mathematik.uni-ulm.de''


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

Date: 14 Apr 1998 19:00:51 GMT
From: Alain.Deckers@man.ac.uk (A. Deckers)
Subject: Re: Can I install perl5.004_04 myself?
Message-Id: <slrn6j7cj3.f8n.Alain.Deckers@bashful.rediris.es>

In <32FE55CB.706F@callisto.si.usherb.ca>,
	John Taylor-Johnston <eslcafe@callisto.si.usherb.ca> wrote:
>Can I install perl myself, with the modules, under my public_html

Why under public_html? This is potentially a SERIOUS security risk. Do
not make your interpreter available to all and sundry. Make sure you
know EXACTLY how your http server is configured before putting the
interpreter in a publicly accesible directory.

Alain
-- 
Perl reference: <URL:http://reference.perl.com/>
 Perl language: <URL:http://language.perl.com/>
  Perl archive: <URL:http://www.perl.com/CPAN/>
      Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>


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

Date: 14 Apr 1998 18:22:02 GMT
From: amehdiza@joule.ee.calpoly.edu (Ali Mehdizadeh)
Subject: checking file 'lock' in NT
Message-Id: <6h09ga$528$1@isnews.csc.calpoly.edu>

Hi,
Inside my perl script, I am trying to check if a file is locked by NT.
The file I am checking, is being used by another process, and when the
other process is done using that file, I want my perl script to delete
the file.  Obviously if I try to delete it before the other process is
done with it, I get an error from NT.  Something like:

The process cannot access the file because
it is being used by another process.

I have checked the faqs and info on stat() but haven't 
come up with anything.

Any help would be appreciated,
Thanks,

-Ali M.


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

Date: 14 Apr 1998 19:25:45 GMT
From: dha@panix.com (David Adler)
Subject: Re: Chicago.pm Meeting April 10 (DONUTS & DANCING GIRLS)
Message-Id: <6h0d7p$g8u@news1.panix.com>

On 7 Apr 1998 07:34:14 -0500, Jim Allenspach <jima@MCS.COM> wrote:

> Remember, ONLY Chicago.pm provides donuts and dancing girls at
>every meeting!

Well, at least here in nyc we have booze!

>Ask about our obfuscated sig!
Ok, what about it?  I think we've got a couple of those...
-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"This is Mace's planet.  We Just Live here."


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

Date: 14 Apr 1998 16:05:13 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Easy way to count lines in a file
Message-Id: <6h0fhp$2lv$1@monet.op.net>
Keywords: efficient eligible histidine posteriori


In article <Pine.SGI.3.95.980414122444.9182B-100000@vangogh.bergen.org>,
Jeff Pinyan  <jefpin@bergen.org> wrote:
>$counter = (<ACCESS>); # this should work, I think

Nope.  <ACCESS> in a scalar context reads one line from the
filehandle, not all of them, and this is a scalar context.  Putting
parentheses around an expression doesn't make it into a list.







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

Date: Tue, 14 Apr 1998 14:13:11 -0400
From: Brian Mathis <brianm@kodak.com>
Subject: Re: Easy way to count lines in a file
Message-Id: <3533A737.DAFCC0EE@kodak.com>

This is a multi-part message in MIME format.
--------------DB39CE3071A71314CA880CDE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Jeff Pinyan wrote:
> 
> #while (<ACCESS>) { counter++; }
> $counter = (<ACCESS>); # this should work, I think
> print "You have $counter lines in this file\n";
> --

Nope.

perlfaq5: How do I count the number of lines in a file? 

One fairly efficient way is to count newlines in the file. The following
program uses a feature of tr///, as documented in the
perlop manpage. If your text file doesn't end with a newline, then it's
not really a proper text file, so this may report one
fewer line than you expect. 

    $lines = 0;
    open(FILE, $filename) or die "Can't open `$filename': $!";
    while (sysread FILE, $buffer, 4096) {
        $lines += ($buffer =~ tr/\n//);
    }
    close FILE;
--------------DB39CE3071A71314CA880CDE
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Brian Mathis
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Brian Mathis
n:              Mathis;Brian
org:            US&C Intranet Services
adr:            Mail Code: 01269;;343 State Street;Rochester;New York;14560-1269;6/15/KO, USA
email;internet: brianm@kodak.com
tel;work:       1(716)724-7960
tel;fax:        1(716)724-2496
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------DB39CE3071A71314CA880CDE--



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

Date: Tue, 14 Apr 1998 14:29:57 -0600
From: bidyut@yahoo.com
Subject: Re: File download problem in IE4.0
Message-Id: <6h0dfl$tg2$1@nnrp1.dejanews.com>

Hi guys,

One more point i have found out after doing a lot of work on that. If I
hardcode the filename is CGI script, then IE is able to download and show the
file in browser. But if i try to get the filename dynamically(i.e passing
through post method from a form and obtaining it by using
$query->param('filename')), then IE fails in showing up the file. So, this
means there is some problem in the filename due to the different way of
processing.

Now, i am certain, the problem is in CGI script. Any help for this now.. at
least..

thanks
Bidyut

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 13 Apr 1998 21:35:34 -0700
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: FileHandle woes: can't use indirect object method invocation?
Message-Id: <r867kd9g15.fsf@asc.sps.mot.com>


Hi,

Not long ago I asked whether anyone had made a way to find out the
name of a file (ie the parameter passed to open) from a FileHandle
object.

(The reasons for wanting this are

 1) methods that get passed open FileHandles need to be able to issue
    warnings about the associated file.
 2) I hate seeing
   
     $File->close() or die "Couldn't close $FileName:$!\n";

    where $FileName has to be the name that was used to open $File:
    what if it's not handly to have around>
  
)

The general response was "write something to do this yourself".

OK - so I tried.  It's appended.  

The problem now seems to be that I can't use indirect object method
invocation for methods who's names clash with perl functions.  This is
unexpectedly obstructive for perl....

I wanted to create my own 'NamedFile' object, and delegate most of the
method calls to FileHandle.  Unfortunately, this causes perl to barf:

  $File = new NamedFile;
  $File->open(">foo") or die "Couldn't write foo:$!\n";

  print $File "Yay\n";   # booo!  

On the line marked "booo!" I get from perl:

   Not a GLOB reference at ./trial line xxx.

Well - of course it's not: I just want NamedFile::print to get invoked!

OTOH,

  $File->print("Yay\n");

works just fine, but this is hardly a 'drop in' replacement for
FileHandle operation!

Thanks for any insights... (including observations about why I
shouldn't be worring about this)!

Martin.


# Since perl won't let us subclass FileHandle, lets use AUTOLOAD to delegate...

package NamedFile;

require 5.003;

use FileHandle;

sub new 
{
  my $type = shift;

  my $self = {};

  $self->{'FileName'} = "";

  bless $self, $type;
}


sub open 
{
  my $self = shift;
  
  $self->{'NamedFile'} = $_[0];

  $self->{'FileHandle'} = new FileHandle;

  return ($self->{'FileHandle'}->open(@_));
}

sub name 
{
  return $self->{'NamedFile'};
}

sub AUTOLOAD
{
  # delegate all other calls to the FileHandle package...

  my $self = shift;

  my @FileHandleArgs = @_;

  my $call = $AUTOLOAD;

  $call =~ s/.*:://;

  $self->{'FileHandle'}->$call(@FileHandleArgs);
}

1;



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

Date: Tue, 14 Apr 1998 20:17:37 +0200
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Getting the name of an SMTP server
Message-Id: <3533a841.524144494f47414741@radiogaga.harz.de>

Hakon Stein (hakon@netbureauet.dk) wrote:
: How does one get the name of an SMTP server from the network name in an
: email address ?

: E.g. My own address is "hakon@netbureauet.dk", but my mailserver's name
: is "mail.netbureauet.dk" (and several other aliases).
: I want to do this in order to verify email addresses. In order to do
: this i need to connect to the remote host and ask him.

: If any of you know of a way to find the name for a particular server in
: a network, providing a particular service (in this case MX) - or of
: another way to verify addresses, i'm grateful.

Give the following a try. I used it to send mail...

    open NSIN, "-|"
      or exec( $nslookup, '-query=MX', $todomain )
      or die "Error executing $nslookup: $!\n";
    my $nsin = undef;
    {
      if (!defined $nsin)
      {
        # try whether $todomain is a mail host itself
        $nsin = "mail exchanger = $todomain";
      }
      elsif (!defined( $nsin = <NSIN> ))
      {
        last; # Give up...
      }
  
      redo if $nsin !~ /mail exchanger = (\S+)$/i;
  
      my $smtp = Net::SMTP->new( $1, %options ) or redo;
      # ...whatever...do set $success
      $smtp->quit;

      redo if !$success;
    }
    close NSIN;


cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


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

Date: 14 Apr 1998 14:46:20 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: greed
Message-Id: <g1jggp9v.fsf@mailhost.panix.com>

sstark@informix.com (Scott Stark) writes:

> JHicon[UNIX]JH some more text some more text JHicon[DOS]JH etc.
>
> I want the script to extract the text between the []
> brackets in the first instance

I would do it like this:

   m{
      \[      # find the first left bracket
      (       # save in $1
       [^]]+  # one or more non right-bracket characters
      )
    }

> I've tried putting a question mark in several positions but can't
> get it to work correctly. How do I make it 'non-greedy'?

The technique I outline above is faster in general than the non-greedy
modifier "?" because it doesn't require as much backtracking.  But,
since you asked, 

   /\[(.+?)\]/

> BTW, I've looked through both of the Schwartz books and found them
> so poorly indexed I couldn't find anything useful about greediness.

I don't know what you mean by "both of the Schwartz books," "poorly
indexed," or "useful."  The index to _Programming Perl_, 2nd Ed., has
an entry for "greedy matching," which leads to clear discussions of
the non-greedy quantifier-modifier.  

Furthermore, the *first* place to look is the documentation that
accompanies perl.  In this case, the "perlfaq6" document probably
would have answered your question right away ("What does it mean that
regexps are greedy? How can I get around it?").  The "perlre" document
is the definitive reference to Perl's regex features, and also would
have answered your question.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: 14 Apr 1998 14:54:47 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: greed
Message-Id: <d8ekgovs.fsf@mailhost.panix.com>

Jonathan Feinberg <jdf@pobox.com> writes:

>    m{
>       \[      # find the first left bracket
>       (       # save in $1
>        [^]]+  # one or more non right-bracket characters
>       )
>     }
       ^
Of course, I left out the "x" modifier.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: Tue, 14 Apr 1998 18:55:59 GMT
From: David Corcoran <david.x.corcoran@boeing.com>
To: Alan McCoy <a.r.mccoy@larc.nasa.gov>
Subject: Re: HELP: Trying to create a search application
Message-Id: <3533B13F.32BD@boeing.com>

Alan McCoy wrote:
> 
> We have several researchers here who currently have to search through
> several different formats of information, such as html documents,
> subscription-based databases, and Usenet groups.

Don't know much about this but it may a source of ideas or leads

	http://strobe.weeg.uiowa.edu/~edhill/public/webpluck/


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

Date: 14 Apr 1998 19:02:36 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Hide or Encrypt perl source code
Message-Id: <6h0bsc$s9g$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    "Namsuk Kim" <a-namsuk@microsoft.com> writes:
			   ^^^^^^^^^  hmmm
:You mean you want it to be binary.  Try perl2exe.

No sir. perl2exe is a lie.  It doesn't compile 
your source code into machine code.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


    "A journey of a thousand miles continues with the second step." --Larry Wall


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

Date: 14 Apr 1998 19:52:48 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Hide or Encrypt perl source code
Message-Id: <6h0eqg$2e7$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    eslcafe@callisto.si.usherb.ca writes:
:What I do is chmod 711 which allows the public to execute the script,
:but not read it. I do it with all my scripts.

You have a very strange system.   What you have advised works on no system
I have ever seen.  If the interpreter can't read the script, you lose.

:Most scripts you pick up reccomend chmod 755 or 777, which are too
:dangerous in my mind. 

I can't see any danger with 755.  It's 777 that has naughtiness.  Being
able to read something is no danger.  In fact, it enhances security by
avoiding the oxymoronic security-through-obscurity myth.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
There are still some other things to do, so don't think if I didn't fix
your favorite bug that your bug report is in the bit bucket.  (It may be,
but don't think it.  :-)  Larry Wall in <7238@jpl-devvax.JPL.NASA.GOV>


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

Date: 14 Apr 1998 15:06:30 -0400
From: Jay Rogers <jay@rgrs.com>
To: Denis DORR <dorr@cetrel.lu>
Subject: Re: How could I improve my perl script's speed ?
Message-Id: <82iuoc9qa1.fsf@shell2.shore.net>

Denis DORR <dorr@cetrel.lu> writes:
> I have to write a script to erase all data on hard disks.
> I've written the following one that does the job, but it takes more than
> 40 minutes for a 2Gb disk.

[snip]

> $repeat=1024 * 1024;
> 
> open CRYPTDD, "| crypt $crypt_key | dd bs=8k of=$disk"
>      or die "Cannot fork : $!\n";
> 
> while ( true ) {
>     print CRYPTDD pack ("c64", 33..96) x $repeat ;
> }

Perhaps it's not worth the time generating and encrypting 64MB strings
when you just want to erase the disk?

How about something along the lines of:

   system "dd if=/dev/zero of=$disk count=$num_blocks bs=63k";

--
Jay Rogers
jay@rgrs.com


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

Date: Tue, 14 Apr 1998 13:57:54 -0600
From: auctionmaster@auctionaddict.com
Subject: how to post to usenet with a perl cgi...
Message-Id: <6h0bji$qqg$1@nnrp1.dejanews.com>

does anyone know of any scripts that will post to usenet via cgi written in
perl?

please respond to email.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 14 Apr 1998 19:37:53 GMT
From: "Pranav Parekh" <pranav@recycler.com>
Subject: IO::Handle error.
Message-Id: <01bd67dd$7fad9e80$e10110ac@la-5592>

Hi!

I am new to this list.  I hope my question is not off topic for this list. 
My apologies if it is.

Well, I have a perl script that is giving me the following error:

Can't locate object method "autoflush" via package "IO::Handle" at
/theperlfile.pl line 186.

I looked at line 186 and the code on that line is: SOCKET->autoflush();

The platform I am trying to run this on is as follows:
Dual Pentium 90
MS NT Server 4.0 with SP3
MS IIS4.0
ActiveState Perl 5.003 Build 316

Does any one have any ideas as to what might be wrong?  Any help is greatly
appreciated.  Thanks in advance.

Kind Regards,
___________________________________
Pranav J. Parekh
http://www.recycler.com
___________________________________





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

Date: Tue, 14 Apr 1998 12:20:43 -0700
From: Sundeep Singatwaria <sundeep@cadence.com>
Subject: Learning Perl
Message-Id: <3533B70B.3213@cadence.com>

Hi All
I'm trying to learn Perl but 'm not able to find any pointers where I
can start. Can somebody give some good pointers for begineers. Is it a
necessity for one to be good in Unix Scripts before learning Perl.

Help appreciated
-Sundeep


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

Date: 14 Apr 1998 18:51:28 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Numeric validation
Message-Id: <6h0b7g$q1g$2@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, gurun@acc.umu.se writes:
:Hell, I'm pretty used to unix man pages but I really have to say that
:perl has the worst I've seen in years. Written by hackers, for hackers,
:more of the "hard to write, should be hard to read"-type..

Do you have any more acid to throw in the eyes of your benfactors?

--tom, who sees no reason to write any more documentation for ingrates.
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
Besides, including <std_ice_cubes.h> is a fatal error on machines that
don't have it yet.  Bad language design, there...  :-)
        --Larry Wall in <1991Aug22.220929.6857@netlabs.com>


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

Date: Mon, 13 Apr 1998 15:24:37 -0400
From: "Marcelo J. Iturbe" <marcelo@msm.cl>
Subject: Password encryption and /etc/shadow file.
Message-Id: <35326672.5216@msm.cl>

Hello,
I have writen a script that changes a users password randomly.
For this I have the following code:

  @ARGV = ("/etc/shadow");
  $^I = ".bak";
  srand($$+time);
  @s=("a".."z","A".."Z","0".."9",".","/");
  $s=$s[rand(64)].$s[rand(64)];  # set a 2 character salt thingy
  $c=crypt($p,$s);   # $p is password, $s is salt character
  while (<>) {
     s/^\Q$u\E:[^:]*:/$u:$c:/   # $u is userID and $c is new passwd
     print;
  }

The problem here is that the new password that is placed in the
/etc/shadow file is not compatible with the system. I try to log in
using the new password and fail.
I have tried various srand() methods, I have even tried omiting the
srand method with no success.
I have tried using 1,2,3,4, and 5 salt characters and none worked.

Thanks for your help
Marcelo Iturbe


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

Date: Mon, 13 Apr 1998 12:04:51 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl Libraries @INC Problems
Message-Id: <3531ea55.1686307@news.btinternet.com>

On  Wed, 8 Apr 1998 16:37:01 -0400 <new_user@email.msn.com> wrote:
>I have two versions of Perl on the PC:
>1. Version 5.004 with DBI and DBD Oracle modules built
>2. Version 5.00307 (I think) cygwin32 that came with some software I
>purchased

<then>

On Thu, 9 Apr 1998 10:15:32 -0400, "Bill Hess" <brhess@email.msn.com>
wrote:

<snip>

>Can't find loadable object for module Cmom in @INC at
>c:/epd/dm/v200/perl5/lib/A
>w.pm line 26
>BEGIN failed--compilation aborted at c:/epd/dm/v200/perl5/lib/Aw.pm line 26.
>

I think that your problem is the result of using a module that has
been compiled for Win32 with Cygwin32 with another perl binary.  The
way in which the two binaries work with respect to XS modules is most
probably different. 

There may be a simple work-around which I havent thought of but You'll
probably either have to get a version of your module that has been
built for the the binary distribution of Perl you are using or get the
full cygwin32 distribution and then compile yourself a perl5.004  with
that and hopefully your module will work..

/J\ 
Jonathan Stowe
See the MetaFaq at http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm


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

Date: Tue, 14 Apr 1998 19:07:03 GMT
From: David Corcoran <david.x.corcoran@boeing.com>
To: Richard Porter <rlp6@cornell.edu.nospam>
Subject: Re: Perl writes to DOS window instead of browser
Message-Id: <3533B3D7.BFE@boeing.com>

Richard Porter wrote:
> 
> Hi,
> 
> I am using PERL 5.003 on Windows 95 using Personal Web Server (IIS) and IE
> 3.02.

Don't know the answer to your questtion but you might 
try your question here:

  http://www.activestate.com/support/mailing_lists.htm

or search the archives:

  http://www.divinf.it/PERL-WIN32/


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

Date: 14 Apr 1998 16:08:02 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Perl/CGI - stale scripts
Message-Id: <6h0fn2$2n8$1@monet.op.net>
Keywords: boogie flail Madagascar whee

In article <35339DB6.3B4756E8@styx.or.fedex.com>,
Igor Vulfson  <igorv@styx.or.fedex.com> wrote:
>Is there a way to have a perl script timeout and exit if it's been
>running for more than N seconds? 

Look into the `alarm' function.

> Is there a reason why this CGI script would be left running?

Your server sucks?



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

Date: 14 Apr 1998 18:44:07 GMT
From: adamp@cc.gatech.edu (Adam Preble)
Subject: Problems compiling util.c of 5.004_04 for Solaris 2.6.
Message-Id: <6h0apn$auk$1@solaria.cc.gatech.edu>

Howdy,
	I'm working on getting Perl 5.00404 compiled for Solaris 2.6.
I got rid of the DATAMODEL_NATIVE problem by recompiling gcc for 2.6,
but util.c is complaining when I 'make.'  Here's what it's saying:

`sh  cflags libperl.a util.o`  util.c
          CCCMD =  /usr/local/bin/gcc -DPERL_CORE -c -I/usr/local/include -O   
util.c: In function `Perl_form':
util.c:1107: number of arguments doesn't match prototype
proto.h:125: prototype declaration
util.c: In function `Perl_die':
util.c:1164: number of arguments doesn't match prototype
proto.h:70: prototype declaration
util.c: In function `Perl_croak':
util.c:1231: argument `pat' doesn't match prototype
proto.h:47: prototype declaration
util.c:1231: number of arguments doesn't match prototype
proto.h:47: prototype declaration
util.c: In function `Perl_warn':
util.c:1288: number of arguments doesn't match prototype
proto.h:529: prototype declaration
*** Error code 1
make: Fatal error: Command failed for target `util.o'

Can anybody give me a suggestion as to what the problem might be?  make dep 
seems to go off without a hitch, as do the previous stages of make.

Thanks,

Adam

--
|          Adam Preble - CS @ Georgia Tech - adamp@cc.gatech.edu        |
|      "Life's like a movie, write your own ending.." - The Muppets     |
| "We were just a band who made it very big, that's all." - John Lennon |


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

Date: 14 Apr 1998 14:51:33 -0500
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Recursive Calls in Perl ?
Message-Id: <emz0gp16.fsf@mailhost.panix.com>

Grace Cheng <gcheng@corp.sgi.com> writes:

> The manul says the "Subroutines may be called recursively"
> but I couldn't seem to get it to work. 

Grace - if you post a short code example that doesn't work the way you
think it should, we'll be more able to help you.  In the meantime,
please read the "perlsub" document that comes with perl.  I'm guessing
that you're having trouble with parameter passing and scoping.  Here's
a recursive subroutine that does work.

   sub fact ($) {
      my $n = shift;
      return 1 if $n < 2;
      return $n * fact($n - 1);
   }

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY


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

Date: Tue, 14 Apr 1998 19:31:30 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Recursive Calls in Perl ?
Message-Id: <ErF4wI.K2y@world.std.com>

Grace Cheng <gcheng@corp.sgi.com> writes:

>The manul says the "Subroutines may be called recursively"
>but I couldn't seem to get it to work. 

Can't you show us an example that didn't work? It would be easier to
help you if we could see what is going wrong.

Without your code, the only things I can think of mentioning are:

1. Make sure all the variables used in e subroutine are either passed
to it, or lexically localized (with my()) or dynamically scoped (with
local()) In most cases, you want to use my().

2. Filehandles and directory handles need to be local too, the best
way of doing this is to use the IO::File and Dirhandle modules.

Since I don't have the towers of hanoi algorithm on the top of my
head,the best thing that I can come up with for an example is
factorial, which is better off done with an iterative algorithm.

#!/usr/bin/perl -w

for $fact (@ARGV) {
  print "!$fact = ", factorial($fact), "\n";
}

sub factorial {
  my $arg = shift;
  return 1 if $arg <= 1;

  return $arg * factorial($arg - 1);
}
-- 
Andrew Langmead


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

Date: Tue, 14 Apr 1998 18:41:16 GMT
From: seebs@plethora.net (Peter Seebach)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <g5OY.52$oa7.285040@ptah.visi.com>

In article <6gkqko$fl8$1@justus.ecc.lu>,
Stefaan A Eeckels <Stefaan.Eeckels@ecc.lu> wrote:
>Back in 1993, I discovered a problem with SCO V3.2's handling
>of volumes it mounted through NFS from a SunOS box.
>It was quite weird - files smaller than 8K gave no problems,
>but larger ones could not be opened.  The SCO box acted as 
>if the NFS server were down. I traced the packets on the
>network, wrote a couple of programs to demonstrate the bug,
>and submitted that to Olivetti (our vendor). They didn't have
>a clue, and submitted the problem to SCO. I've not heard from
>them since ;-). I fixed the problem by mounting the SCO volume
>on the SunOS box, and since 1995 the problem has gone away
>together with the SCO machine.

Curiously, at my previous job, we had exactly the same problem, using
Unixware 1.1.x (for compatability with proprietary software) and Solaris
2.x.

-s
-- 
Copyright '98, All rights reserved.  Peter Seebach / seebs@plethora.net
C/Unix wizard, Pro-commerce radical, Spam fighter.  Boycott Spamazon!
Not speaking for my employer.  Questions on C/Unix?  Send mail for help.
Visit my new ISP <URL:http://www.plethora.net/> --- More Net, Less Spam!


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

Date: Tue, 14 Apr 1998 19:02:13 GMT
From: seebs@plethora.net (Peter Seebach)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <VoOY.54$oa7.285040@ptah.visi.com>

In article <MPG.f9d6baf1030122298977d@news.cableinet.co.uk>,
Barry O'Neill <boneil@nothanks.cableinet.co.uk> wrote:
>You are essentially giving away your code for anyone to use as they 
>please, with no restrictions.  To do such a thing would indicate you  
>hold your code in either extremely high or extremely low regard.

Why does it indicate this?  Maybe you just like people and want them to have
your code.

>If the former, you should consider protecting your code with licensing to
>enable others to benefit from its availability and source code.

I don't follow.  If my code is in the public domain, everyone can benefit
from it.  No one can ever make *my* code be anything but public domain.
They can derive things from it, but people still benefit from the availability
and source code of *my* work.

-s
-- 
Copyright '98, All rights reserved.  Peter Seebach / seebs@plethora.net
C/Unix wizard, Pro-commerce radical, Spam fighter.  Boycott Spamazon!
Not speaking for my employer.  Questions on C/Unix?  Send mail for help.
Visit my new ISP <URL:http://www.plethora.net/> --- More Net, Less Spam!


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

Date: 13 Apr 1998 23:14:38 -0700
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: suprise results from exit and backticks
Message-Id: <r84szx9bg1.fsf@asc.sps.mot.com>


Hi,

I just got suprised by something like this:

in bar.pl:

  exit(1);

in foo.pl

  $r = `bar.pl`;
  $status = $?;

  exit($status);

So...  without trying it: what would you guess would be the exit
status of the execution of foo.pl?

How could I have known this?

Thanks,

Martin.

(I get '0'.  The value in $status is 256.  SunOS 4.1.4 under /bin/csh).


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

Date: Tue, 14 Apr 1998 14:56:42 -0600
From: donat@wwa.com
Subject: sybperl: obtaining return code from stored procedure
Message-Id: <6h0f1p$vht$1@nnrp1.dejanews.com>

Rather than use output parameters, I would prefer to make use of the returned
values for Sybase stored procedures.  I have attempted this using the
dbresults and
dbretstatus, to no avail.  Is there a way to accomplish this?

(using DBlib)
(I have tried this successfully using the @RETURN output parameter with:
$SQL=
"   declare \@a int
    exec cs_add_schedule
        \@RETURN=\@a output,
        \@msymbol_ukey=$$row{msymbol_ukey},
        \@event_type_ukey=2,
        \@start_date='$$row{fromdate}',
        \@end_date='$$row{todate}',
        \@info_ukey=$info_ukey,
        \@trigger_ukey=NULL
    select \@a";
            @data=$db->sql($SQL);
            print "schedule_ukey = $data[0]\n";
            $schedule_ukey=$data[0];
)

Thanks much,
Rob Donat.
donat@wwa.com

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: 14 Apr 1998 19:52:13 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: wc -l in perl is??????
Message-Id: <6h0epd$kvk$1@marina.cinenet.net>

Michael J Schout (mschout@gkg.net) wrote:
: Of course, if all you want is the output from wc -l, you could just do:
: my $linecount = `wc -l $filename`
: 
: Of course that has the drawback of forking wc.. but its a possibility..

And another disadvantage of making the app unnecessarily Unix-specific.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 14 Apr 1998 18:46:55 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: where are the examples in the newer (blue) camel book?
Message-Id: <6h0auv$q1g$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Digital Puer <digital_puer@hotmail.com> writes:
:This is probably old hat. I just bought the blue camel book
:"Programming Perl" after owning the older edition for the 
:longest time (I had gotten my perl 5 info off the net). I was 
:greatly disappointed that the new edition does not have a
:section of examples like the older edition. The examples
:of "common problems" was what got me into perl in the first
:place. Are these examples in the new "Learning Perl" book?
:If not, are they online somewhere?

You will have them in the Perl Cookbook, available sometime
this summer.  Over 500 pages of examples.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
I might be able to shoehorn a reference count in on top of the numeric
value by disallowing multiple references on scalars with a numeric value,
 but it wouldn't be as clean.  I do occasionally worry about that. --lwall


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

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

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