[7944] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1569 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 2 17:07:17 1998

Date: Fri, 2 Jan 98 14:00:24 -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           Fri, 2 Jan 1998     Volume: 8 Number: 1569

Today's topics:
     "Excessive Paranoia" using crypt (Frank)
     Re: "Excessive Paranoia" using crypt <emorr@fast.net>
     Convert GET to POST <stephen@iu.net>
     EditPage--http://www.zonecoaster.com/worldhost/ (2001 .)
     Help on writing perl. <iang@sytecuk.demon.co.uk>
     Help!: Sample HTTP POST request needed. <Craig@skybound.demon.nl>
     Re: IIS4 Please Help! <stevew@metafuse.com>
     Re: Multi-dimensional Arrays? <rootbeer@teleport.com>
     Re: NEWBE: Triming an input string (M.J.T. Guy)
     Re: newbie regexp-problem <bugaj@bell-labs.com>
     Re: PERLIPC - FIFO: parent, child, stalled! <jbattikha@highsynth.com>
     Re: PERLIPC - FIFO: parent, child, stalled! <rootbeer@teleport.com>
     Re: pingecho() on Win32? <pjach@erac.com>
     Re: Putting a Caret in My Unix Prompt Capitalizes the N (Billy Chambless)
     Re: reading in passwords <dev@sgi.net>
     recomended Perl books ? <tiagosdelete@gdn.net>
     Re: recomended Perl books ? (Michael Ng)
     Re: recomended Perl books ? <emorr@fast.net>
     Re: Simple(!) regular expression problem <rootbeer@teleport.com>
     Re: soriting a file (Kerry Schwab)
     Re: Sorting Data File <NerveGas@nospam.com>
     Re: SQL and PERL <NerveGas@nospam.com>
     uploading files in perl? <reach.me@through.the.newsgroup>
     Re: Writing a "nice" server? <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 02 Jan 1998 20:34:38 GMT
From: FHeasley@chemistry.com (Frank)
Subject: "Excessive Paranoia" using crypt
Message-Id: <34ad4e9c.21089949@news.halcyon.com>

I'm trying to implement crypt, but I'm getting this wierd message that
says "Function not implemented due to excessive paranoia".

What does this mean?  Is my program "too paranoid", or is perl
refusing to act because perl is too paranoid?

All I want to do is write encrypted passwords to a file.  There's
nothing in the faq that I can find, and I've been all through the man
page and the modules, and dejanews and the various search engines.

Any clarification would be appreciated.

Frank



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

Date: Fri, 02 Jan 1998 21:17:47 GMT
From: "Edward Morris, Jr." <emorr@fast.net>
Subject: Re: "Excessive Paranoia" using crypt
Message-Id: <34AD59B5.7680@fast.net>

Frank wrote:
> 
> I'm trying to implement crypt, but I'm getting this wierd message that
> says "Function not implemented due to excessive paranoia".
> 
> What does this mean?  Is my program "too paranoid", or is perl
> refusing to act because perl is too paranoid?
> 
> All I want to do is write encrypted passwords to a file.  There's
> nothing in the faq that I can find, and I've been all through the man
> page and the modules, and dejanews and the various search engines.
> 
> Any clarification would be appreciated.
> 
> Frank

They don't include crypt in the Win32 version.  I guess they don't want
you to figure out hashing of passwords unless you're a sysadmin, since
Win32 Perl is usually on a stand-alone platform.

ed


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

Date: Fri, 02 Jan 1998 15:29:45 -0500
From: Stephen Cobb <stephen@iu.net>
Subject: Convert GET to POST
Message-Id: <34AD4E39.C508E074@iu.net>

I'm trying to write a perl cgi script that reads the input from a form
and then sends that input on to another perl script. 

The line Print "Location :
http://www.foo.com/cgi-bin/test.pl?Name=Joe\n\n"; 
works fine but it uses the GET method resulting in an untidy URL string. 

