[7734] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1359 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Nov 22 18:08:53 1997

Date: Sat, 22 Nov 97 15:00:22 -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           Sat, 22 Nov 1997     Volume: 8 Number: 1359

Today's topics:
     Re: [Q] Why does this behave this way? <rootbeer@teleport.com>
     Re: compiling perl & mod's on HP-UX (dave)
     Re: CPU Intensive code? (Jeremy D. Zawodny)
     Date/Time Comparisons on Win32 platform? <remerick@erols.com>
     Re: giving up on flock <merlyn@stonehenge.com>
     Hash table troubles <jdubchak@mb.sympatico.ca>
     How do I call GDBM's reorganize function from within a  Gerben_Wierda@RnA.nl
     Re: How do I call GDBM's reorganize function from withi Gerben_Wierda@RnA.nl
     Re: How to: push (condition ? @this : @that),$value; <talkasab@opal.tufts.edu>
     Re: How to: push (condition ? @this : @that),$value; <ajohnson@gpu.srv.ualberta.ca>
     Re: Learning Perl in win95 (dave)
     Re: New to Perl <rootbeer@teleport.com>
     Re: Perl / mSQL / Access <info@welnet.co.uk>
     perl bad for backgroud job? (Ernest Siu)
     Re: perl development package ? lvirden@cas.org
     Re: perl development package ? <kermit@ticnet.com>
     Re: Perl/UNIX question <markm@nortel.ca>
     Re: ref to typeglob and filehandles (Charles DeRykus)
     Re: removing lines from a file?? <rootbeer@teleport.com>
     Seat Reservation Script <yv50@dial.pipex.com>
     solutionL: eloquent file trees <mhazen@franklin.uga.edu>
     Re: Sort example for Dummy ?? <mak@mark.dircon.net>
     Re: Suppressing echo at STDIN <kscott@pcisys.net>
     Re: System runs as sub-process... <merlyn@stonehenge.com>
     WIN32 perl with NT and IIS - Error 501 <virtua@chez.com>
     Re: WIN32 perl with NT and IIS - Error 501 <bowlin@sirius.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 22 Nov 1997 08:40:28 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: lm@binary9.net
Subject: Re: [Q] Why does this behave this way?
Message-Id: <Pine.GSO.3.96.971122083826.15389G-100000@usertest.teleport.com>

On Fri, 21 Nov 1997 lm@binary9.net wrote:

> @a=qw ( Hello );
> $a=sprintf @a;

The first argument to sprintf should be a format string. In this case,
it's not. 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: Sat, 22 Nov 1997 17:23:49 GMT
From: over@the.net (dave)
Subject: Re: compiling perl & mod's on HP-UX
Message-Id: <347710ae.8708303@news.one.net>

Steven Oney <soney@1y.com> wrote:

>I hope this has not been asked to many times before.
>I'm trying to get perl and all the mod's compiled using the
>HP Ansi C compiler. Would like to talk to someone who
>has got this to work.
>Steve
>soney@1y.com
>

I got Perl 5.004_01 and Tk 400.202 built and installed for HPUX 9 on 800 series
servers and for HPUX 10 on the new B160/B180 workstations.  I had problems
building Tk for HPUX 9 on 700 series workstations, but was able to simply copy
the files built/installed on the HPUX 9/800 series system to the 700 series
workstation and perl/Tk worked OK.

I put perl5 under the /opt directory, although /opt is a symbolic link to
whichever logical volume has sufficient space.  I put Tk under the site_perl
subdirectory.  As far as I remember, I used all configuration defaults.

I made a shar file that contains everything under the /opt/perl5 directory.  We
now only need to execute the shar file for other targets.  I even modified the
shar file to create the symbolic links, /usr/bin/perl, /usr/bin/perldoc and
/usr/bin/pod2man.


HTH,

Dave
|
| Please visit me at http://w3.one.net/~dlripber
|
| For reply by email, use:
| dlripber@one.net
|________


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

Date: Sat, 22 Nov 1997 16:44:50 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: CPU Intensive code?
Message-Id: <34780b4c.59875346@woody.wcnet.org>

