[6407] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 32 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 28 20:07:22 1997

Date: Fri, 28 Feb 97 17:00:21 -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, 28 Feb 1997     Volume: 8 Number: 32

Today's topics:
     Assigning an element to a multidimensional hash <stats9@mail.idt.net>
     can $_ be dissociated from its contents? (Rahul Dhesi)
     Re: File Locking <tchrist@mox.perl.com>
     Getting the most out of comp.lang.perl.misc nvp@shore.net
     gmtime <Jonathan.O.Nichols@ast.lmco.com>
     Re: Grabbing text of web pages using perl (Nathan V. Patwardhan)
     Re: Grabbing text of web pages using perl (Tad McClellan)
     Re: Grabbing text of web pages using perl <edhill@strobe.weeg.uiowa.edu>
     Re: help!: RE parse comma separated list (Joel Earl)
     Re: Help: IlyaZ's Perl and SIGSEGV (Ilya Zakharevich)
     Re: HOW TO SPLIT A SIMPLE STRING <sgifford@tir.com>
     Re: If you know perl this should be simple <billc@tibinc.com>
     Need Perl index creator script!! Help! (Neil Johnson)
     Re: Need Perl index creator script!! Help! <swimmer@freising-pop.de>
     Re: Nested if in compound if statement (Dave Thomas)
     Re: Newbie Perl / HTML Content-type question (Tad McClellan)
     Numeric versions of sort/reverse? bassler@i1.net
     Re: Numeric versions of sort/reverse? <don.bowen@cat.com>
     Perl 4 -> Perl5, SEGV from Carp::Longmess.  Please read (Microserf)
     Perl eZone Interactive Course (with certification!) (Steven Katz)
     Re: PERL for NT & Netscape Enterprise Server <strad@mondenet.com>
     Re: Perl on Windows 95 <charliew@atlml1.attmail.com>
     Re: Question about the SYSTEM function (Ilya Zakharevich)
     Re: Returning a reference to a 'my' variable <tchrist@mox.perl.com>
     Re: Searching for Perl-supported Linux database <brett@speedy.speakeasy.org>
     Re: shuffle an array <sgifford@tir.com>
     Starting with PERL: a question <hugh@island.net.au>
     Re: web opens DOS window on scripts <xaren@ascentech.com>
     Re: Which database in Perl? (dan ritter)
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: Fri, 28 Feb 1997 18:25:29 -0500
From: Chris Plachta <stats9@mail.idt.net>
Subject: Assigning an element to a multidimensional hash
Message-Id: <33176969.3A2FC738@mail.idt.net>

If I have a hash:


$hash{KEY1}{INFO1} = value;
$hash{KEY1}{INFO2} = value;
$hash{KEY1}{INFO3} = value;
$hash{KEY2}{INFO1} = value;
$hash{KEY2}{INFO2} = value;
$hash{KEY2}{INFO3} = value;
 .
 .
 .

and I want to assign some other hash a particular value:

$new_hash{KEY1} = $hash{KEY1}

without creating a reference, how do I do it?  When I do the above,
%new_hash gets referenced to %hash, so now both data structures are
pointing to the same data.  I would like to avoid explicitly assigning
each value like this:

  $new_hash{KEY1}{INFO1}=$hash{KEY1}{INFO1};
  $new_hash{KEY1}{INFO2}=$hash{KEY1}{INFO2};
  $new_hash{KEY1}{INFO3}=$hash{KEY1}{INFO3};

Any ideas?  Thanks in advance.


Chris Plachta


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

Date: 1 Mar 1997 00:36:19 GMT
From: c.c.eiftj@66.usenet.us.com (Rahul Dhesi)
Subject: can $_ be dissociated from its contents?
Message-Id: <5f7tm3$6rv@samba.rahul.net>

Support $_ holds a big (1-meg) string.  We want to push a copy of this
string onto @::ARRAY and then reuse $_ for other purposes.
Conceptually, the most efficient way of doing this would be to push onto
@::ARRAY something that points to the data currently in $_, and then
reuse the identifier $_ by pointing it elsewhere.  

Thus we want $_ to act like a pointer and we want to push a copy of the
pointer onto @::ARRAY then reuse the pointer for other things.

This would avoid the overhead of the normal perl code:

     push(@::ARRAY, $_);

which does an expensive 1-meg copy from memory to memory.

Is there any way in perl of doing such a thing?  My experiments with
references did not yield useful results.  Something like:

   push(@::ARRAY, \$_);
   $_ = 'something else';

did not work as I had hoped -- the reference pushed onto @::ARRAY points
towards the current $_, and not towards original data that $_ contained.