Can anyone point me to code for doing this same thing but using the POST
method. I can find 100s of examples of GET but not POST ;-(

Cheers...Stephen


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

Date: Fri, 2 Jan 1998 14:01:18 -0500
From: JSK2001@webtv.net (2001 .)
Subject: EditPage--http://www.zonecoaster.com/worldhost/
Message-Id: <68jdhu$j7k$1@newsd-142.iap.bryant.webtv.net>

Can someone help me set this up?


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

Date: Fri, 2 Jan 1998 20:59:27 -0000
From: "Ian Gregson" <iang@sytecuk.demon.co.uk>
Subject: Help on writing perl.
Message-Id: <883777456.11002.0.nnrp-03.c1ed222a@news.demon.co.uk>

Hello, I am a newbie to perl writing and I am a little confused.

I wonder if someone could help me.

I am looking for all the tools to help me write a perl script. I know I need
an editor which I presume would be EMACS ?? I have the perl documentation
but I am very confused.

Do I need to a compiler ?
Do I need an interpreter ?

Does anyone know where I can actually get these files/utilities from ?

I am a visual basic programmer by profession but to write an application
that needs to run on a UNIX server I believe I need to resort to Perl.

Any help would be greatly appreciated.

Ian





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

Date: Fri, 02 Jan 1998 19:45:13 +0100
From: Craig Manley <Craig@skybound.demon.nl>
Subject: Help!: Sample HTTP POST request needed.
Message-Id: <34AD35B9.2FA9@skybound.demon.nl>

Hi there,

I want to execute a CGI script from a Java applet using a HTTP POST
request, sending a few field=value combinations just as a HTML form
would. Has anybody got a sample on how such a request header+body could
look.

Thanks,
Craig Manley.

-- 
And now, for some tasty spammer bait:
root@127.0.0.1
postmaster@127.0.0.1
webmaster@127.0.0.1
info@127.0.0.1
sales@127.0.0.1
fraud@UU.NET (MassMail Complaint)
spam-complaint@UU.NET (Usenet Complaint)
abuse@hotmail.com
net-abuse@nocs.insp.irs.gov
fraud@uspis.gov
fraudinfo@psinet.com
piracy@spa.org
postmaster@fbi.gov
contact@bsa.nl
downwithwarez@hotmail.com
postmaster@cyberpromotions.com
postmaster@cyberpromo.com
postmaster@mail-promo.com
FreeWay5@dm1.com
toby@becsplace.com
associates@savoynet.com
wmgroupr@pobox.com
51189123456@aol.com
74072325@compuserve.com
abanks@ultramax.net
link-signup@chac.com
frick@bigfoot.daltek.net
05838448@ibm.net
nobber@ibm.net
computerphys@hotmail.com
privuser@mailexcite.com
Important@usa.net
456S15P1008@juno.com
1mktg00@juno.com
members@your.com
netbiz@03403.com
neil@venus.gmds.com
homedirectory@hotmail.com
webtech@mmaildirect.com
dstadler@savoynet.com
Majordomo-Owner@rtfm.be
sendnim@15509.com
52614725@ismi.net
Racanaw@TRIValley.com
harmony@ultra-mail.com
39988580@hotmail.com
UcanDoit@hotmail.com
UcanDoit@kolomiec.rosmail.com
charel@cyberopp.com
aarica@chacaltaya.com
nt@ntec.net
1056_fred@flash.net
2760_ur@careeropp.com
deserthome@worldnet.att.net
MoneyMaker18@juno.com
associates@bigfoot.daltek.net
panzer@goplay.com
2700_dave@cymx.net
osgood@aixmiced.mi.unicatt.it


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

Date: Fri, 02 Jan 1998 11:23:15 -0800
From: Steve West <stevew@metafuse.com>
To: scott_clark@merck.com, james@netmart.com
Subject: Re: IIS4 Please Help!
Message-Id: <34AD3EA3.615C54A8@metafuse.com>

Scott,

I had that problem too, and was able to fix it. It has nothing to do with Perl
it is Microsoft IIS server problem.

Microsoft changed from having the script mappings in the registry to the a
configuration in the service manager.  Now script mappings are changed in the
default website properties.

Go to the default website, right mouse click on the properties for that site....

then click on "Home Directory" tab
Go to the "Applications Settings" toward the bottom of the window...find
the "Configuration" button...the click on  it.  A new window called script
mappings exists..you need to either create a new script mappings or edit the old
one.

It should look like this

 .cgi        c:\perl\bin\perl.exe %s %s
 .pl         c:\perl\bin\perl.exe %s %s

I had those set before in the registry...as you may have too...and MS IIS 4.0
pulled the values out and capitalized the %S %S...that wont work..it looked like
this

*** MICROSOFT PUT THIS THERE...IT WILL NOT WORK ***
 .pl      C:\PERL\BIN\PERL.EXE %S %S

*** YOU MUST CHANGE MAPPING TO LOOK LIKE THIS***
 .cgi        c:\perl\bin\perl.exe %s %s
 .pl         c:\perl\bin\perl.exe %s %s


***** OTHER PERL PROBLEMS WITH IIS 4.0 *****
There is still another problem that I am aware of with running perl and IIS 4.0.

You cannot use standard I/O redirection with perl and IIS 4.0... (at least by
default
it is not configured properly and I still havent been able to get it to work)

What this means is if you want to send information to the console and redirect
it to another application like sendmail, or blat you cannot do this
open(BLAT, " | blat - -t email@email.com -s subject")  || die "cannot send to
blat";

This will not work because the IIS 4.0 server will not open a new console...
I am working on this as we speak and will post a message here if I get it
resolved.   I also have a call into Microsoft on this one...so I hope we are in
good hands but probably not

Perl WILL run on IIS 3.0 becuase it does create a new console.
So for those of you with Perl running just fine on 3.0 beware do not upgrade
just yet.

Steve West

scott clark wrote:

> Mark Polakow wrote:
> >
> > Hello all. I am in serious need of getting Perl up and running on IIS4
> > and having a heck of a problem setting up Perl scripts though I had no
> > problem running them under Netscape server on NT. I have done all the
> > basics: Run the Perl 5.003 Install.bat which makes registry changes
> > and associates .pl with the Perl interpreter. I have heard that IIS
> > requires you to use 2 slashes instead of 1 for pathing....
> > If you could offer any help I would appreciate it!
>
> Try the following URL, it worked great for me on IIS3.0...
> http://support.microsoft.com/support/kb/articles/Q150/6/29.asp
>
> This of course assumes that you have Perl running from the command
> line...
> If not, check and *make sure* your path points to ...\Perl5\bin\  (or
> wherever you installed the Perl.exe
>
>        The contents of this message express only the sender's opinion.
>        This message does not necessarily reflect the policy or views of
>        my employer, Merck & Co., Inc.  All responsibility for the statements
>        made in this Usenet posting resides solely and completely with the
>        sender.





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

Date: Fri, 2 Jan 1998 12:25:14 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Denard Springle <admin@vsgcom.com>
Subject: Re: Multi-dimensional Arrays?
Message-Id: <Pine.GSO.3.96.980102122400.26534K-100000@user2.teleport.com>

On Fri, 2 Jan 1998, Denard Springle wrote:

> I'm trying to build a multi-dimensional array

> $roombase{$rooms[0].$roomkeys[$count-1]} = $rooms[$count-1];

Have you seen the perlref, perllol, and perldsc manpages? Those show a
better way to do this kind of thing. Hope this helps! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 2 Jan 1998 19:23:50 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: NEWBE: Triming an input string
Message-Id: <68jes6$fmr$1@lyra.csx.cam.ac.uk>

In article <34ad3433.11292567@news.on-net.net>,  <djboyd@sam.on-net.net> wrote:
>How does one trim a string.  That is, like in VB you can issue a
>command such as ltrim which will remove all spaces etc, on the left
>hand of the string and same for rtrim.  How does one do this in perl.
>that is remove spaces, tabs and new line on the right hand side of a
>string.

Looks like you want this entry from part 4 of the Perl FAQ:

     How do I strip blank space from the beginning/end of a
     string?

The FAQ is distributed with all recent versions of Perl, or is
available in many formats via http://www.perl.com.


Mike Guy


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

Date: Fri, 02 Jan 1998 15:32:31 -0500
From: Stephan Vladimir Bugaj <bugaj@bell-labs.com>
Subject: Re: newbie regexp-problem
Message-Id: <34AD4EDF.15FB@bell-labs.com>

> Another question: I'm considering buying either "Learning Perl" or "Learning
> Perl on win32 systems". They are rougly same size and one (or more?) of makers
> seem to be same. So which would be better? I'm an NT-person but I'm after a
> good Perl book.
> 
I have the Perl4 original and the Perl5 Win32 of Learning Perl and
have skimmed through the Perl5 regular version and they're all fairly
similar.  If you're on NT there's no reason not to get the Win32
version. I bought it just to upgrade my Perl4 version of LP and to
get free bonus info about Perl on NT in case I ever need it.  They're
pretty much the same book, really, but the Win32 has some tailored
Win bits in it.

A great book on RegExps which I got because I'm a RegExp newbie is
J. Friedl's Mastering Regular Expressions.


LL+P,
Stephan

  
                    "Do computers think?"
---------------------------------------------------------------
Stephan Vladimir Bugaj, Multimedia Communication Research Dept.
Departmental Website:       http://www.multimedia.bell-labs.com
PGPkey from http://www.pgp.net/wwwkeys.html or other keyservers
Non-Lucent website:     http://www.cthulhu-dynamics.com/stephan
FAQs:     http://www.cthulhu-dynamics.com/tech/metametafaq.html 
---------------------------------------------------------------
    STANDARD DISCLAIMER:My opinions are NOT those of LUCENT
---------------------------------------------------------------
             "Do submarines swim?" - E.W. Dijkstra


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

Date: Fri, 02 Jan 1998 15:09:51 -0500
From: Jihad Battikha <jbattikha@highsynth.com>
To: Lutz Albers <lutz@muc.de>
Subject: Re: PERLIPC - FIFO: parent, child, stalled!
Message-Id: <34AD498F.663886E3@highsynth.com>

Lutz Albers wrote:

> You might want to use "use strict 'vars','subs'" then. It will choke on
> all undeclared variables and bareword sub's which aren't declared.
> 
> ciao
>   lutz

Thanks, I will try to use this.  I wasn't too aware of the
differences...

Anyway, I finally got my script working!  I narrowed down the problem to
a block by the parent that was forcing it to hang waiting for the child
to return.  But, of course, the child wasn't going to return until the
FIFO received a READ reqeust.  I also checked my web host provider &
found they offer the POSIX module!!  So, basically, POSIX saved the
day.  I was able to set up a non-blocking wait using the POSIX
'WNOHANG'.  Thanks to all that helped!

Finding info on the POSIX module also lead me to find some good examples
of reaping child zombies.  That should make my web host provider happy
:-))

