[7179] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 804 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 1 11:22:30 1997

Date: Fri, 1 Aug 97 08:00:33 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 1 Aug 1997     Volume: 8 Number: 804

Today's topics:
     Re: !Capture who command results (Sami Sandqvist)
     Re: [Q] Checkbox forms in Perl (Greg Zevin)
     Re: [Q] Converter between ELM filter-rules file to proc (Dick Adams)
     Re: [Q] Pattern matching syntax (Tad McClellan)
     Re: [Q] Pattern matching syntax (Tad McClellan)
     Any nice "Powered by Perl" gifs? nospam@domain.com
     Re: ANYONE KNOW OF A GOOD BOOK FOR LEARNING PERL (Edward W. Morris)
     ARRGH!  This class has no class <adrianh@yucc.yorku.ca>
     Re: comment (A. Deckers)
     Re: comments in regular expressions (wish list) <jbuehler@hekimian.com>
     Re: Compact syntax (was: Re: Poetry questions) <rootbeer@teleport.com>
     Re: Doubt using PERL and NT (Jim Michael)
     Re: Dynamic memory allocation/deallocation (dave)
     Re: file extensions ( Thomas Lachlan XMS x4206 )
     Re: Installing module without having privledges <jacksodp@dragon.ham.muohio.edu>
     matching , in a reg expr (Umm)
     Re: Matching...( Practice what U preach!! ) <sfairey@adc.metrica.co.uk>
     need a Perl programmer! <cyberwolf@resurrection.com>
     Re: Need alarm to interrupt system call (Charles DeRykus)
     Re: Net::FTP documentation and examples <zenin@best.com>
     Re: Perl String truncation (Tad McClellan)
     Perl won't cgi on WinNT <jzv20@amail.amdahl.com>
     Re: Print Web Page a la netscape <cs@zip.com.au>
     Re: printing leading zeros in number <zenin@best.com>
     Re: Q: empty elements in arrays (robert)
     Re: Questions regarding speed of grep EXPR <sfairey@adc.metrica.co.uk>
     Re: Server-side web pushes in Perl <rootbeer@teleport.com>
     Re: setuid perl scripts on HP-UX 10.20 stop.spam@infoband.com
     Re: Super Newbie Question <burleigh@hackberry.chem.niu.edu>
     Re: Too many people in this group are arrogant #*(@# (R (Bryan Miller)
     Re: Unexecuted stmt adds array elem?? <adrianh@yucc.yorku.ca>
     uppercase($mystring) ? <fgaume@atos-group.com>
     Re: uppercase($mystring) ? ( Thomas Lachlan XMS x4206 )
     Re: use versus require (Randy J. Ray)
     Xbase module <serginho@alpha.hydra.com.br>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 31 Jul 1997 07:57:09 GMT
From: samiss@assari.cc.tut.fi (Sami Sandqvist)
Subject: Re: !Capture who command results
Message-Id: <slrn45u0hbd.isf.samiss@assari.cc.tut.fi>

On	Wed, 30 Jul 1997 20:14:01 +0300, Lauri Laakso <lauri@samoilu.net> wrote:
>When I type who I get...
>
>paja:/lauri$ who
>lauri    ttyp0    Jul 30 18:48 (paja.samoilu.net)
>inkinen  ttyp3    Jul 30 16:39 (cypress.samoilu.)
>paja:/lauri$ 
>
>...how do i get those (2 in this example) lines?

You can say
@lines = `who`;
to get an array of (2 in this example) lines or you can do
open FH, "who |";
while (<FH>) {
	...something..
}

Sami Sandqvist
-- 
    "What is the sound of Perl?  Is it not the sound of a wall that
     people have stopped banging their heads against?"
		--Larry Wall in <1992Aug26.184221.29627@netlabs.com>


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

Date: 1 Aug 1997 10:37:45 +1000
From: greg@turing.une.edu.au (Greg Zevin)
Subject: Re: [Q] Checkbox forms in Perl
Message-Id: <5rrb4p$7db@turing.une.edu.au>

"Jack Lawrence" <jlawrenc@acc.jc.edu> writes:

>Along those lines...
>Is it possible to, after a list of items with checkboxes, to have a single
>checkbox that will either select or deselect the entire list of checkboxes?

Yes, if you write a simple JavaScript function which will use 
OnClick event to reset the checkboxes (I actually am doing this at the moment,
but I am using a button to do this :)) )

Greg Zevin







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

Date: 1 Aug 1997 03:22:00 -0400
From: rdadams@access5.digex.net (Dick Adams)
Subject: Re: [Q] Converter between ELM filter-rules file to procmailrc file?
Message-Id: <5rs2qo$rp4@access5.digex.net>

Ricardo Marek  <ricky@ornet.co.il> wrote:

> Does such animal exist? (to convert the ELM filter-rules file 
> into a procmailrc file
>
> Please answer via e-mail

I was really hoping to see an answer to this question posted!!


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

Date: Wed, 30 Jul 1997 22:07:08 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: [Q] Pattern matching syntax
Message-Id: <sgvor5.1h4.ln@localhost>

Terje Br}ten (terjebr@pvv.ntnu.no) wrote:
: Adam Grayson <dyrewolf@worldnet.att.net> writes:


: > Another question: can "&" be used as a regular ASCII character, say to
: > break up a text line that has the strings connected by an ampersand?

: Sure, but you have to be careful to use single quotes around the &
                                      ^^^^^^^^^^^^^^^^^
: char in your code, or put a \ in front of it.
                        ^^^^^^^^^^^^^^^^


huh?


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

$_ = "watch out for &foo in double quotes\n";

print;

sub foo  {
   return 'foo was here';
}
-----------------------

outputs:

watch out for &foo in double quotes


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


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

Date: Wed, 30 Jul 1997 22:13:24 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: [Q] Pattern matching syntax
Message-Id: <ksvor5.2i4.ln@localhost>

Adam Grayson (dyrewolf@worldnet.att.net) wrote:
: I want to run a pattern matching function on an array variable, the name
: of which is @cover[$i]. Not sure if that is correct to start with. 

That is not correct.

use the -w switch. It would have told you that you probably want
a scalar value, which you would access thusly:

$cover[$i]


: Can I
: run /@cover[$i]/ to search for that string in a text line? 

What happened when you tried it?

If it doesn't do what you wanted, *then* you post a question about it...


: Another question: can "&" be used as a regular ASCII character, say to
: break up a text line that has the strings connected by an ampersand?

What happened when you tried it?

If it doesn't do what you wanted, *then* you post a question about it...


: Thanks in advance

Uh huh.

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


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

Date: 30 Jul 1997 03:12:43 GMT
From: nospam@domain.com
Subject: Any nice "Powered by Perl" gifs?
Message-Id: <5rmbfb$rpf$1@news2.voicenet.com>

Has anyone ever seen any nice "Powered by Perl" gifs?

(Maybe with a really muscular-looking camel...)
--
##--------------------------------
##  J o h n   N o l a n  
##  jpn acm org
##--------------------------------


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

Date: 1 Aug 1997 01:41:42 GMT
From: emorr@linux.fast.net (Edward W. Morris)
Subject: Re: ANYONE KNOW OF A GOOD BOOK FOR LEARNING PERL
Message-Id: <5rresm$kro$4@news1.fast.net>

DanitoFool (danitofool@aol.com) wrote:
: I am looking for a good book or online manual to learn perl from, please
: help and e-mail me back if you know of any?

Learning Perl by Schwartz published by O'Reilly.
--
MAIL:	emorr AT fast.net
WEB:	http://www.users.fast.net/~emorr


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

Date: Thu, 31 Jul 1997 17:41:13 -0400
From: Adrian Hawryluk <adrianh@yucc.yorku.ca>
Subject: ARRGH!  This class has no class
Message-Id: <33E10678.2FD4@yucc.yorku.ca>

I am tring very hard to get a handle of perl's very interesting work
around to become object oriented, and it is quite interesting.  However,
it seems that what I want to do cannot be done.

I want a class to have an instance of a file handle unique to that
instance.  But file handles are of type GLOB.  A GLOB reference cannot
be declared using my, although it can be referenced by a SCALAR.  If
delcared using local in side of the "class", then referenced using a
SCALAR, each instance will have a reference to the *same* file handle.

This is useless to me.  I require that each instance have seperate file
handles.  The only workaround I've come up with is to declare the
filehandle(s) beforehand and then passing that handle to a member
function of that class.  I would perfer that the class would dynamically
produce a filehandle.  Is there a way of doing this?

Adrian


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

Date: 1 Aug 1997 01:13:25 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: comment
Message-Id: <slrn5u2e1k.fmp.I-hate-cyber-promo@news.rediris.es>

In <Pine.GSO.3.96.970730100054.23957O-100000@kelly.teleport.com>,
	Tom Phoenix <rootbeer@teleport.com> wrote:
>On 29 Jul 1997, John Liao wrote:
>
>> Is there a equivalent  /*   */ for comments in perl?
>
>No and yes. :-)
>
>No, Perl doesn't have a way to comment-out blocks of text [...]

=pod

But it does.

=cut

ALain

-- 
Perl information: <URL:http://www.perl.com/perl/>
    Perl archive: <URL:http://www.perl.com/CPAN/>
        Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<


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

Date: Thu, 31 Jul 1997 18:03:45 -0400
From: Joe Buehler <jbuehler@hekimian.com>
Subject: Re: comments in regular expressions (wish list)
Message-Id: <33E10BC1.212A9324@hekimian.com>