One possible application of the above optimization is to efficiently
implement the following:

     while (<STDIN>) {
        print $_;
        push(@::ARRAY, $_);
	scalar(@::ARRAY) > 10 && shift(@::ARRAY);
     }

Which copies STDIN to STDOUT and also saves the last 10 lines in memory.
It's nice to not copy all data twice.
-- 
Rahul Dhesi <dhesi@spams.r.us.com>
a2i communications, a quality ISP with sophisticated anti-junkmail features
*** Now featuring Strategy C for junk-mail-proof News postings ***
|| "please ignore Dhesi" -- Mark Crispin <mrc@CAC.Washington.EDU> ||


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

Date: 28 Feb 1997 23:33:05 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: File Locking
Message-Id: <5f7pvh$901$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    abigail@ny.fnx.com writes:
:Isn't that dangerous? Another process can create the file
:right after your if, but before you open it.

Yes, it was.

:How about:
:-e $file or system "touch $file" and die "Oops: " . $? >> 8;
:open FILE, "+< $file" or die "Oops: $!";

Might as well just go for the "real" way:

    sysopen(FILE, $file, O_CREAT|O_RDWR, 0644);

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    Even if you aren't in doubt, consider the mental welfare of the person who
    has to maintain the code after you, and who will probably put parens in
    the wrong place.  --Larry Wall in the perl man page 


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

Date: 1 Mar 1997 00:22:54 GMT
From: nvp@shore.net
Subject: Getting the most out of comp.lang.perl.misc
Message-Id: <5f7ssu$iuv@fridge-nf0.shore.net>

$Date: 1997/03/01 00:25:40 $
$Revision: 1.4 $

Posted the week of: Sunday, February 23, 1997
=============================================

This newsgroup has become recently trafficked with numerous questions 
not directly related to Perl, particularly CGI and webserver questions,
which are better answered and appropriate, elsewhere.  Some of this traffic 
ebbed during the auto-faqqing phase, but has recently re-emerged.

Although Perl seems to have become "the other language of the web," and
thus Perl questions have reached a peak, this does not mean that *any* 
problem you might encounter when installing, programming, or porting Perl 
belongs in this newsgroup.  With the scope that Perl is being used, it is 
ludicrous to expect that comp.lang.perl.misc netizens should have to answer 
*every* question with Perl in the "body text."

If you are a newcomer unfamiliar with netiquette, or Usenet practice,
you will receive the best assistance if you pay attention to the
following:

(1) RESEARCH - Before asking "how do I do x?" READ THE DOCUMENTATION.
    Perl developers and other contributors have spent countless hours
    documenting Perl, and it's foolish for you not to read it.  If you
    don't know what to expect from the documentation, or are afraid of
    Unix manpages (hey, a riddle is nice every now and again), go to
    your local bookstore and buy a Perl 5 book.  Tom Christiansen
    maintains a list of publications (and reviews) for your perusal,
    at: http://www.perl.com/perl/critiques/index.html.

(2) NEWSGROUP - "If all else fails, try Usenet."  Seriously, Perl 5
    has been around for several years.  comp.lang.perl.misc has been
    around *much* longer.  There are millions of users on the internet,
    many of whom have already asked questions on comp.lang.perl.misc
    related to Perl 5.  Do you think you'll find an answer this way?
    You do the math.

    *Read* all the articles in the group and search for subject lines 
    (*see below*) that have keywords you are interested in, like
    "directory," or "screen," etc.  If you don't find a question that
    answers your question, check the Usenet archives at 
    http://www.dejanews.com, and search for comp.lang.perl.misc.  I assure
    you that you'll find an answer.  :-)