Here's the final (working) script in case anyone is interested (paths
have been change to protect the innocent):

---- start working script ----
#!/usr/local/bin/perl -w

# NOTE: This script is for CGI usage....

# Hmmm, the Perlipc & Perlfunc docs for Perl5 say "use POSIX 'wait_h';"
# Took a couple hours of Net-searching before finding out this was
wrong!
# use POSIX 'WNOHANG'; # <--better? - who knows...
use POSIX ':sys_wait_h';
# use strict 'vars','subs';
# any variation of strict seems to not like this script
# the script is working now, so I figure it doesn't matter anyway

$|=1; # auto-flush buffers
$FIFO = "$ENV{DOCUMENT_ROOT}/temp/rawpipe.tmp";
$encrypted = "$ENV{DOCUMENT_ROOT}/temp/encrypted.txt.pgp";
$pgpcmd = '/path/to/pgpe -at -r user@domain.com
--pubring=/path/to/pubring.pkr';

defined($pid = fork) || &error('fork');
$kid = $pid; # capture child pid for later use

if ($pid == 0) { # child
  chdir;
  $ENV{PATH} .= ":/etc:/usr/etc:/sbin:/usr/bin";
  unless (-p $FIFO) {
    unlink $FIFO;
    system('mkfifo', $FIFO, 'p') || &error('mkfifo');
  }
  open (FIFO, "> $FIFO") || &error('open fifo'); # block FIFO
    print FIFO "Text to encrypt...blah blah blah...more
text...whoopeeee.\n";
  close FIFO;
  exit(0);
}
elsif (undef $pid) {
  print "Content-type: text/html\n\n";
  &error('no process space');
}
else { # parent
  $parent = $$;
  $pid = POSIX::waitpid($pid,&POSIX::WNOHANG);
  sleep(2); # give child a head start in life
  unlink $encrypted;
  open(PGP,"| $pgpcmd -o $encrypted $FIFO") || &error('pgp failed');
    close(PGP);
  unlink $FIFO;
  $done = wait;
    if ($done != $kid) {
      kill(9,$kid); # in case child is naughty
    }
  print "Content-type: text/html\n\n";
  &build_header;
    print "Data encrypted via \$FIFO ($FIFO).<br>\n";
    print "Command line: $pgpcmd -o $encrypted $FIFO<br>\n";
    print "child status = ", ($? / 256), " - should be \"0\"<br>\n";
    print "pid of parent = $parent<br>\n";
    print "documented pid of child = $kid<br>\n";
    print "wait status (pid of child after death) = $done<br>\n";
    if ($done != $kid) {
      print "The child was naughty and wouldn't answer the parent so we
had to",
            "hire a hitman to kill it. The only thing the hitman had
to",
            "go on, though, was a picture of the child snapped at
birth.<br>\n";
    }
  &build_footer;
  # this *should* appear prior to forking, but I kept
  # finding that the return status of the dead child
  # was 205.25 (??) rather than 0
  # moving the reap to here fixed that
  $SIG{CHLD} = \&REAPER; # clean up zombie children
  exit;
}

