[10956] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4557 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 5 16:07:16 1999

Date: Tue, 5 Jan 99 13:01:36 -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           Tue, 5 Jan 1999     Volume: 8 Number: 4557

Today's topics:
        Perl CD Bookshelf plans <crism@oreilly.com>
    Re: Perl CD Bookshelf plans (Erik)
        psswrd protect <ktupper1@maine.rr.com>
    Re: Q: Minimal (stingy) Regular Expression (John Moreno)
        Question: How to spawn another program and then die <gbc1@axe.humboldt.edu>
    Re: Question: How to spawn another program and then die <gbc1@axe.humboldt.edu>
    Re: scrolling list question (newbie) (Abigail)
    Re: Solaris 2.6 Perl5.005_02 and h2ph problems for the  (M.J.T. Guy)
    Re: sort hash by values (Abigail)
    Re: sort hash by values (Abigail)
    Re: Split on whitespace sintax ? <ajohnson@gatewest.net>
        striping Perl binaries under Solaris (jl gomez)
        subroutine returning an lvalue <Brett.Diamond@lmco.com>
    Re: using Perl as a telnet "shell" (William Totten)
    Re: why this doesn't work (Abigail)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 05 Jan 1999 13:45:31 -0500
From: Chris Maden <crism@oreilly.com>
Subject: Perl CD Bookshelf plans
Message-Id: <kevhil4kz8.fsf@rosetta.ora.com>

Question for the Perl community:

We're getting ready to put together _The Perl CD Bookshelf_.  Like the
other O'Reilly CDs, it'll be a bunch of books as HTML files with a
combined index and search engine.  The current plan is to have five
books:

_Advanced Perl Programming_
_Perl Cookbook_
_Programming Perl_
_Perl in a Nutshell_
_Perl 5 Pocket Reference_

The question is, would it be useful to also include _Learning Perl_
and _Learning Perl on Win32 Systems_?  I know that most people on this
list no longer need these books, but would you have wanted them?
Would a beginner (as we all once were) be likely to purchase such a
comprehensive CD?  Would an expert be annoyed at search hits coming up
in the introductory books?

Simple yes/no responses should probably be sent directly to me, to
avoid "me-too"ing.  If you want to discuss it on the list, go ahead (I
certainly won't stop you), but I'm not sure people will actually care.

-Chris
 JAPH; IANA marketing research consultant, but I play one on USENET!
-- 
<!NOTATION SGML.Geek PUBLIC "-//Anonymous//NOTATION SGML Geek//EN">
<!ENTITY crism PUBLIC "-//O'Reilly//NONSGML Christopher R. Maden//EN"
"<URL>http://www.oreilly.com/people/staff/crism/ <TEL>+1.617.499.7487
<USMAIL>90 Sherman Street, Cambridge, MA 02140 USA" NDATA SGML.Geek>


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

Date: 5 Jan 1999 19:56:54 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Perl CD Bookshelf plans
Message-Id: <76tqq6$3pc$1@news.cyberhighway.net>

[Posted and mailed]

In article <kevhil4kz8.fsf@rosetta.ora.com>,
	Chris Maden <crism@oreilly.com> writes:
> The question is, would it be useful to also include _Learning Perl_
> and _Learning Perl on Win32 Systems_?  I know that most people on this
> list no longer need these books, but would you have wanted them?
> Would a beginner (as we all once were) be likely to purchase such a
> comprehensive CD?  Would an expert be annoyed at search hits coming up
> in the introductory books?

I think they should definitely be included, but have search options,
like "Search only in these books" or allow for "Beginner" searches
and "Advanced" searches.  Also, each book should have its own searcher.
I don't know if this is already how you handle things, as I've never
purchased an O'Reilly CD.  How to implement this is left up to your
product development team.

-- 
Erik Nielsen, Cyberhighway Internet Services NOC
Hey, I had to let awk be better at *something*...  :-)
             -- Larry Wall in <1991Nov7.200504.25280@netlabs.com>1


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