(3) SUBJECT LINES - "Help me - I need help" is among the WORST subject
    lines that someone can post to *any* newsgroup.  If you have a problem
    with this comment, read "Peter and the Wolf," then you'll understand
    my point.  Several years ago, the volume of postings on Usenet was
    dramatically less, and people could use vague subject headers (although
    they would be corrected by netizens) and possibly get their questions
    answered.  Now, *no one sees a red flag* when they see a posting
    with a subject like "HELP A NEWBIE," because the "urgent" nature of
    the author's posting, or subject headers with keywords like "HELP"
    and "NEWBIE" have been cliched and abused.

    Bear in mind that your subject headers have an effect on others
    seeking help, too.  Useless subject headers prevent people from
    effectively querying Usenet archives (http://www.dejanews.com)
    for assistance.  For example, you might have posted a question
    with the subject header: "help me --- I'm damned," which dealt
    with regular expressions.  Joe Consultant and Jane Consultant
    answered your question nicely, but people searching dejanews
    *for an answer to the same question* would never know this 
    because your subject header was meaningless and/or misleading.

(4) ELITISM - There is no such thing.  An elitist won't take the 
    time to reply to your questions at all.  If someone slaps you
    on the wrist, you've probably gone against the grain of Usenet
    etiquette (netiquette).  Speaking for myself, I'm tired of Usenet 
    chaos, and want to help people to help themselves (hence this note).  
    There must be a way to control this tremendous amount of traffic 
    while not making people feel bad by correcting their misdirected 
    postings, killfiling them, and not answering their questions.  I'd 
    like to be part of the solution, not the problem, so I'm dedicating 
    my time to helping beginners research internet materials properly.

(5) RELEVANCE - Does the posting belong is this newsgroup?  If the
    group is talking about Perl, please be courteous and stick to
    the theme.  This group is not a device to ask random questions
    and get "well, maybe they won't notice that I'm not supposed to
    put this here" answers.  Go to killfile.  Go directly to killfile.
    Do not pass go.  Do not collect $200.

(6) CROSSPOSTING - Don't use the "pinyata method".  Taking random
    swings or stabs at the pinyata, you might accidentally strike
    a friend, or even a relative.  :-)  In other words, don't just
    post to a newsgroup if it contains the word "Perl" in the title.
    
    Here's a breakdown of the Perl newsgroups:
		o comp.lang.perl -> doesn't exist, so don't post there.
		o comp.lang.perl.misc -> this newsgroup, which deals with
			the Perl language.
		o comp.lang.perl.tk -> a newsgroup dealing with a GUI
			extension to the Perl Language.
		o comp.lang.perl.modules ->a newsgroup dealing with
			Perl modules and development.
		o comp.lang.perl.announce -> a newsgroup dealing with
			Perl announcements.
    
    Topics dealing with Minnie Pearl, or Pearl Jam belong elsewhere.
    You might try alt.music.pearl-jam or the like.  I hear Eddie Vedder
    uses some regular expressions that are regularly discussed in the 
    group. :-)


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

Date: Fri, 28 Feb 1997 16:12:46 +0000
From: Jonathan Nichols <Jonathan.O.Nichols@ast.lmco.com>
Subject: gmtime
Message-Id: <331703FA.13BE@ast.lmco.com>

Is there a way to use gmtime by giving it the day of year instead of
month and day of month without writing a routine to convert between the
two?

for instance, how would I take a time string of the format

97-355T12:15:35.134

and convert it to seconds?

I have checked the documentation and previous posts to this newsgroup
and have not found the answer. 

Thanks

jon


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

Date: 28 Feb 1997 21:01:23 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Grabbing text of web pages using perl
Message-Id: <5f7h33$2bo@fridge-nf0.shore.net>

Timothy B. Hutchinson (hutchin@news-server.engin.umich.edu) wrote:
: Is there a relatively easy way -- or a publicly available script --
: which would allow me to grab the text of a web page and append it 
: to a file?  In other words, the input for a filehandle would be the
: web page -- is this possible?

There are a number of ways to do this:

(1) Get the LWP modules from http://www.perl.com/CPAN/modules/by-module/LWP/
    and install them.  Read the docs.
(2) Use lynx -source http://whatever.com and redirect output to a file
(3) Write a simple socket client that connects to port 80 of a server,
    grabs a page, and re-directs output to a file. (Simple socket clients
    are documented in perlipc.pod in your Unix Perl 5 distribution).

HTH!

--
Nathan V. Patwardhan
nvp@shore.net
"A stitch in time saves nine."


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

Date: Fri, 28 Feb 1997 16:32:45 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Grabbing text of web pages using perl
Message-Id: <dem7f5.lg3.ln@localhost>

Timothy B. Hutchinson (hutchin@news-server.engin.umich.edu) wrote:
: Oops -- my news programme messed up my e-mail address -- it's actually
:   hutchin@umich.edu.

: Timothy B. Hutchinson  wrote:
: : Is there a relatively easy way -- or a publicly available script --
: : which would allow me to grab the text of a web page and append it 
: : to a file?  In other words, the input for a filehandle would be the
: : web page -- is this possible?


http://lynx.browser.org  (see the -source command line option)


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 28 Feb 1997 16:59:02 -0600
From: Ed Hill <edhill@strobe.weeg.uiowa.edu>
Subject: Re: Grabbing text of web pages using perl
Message-Id: <ubiv3cmtah.fsf@strobe.weeg.uiowa.edu>

I wrote a simple LWP based script called webclip which might do what you want.
You can find out more about it at:

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