# kill the family members that are hanging around...
# will this accidentally kill legit children spawned
# from other processes under my user account that just
# simply haven't finished processing?  I don't know
# too much about Unix or processes in general...
sub REAPER {
  {
    my $child = waitpid(-1, WNOHANG);
    redo if $child != -1;
  }
}

sub error {
  my ($error,@error_fields) = @_;
  &build_header;
    if ($error =~ /mkfifo/) {
      print "There was a MKFIFO error.<br>\n";
    } elsif ($error =~ /fork/) {
      print "There was a FORK error.<br>\n";
    } elsif ($error =~ /open fifo/) {
      print "There was a OPEN FIFO error.<br>\n";
    } elsif ($error =~ /pgp failed/) {
      print "There was a PGP FAILED error.<br>\n";
    } elsif ($error =~ /no process space/) {
      print "There was a NO PROCESS SPACE error.<br>\n";
    } else {
      print "There was an unknown error.<br>\n";
    }
  &build_footer;
  exit;
}

sub build_header {
  print "<html>\n";
  print "<head>\n";
  print "<title></title>\n";
  print "<body>\n";
}

sub build_footer {
  print "</body></html>\n";
}
__END__
--- end working script ----

NOTE: I can only verify that this works on my provider's SGI Irix
system.  Your own mileage may vary.