Dennis Grinberg wrote:
> 
> If wishes could come true...
> 
> I find that comments in regular expressions have only limited usefulness,
> namely commenting the regular expression. I would like a more general
> mechanism that allows one to attach attributes to certain portions
> of the expression. If the portion of the regular expression corresponding
> to an attribute was matched, the attributes would be consulted/executed/etc.
> Of course this could only take place after the entire string was matched.
> 
> A simple application using this mechanism would print the portions of
> the regular expression that caused the match. While one could achieve
> this result running over all registers, the attribute mechanism would
> be much cleaner from a user point of view.

Along this line, it would be nice to be able to be able to
stuff the matching portions of a pattern into named variables:

$x =~ /(?>$var:some_pattern)(?>$var2:some_pattern_2)/;


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

Date: Fri, 1 Aug 1997 06:48:01 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Aaron Sherman <ajs@lorien.ajs.com>
Subject: Re: Compact syntax (was: Re: Poetry questions)
Message-Id: <Pine.GSO.3.96.970801064206.9029G-100000@kelly.teleport.com>

On 31 Jul 1997, Aaron Sherman wrote:

> > $var = $long->{'variable'}->{'name'} || "nope";
> 
> Yes, that works. The one I wish perl had was:
> 
> 	$feel = defined($nuts)?$nuts:$mounds;

Something that would make a shortcut for that possible has been kicked
around by the Perl development team for a while now. Exactly how it will
behave and what it will be called were still uncertain last time I
checked, but you may see something able to do this (and perhaps more cool
stuff) in a few more months. 

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/



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

Date: Fri, 1 Aug 1997 01:57:46 GMT
From: genepool@netcom.com (Jim Michael)
Subject: Re: Doubt using PERL and NT
Message-Id: <genepoolEE7pGA.IKr@netcom.com>

Mark Haskamp (haskamp@lexis-nexis.com) wrote:
: You could map the network drive via Explorer.  Explorer will assign a
: drive letter to the networked drive and you can then refer to the file
: using the new drive letter.

If you intend to do this repeatedly and consistently, use a batch file to 
map the drive after deleting any existing mapping, run your script, then 
delete the mapping to free resources:

runme.bat
==========
map p: /delete
map p: \\myhost\myshare
REM better make sure I know where perl.exe is: d=drive letter
path=d:\perl\bin;%path%
perl myProgram.pl myargs
REM clean up
map p: /delete

Cheers,

Jim


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

Date: Fri, 01 Aug 1997 01:12:02 GMT
From: over@the.net (dave)
Subject: Re: Dynamic memory allocation/deallocation
Message-Id: <33e13725.10014969@news.one.net>

Larry D'Anna <ldanna@hotmail.com> wrote:

>dave wrote:
>
>> I'm keeping a global array of references to hashes.  Each hash is
>> created with its reference pushed on the array.  The hash is then
>> identified by the index of its reference in the array.  This provides
>> an ID that is a simple number.
>>
>> I'm thinking I should periodically clean up the array, removing hashes
>>
>> that are no longer used.  How do I insure the memory is deallocated?
>>
>
>$array[hash_i_don't_need_anymore] = undef;
>
>---------------------------------------------------
>|Democracy is the worst system of government. --
>|Except for all the others
>|               -Winston Churchill
>---------------------------------------------------
>Larry D'Anna                   "eschew obfuscation"
>
>

Is it that simple?  Comments in undef(camel) indicate one should not
attempt to undefine elements of an array or hash.  One should only
undefine an entire structure.  What does it all mean?????

Thanks,
Dave

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


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

Date: 1 Aug 1997 13:37:59 GMT
From: etltsln@etlxd30.ericsson.se ( Thomas Lachlan XMS x4206 )
Subject: Re: file extensions
Message-Id: <5rsorn$53s@newstoo.ericsson.se>

Shaun O'Shea (lmisosa@eei.ericsson.se) wrote:
: I have an array whose elements are all file paths E.G.

: 	address/of/the/file/in/question/file1.Uen.A.fmk
: 	address/of/the/file/in/question/file1.Uen.B.fmk
: 	address/of/the/file/in/question/file2.Uen.A.fmk
: 	address/of/the/file/in/question/file3.Uen.A.fmk

: I would like to use this array to create another array which just
: contains the file extensions i.e.
: 			.Uen.A.fmk
: 			.Uen.B.fmk
: 			.Uen.A.fmk
: 			.Uen.A.fmk

: I tried to find some way to substitute everything up as far as the first
: "." with nothing but I couldn't.

: Any offerings appreciated.


: 			Shaun..............:-)
: -- 
: ***********************************************************************
: Shaun O'Shea,
: lmisosa@eei.ericsson.se
: OR
: shaunos@orca.ucd.ie
: ***********************************************************************
Hello Shaun as your from Ericsson....
			Try this:

@temp_array=();
@file_name_array=();