-- 
-Ed Hill (ed-hill@uiowa.edu)
Systems Administrator - Information Technology Services - University of Iowa
"I am Homer of Borg, prepare to be assim... Ooooooooh donuts!"


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

Date: 28 Feb 1997 21:14:21 GMT
From: earl@shadowfax.rchland.ibm.com (Joel Earl)
Subject: Re: help!: RE parse comma separated list
Message-Id: <EARL.97Feb28151421@shadowfax.rchland.ibm.com>


You should take a look at the Text::ParseWords module.
-- 

   Joel Earl, earl@vnet.ibm.com
   Logic Analysis and Optimization
   IBM Rochester, Minnesota
   (507) 253-2304


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

Date: 28 Feb 1997 21:24:38 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Help: IlyaZ's Perl and SIGSEGV
Message-Id: <5f7iem$dos$2@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Petr Prikryl
<prikryl@dcse.fee.vutbr.cz>],
who wrote in article <5f7cmi$605@boco.fee.vutbr.cz>:
> Hi all,
> 
> I have a problem with Ilya Zakharevich's Perl 5.00305 port for
> OS/2, DOS, and Win. To be short, whenever I run a script that uses
> glob() or backticks, the Perl quits with the message:
> 
>    Process terminated by SIGSEGV

This is a bug on 5.003_05 (corrected soon afterwards). It means that
your installation is broken (PERL_SH_DIR part). As usual, running with
-w may help.

> set perl_sh_dir=%perlroot%/bin

Try forward slashes in perl_sh_dir (it gets some backward ones from
%perlroot%). Again, it is fixed in later version.

Ilya


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

Date: 28 Feb 1997 22:17:38 GMT
From: "Scott W. Gifford" <sgifford@tir.com>
Subject: Re: HOW TO SPLIT A SIMPLE STRING
Message-Id: <01bc25c5$34c5e220$f8298acd@sgifford.tir.com>

> >In article <5e254b$to6$1@news.nyu.edu>, donahue@acf2.nyu.edu (Adam M.
> >Donahue) wrote:
> # How about...
>  
> ($var1,$var2,$var3) = $string =~ /(..)(..)(..)/;
>  
> # Moral: never use 3 lines of Perl if you can accomplish the same
> # thing in one (while thoroughly confusing everyone in the process).

  This should accomplish the same thing, and run a smidge faster:

($var1,$var2,$var3)=unpack("a2"x3,$string);
 
  Moral: never use 48 bytes of Perl if you can accomplish the same
  thing in 43 (while even MORE thorougly confusing everyone in the
  processs).

  :-)


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

Date: Fri, 28 Feb 1997 18:08:27 -0500
From: Bill Cowan <billc@tibinc.com>
To: "Geoffrey Hebert heberts@microserve.net" <soccer@microserve.net>
Subject: Re: If you know perl this should be simple
Message-Id: <3317656B.7E39@tibinc.com>