--
Jihad Battikha
jbattikha@highsynth.com
http://www.highsynth.com


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

Date: Fri, 2 Jan 1998 12:22:57 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jihad Battikha <jbattikha@highsynth.com>
Subject: Re: PERLIPC - FIFO: parent, child, stalled!
Message-Id: <Pine.GSO.3.96.980102120018.26534J-100000@user2.teleport.com>

On Fri, 2 Jan 1998, Jihad Battikha wrote:

> As far as using strict, how would this help me in this script?  I'm
> using symbolic references in some variables (I have to) and 'strict'
> will choke on this.  

You can 'use strict' in general, then add 'no strict q/refs/' when needed,
and that will give you all of the benefits of strict's checking while
still allowing you to do what you need. (But do you really need symbolic
refs? Those are easy to get wrong.) 

> I just don't know HOW to verify the fork has succeeded. 

It worked if the result is not undef. I often use something like this.

    my $pid;
    {
	unless (defined($pid = fork)) {
	    # Assume a harmless failed fork
	    sleep 1;
	    redo;
	}
    }
    if ($pid) {
	# parent here
	...

> Please note in this version of the script I'm using PGP in the process &
> it's meant for CGI usage.

Of course, if the data to be encrypted is sent in plain text over the web,
you're wasting your time. :-)

And since you've got two security concerns (PGP and CGI both) it's doubly
advisable to use taint checking, as described in the perlsec manpage. 

>   chdir;

This is probably not a good idea in a CGI script. I say that because the
default directory for chdir is the user's own home directory, and it's bad
to assume that there will even _be_ a meaningful home directory for the
user of a CGI script (which may not be the author). It would be better to
explicitly specify a directory, if you need a particular one. (You
probably don't, if you use full path names everywhere, which is a good
idea.) 

>     system('mknod', $FIFO, 'p') || &error('mkfifo');

Is there a reason you're not using mkfifo instead of mknod?

>   # I'm thinking that this below where I'm stalling.

>   open (FIFO, "> $FIFO") || &error('open fifo'); # to block
>     print FIFO "Text to encrypt...\n";
>   close FIFO;

I believe that that will block until there's a reader for this. Of course,
the other problem is that this isn't secure: Another process could sneak
in here and become the reader, thereby acquiring your text to encrypt.
Maybe you want to see the discussion of PGP in this newsgroup in the
recent weeks, and possibly the PGP module from CPAN.

>   open(PGP,"| $pgpcmd -o $encrypted $FIFO") || &error('pgp failed');
>   close(PGP);

You probably meant to use system instead of open, since you weren't really
piping to PGP.

> P.S.  Normally, I'd use STDIN/STDOUT (IPC::Open2 or IPC::Open3) with PGP
> rather than a named pipe, but there's a bug with the 5.5 version of PGP
> (on Windows95/NT) that defaults to using 'stdin' as the decrypted file
> name.  Hence, the need for a named pipe.

Hmmm.... I'd prefer to fix the bug than to run it insecurely. :-)  (But
maybe you could let 'stdin' be the named pipe, and use it for passing the
_encrypted_ text back to your code....)

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!




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