for(@your_array) {
				$num_of_slashes=@temp_array;
				@file_extension=split /\./,($temp_array[$num_of_slashes - 1]);
				$num_of_ext_parts=@file_extension;
				$extension=(join '.',@file_extension[1..$num_of_ext_parts]);
				$last_dot=length($extension) - 1;
				push(@file_name_array,substr($extension,0,$last_dot));
				}
				
				print "@file_name_array\n";

	You can do this more elegantly i.e. one line of cunning reg exp., however I hope this
	gives you the idea.


			Regards etc Tom.


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

Date: 31 Jul 97 15:29:27 -0500
From: Dane P. Jackson <jacksodp@dragon.ham.muohio.edu>
Subject: Re: Installing module without having privledges
Message-Id: <1997Jul31.152927.6024@nntp.muohio.edu>

othernane <jason@watson.ibm.com> wrote:
> I have access to several *nix machines that have perl installed, but
> none have
> LWP installed.  I've tried to do a conventional install of LWP on these
> machine, but the install keeps on trying to put files in directories in
> which I  don't have write privledges.
> Is there a way for me to install these modules elsewhere and have them
> work normally?

	I have had some luck just putting them one up from my perl directory.
ex.  NEWS::NNTPClient - my perl directory is ~/perl I put NNTPClient in a
directory ~/perl/News.

	It works fairly well except that I can only run it from ~/perl. I
could probably get to work elsewhere if i worked on @INC or my path
environment variable.  I don't know how good a solution this is but it 
works for me.

-- 
Dane Jackson - jacksodp@dragon.ham.muohio.edu
"Never date a woman with a brother named Nunzio."
-Walter Slovotsky's Law #22


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

Date: 1 Aug 1997 13:09:55 GMT
From: l41484@alfa.ist.utl.pt (Umm)
Subject: matching , in a reg expr
Message-Id: <5rsn74$6rn@ci.ist.utl.pt>

I tried something like m/(*.),*$

obviously i can't use , directly, i tried some variations but they don't
work, can u help??

thanks.


--
                         Tiago Umm Pascoal
                    'The unstoppable mail machine'
                        l41484@alfa.ist.utl.pt

 I believe in making trouble. If women have any duty at all, essentially
it's to be a pain in the arse. (avital ronell)



--
                         Tiago Umm Pascoal
                    'The unstoppable mail machine'
                        l41484@alfa.ist.utl.pt

 I believe in making trouble. If women have any duty at all, essentially
it's to be a pain in the arse. (avital ronell)



--
                         Tiago Umm Pascoal
                    'The unstoppable mail machine'
                        l41484@alfa.ist.utl.pt

 I believe in making trouble. If women have any duty at all, essentially
it's to be a pain in the arse. (avital ronell)



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

Date: Fri, 01 Aug 1997 13:50:18 +0100
From: Simon Fairey <sfairey@adc.metrica.co.uk>
To: jjjj@zenith.yok.utu.fi
Subject: Re: Matching...( Practice what U preach!! )
Message-Id: <33E1DB8A.8482AD3E@adc.metrica.co.uk>

Simon Fairey wrote:

> J.Hernetkoski wrote:
>
> > Hello again!
> >
> > I'd need to match all lines between <pre> and </pre>-tags
> > and in the following code, $prices should include all text
> > between <pre> and </pre>-tags.
> >
> > ($prices) = ($results = m#<PRE> ([^</PRE>]*)#i);
>
> There are a couple of problems with the above. Firstly between
> '$results' and 'm///' you should be using '=~' not '=', but assuming
> that is a typo when you posted this it still wont work. [^</PRE>] -
> this
> is defining a charater class where valid characters are anything
> except
> the ones listed, it does not treat '</PRE>' as a single string but as
> a
> list of characters. The regep you need is as follows:
>
> ($prices) = ($results = m#<PRE>(.*?)</PRE>#is);

Bugger......

Of course that should be:
  ($prices) = ($results =~ m#<PRE>(.*?)</PRE>#is);



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

Date: Thu, 31 Jul 1997 23:30:45 -0600
From: "Brian Gorr" <cyberwolf@resurrection.com>
Subject: need a Perl programmer!
Message-Id: <cyberwolf-3107972330450001@belial-58.d.enteract.com>

I am currently in need of a Perl5 savvy programmer for some job-by-job basis CGI scripting. I am fairly certain that they would be simple scripts. Ideally, I would email this person things such as HTML forms, samples of desired email output and HTML output, and any additional comments/questions. This person would, in turn, email back to me a functioning script.

Please contact me via the address at the bottom of this page so that compensation and time-frames for script completion can be negotiated.

Hope to hear from you soon!

Brian

cyberwolf@resurrection.com
http://www.enteract.com/~northlit
Responses are appreciated for ALL email!


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

Date: Fri, 1 Aug 1997 01:30:44 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Need alarm to interrupt system call
Message-Id: <EE7o78.42J@bcstec.ca.boeing.com>

In article <5rqhal$3vc$1@news.or.intel.com>,
Scott Grosch <grosch@ichips.intel.com> wrote:
 > 
 > I'm writing some network code, and it's possible the connect() call will fail
 > if the machine is not up.  However, I don't want it to hang there forever until
 > some system timeout happens.  I want to set an alarm for 5 seconds and after
 > that just skip the machine and move on.  
 > 
 > I can get an alarm to go off, but the call is not interrupted.  for example,
 > if I do this:
 > 
 >     sub skip { warn "alarm went off\n"; }
 >     $SIG{ALRM} = \&skip;
 > 
 >     [ set $sym, call socket(), etc... ];
 > 
 >     warn "About to connect\n";
 >     alarm(5);
 >     unless (connect($sym, $paddr)) {
 >         close($sym);
 >         warn "Unable to connect to $host: $!\n";
 >         return undef;
 >     }
 >     alarm(0);
 >     warn "Beyond connect\n";
 > 
 > 
 > I see the 'About to connect' message, then 5 seconds later I see the message
 > saying 'alarm went off' and then it just hangs until the system times out the
 > connect call.  


The call is interrupted - but then is restarted. 
So you could raise an exception to escape, e.g, 

 my $alarm = "alarm went off";
 $SIG{ALRM} = sub { die $alarm };
 alarm(5);
 eval { unless (connect...  };
 alarm(0);
 if ( $@ =~ /^$alarm/ ) {
    warn "...";
 } elsif ($@) {
    die "weird eval error: $@\n";
 }


HTH,
--
Charles DeRykus
ced@carios2.ca.boeing.com


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

Date: 31 Jul 1997 09:58:18 GMT
From: Zenin <zenin@best.com>
Subject: Re: Net::FTP documentation and examples
Message-Id: <5rpnjq$8cf$2@nntp2.ba.best.com>

Keys <keys@babylon5fan.org> wrote:
> I have read the pod (which is why I turned to clp.misc), and found
> little more than a basic sample script and vague instructions for
> advanced features...  Does anyone know if the author (or anyone else)
> has a webpage with more detail?

	Once again, tell us in general what you are trying to do that
	the docs don't cover.  If the docs aren't clear enough, then it
	is a bug in the docs.  If you don't tell us what you are looking
	for, how do you expect us to help you???  How is anyone to know
	what to add to the docs if you don't tell us???

-- 
-Zenin
 zenin@best.com


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

Date: Wed, 30 Jul 1997 21:45:22 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl String truncation
Message-Id: <28uor5.kd4.ln@localhost>

Mwebernet (mwebernet@aol.com) wrote:
: I have a string that is very long.  I want to chop it off at 50 
: charectors.  How can I do this?


$long_string = substr($long_string, 0, 50);


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


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

Date: Thu, 31 Jul 1997 23:11:50 GMT
From: John Verhagen <jzv20@amail.amdahl.com>
Subject: Perl won't cgi on WinNT
Message-Id: <33E11BB6.3B67@amail.amdahl.com>

I'm new to Perl, and have installed it on my work Machine
Window NT Server 4.0
IIS 2.0

Everything is working fine, so now to install it on the production
server, which has the same configuration. I download and install the
latest version:
ftp://ftp.digital.com/pub/plan/perl/CPAN/ports/win32/Perl5/Release/Pw32i307.exe
The installation goes without a hitch.  
I reboot the server.
The test from the command line works okay.  
However, my form "Form1.htm" with <form action="/cgi-bin/gfm.pl">
tries to list gfm.pl instead of executing it.  POST and GET have the
same results.

Looking back at my work Machine, where this worked okay, I see that I
had originally installed a copy of Perl from the book Perl 5 Unleashed,
and then installed it again from
ftp://ftp.digital.com/pub/plan/perl/CPAN/ports/win32/Perl5/Release/Pw32i306.exe
This left an association of .pl with plfile whereas the production
server associates .pl with Perl.  Both work and production servers point
to "c:\perl\bin\perl.exe %1 %*" in the registry.

So far, this is the only difference I can see in the two machines.  

Are there any words of wisdom that can make the production machine work
so that I can get back to writing Perl instead of installing it?

John.


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

Date: 1 Aug 1997 00:15:08 GMT
From: Cameron Simpson <cs@zip.com.au>
To: Joe Kline <Joe.Kline@sdrc.com>
Subject: Re: Print Web Page a la netscape
Message-Id: <19970801105238-cameron-1-22870@sid.research.canon.com.au>

Joe Kline <Joe.Kline@sdrc.com> writes:
| What I had in mind was a way to print a web page out from
| the command line (just laziness on my part I gues).

Not at all - I feel this urge myself from time to time.

| So I guess I should look for an html2postscript converter then
| basically??

Well, it's more than that. HTML to postscript isn't so bad - I did one once
which transcribed the HTML into "troff -mm" input (the correlation is pretty
close) because I didn't like Netscape's layout style, then fed that into troff.

For textual pages this works well.

For pages with inlined things (mostly GIFs, which at the time I was
prepared to sacrifice to the god of information-rather-than-junk) you
need some fetch capability.

For current trendy graphic-rich table laid-out framed layered flim-flam you
probably need to fall back to a browser unless you want to work really hard.
	- Cameron Simpson, cs@zip.com.au, DoD#743
	  http://www.zip.com.au/~cs/
--
Giving money and power to the government is like giving whiskey and car keys
to teenaged boys.	- P J O'Rourke


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

Date: 1 Aug 1997 00:33:26 GMT
From: Zenin <zenin@best.com>
Subject: Re: printing leading zeros in number
Message-Id: <5rrasm$qj$2@nntp2.ba.best.com>

Nihar Jindal <njindal@san-jose.ate.slb.com> wrote:
> How do I print the leading zeros in a number?  I am printing out a 
> time and I want the numbers I print to always be 2 digits long, even
> if they are less than 10.  Example:
>    $min = 4;
>    when I print the time I want to print:
>     4:04.32 
> I do not want to print: 4:4.32 or 4: 4.32
> Using printf with %2d would print " 4" because it will not print
> the leading zero.  Is there some simple way of doing this?

	man 3 printf

	$ perl -e 'printf "%.2d\n", 4'
	$ 04

	Note the "." in the format.

-- 
-Zenin
 zenin@best.com


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

Date: 31 Jul 1997 09:48:03 +0200
From: robert@ICK.il.fontys.nl (robert)
Subject: Re: Q: empty elements in arrays
Message-Id: <5rpfvj$ad@bsd1.hqehv-internal.ilse.net>

Uwe Lammers <Uwe.Lammers@astro.estec.esa.nl>:
 >looking for the most efficient way to determine whether a string array
 >contains empty entries.

--
sub	containsemptyentry
{
	my $ref = shift;

        map { $_ || return 1 } @{$ref};
        return 0;
}
print "somearray has empty entries\n" if containsemptyentry(\@somearray);
--

I can't really tell if this is efficient or not, but atleast it stops when
it finds the first empty entry in the array :)

                                                                    robert


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

Date: Fri, 01 Aug 1997 12:07:34 +0100
From: Simon Fairey <sfairey@adc.metrica.co.uk>
To: mystery@itis.com
Subject: Re: Questions regarding speed of grep EXPR
Message-Id: <33E1C375.3BB628DF@adc.metrica.co.uk>

Prince Mystery wrote:

> Ok, time trails are here:  Whats the fastest routine
>
> foreach (@keys) {
>   $counter++ if(/searchString/);
> }
>
> $counter = $#{ grep {/searchString/} @keys } + 1;
>
> Both clock under a second on a 1MB hash brought out of a dbm file, and
> I
> don't have anything bigger to work on.
>
> Thoughts?
>
> Myst
>
> -------------------==== Posted via Deja News
> ====-----------------------
>       http://www.dejanews.com/     Search, Read, Post to Usenet

   As an example, using Benchmark:

File:
use Benchmark;

my @array = ( qw( The Benchmark module encapsulates a number of routines
to help you figure out how long it takes to execute some code) );

timethese(shift, {
        'using foreach' => 'foreach(@array){$counter++ if /on/};',
        'using grep' => '$counter = $#{ grep /on/, @array } + 1;',
});

Results:
>perl foreachVgrep 100000

Benchmark: timing 100000 iterations of using foreach, using grep...
using foreach:  1 secs ( 1.40 usr  0.00 sys =  1.40 cpu)
using grep:  4 secs ( 2.48 usr  0.01 sys =  2.49 cpu)

NB: If you will be doing this more than once and you need to reset
$counter to 0 each time then on my system the foreach time went up to
1.90cpu

Benchmark is a wonderful little module, get it, use it and have fun.

Simon



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

Date: Fri, 1 Aug 1997 07:29:33 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Jordan Digby <jadigby@magna.com.au>
Subject: Re: Server-side web pushes in Perl
Message-Id: <Pine.GSO.3.96.970801072130.9029M-100000@kelly.teleport.com>

On Thu, 31 Jul 1997, Jordan Digby wrote:

Newsgroups: comp.lang.perl

If your news administrator still carries comp.lang.perl, please let him
or her know that that newsgroup has not existed since 1995. If you
have such an outdated newsgroup listing, you are probably missing out
on many other valid newsgroups as well. You'll be doing yourself and
many others a favor to use only comp.lang.perl.misc (and other valid
Perl newsgroups) instead.

>     Sorry if this is in the wrong newsgroup, I can't seem to find an
> HTML / Web Server newsgroup anywhere.  

You may not be the only person here who can't find these, although having
an up-to-date list of newsgroups might be a good start. :-) But here's a
web page which may help. It's called "What newsgroups discuss the Web?",
and it lists fifteen (!) separate newsgroups which are all about the web. 

    http://sunsite.unc.edu/boutell/faq/ngroups.htm

Gee, the author doesn't mention c.l.p.misc....  :-)

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/



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

Date: Thu, 31 Jul 1997 13:52:26 -0600
From: stop.spam@infoband.com
Subject: Re: setuid perl scripts on HP-UX 10.20
Message-Id: <870374693.31704@dejanews.com>

In article <meyer.870166007@hp01.megatel.de>,
  meyer@megatel.de (Sebastian Meyer) wrote:
>
> Is it possible to run perl scripts setuid on HP-UX 10.20?
>
> When I start a setuid perl script it just gives me:
>   YOU HAVEN'T DISABLED SET-ID SCRIPTS IN THE KERNEL YET!
>   FIX YOUR KERNEL, PUT A C WRAPPER AROUND THIS SCRIPT, OR USE -u AND UNDUMP!
>
> When I put up the question, howto disable set-id scripts, in
> comp.sys.hp.hpux I received this one answer:
>
> > That is not a feature of hp-ux. however, you can put the script in,
> > saay, /usr/local/bin and make this a separate file system with
> > "nosuid" set in /etc/fstab.
>
> Mounting /usr/local with "nosuid" is not an option, too many programs
> rely on this. Is there any way to get around this constraint or do I
> really have to do without this feature in HP-UX ?
>
> sebastian

my 10.20 box gave me the same message for a setuid root perl script, but
will run Korn shell scripts and C programs no prb setuid.  of course when
I created Perl on this particular machine I didn't explicitly Configure
the setuid stuff...

this is a function of the Configure script whilst making Perl as much as
your particular OS config.  perl.c has logic in there to check "real"
versus "effective" UIDs when it runs, and will bomb if he hasn't been
built with the IAMSUID pragmas.

at the very least, you're going to have to recompile perl, so my
suggestion is to go thru `sh Configure` and read the doc in there about
setting up the suidperl stuff (or have your sysadmin do so if you don't
have access).

hope this helps a bit...

--rsf

Robert Flannigan
InfoBand Inc.
http://infoband.com

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


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

Date: Thu, 31 Jul 1997 16:41:29 -0500
From: Darin Burleigh <burleigh@hackberry.chem.niu.edu>
Subject: Re: Super Newbie Question
Message-Id: <33E10689.29F7@hackberry.chem.niu.edu>

Lars Luthman wrote:
> 
> I've just started using macPerl, and I have a problem:
> 
> when I try to open script files larger than a few K, a dialog box pops
> up:"This file is too large to be edited with MacPerl."
> I can't even run the script! There is probably a very simple solution to
> this, but I haven't been able to find it.
> 
> ll

I'd guess its a Mac problem, not a Perl problem.
maybe it needs more memory, or you have to turn 
off some stuff.

-- 
==========================================================
 - darin
burleigh@hackberry.chem.niu.edu
\\//\\//.\\//\\//.\\//\\//. http://hackberry.chem.niu.edu/HOME/dcb/
 '2 kinds of green, look out!' - dieter rot


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

Date: 31 Jul 1997 18:18:30 GMT
From: millerb@PROBLEM_WITH_INEWS_GATEWAY_FILE (Bryan Miller)
Subject: Re: Too many people in this group are arrogant #*(@# (Re: Checking for valid Email...)
Message-Id: <5rqktm$og3@fcnews.fc.hp.com>

Andrew M. Langmead (aml@world.std.com) wrote:
: "John Bokma" <jbokma@caiw.nl> writes:

: >Subject: Re: Too many people in this group are arrogant #*(@# (Re:
: > Checking for valid Email...)

: Let me just suggest another way of looking at this issue.

Thanks Andrew.  I wouldn't have been so patient and succinct should
have I replied.  The needs of the many (who like me have received
excellent support) outweigh the needs of the few (ubiquitous whiners).

Bryan


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

Date: Thu, 31 Jul 1997 18:36:22 -0400
From: Adrian Hawryluk <adrianh@yucc.yorku.ca>
Subject: Re: Unexecuted stmt adds array elem??
Message-Id: <33E11366.3FF9@yucc.yorku.ca>

Dave Hollenbeck wrote:
> 
> I have some code which produces an array element count even though
> it doesn't execute.  In the code below, when printing the element
> count of $a->{somearray}, the result should be zero, since we
> haven't actually put anything in the array.  However, it seems
> to have one element.
> 
> Is this _supposed_ to work?
> 
> #!/usr/bin/perl -w
> 
> package BugTester;
> 
> sub new {
>     my $type = shift;
>     my $self = {};
>     $self->{somearray} = [];
>     bless $self, $type;
> }
> 
> sub _secret_call {
>     my $self = shift;
>     my $dont_do_it = shift;
>     my $hashref = shift;
>     $$hashref = "whocares";
> }
> 
> sub maybe_fill {
>     my $self = shift;
>     my $dont_do_it = shift;
>     my $which_one = 0;
>     unless ($dont_do_it) {
>         print "Adding an element...\n";
>         $self->_secret_call($dont_do_it,
>                             \$self->{somearray}[$which_one]{name});
>     } else {
>         print "NOT adding an element.\n";
>     }
> }
> 
> package main;
> 
> $a = new BugTester;
> 
> $a->maybe_fill(1);
> 
> @foo = $a->{somearray};
> $foo = @foo;
> 
> print "Number of elements: $foo\n";

This code doesn't seem to make sense.  Does this compile?  The unless
modifier, from what I understand will execute the simple statement
before 'unless' unless the expression after will return true.  Else is
part of an if construct and shouldn't be here unless the unless was ment
to be an if, in which case you may want to flip around the two blocks
around the else.  

Doing all of which I suggested may get the code to work.

L8r

Adrian


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

Date: Fri, 01 Aug 1997 13:15:41 +0200
From: Frederic Gaume <fgaume@atos-group.com>
Subject: uppercase($mystring) ?
Message-Id: <33E1C55D.1BDC@atos-group.com>

How to uppercase a string in perl ?

Fred
_____________________________________________________________

Frederic GAUME			Atos   -   Division Solutions
tel: 33-(0)1 40 09 35 13	Departement Salles de Marches
mailto:fgaume@atos-group.com	137, bvd Voltaire 75011 PARIS
_____________________________________________________________


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

Date: 1 Aug 1997 12:48:03 GMT
From: etltsln@etlxd30.ericsson.se ( Thomas Lachlan XMS x4206 )
Subject: Re: uppercase($mystring) ?
Message-Id: <5rslu3$53s@newstoo.ericsson.se>

Frederic Gaume (fgaume@atos-group.com) wrote:
: How to uppercase a string in perl ?

: Fred
: _____________________________________________________________

: Frederic GAUME			Atos   -   Division Solutions
: tel: 33-(0)1 40 09 35 13	Departement Salles de Marches
: mailto:fgaume@atos-group.com	137, bvd Voltaire 75011 PARIS
: _____________________________________________________________


Try:

	tr/a-z/A-Z/;

	i.e. $string_for_uppercase =~ tr/a-z/A-Z/;

Or:

	Read a book.

				Regds Tom.


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

Date: 31 Jul 1997 21:25:25 -0600
From: rjray@tremere.ecte.uswc.uswest.com (Randy J. Ray)
Subject: Re: use versus require
Message-Id: <uowbu3ia8ka.fsf@tremere.ecte.uswc.uswest.com>

>>>>> "Randal" == Randal Pittelli <pittelli@ehsct7.envmed.rochester.edu>
>>>>> wrote the following on Sun, 27 Jul 1997 16:21:15 -0600

These are both frequently asked questions (FAQs). Please read the FAQ list
for greater detail (it is available from several sources).

  Randal> What are the pros of saying 'use some_script.pl' (build 5+)
  Randal> over 'require some_script.pl' (4.036) ? Someone here
  Randal> understand the differences in memory allocation, and why
  Randal> 'use' is nearly ubiquitous for 5.001+ ?

'use' is done at compile time, 'require' is done at run time. 'use' lets you
do more things than 'require'. Foremost, the usual errors of not finding a
given library/module in @INC are found at compile time (faster).

  Randal> Similarly, what is the difference between saying: 'my
  Randal> $variable' (5+) and 'local($variable)' (4.036) ?

Lexical scoping. The differences are subtle but *very* significant. Again, I
direct you to the various resources, including the FAQ list (see the web
page http://mox.perl.com/perl for sources of this), the Programming Perl book
from O'Reilly and Associates (otherwise referred to as "the Camel") and
Learning Perl, also from ORA.

Randy
-- 
===============================================================================
Randy J. Ray -- U S WEST Technologies IAD/CSS/DPDS         Phone: (303)595-2869
                Denver, CO                                     rjray@uswest.com
"It's not denial. I'm just very selective about the reality I accept." --Calvin


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

Date: 31 Jul 1997 20:56:42 GMT
From: "Sergio Stateri Jr" <serginho@alpha.hydra.com.br>
Subject: Xbase module
Message-Id: <01bc9df4$9ef88740$ca75e7c8@AFXTD_202.Autofax>

Hi ! I downloaded the Xbase module...But when I run a test script, nothing
happening...WHat's wrong :

require("cgi-lib.pl");
&ReadParse;

use Xbase;
$database = new Xbase;
$database->open_dbf("teste.dbf");
$database->go_top;
$database->go_next;
print $database->get_field("NAME");
@fields = $database->get_record;
$database->close_dbf;
print @fields;
exit(0);

-- 
--------------------------------------------
Sergio Stateri Jr
Sco Paulo (SP) - Brazil
e-mail: serginho@mail.serve.com
--------------------------------------------


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

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

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