Geoffrey Hebert wrote:
> 
> Need help Received this message
> Can't modify subroutine entry in scalar assignment at addlink7.cgi
> line 398,
> near "];"
> 
> line 398 is marked below
> 
> sub find_index_file {
>     my($word) = @_;
>     local $a_file= ' ';  ## tried this thought it might help
> $first_char=substr($word,0,1);
>    $first_char=lc($first_char);
>    $a_dir=$first_char;
>    if ($first_char lt 'a') {$a_dir='a';}
>    if ($first_char gt 'u') {$a_dir='vwxyz';}
>    $all_files = `ls $p_subject\/alpha\/$a_dir`;
> print "all files $all_files \n";
>    @all_files = split(/\s+/,$all_files);
>    $num_files = @all_files;
> print "num files is $num_files \n";
>     if ($num_files==1) {
>        $a_file=@all_files[0];     ## line 398  ### here is the line
                ^^^
Didn't you mean:
	$a_file = $all_files[0]
to get subscript zero of the array? I admit the error message is
puzzling.  Did you run this with -w switch?  


> print "return a_dir $a_dir, a file $a_file  \n";
>       return $a_dir, $a_file;
>    }
> 
> Please email answer also   heberts@microserve.net
> 
> Thanks

-- Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com>    Voice:919-490-0034   Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707


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

Date: Fri, 28 Feb 1997 21:24:13 GMT
From: njohnson@enterprise.net (Neil Johnson)
Subject: Need Perl index creator script!! Help!
Message-Id: <33174c61.1675343@news.enterprise.net>

Could someone please tell me where I can download a perl script that
can produce a directory index in HTML format. I know a Perl script
like this exists but I just can't find it!!

Also is there a Perl script that can allow users to upload files onto
a server??

Thanks!!

Neil Johnson
njohnson@enterprise.net


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

Date: Fri, 28 Feb 1997 23:49:25 +0100
From: Stefan Wimmer <swimmer@freising-pop.de>
Subject: Re: Need Perl index creator script!! Help!
Message-Id: <3317607E.6E5F@freising-pop.de>

Neil Johnson wrote:
> 
> Could someone please tell me where I can download a perl script that
> can produce a directory index in HTML format. I know a Perl script
> like this exists but I just can't find it!!
> 
> Also is there a Perl script that can allow users to upload files onto
> a server??
> 
> Thanks!!
> 
> Neil Johnson
> njohnson@enterprise.net

I think I know what you're looking for. Try gtindex. 

It's written by Dale Bewley <dale@bewley.net>. Unfortunately I can't
remember where to find this script, but you have email ...

good luck
Stefan


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

Date: 28 Feb 1997 23:08:09 GMT
From: dave@fast.thomases.com (Dave Thomas)
Subject: Re: Nested if in compound if statement
Message-Id: <slrn5hep43.hkq.dave@fast.thomases.com>

On Sun, 23 Feb 1997 05:51:40 -0600, Timothy Shell <tshell@mcs.net> wrote:
> I have two segments of code like this that I need to combine:
> 
> 1.   if (
> 	($a =~ /\balpha\b/) && ($b =~ /\bbeta\b/) && 
> 	($c =~ /\bgamma\b/) && ($d =~ /\bdelta\b/) 
> 	)
> 
> 2.    	if ($one == 1) {dog >= cat;}
>  	elsif ($two == 1) {dog <= cat;}
> 	else {dog == cat;}
> 
> Each segment in my actual program seems to work, but I have had no luck
> combining them.
> 
> The program should match a record if the four conditions in segment one
> are met, and then check to see which condition of segment two must be
> met, and then check that condition.

Doesn't something like:

   if (($a =~ /\balpha\b/) && ($b =~ /\bbeta\b/) && 
 	($c =~ /\bgamma\b/) && ($d =~ /\bdelta\b/) &&
	
	((($one == 1) && (dog >= cat)) ||
  	 (($two == 1) && (dog <= cat)) ||
 	  (dog == cat))) {
	  
	  ...
    }
    
A couple of points. 

  - Presumably dog and cat have $'s in your actual code
  - are you familiar with the <=> operator? You might be able to use it to
    simplify the test
    
Regards

Dave



-- 

 _________________________________________________________________________
| Dave Thomas - Dave@Thomases.com - Unix and systems consultancy - Dallas |
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Fri, 28 Feb 1997 16:30:13 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Newbie Perl / HTML Content-type question
Message-Id: <l9m7f5.lg3.ln@localhost>

Nathan V. Patwardhan (nvp@shore.net) wrote:
: Ben Thompson (ben@mendip.com) wrote:

: : >comp.lang.perl.misc has nothing to do with webservers.  There are some
: : >servers groups, like comp.infosystems.www.servers.misc.

: : Unfortunately this problem has nothing to do with Web servers. On NT
: : Perl comes in three varietys, Perl, a Perl IIS extension (for
: : Microsofts IIS server) and Perl Script. 
                   ^^^^^^
                   ^^^^^^

: Very well then, but it still doesn't belong here.


Exactly! There is a newsgroup for this problem (if it's particular
to M$ stuff:

comp.infosystems.www.servers.ms-windows


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Fri, 28 Feb 1997 15:51:17 -0600
From: bassler@i1.net
Subject: Numeric versions of sort/reverse?
Message-Id: <857165970.23491@dejanews.com>

Howdy.  Do there happen to be similar commands to sort and reverse that
work with numeric values instead of ASCII ala these two commands?
True, I guess I COULD have bunch of fun and sort the array numerically
with stacks, etc, but would appreciate it if anyone could enlighten me
with an easier way/command.  Thanks in advance.


Ryan Bassler  -> basslerp@musu2.slu.edu
LMP web page  -> http://www.prairienet.org/~bassler

Become an LMP pod - order your CD copy of "Aunt Canada" today!

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Fri, 28 Feb 1997 18:23:44 -0600
From: Don Bowen <don.bowen@cat.com>
Subject: Re: Numeric versions of sort/reverse?
Message-Id: <33177710.76D5@cat.com>

Ryan,

sort has an optional third parameter (or is 2nd?) that is the name of a
function which receives two parameters a and b.  It returns a numeric
value indicating whether a>b, a<b or a==b.

Don't have my book in front of me and can't think of it off the top of
my head, but it works great.  I even used a function to sort tcp-ip
addresses. Some of the addresses were ip addresses and some were dns
names.  Worked great.

Don;

bassler@i1.net wrote:
> 
> Howdy.  Do there happen to be similar commands to sort and reverse that
> work with numeric values instead of ASCII ala these two commands?
> True, I guess I COULD have bunch of fun and sort the array numerically
> with stacks, etc, but would appreciate it if anyone could enlighten me
> with an easier way/command.  Thanks in advance.
> 
> Ryan Bassler  -> basslerp@musu2.slu.edu
> LMP web page  -> http://www.prairienet.org/~bassler
> 
> Become an LMP pod - order your CD copy of "Aunt Canada" today!
> 
> -------------------==== Posted via Deja News ====-----------------------
>       http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Fri, 28 Feb 1997 21:54:12 GMT
From: sb@netcom.com (Microserf)
Subject: Perl 4 -> Perl5, SEGV from Carp::Longmess.  Please read
Message-Id: <sbE6C26C.CLC@netcom.com>

I have a big perl script (> 3000 lines) that i am using to process
some data sets.  it is written using perl 4, and worked fine.. till i
upgraded to Perl 5.  

	now, for some reason i get a SEGV fault on only SOME of the
data sets.  i ran it using the debugger, and found that it goes to
Carp::longmess at some point in a particular function.

can someone please tell me why this may be happening or what to look
for?  the only lib. i am using newgetopt.pl in the begining to get
args.

thanks.
sb



-- 
			  WIDE AWAKE IN AMERICA
Sanjay Bhatia <sb@netcom.com>		  		 Sys Admin/Programmer
415 617-0155				Taos Mountain Software, Palo Alto, CA 


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

Date: Fri, 28 Feb 1997 20:51:22 GMT
From: skatz@waite.mcp.com (Steven Katz)
Subject: Perl eZone Interactive Course (with certification!)
Message-Id: <5f7gmv$2ud$11@news.iquest.net>

Waite Group Press - eZone Interactive Course Series
http://www.waite.com/ezone

A revolutionary approach to online education. The eZone is a service available 
to owners of the Waite Group Press 'Interactive Course' series computer books. 
The eZone features online quizzes, university certification, live mentors, 
regularly published newsletters, discussion lists and more, all designed to 
enhance the online classroom metaphor.

Stop by and be our guest for a tour of the future of online learning!

--
Steven Katz, Webmaster
Waite Group Press


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

Date: Thu, 27 Feb 1997 16:10:32 -0600
From: Anthony John Doyle <strad@mondenet.com>
To: "strad@mondenet.com" <strad@mondenet.com>
Subject: Re: PERL for NT & Netscape Enterprise Server
Message-Id: <33160658.6B03@mondenet.com>

<HTML><BODY>
nelson wrote:&nbsp;

<BLOCKQUOTE TYPE=CITE>Anthony John Doyle &lt;strad@mondenet.com&gt; writes:
<BR><I>&gt; Have been working the last few weeks with the Netscape Communications</I>
<BR><I>&gt; Server 1.12 and have been doing some PERL scripts which would get</I>
<BR><I>&gt; executed as:</I>
<BR><I>&gt;</I>
<BR><I>&gt;&nbsp;&nbsp; <A HREF="http://host/cgi-bin/perl.exe?myscript.pl">http://host/cgi-bin/perl.exe?myscript.pl</A></I>
<BR>
<BR>AAUGH!&nbsp; NO NO NO NO NO!&nbsp; Tom Christiansen has provided a grumpy
but
<BR>invaluable service with his &quot;latro&quot; program--available at
<BR><A HREF="http://www.perl.com/perl/news/latro-announce.html--that">http://www.perl.com/perl/news/latro-announce.html--that</A>
could let
<BR>anyone anywhere run any program on your system that they like.
<BR>
</BLOCKQUOTE>
i am / was aware of that - we are operating on a private intranet behind
a firewall
<BR>here so that was not an immediate concern - the server was a development
/ test
<BR>machine as well - it was ugly too - however - there were problems with
a number
<BR>of things - the worst was when upgrading to netscape's enterprise server
3.0beta2
<BR>at the same time as changing a line or two of code with the binmode(STDOUT);
<BR>having to do with the differences in the way unix and windows nt handle
end of
<BR>line markers differently - once i moved the binmode(STDOUT); after the
<BR>print &quot;Content-type: text/html\n\n&quot;; line and a few small other
changes the scripts
<BR>now work as they should with <A HREF="http://server/cgi-bin/script.pl">http://server/cgi-bin/script.pl</A>
<BR>
<BR>

</BODY>
</HTML>



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

Date: Fri, 28 Feb 1997 09:16:18 -0500
From: Charlie Wu <charliew@atlml1.attmail.com>
Subject: Re: Perl on Windows 95
Message-Id: <3316E8B2.4959@atlml1.attmail.com>

Sandy MacKenzie wrote:
> 
> I got perl scripting working well with PWS and Netscape.  IE3 however
> demands that
> I invoke dial up networking.
> 
> Terence Jordan <tjordan@ns15.cca.rockwell.com> wrote in article
> <33158dd2.4281113@news>...
> > On Tue, 25 Feb 1997 23:51:46 GMT, wilsonpm@gamewood.net (Pete M.
> > Wilson) wrote:
> >
> > >Microsoft has the free PWS (Personal Web Server) for Win95 on their
> > >site. I don't know if it supports scripting.
> > >
> > >Peter Holtan <puzzled@cris.com> wrote:
> >
> > I tried it, but I couldn't get it to work with perl.
> > +--Terence Jordan(x7233)----------------+----------------------------+

Hi Sandy:

Can you detail how you did that? I spent the whole night trying to make
it work but I always get this 500 Sever error message.

I have Perl5.003 and pws1.0 - and also associated .pl with
c:\perl5\bin\perl.exe, and in the registry added an entry 
".pl	c:\perl5\bin\perl.exe" (as suggested in one of the dejanews
articles) but still no luck...

thank you very much!!!

Charlie Wu
http://www.impactsite.com/charliew/
Web Applications Developer/Consultant
AT&T, Atlanta, Georgia


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

Date: 28 Feb 1997 21:19:35 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Question about the SYSTEM function
Message-Id: <5f7i57$dos$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Efigenio Ataide
<ataide@planetarium.com.br>],
who wrote in article <33137d89.3808563@newsfeed.pnl.gov>:
> In a Perl program I am trying to do the following:
> 
> system("/sbin/diplogin", $user) == 0 || die "calling diplogin: $?\n";

You probably want && instead of ||, see perlfunc/system.

Ilya


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

Date: 28 Feb 1997 23:36:12 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Returning a reference to a 'my' variable
Message-Id: <5f7q5c$901$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    Bill Kuhn <wkuhn@uconect.net> writes:
:If you use a named array, then I think $A and $B will refer to the same
:thing in your example.

Noope.  Try this, and marvel:

    for $i ( 1 .. 10 ) {
	my @a;
	push @many, \@a;
    } 

    print "@many\n";

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

    X-Windows: A mistake carried out to perfection.
	--Jamie Zawinski


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

Date: 28 Feb 1997 13:22:18 -0800
From: Brett McCormick <brett@speedy.speakeasy.org>
Subject: Re: Searching for Perl-supported Linux database
Message-Id: <7vk9nspqwl.fsf@speedy.speakeasy.org>


There is postgresql (aka postgres95) as well, which is also used in
commercial applications, and IMHO a very fine database with some very
fine features (creation of custom types/functions via dynaloaded code)..

http://www.postgresql.org/

--brett

jrs@alpha.hut.fi (Johan R Sundstr|m) writes:

> 
> Chris Schoenfeld <chris@ixlabs.com> writes:
> 
> >I'm in the market for a database with the following features:
> 
> >1. Native Linux and Spac Solaris support (i.e. share binary db's).
> >2. A thoroughly tested Perl 5 module interface.
> >3. Speedy, for CGI work.
> >4. Either commercial or well-supported PD.
> >5. Native file/record locking.
> 
> >We have been using Berkeley DB / DB_File but wish to move to something a
> >little more robust, as we have been having some portability, locking,
> >and corruption problems here and there.
> 
> >After some preliminary research, I have narrowed it down to the
> >following:
> 
> Take a look at http://www.tcx.se/ It is used in commercial applications.
> 
> Johan
> 
> -- 
>  jrs@cc.hut.fi            // 
>  jrs@niksula.cs.hut.fi   // Phone: +358-40-5120550
>  jrs@polycon.fi         //


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

Date: 28 Feb 1997 23:16:00 GMT
From: "Scott W. Gifford" <sgifford@tir.com>
Subject: Re: shuffle an array
Message-Id: <01bc25cd$5ce89100$f8298acd@sgifford.tir.com>

> Is there a perl function that returns a shuffled array.
> e.g: @shuffledarray = shuffle(@old);
> 
> I tried "values" and "keys" for associative arrays, but those
> don't actually return random values.

  Here's one way to do it . . .

-----Scott.

#!/usr/tools/bin/perl -w

srand($$^time);

@list=qw(camel fish aardvark giraffe skunk porcupine
         heffalump woozle snake potato);
@list=&shuffle(@list);
print "@list\n";

sub shuffle
{
  local($_);
  my(@r);

  foreach (@_)
  {
    push(@r,rand().":$_");
  }
  @r=sort{((split(/:/,$a))[0] <=> (split(/:/,$b))[0])} @r;
  grep($_=(split(/:/,$_))[1],@r);
}


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

Date: Fri, 28 Feb 1997 19:54:15 +1000
From: Hugh Blandford <hugh@island.net.au>
Subject: Starting with PERL: a question
Message-Id: <3316AB47.467B@island.net.au>

I have never done any sort of programming in my life and am thinking of
learning to use PERL.

>From the website, it appears that the only basic instruction material is
from O'Reilly in the form of the 'llama' book.  Yet this only deals with
PERL version 4. Is this where I will have to start?  Does anyone know of
any tutorial docs at universities around the world that might be of
help?

Does anyone have any starting suggestions for a complete non-programmer
about to delve into PERL?

Regards,

Hugh.


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

Date: Fri, 28 Feb 1997 14:17:07 -0700
From: Wayne Will <xaren@ascentech.com>
Subject: Re: web opens DOS window on scripts
Message-Id: <33174B53.720F@ascentech.com>

Petri Bdckstrvm wrote:
> 
> Wayne Will <xaren@ascentech.com> wrote in article
> <3311E560.7649@ascentech.com>...
> > I'm almost certain I've missed something in setup.
> >
> > When my scripts are opened from a browser, it dowloads it, and runs it
> > in a DOS window. I try taking off read access rights, and the browser
> > can't find the file.
> >
> > I'm useing this to access the script from a form, and have reduced
> > everything to the simplest of commands.
> > <FORM METHOD="get" ACTION="temp/register.pl">
> >
> > Can anyone help or give a suggestion?
> >
> > No one around here has anymore Ideas.
> 
> This is not a Perl problem at all, but something you should've
> taken up in, e.g., comp.infosystems.www.authoring.cgi, or
> someplace where your particular web server is discussed.
> 
> If your script is run in a DOS window by the browser, then it
> means:
> 
>    a) You have misconfigured your web server (or misunderstood
>       how CGI scripts - written in Perl or whatever language -
>       are invoked).
> 
>       That is, you have not set the "temp/" directory under the
>       current root to execute only. Or, alternately, put your
>       script in a directory that already *IS* set to execute only
>       (usually someplace that the web server alias /cgi-bin points
>       to).
> 
>       How it is done depends on your server (that is, consult
>       your server documentation).
> 
>       In other words, the code shouldn't even be sent to your
>       browser.
> 
>    b) The fact that your browser runs the Perl code in a DOS
>       window (besides being mistakenly - well, the server only
>       does what you tell it to do, and you didn't tell it to
>       run .pl files on the server - sent the actual code), stems
>       from you having locally a Perl interpreter installed, and
>       an assocociation to it for files with a .pl extension, and
>       configuring your browser to execute data/files sent (when
>       a web server sends it to it).
> 
> ...petri.backstrom@icl.fi
>    ICL Data Oy
>    Finland
Thanks for responding, I think we've found the problem, The regestry
will not act correctly, and we are going to do a re-install. We
installed IIS and it would not work at all, and looked at the registry
and saw some very important things missing.
Thanks again.


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