Date: Fri, 2 Jan 1998 15:46:03 -0600
From: "Phil Jach" <pjach@erac.com>
Subject: Re: pingecho() on Win32?
Message-Id: <34ad6024.0@news1.ibm.net>

I don't use the Win32 way.  I think this is just as easy.  It captures the
results in an array.  Works for me.  I'll watch to see if someone else posts
a better way.  Then I can use that.

@ping = `c:\\winnt\\system32\\ping $server`;


Steve McCullagh wrote in message
<01bd17a5$07977110$f41d6481@bus-sherwood>...
>Can anyone describe how to do a TCP ping on Win32?
>
>The Ping.pm uses the alarm() call, which is unsupported.
>
>Many thanks,
>Steve <smcculla@ivey.uwo.mx>  <- change it from Mexico to Canada!
>(just to keep the spammers off balance) ;-|




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

Date: 2 Jan 1998 18:57:32 GMT
From: billy@cast.msstate.edu (Billy Chambless)
Subject: Re: Putting a Caret in My Unix Prompt Capitalizes the Next Character
Message-Id: <68jdat$dfm$1@nntp.msstate.edu>

In article <Pine.GSO.3.96.971231174619.27854Y-100000@user2.teleport.com>, Tom Phoenix <rootbeer@teleport.com> writes:
 
|> > Is there a way to set my prompt from within the "perl" script, instead
|> > of reverting to a Unix call that refer- ences a "perl" script, as I'm
|> > doing above? 

|> Perl doesn't have a built-in prompt, so there's no way to set one! :-) 

Is this being fixed for Perl5.005 ? ;)


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

Date: Fri, 02 Jan 1998 20:26:20 GMT
From: "Devin P. Anderson" <dev@sgi.net>
Subject: Re: reading in passwords
Message-Id: <34AD4E16.2A82@sgi.net>

Austin Schutz wrote:
> 
> Devin P. Anderson wrote:
> >
> > How can you read from STDIN and not display what is being typed on the
> > screen? Like a password. Is this possible though a socket?
> 
> Sure.. I'd recommend using IO::Stty, available on CPAN.

Looks good to me, but I can't find the module on CPAN. ????
 
---                                                                 @				
Devin P. Anderson                           Happy Holidays         * * 	
Webmaster, Systems Administrator                from              * ' *
Stargate Industries, Inc.                 Network Operations     * ',` *
http://www.sgi.net/                                             *',  `,
*
Phone: 412.930.STAR (7827) ext. 241                           
***********
F a x: 412.930.7110                                                ***
                                                                && ***