Date: Tue, 05 Jan 1999 20:40:20 GMT
From: "Tuppers" <ktupper1@maine.rr.com>
Subject: psswrd protect
Message-Id: <01be38eb$62340940$2951d2cc@yoda>

I need a script to password protect a directory for my web site. It needs
to be fairly reliable but easy to configure.




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

Date: Tue, 5 Jan 1999 15:35:50 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Q: Minimal (stingy) Regular Expression
Message-Id: <1dl602p.1euykdr4v7r9aN@roxboro0-018.dyn.interpath.net>

Peter Grimes <grimes@waste.org> wrote:

> On Tue, 5 Jan 1999 serstad@acc.jc.edu wrote:
> 
> > I've got the regexp down, but it's doing maximal ("greedy) matching -- I
> > thought I would throw in a ? to do the minimal thing, but it's not working!
> 
> No, it's actually doing minimal.  (see below for explanation)
> 
> > while (<>) {
> >    if (/(\".*?cgi\")/) {print "$1\n";}
> > }
> > 
> > Example Search Strings:
> > 
> >   method="GET" action="/cgi-bin/wais/resource.cgi"
> >   method=GET action="/cgi-bin/wais/resource.cgi"
> 
> > In both cases, I would like to print simply "/cgi-bin/wais/resource.cgi"
> > However, the first one prints the whole damn thing from the very first quote
> > to the very last quote (it's greedy?).
> 
> Non-greedy only refers to how many characters _after the first match_ it
> matches.
[...]
> To get what you want try something like this (BTW, there's no need to
> escape double quotes in a regex)
> 
> /action=(".*?cgi")/   #if it will always be preceded by 'action='
> 
> or
> 
> /.*(".*?cgi")/  #matches the last ".*?cgi" on a line

Or more easily  /("[^"]*cgi")/  -- of course it can't be said loudly
enough that this isn't a suitable substitute for using CGI.pm, but if
his data set is restricted enough it's acceptable.

-- 
John Moreno


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

Date: Tue, 05 Jan 1999 11:46:35 -0800
From: Greg Coit <gbc1@axe.humboldt.edu>
Subject: Question: How to spawn another program and then die
Message-Id: <36926C1B.CA520974@axe.humboldt.edu>

Hello all,

I'm writing a perl/cgi program that needs to (among other things), take
in some data, fire another perl program and send it a variable, and then
send a web page to the browser.  the catch is that the program that gets
fired off takes several hours to complete it's process, and I'm having a
hard time getting the browser to not wait for it.  If I understand this
process correctly, I need to find a way to kill the current script after
the new one is called (I can send the new page to the browser before
firing off the new script - but the browser seems to want to wait until
the old script is done before showing the page, and the old script is
waiting for the new one to finish).  I have tried using exec (page 538
of the cookbook), eval (with an alarm - from page 80 of Advanced Perl)
and calling a shell script which calls the new script and places it in
the background.  I haven't tried fork because the parent wouldn't be
around to clean up the child's entry in the process table after the
child dies (per page 552 of the cookbook).

Any ideas or suggestion are welcome.  Thanks in advance for your help.

Greg Coit
gbc1@axe.humboldt.edu



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

Date: Tue, 05 Jan 1999 12:17:35 -0800
From: Greg Coit <gbc1@axe.humboldt.edu>
Subject: Re: Question: How to spawn another program and then die
Message-Id: <3692735F.52C50AB@axe.humboldt.edu>

Greg Coit wrote:

> Hello all,
>
> I'm writing a perl/cgi program that needs to (among other things), take
> in some data,

PS, I'm using Perl 5.005_2 on a dec alpha with Digital Unix 4.0d

Greg Coit
gbc1@axe.humboldt.edu




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

Date: 5 Jan 1999 19:08:30 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: scrolling list question (newbie)
Message-Id: <76tnve$d8j$4@client3.news.psi.net>

Jeff Schneider (jschneid@sienahts.edu) wrote on MCMLII September MCMXCIII
in <URL:news:36912fe7.33964078@news.dmci.net>:
() 
() I don't think that this example works:
() print scrolling_list(
() 		-NAME => "tech",
() 		-VALUE => [qw(`cat $Eng_file`)],
() 
() 		-SIZE => 3,
() 		-MULTIPLE => 0,
() 
() assuming that I have everything else correct,  can someone give me
() advice?   Thanks


How about looking up what qw() means?



Abigail


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

Date: 5 Jan 1999 19:23:00 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Solaris 2.6 Perl5.005_02 and h2ph problems for the aub script
Message-Id: <76toqk$ovk$1@pegasus.csx.cam.ac.uk>
Keywords: h2ph solaris 2.6 perl5.005_02 aub

Lyle Merdan <lyle@visi.com> wrote:
>I'm having trouble with the aub script. It says that it cannot find the 
>sys/socket.ph.

I've no idea what the "aub" script is, but sys/socket.ph is ancient
history.    The proper way to get at socket constants is

    use Socket;


Mike Guy


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

Date: 5 Jan 1999 20:03:18 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: sort hash by values
Message-Id: <76tr66$e0k$2@client3.news.psi.net>

Ying Hu (yhu@mail.nih.gov) wrote on MCMLIII September MCMXCIII in
<URL:news:369228CB.6791FE63@mail.nih.gov>:
// Hi:
// 
// I do not know why the following scritpe did not work. Help, please.
// I want sort values (number) of hash.


FAQ.


Abigail


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

Date: 5 Jan 1999 20:04:30 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: sort hash by values
Message-Id: <76tr8e$e0k$3@client3.news.psi.net>

Ying Hu (yhu@mail.nih.gov) wrote on MCMLIII September MCMXCIII in
<URL:news:36924AB8.1FBF2B7D@mail.nih.gov>:
__ I wanted as the following:
__ 
__ foreach $key (keys %hash_sorted_by_their_values){
__     @doing;
__ }


Tie your hash. There's probably a module on CPAN that does that.



Abigail


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

Date: Tue, 05 Jan 1999 13:45:01 -0600
From: Andrew Johnson <ajohnson@gatewest.net>
Subject: Re: Split on whitespace sintax ?
Message-Id: <36926BBD.6FD672C7@gatewest.net>

gattaz@hotmail.com wrote:
!
! $var= "01 sss";
! 
! ($a, $b) = split $var;
! #doesn't work ...
! #isn't it the same as ($a, $b) = split(/ /,$var) ????
! 
! 
! print "$a <***> $b";

first, re-read the docs on split: 'perldoc -f split'.

split takes 3 arguments, all of which are optional, But you can't
just pick and choose which ones to use or not use because the
argument order is important. You can only decide to drop arguments
from the end of the list of possible parameters. Your choices are:

split /PATTERN/,EXPR,LIMIT
split /PATTERN/,EXPR
split /PATTERN/
split

there is no choice for 'split EXPR' in the calling syntax because if
split sees that it has a first argument it will take that argument to
be the PATTERN (how would split know you wanted things otherwise?).

So, you'll either have to do:

$_ = '01 sss';
($a, $b) = split; # default pattern on default $_ variable
print "$a <***> $b\n";

or supply the actual pattern ... and the default pattern is
not the same as / /, but you can use the special case of supplying
a string containing a space to get the default split behavior:

$var = '01 sss';
($a, $b) = split ' ', $var;
print "$a <***> $b\n";

once again, check 'perldoc -f split' for further information.
hope it helps
regards
andrew


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

Date: 5 Jan 1999 20:47:42 GMT
From: jlg@a-ko.enteract.com (jl gomez)
Subject: striping Perl binaries under Solaris
Message-Id: <76ttpe$49q$3@eve.enteract.com>

Successfully built Perl 5.005_02 under Solaris 2.6 using
GCC 2.8.1.

For kicks, did a 'find . -print -exec strip {} \;' in the
Perl source directory and "make test" failed because it
couldn't load the symbol table.  I've compiled for shared libaries.

That's strange because under Linux it didn't complain.
Any insights?


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

Date: Tue, 05 Jan 1999 15:24:40 -0500
From: Brett Diamond <Brett.Diamond@lmco.com>
Subject: subroutine returning an lvalue
Message-Id: <36927505.6968F943@lmco.com>

I'd like to create a subroutine that works like the Perl "substr"
builtin,
where I can both use it both as an rvalue and an lvalue.

I would be implementing this as a method in a package.  Since I would
like to
pass parameters, I would rather use a subroutine that works as an lvalue
rather
than use a tied variable or some other clever construct.  In other words
I am
not looking for another solution, just a "This is how it is done:...",
or a "It
cannot currently be done" (no "just add another parameter", "use the -P
flag",
etc.).

As an example (although perhaps not a great one, as it looks nothing
like the
package on which I'm actually working) here is a little snippet of code:

=== snip snip snip =============

use Department;
$my_dept = new Department;

# use subroutine as a function
$my_dept->Budget() = 1000000;
$my_dept->Budget("Overhead") = 170000;
$my_dept->Budget("Expence") = 340000;
 ...

print "My overhead budget is ", $my_dept->Budget("Overhead"), "\n";
print "My expence budget is ", $my_dept->Budget("Expence"), "\n";
 ...
print "My overall budget is ", $my_dept->Budget();

=== snip snip snip =============


Thanks in advance,
Brett Diamond
Brett.Diamond@lmco.com




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

Date: 5 Jan 1999 19:56:35 GMT
From: totten @ cis . udel . edu (William Totten)
Subject: Re: using Perl as a telnet "shell"
Message-Id: <76tqpj$ctv$1@dewey.udel.edu>

In article <199901010231.NAA06309@no.spam.here.thanks.com>,
Big Jim <big.jim@no.spam.here.thanks.com> wrote:
>After taking out a 6 month subscription with a local iap I then
>discovered that they have no newsserver! Their mail server was
>initially flakey, failed for weeks, and is plainly unreliable. Then
>pdksh broke, so I converted my few scripts to zsh. Now, with still
>two months subscription remaining, telnet has been made rwx------
>and I can no longer even telnet to port 119 of another newsserver
>to read their local newsgroups (albeit slowly and painfully). For
>some mysterious reason, ps is also now rwx------. Unsurprisingly,
>the admin have stopped responding to my email complaints.
>
>Possibly I could use the telnet facility in Perl to get some use
>out of my last two months' sub?

Why now just get telnet or and NNTP capable newsreader from some
relavent ftp server and compile it yourself.  Or, if you cannot compile,
find a binary copy.

What version of UNIX is your ISP running?  When you get a binary of
something your ISP doesn't like, name it ``sh'' so they don't catch
on too quickly.


-- 
Totten, William David (Bill)         Computer and Information Science Major
totten@pobox.com                   University of Delaware (Newark, DE; USA)
http://pobox.com/~totten/               Friends don't let friends use emacs


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

Date: 5 Jan 1999 19:28:53 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: why this doesn't work
Message-Id: <76tp5l$d8j$5@client3.news.psi.net>

etrim@my-dejanews.com (etrim@my-dejanews.com) wrote on MCMLIII September
MCMXCIII in <URL:news:76smf8$n39$1@nnrp1.dejanews.com>:
[I] 
[I] myscript.pl script:
[I] #!/usr/bin/perl
[I] $image = "http://host/myimage.gif";
[I] print $image;
[I] 
[I] The script is chmod 755 (tried 777) but it gives me 500 internal server error.
[I] If i execute the script from unix it correctly outputs http://host/myimage.gif
[I] and therefore i think it should correctly put that into HTML: <IMG
[I] SRC="http://host/myimage.gif"> but it doesn't do that.

That's a hell of detour.

<IMG SRC = "http://host/myimage.gif"> would work as well.


Anyway, if you want to increase your visitors display time, and keep
your script, output the appropriate redirection headers.
A properly configured server would of course told you so - if you can
be bothered to look in the error log.

Details can be found in that other group, which deals with these issues.



Abigail


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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