[original author automagically cc'd via e-mail]

On Sat, 22 Nov 1997 11:34:28 +0200, Stas Bekman
<sbekman@iil.intel.com> wrote:

>My perl cgi-script has been shoutdowned by my ISP, the reason CPU heavy
>code!

Sounds like your ISP needs to look at something like CGIWRAP.

>I have a simple counter script based on Matt's well known script (it uses
>'fly' to concatenate basic digit images to one real image number)

Who is Matt and what is Fly?

>All I added is some code, which uses 
>use URI::URL ();
>use CGI qw(:standard);
> 
>I checked -- it takes 5-15% CPU (looked at the 'top' util) for a few
>seconds but the site's traffic is heavy so the counters runs every few
>seconds...

Yeah. Reading, parsing, and compiling those modules will certainly add
some overheard.
 
>How can I fix it? Or how can I look what are the CPU intensive parts?

Several options:

(1) Prune out unnecessary code.
(2) Use a persistent counter (one that is always in memory, or runs in
the web server process). Something along the lines of FastCGI.
(3) Use a compiled (rather than interpreted) counter.

>(I guess the 'fly' part? But everyone use it?

I'm not sure why the 'fly' part is. So, it's safe to say that not
everyone uses it.

Jeremy
-- 
Jeremy D. Zawodny                 jzawodn@wcnet.org
Web Server Administrator          www@wcnet.org
Wood County Free Net (Ohio)       http://www.wcnet.org/


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

Date: Sat, 22 Nov 1997 13:21:18 +0000
From: Robert Emerick <remerick@erols.com>
Subject: Date/Time Comparisons on Win32 platform?
Message-Id: <3476DC4E.DB8A4D10@erols.com>

I need some help making comparisons between two dates/times.

I am extracting data from a file and need some assistance in
understanding how to convert a string into a date and/or time so that I
can perform some comparisons between various dates/times.  I thought
that there would be some modules out there to handle this but I have not
found anything yet.  Any pointers would be greatly appreciated.

Thanks,
Bob Emerick

remerick@erols.com



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

Date: 22 Nov 1997 11:29:46 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: giving up on flock
Message-Id: <8cbtzckcit.fsf@gadget.cscaper.com>

>>>>> "Tom" == Tom Christiansen <tchrist@mox.perl.com> writes:

Tom> :Here's the canonical "update" model with flocking:
Tom> :
Tom> :        open FILE, "+>>in-duh-vidual";
Tom> :        flock FILE, 2;

Tom> Yes, Randal was wrong here.  He didn't understand what O_APPEND
Tom> was all about.

Right.  I was still thinking about what the One True Unix (V7) does
for this.  All this new fancy modern stuff has me slightly baffled.
(That's the problem with playing with nearly every version of Unix
since 1977... :-)

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

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


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

Date: Sat, 22 Nov 1997 09:29:29 -0600
From: "John Dubchak" <jdubchak@mb.sympatico.ca>
Subject: Hash table troubles
Message-Id: <656th9$3s4g@top.MTS.Net>

I am trying to load a hash table based on run-time arguments/parameters.
The definition of the hash table is:

%ini = ( section_name  =>  { key  => undef } );

I retrieve values by reading a configuration file and setting it to an array
as such:

@file = <FILEHANDLE>;    # I know this line works...

Then I loop through the array using FOREACH and attempt to parse it into
Section, Key and Value, and this seems to work.  Then I load the hash table
by using the following sub-routine:

sub hash_load {
   my $attribute = shift;
   my $tag_val = shift;

   @_ ? $ini{$attribute} = {$tag_val => shift} :
$ini{$attribute}->{$tag_val};
}

With a call such as:

hash_load ($section, $key, $value);

But, if I want to retrieve a value based on section and key, then a call
such as this should work:

$val = hash_load ($section, $key);

The problem I am having is that $val is returned as nothing/blank.

Is there anything I am doing wrong with the loading, or retrieving of values
from the hash itself?

Thanks.
John Dubchak




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

Date: Sat, 22 Nov 1997 17:06:49 GMT
From: Gerben_Wierda@RnA.nl
Subject: How do I call GDBM's reorganize function from within a perl script?
Message-Id: <EK24vD.58w@RnA.NL>

Subject says it all. GDBM_File is not really documented and the reorganize 
function is probably mapped. But how do I call it?

-- 
Gerben_Wierda@RnA.nl (Gerben Wierda)
"If you don't know where you're going, any road will take you there"
Paraphrased in Alice in Wonderland, originally from the Talmud.

Dass man fuer die Philosophie ein Interesse zeigt, bezeugt noch keine
Bereitschaft zum Denken -- Martin Heidegger


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

Date: Sat, 22 Nov 1997 17:21:50 GMT
From: Gerben_Wierda@RnA.nl
Subject: Re: How do I call GDBM's reorganize function from within a perl script?
Message-Id: <EK25KE.5D5@RnA.NL>

Gerben_Wierda@RnA.nl wrote:
>Subject says it all. GDBM_File is not really documented and the reorganize 
>function is probably mapped. But how do I call it?

I experimented a bit and this works:

$dbref = tie ....
$dbref->reorganize();
untie ....

The only thing now is: why do I get "untie attempted while 1 inner references 
still exist"? Should I undef $dbref? A test:

$dbref = tie ....
$dbref->reorganize();
$dbref = undef;
untie ....

And this works.

-- 
Gerben_Wierda@RnA.nl (Gerben Wierda)
"If you don't know where you're going, any road will take you there"
Paraphrased in Alice in Wonderland, originally from the Talmud.

Dass man fuer die Philosophie ein Interesse zeigt, bezeugt noch keine
Bereitschaft zum Denken -- Martin Heidegger


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

Date: Sat, 22 Nov 1997 09:51:50 -0500
From: "Tarik Alkasab" <talkasab@opal.tufts.edu>
Subject: Re: How to: push (condition ? @this : @that),$value;
Message-Id: <656rlb$amj$1@news3.tufts.edu>


Toutatis wrote in message ...
>I'd like to write something like
>push (condition ? @this : @that),$value;


I'm just starting to graduate from baby talk, but here's what I though of:

    push @{condition ? \@this : \@that}, $value;

The @{} dereferences what's inside the braces, and the ?: returns a
reference to @this if condition, and @that if not condition.

I tried this program, and it did what you seemed to want:

#!/usr/bin/perl -w
use strict;
my @evens = ();
my @odds = ();
foreach (1..10) { push @{($_ % 2) ? \@odds : \@evens}, $_ }
print join (' ', @evens), "\n";
print join (' ', @odds), "\n";

When I ran it:
% testprog
2 4 6 8 10
1 3 5 7 9

--
Terry




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

Date: Sat, 22 Nov 1997 09:13:37 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: How to: push (condition ? @this : @that),$value;
Message-Id: <3476F6A1.5E24C11F@gpu.srv.ualberta.ca>

Toutatis wrote:
! 
! This is the way i've been typing it so far, and every time i did,
! I thought there must be a shorter way.
! 
! my $value = "some_value";
! if (condition){
!    push @this, $value;
! else {
!    push @that, $value;
! }
! 
! I'd like to write something like
! push (condition ? @this : @that),$value;
! But then something that works. map ik ok as well, as long as it's
! _short_.


well, I wouldn't say its more readable than your if/else version,
but the following is short and appears to work:

($condition?$this[@this]:$that[@that])=$value;

regards
andrew


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

Date: Sat, 22 Nov 1997 17:02:23 GMT
From: over@the.net (dave)
Subject: Re: Learning Perl in win95
Message-Id: <34770ff8.8526502@news.one.net>

fox@securenet.net (Pearl Fox) wrote:

> If there is a site where I can get the information that I need to get
>me  started in learning how to program in Perl with win 95
>environment, I  would really appreciate it.  I downloaded the Perl
>program but don't know how to use it with win 95?
>
>Thanks
>Pearl
>
>Pearl S. Fox,
>Montreal (Que.)
>http://www.securenet.net/members/fox/index.html
>

I remember seeing that the "for dummies" book on Perl is presented for Windows
95, I think.

Dave
|
| Please visit me at http://w3.one.net/~dlripber
|
| For reply by email, use:
| dlripber@one.net
|________


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

Date: Sat, 22 Nov 1997 08:49:20 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: calbij@ix.netcom.com
Subject: Re: New to Perl
Message-Id: <Pine.GSO.3.96.971122084219.15389I-100000@usertest.teleport.com>

On Fri, 21 Nov 1997 calbij@ix.netcom.com wrote:

> Subject: New to Perl

Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.

    http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post

> I am new to perl and would like to know if there is a way that I can set
> unix enviornment variables and have them stay set in the users shell
> when the perl script ends. I have tried setting the %ENV but this only
> seems to last for the life of the script. Any help would be appricated.

Check the FAQ. Hope this helps!

    http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq8/
          I_changed_directory_modified_m.html

-- 
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: 22 Nov 1997 22:47:07 GMT
From: "Martin Williams" <info@welnet.co.uk>
Subject: Re: Perl / mSQL / Access
Message-Id: <01bcf799$b79fee60$2c1126a4@howdy.dixons.co.uk>

 .....will this work on a UNIX box ?

Martin





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

Date: 22 Nov 1997 02:50:11 GMT
From: esiu@cs.UAlberta.CA (Ernest Siu)
Subject: perl bad for backgroud job?
Message-Id: <655h93$a1m$1@scapa.cs.ualberta.ca>

Hi,

Is perl bad for a job which is run continously on background?
I have a simple perl program to periodically record some data.
It is supposed to be run continuously on the background.
However, after I ran it for couple of days, it seems like it
is eating up more and more RAM as time goes.  Is there anything
special about memory allocation in perl?  Any suggestion?

Ernest
esiu@cs.ualberta.ca



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

Date: 22 Nov 1997 18:17:11 GMT
From: lvirden@cas.org
Subject: Re: perl development package ?
Message-Id: <6577j7$dm9$1@srv38s4u.cas.org>


According to David W. Crawford <dc@panix.com>:
:Another useful tool would give a listing of all variables used
:sorted by type (@,$) then by name.

This would be particularly useful if one could indicate that it should
work against a group of files (and modules, etc.).  In C, I use a program
called cscope that allows me to specify a string and it returns
me a series of non-comment lines where that string is used as a variable
name in various modules, headers, etc.  It allows me to 'browse' code
looking for functions, variables, even strings in comments, quickly.

Some sort of interactive code browser for perl would be really useful .

-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: Sat, 22 Nov 1997 16:38:32 -0600
From: Kermit Tensmeyer <kermit@ticnet.com>
Subject: Re: perl development package ?
Message-Id: <34775EE8.E7FA7DCF@ticnet.com>

lvirden@cas.org wrote:
> 
> According to David W. Crawford <dc@panix.com>:
> :Another useful tool would give a listing of all variables used
> :sorted by type (@,$) then by name.
> 
> This would be particularly useful if one could indicate that it should
> work against a group of files (and modules, etc.).  In C, I use a program
> called cscope that allows me to specify a string and it returns
> me a series of non-comment lines where that string is used as a variable
> name in various modules, headers, etc.  It allows me to 'browse' code
> looking for functions, variables, even strings in comments, quickly.

  Sorry, but this type of functionality already exists in the
 One-True Editor. I can have it track function definition
 module usage and some pretty good syntax verification.

  Nope it does not work with edline ;-( But if you are stuck with
 Edlin as the editor of choice, then the problems are much more
 serious than a lack of variable listings

 oh by the way... go to a prompt  and type perl -dw filename.pl

  and use the T, W or V commands to examine variables in packages
 as well. This is documented in the perl man pages AND the camel
 book.  (you Don't have perl man pages? I told you that you had
 bigger problems.. )



-------
  Kermit Tensmeyer    (E & T - Networking)
  Kermit@ticnet.com     Dallas


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

Date: 22 Nov 1997 15:49:44 -0500
From: Mark Mielke <markm@nortel.ca>
Subject: Re: Perl/UNIX question
Message-Id: <lq12008u00n.fsf@bmers2e5.nortel.ca>

Angelo Kontarinis <akontari@ix.netcom.com> writes:
> Hi..I am new to CGI/PERL and UNIX.  I am installing a WWWboard script on
> a server and I am supposed to chmod a directory.  I have no problem
> chmoding a file, but how doe you go about chmoding a directory?  Thanks
> so much in advance.

Hello.

As far as i know, you can without exception do the chmod() operation the
same as your would for a file. One difference is that directories require
the 'x' bit set to properly access them.

   $ mkdir abc
   $ chmod 755 abc
   $ ls -ld abc
   drwxr-xr-x   2 markm    srp            96 Nov 22 15:48 abc/

In perl it's the same thing:

   ... continued ...
   $ perl -e 'chmod(0750, "abc") || die "chmod failed: $!\n"'
   drwxr-x---   2 markm    srp            96 Nov 22 15:48 abc/

hoping this helps,
mark

--                                                  _________________________
 .  .  _  ._  . .   .__    .  . ._. .__ .   . . .__  | Northern Telecom Ltd. |
|\/| |_| |_| |/    |_     |\/|  |  |_  |   |/  |_   | Box 3511, Station 'C' |
|  | | | | \ | \   |__ .  |  | .|. |__ |__ | \ |__  | Ottawa, ON    K1Y 4H7 |
  markm@nortel.ca  /  al278@freenet.carleton.ca     |_______________________|


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

Date: Sat, 22 Nov 1997 21:35:39 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: ref to typeglob and filehandles
Message-Id: <EK2HBG.72t@bcstec.ca.boeing.com>

In article <3476A088.9385510F@sirius.com>,
Jim Bowlin  <bowlin@sirius.com> wrote:
 > I am updating Perl 4/5 code to be compatible with "use strict;"
 > I was able to pass file handles around in Perl 4/5 as follows:
 > 
 > $file = '/etc/passwd';
 > open($file, $file);
 > 
 > &process($file);
 > 
 > sub process {
 >    local(*HANDLE) = @_;
 >    while (<HANDLE>) {
 >       ...
 >    }
 > }
 > 
 > One nice feature of this approach was that unexpected system error
 > messages would tell me the name of the file that was being processed
 > since the name of the file is the filehandle.
 > 
 > When I convert this to refs to typeglobs, it seems I lose
 > the ability to name filehandles after the name of the file.
 > 
 > Should I just give up on naming filehandles after the files themselves?



That was a nice feature. Could you live with a "no strict" block: 
 

  sub process {
     my $file = shift;
     { no strict; 
       open($file, $file) or croak "open failed: $!";
       while (<$file>) {
          ...
     }



Regards,
--
Charles DeRykus


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

Date: Sat, 22 Nov 1997 08:41:38 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Burt Lewis <burt@ici.net>
Subject: Re: removing lines from a file??
Message-Id: <Pine.GSO.3.96.971122084103.15389H-100000@usertest.teleport.com>

On 22 Nov 1997, Burt Lewis wrote:

> I need to remove the lines that end with a - and keep the rest.

Okay, you should probably write a Perl script to do this. How far have you
gotten?

-- 
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: Sat, 22 Nov 1997 16:30:01 -0800
From: Brian Roberts <yv50@dial.pipex.com>
Subject: Seat Reservation Script
Message-Id: <34777909.924@dial.pipex.com>

Can anyone let me know where I might find a Perl script I can use
for seat reservations.

I guess a modified shoppingcart script would do , but most don't
include stock control. i.e. if you buy something it does not
automatically decrement from a limited stock - in the case
of a theatre reservation system there would of course be a stock of just 
one seat per performance that would need to be reserved on booking.

Anyone know of anything that might suffice - commercial or free?

Regards  Brian Roberts



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

Date: Sat, 22 Nov 1997 11:07:51 -0500
From: Mark Hazen <mhazen@franklin.uga.edu>
Subject: solutionL: eloquent file trees
Message-Id: <34770357.BCEF2179@franklin.uga.edu>

Found the solution to my own question:

> I've been using a fairly brutish method to obtain a list of files
under a
> directory structure into an array. Well, okay... a REALLY brutish
method.
> I'm capturing the output of a "find" command via "qx". I don't like
doing
> this because it's not 'taint' friendly, but I've been unable to come
up
> with a taint-free and reliable method in the standard modules (didn't
find
> it via a search on CPAN).

D'OH!  I took another look in the index of the camel book and discovered
"find()" on page 439... i.e. the "File::Find" module. Man, do I feel
dumb. :-)

-mh.
----
   . _+m"m+_"+_   Mark Hazen    Network Administrator, Dean's Office
 d' Jp     qh qh             The Franklin College of Arts & Sciences
Jp  O       O  O             The University of Georgia (706)542-1546
Yb  Yb     dY dY
 O   "Y5m2Y"  "     even the mightiest wave starts out as a ripple.
  "Y_           why make waves when it's easier to nurture ripples?




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

Date: Sat, 22 Nov 1997 15:42:40 +0000
From: Mark Morgan <mak@mark.dircon.net>
Subject: Re: Sort example for Dummy ??
Message-Id: <3476FD70.7BB930C6@mark.dircon.net>

Joseph N. Hall wrote:
> 
> Burt Lewis wrote:
> >
> > Hi,
> >
> > I've read the books, man pages, faq's, etc. and am still having trouble
> > understanding sorting by multiple or specified fields.
> 
> I'm not sure the following is "simple" but it is short, sweet,
> and efficient.  The "Schwartzian Transform" below--a sort
> sandwiched between two maps--is generally the best way to sort
> lists where expensive key transformations (e.g. splitting,
> reading from disk) are required.  Just about any other code
> that you write to do the work below will be longer and
> clunkier in some way.  Once you know what you are looking at,
> it becomes pretty straightforward.
> 
> You can read a few pages about sorting in my book (see the address
> below) and of course there are the man pages (which you've already
> seen I guess) and Tom C's FMTYEWTK about sorting.  The latter
> may help you if you are looking for a really really verbose,
> crawlingly painstaking description of what's going on.
> 
>         -joseph
> 
> print
>   map { $_->[0] }
>   sort { $a->[1] <=> $b->[1] or $a->[2] cmp $b->[2] }
>   map { [ $_, (split)[3, 0] ] }
>   <DATA>;
> 
> __END__
> aaaa Sat Nov 1 = 1537
> bbbb Sat Nov 1 = 1506
> aaaa Sun Nov 2 = 1547
> aaaa Mon Nov 3 = 1679
> bbbb Mon Nov 3 = 1618
> bbbb Tue Nov 4 = 1288
> bbbb Sun Nov 2 = 1540
> aaaa Tue Nov 4 = 1347
> bbbb Wed Nov 5 = 1543
> aaaa Wed Nov 5 = 1566
> 
> --
> Joseph N. Hall   http://www.5sigma.com/joseph/  mailto:joseph@5sigma.com
> Proprietor, 5 Sigma Productions          P.O. Box 6250 Chandler AZ 85246
> Perl training & software, C++/C/etc. software, web stuff, original music
> *Effective Perl (A-W Fall '97) ............ http://www.effectiveperl.com
> *Perl resources & instruction .............. http://www.perltraining.com
> *Exploding groceries ................ http://www.5sigma.com/joseph/inan/

Is the book out now?  I checked the web page, and was very impressed by
the chapters up there.  Who's the book being published through?  I guess
I could have a look at the webpage again for the details... :)

Mark.


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

Date: Sat, 22 Nov 1997 12:26:10 -0700
From: "Ken Scott" <kscott@pcisys.net>
Subject: Re: Suppressing echo at STDIN
Message-Id: <657bkl$snr$1@newman.pcisys.net>


Tom Phoenix wrote in message ...
>On Thu, 20 Nov 1997, Ken Scott wrote:
>
>> I am writing an interactive script that needs to ask a user for a
>> password.  How do I keep from echoing whatever the user types to the
>> terminal?
>
>Check the FAQs again. :-)  perlfaq8 has the question "How do I ask the
>user for a password?" Good luck!
>
Thanks for pointing me in the right direction. I had missed some of the FAQ
stuff.

However, after trying the Term solution, I found that it doesn't seem to
work properly on NT. Has anyone else found this to be true? If not, what did
you differently.

And am I correct that setting stty is a Unix-only solution?

Ken





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

Date: 22 Nov 1997 11:34:19 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: "Billy Boone" <bboone@lexmark.com>
Subject: Re: System runs as sub-process...
Message-Id: <8c90ugkcb8.fsf@gadget.cscaper.com>

>>>>> "Billy" == Billy Boone <bboone@lexmark.com> writes:

Billy> Is there a way in perl to run multiple commands in one process
Billy> environment?  The reason I am asking is because we would like
Billy> to run the batch files provided with most compilers to set up
Billy> the environment (include, lib, etc) for compiling and then run
Billy> nmake.

Billy> However if you attempt to run (for Visual C++ 4.2):
Billy> system("vcvars32 x86");
Billy> system("nmake /nologo /f test.mak");

Billy> You do not get the desired effect.  I am attempting to create
Billy> programmatically what a person would do from a command prompt.

You're gonna die when you see how simple it was:

	system("vcvars32 x86; nmake /nologo /f test.mak");

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

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


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

Date: Sat, 22 Nov 1997 19:22:15 +0100
From: "Stiphane SOLOMON" <virtua@chez.com>
Subject: WIN32 perl with NT and IIS - Error 501
Message-Id: <em4lnO398GA.296@upnetnews03>

Hello,

I'm an absolute begginer in perl and I use WIN32 perl on a NT server with
IIS.
So my first trial is to write "HELLO" on my browser when I click on a submit
button

Here are my two components :

---------
trial.pl
---------
#!/usr/bin/perl
print "HELLO\n";

-----------
trial.htm
-----------
<HTML>
<BODY>
<FORM METHOD="POST" ACTION="cgi-bin/trial.pl">
<INPUT TYPE="SUBMIT">
</FORM>
</BODY>
</HTML>


When I click on the submit button, my browser displays "HTTP 1.0 - error
501".
What shall I do ?


Other informations :
----------------------------
My perl program runs correctly when I run it in a DOS window.
When I replace the POST method by th GET method, my browser displays the
text of my perl program.

Thanks.

Stiphane SOLOMON





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

Date: Sat, 22 Nov 1997 14:04:50 -0800
From: Jim Bowlin <bowlin@sirius.com>
To: "Stiphane SOLOMON" <virtua@chez.com>
Subject: Re: WIN32 perl with NT and IIS - Error 501
Message-Id: <34775702.CE8F76BA@sirius.com>

First you should really get a book or read up on CGI.  One place to start is
http://www.eprotect.com/stas/TULARC/


2) You need to configure your server to recognize .pl as a perl script.
For IIS this involves editing the registry and is (poorly) explained in
the html docs that come with IIS.

3) You need to put your cgi script in the scripts directory (which should
be next to the wwwroot directory.  They are both under \InetPub on my system.

4) Any CGI script needs to print out the content type followed by a blank
line before any text or html is printed.

    print "Content-type: text/html\n\n";

for html or 

    print "Content-type: text/text\n\n";

for straight text.

5) finally you can check out your CGI just by pointing your browser directly to
the URL of the CGI script as in:

http://HOST/Scripts/test.pl


HTH -- Jim Bowlin

Stiphane SOLOMON wrote:
> 
> Hello,
> 
> I'm an absolute begginer in perl and I use WIN32 perl on a NT server with
> IIS.
> So my first trial is to write "HELLO" on my browser when I click on a submit
> button
> 
> Here are my two components :
> 
> ---------
> trial.pl
> ---------
> #!/usr/bin/perl
> print "HELLO\n";
> 
> -----------
> trial.htm
> -----------
> <HTML>
> <BODY>
> <FORM METHOD="POST" ACTION="cgi-bin/trial.pl">
> <INPUT TYPE="SUBMIT">
> </FORM>
> </BODY>
> </HTML>
> 
> When I click on the submit button, my browser displays "HTTP 1.0 - error
> 501".
> What shall I do ?
> 
> Other informations :
> ----------------------------
> My perl program runs correctly when I run it in a DOS window.
> When I replace the POST method by th GET method, my browser displays the
> text of my perl program.


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

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

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