&&	
                                                         
#=#=#=#=#=#=#=#=#=#=#

"Prehaps today *is* a good day to die. Ramming speed."
		-Lt. Worf

-----PGP PUBLIC KEY AVAILABLE-----


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

Date: Fri, 2 Jan 1998 02:21:17 -0500
From: "Tiago Stock" <tiagosdelete@gdn.net>
Subject: recomended Perl books ?
Message-Id: <68jh07$7dj@obi-wan.fdt.net>

Please follow this thread in recommending your favorite Perl reference book.

I'm just starting and would like input from more experienced users in which
book to buy.
I'm sure more readers would appreciate this as well.

--
Tiago S.
http://members.aol.com/tiagos




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

Date: 2 Jan 1998 20:49:17 GMT
From: syng@garlic.engr.ucdavis.edu (Michael Ng)
Subject: Re: recomended Perl books ?
Message-Id: <68jjsd$ngr$3@mark.ucdavis.edu>

Programming Perl and Adv. Perl Programming.

Tiago Stock (tiagosdelete@gdn.net) wrote:
::> Please follow this thread in recommending your favorite Perl reference book.

::> I'm just starting and would like input from more experienced users in which
::> book to buy.
::> I'm sure more readers would appreciate this as well.

::> --
::> Tiago S.
::> http://members.aol.com/tiagos



--
Michael (syng@engr.ucdavis.edu)
+--------------------------------------------------------------+
| http://www.engr.ucdavis.edu/~syng/                           |
| <PGP public key: http://www.engr.ucdavis.edu/~syng/mike.pgp> |
+--------------------------------------------------------------+


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

Date: Fri, 02 Jan 1998 21:16:35 GMT
From: "Edward Morris, Jr." <emorr@fast.net>
Subject: Re: recomended Perl books ?
Message-Id: <34AD596D.5F7B@fast.net>

Tiago Stock wrote:
> 
> Please follow this thread in recommending your favorite Perl reference book.
> 
> I'm just starting and would like input from more experienced users in which
> book to buy.
> I'm sure more readers would appreciate this as well.
> 
> --
> Tiago S.
> http://members.aol.com/tiagos