Date: 28 Feb 1997 15:33:29 -0500
From: dsr@cyber3.servtech.com (dan ritter)
Subject: Re: Which database in Perl?
Message-Id: <5f7fep$5n5@cyber3.servtech.com>
Keywords: *

In article <33158420.54521@news.demon.co.uk>,
Guy Saner <gs@iscon.demon.co.uk> wrote:
>I am programming an online database system in Perl. I have found several
>modules for accessing databases, but I am unsure about which
>is best. My requirements are: 
>
>Between 2000 - 6000 records
>Fully searchable under any field.
>Ability to write and read records.
>
>If anyone has suggestions about which modules I should use or what
>database structure is best, I would be very grateful for any response.

Well, with those requirements, any database is probably overkill. Why
not use your friend, the associative array? 10,000 records, at, say,
20K apiece is just 200 MB, which any worthwhile system can handle in
memory. If your records are actually 4K apiece, and you have 8,000,
that's just 32 megs - nothing at all. Keep the whole thing in memory,
handling requests without halting afterwards, and your speed will be
nice, too.

Alternatively, the plain old DBM system works well. :)

-dsr-


-- 
--
dsr@servtech.com                     Flash:  Systems/network admin seeks new job
Dan S. Ritter                                on the East Coast. Resume at 11!
                                             (Resume available on request.)


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

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 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.

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

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