Learning Perl (O'Reilly) is what you want for a beginner. Programming
Perl is more of a reference, IMHO.

ed


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

Date: Fri, 2 Jan 1998 12:33:45 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Denard Springle <admin@vsgcom.com>
Subject: Re: Simple(!) regular expression problem
Message-Id: <Pine.GSO.3.96.980102122647.26534M-100000@user2.teleport.com>

On Fri, 2 Jan 1998, Denard Springle wrote:

> Perhaps try the /g option such as:
> 
> if ($reqmatch =- /360-WG-002/g) && ($reqinput =- /360-WG-002/g){

Did that code actually work for you when you tested it before posting? Do
you know what the /g option does in a scalar context?

> or the /x option such as:
> 
> if ($reqmatch =- /360-WG-002/x) && ($reqinput =- /360-WG-002/x){

Do you have any idea what the /x option does? (Not that that works any
better than the previous try.)

When I see people using features at random without knowing how they work,
I figure that they graduated from the Mr. Bean School for Computer
Programmers and Air Traffic Controllers. And that the career guidance
counselor recommended that they choose the former. :-) 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 2 Jan 1998 14:15:58 -0700
From: kschwab@nyx.net (Kerry Schwab)
Subject: Re: soriting a file
Message-Id: <68jlee$m1r$1@nyx10.nyx.net>

In article <34AC08EA.2C96ED99@data.net.mx>,
Ramon B. <ramon.b@pemail.net> wrote:
>Hi!!
>
>I have a file like this:
>
>name: xxxx
>Lastname:xxxx
>phone: xxx-xx
>Zip: xxx
>
>**********************
>name: xxxx
>Lastname:xxxx
>phone: xxx-xx
>Zip: xxx
>
>********
>
>And i need to sort it by lastname, but keeping the other records, in the
>same part, the information of each person is divided by the ********
>
>i put the info on an array, and is diveded by the *****, but i dont have
>a clue, on how to sort them by lastname, and keep the other information
>in the same block.
>
>Any idea?
>
>Thanks in advance!!
>
>R.B.
>
>
#
# assumes your data file has a "******" line after *every* record, 
# including the last one. 
# perhaps not the most elegant solution, but it works...
#
open(FILE,"/path/to/datafile") or die;
$index=0;
while (<FILE>) {
   if (/^\*+/) {
      $index++;
   } else {
               $array[$index] .= $_;
   }
}
for (sort bylastname @array) {
   print;
   print "**********\n";
}
sub bylastname {
   my $c,d;
   $a =~ /Lastname: (\S+)/;
   $c=$1;
   $b =~ /Lastname: (\S+)/;
   $d=$1;
   $c cmp $d;
}


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

Date: Fri, 02 Jan 1998 11:41:22 -0700
From: NerveGas <NerveGas@nospam.com>
Subject: Re: Sorting Data File
Message-Id: <34AD34D2.5D35@nospam.com>

> Hi, I have a data file that contains about 20k records (about 200bytes
> each) that I need sorted.  Unfortunately,
> I don't have access to a sort utility on my platform, and I need the
> file sorted (daily) so that I can compare it to
> the previous day's file.  Does anyone have a relatively efficient PERL
> algorithm that might help me order the
> file?  Thanks in advance,

  Assuming that there aren't multiple columns, etc., and you just want
them sorted alphabetically (the ideal, simple case),

#!/usr/local/bin/perl

open(infile,"junk.dat") or die "Sorry, no input\n"; 
@array=<infile>;
close(infile);

sort (@array);

open(outfile,">junk.dat") or die "Can't open file for writing\n";
print outfile ("@array);
close (outfile);


Keep in mind, though, that this will load the entire file into memory at
once, and then might (I don't know enough about the internals of perl)
create a second temporary array.  So, with 20K records of 200 bytes,
that's a little under 4 megs, so be prepared for this process to take
from 8 to 15 megs of RAM.  If it's a decent machine, that shouldn't be a
problem, but be forewarned.  : )

Steve


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

Date: Fri, 02 Jan 1998 11:23:11 -0700
From: NerveGas <NerveGas@nospam.com>
Subject: Re: SQL and PERL
Message-Id: <34AD308F.4F55@nospam.com>

> Peter Salomonsen <pesalomo@online.no> wrote:
> : Does anyone know an easy and efficient way to connect Perl and a
> : SQL-database in an unix/linux environment? Is there any free code
> : available?

  If you are using MySQL, it comes with a very good Perl module that
makes interfacing with the SQL server a dream.  I've done several jobs
with that, and had nothing but good, easy results.

Steve


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

Date: Fri, 02 Jan 1998 15:42:50 -0500
From: Rich Stevens <reach.me@through.the.newsgroup>
Subject: uploading files in perl?
Message-Id: <34AD5149.2DB301F2@through.the.newsgroup>

    I am trying to make a program that will allow users to upload files
to my Web server.  If you have ever used GeoCities for posting Web
pages, you know what I'm looking for.  I want my script to take a
filename and upload it to me through a Web page.  I would really
appreciate any help.



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

Date: Fri, 2 Jan 1998 12:50:55 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: plambert$1@plambert.org
Subject: Re: Writing a "nice" server?
Message-Id: <Pine.GSO.3.96.980102123522.26534N-100000@user2.teleport.com>

On 2 Jan 1998 plambert$1@plambert.org wrote:

> My server, with no clients even connected, sits in the select() call,
> but uses all the cpu it can get. 

Select should block until there's activity on one of the filehandles. As
far as I know, it should never sit and waste cpu cycles. (What value are
you using for the fourth argument, the timeout?)

I recommend calling select something like this, for debugging.

    warn "select(" .
	join(", ", map '"0x' . unpack("H*", $_) . '"',
	    $rin, $win, $ein) .
	", undef) at @{[ scalar localtime ]}";
    select($rout=$rin, $wout=$win, $eout=$ein, undef);
    warn "select returned with masks " .
	join(", ", map '"0x' . unpack("H*", $_) . '"',
	    $rout, $wout, $eout) .
	" at @{[ scalar localtime ]}";

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

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

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