[8696] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2313 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 14 00:07:26 1998

Date: Mon, 13 Apr 98 21:00:26 -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           Mon, 13 Apr 1998     Volume: 8 Number: 2313

Today's topics:
    Re: [Q] find largest value in key of associative array? <ebohlman@netcom.com>
    Re: Bill Gates should be invited to O'Reilly's "Free So <dveditz@netscape.com>
    Re: Can I install perl5.004_04 myself? <rootbeer@teleport.com>
    Re: Confused - pod and man files <sowmaster@juicepigs.com>
    Re: Confused - pod and man files <kairys@mi.sl.com>
    Re: Confused - pod and man files <rootbeer@teleport.com>
    Re: Converting a scalar data to ACII format. (Martien Verbruggen)
        Easy way to count lines in a file <hareed@bellsouth.net>
    Re: environnemt variables <rootbeer@teleport.com>
        Finding string and removing remainder file <stathy@jaske.com>
    Re: help with delimiters - thank you! <scott@rappahannock-web.com>
    Re: i want to learn Perl. HELP! <rootbeer@teleport.com>
    Re: Ideas for installations (Abigail)
    Re: Ideas for installations <rootbeer@teleport.com>
    Re: If "=~" means match what is doesn't match? <rjk@coos.dartmouth.edu>
    Re: looking for a good win32 perl editor. <sowmaster@juicepigs.com>
    Re: Need a Free Perl Data Base to the Web <rootbeer@teleport.com>
    Re: Need to find web-based e-mail client in Perl! <c..bojswbo@67.usenet.us.com>
    Re: Purging files to a NO. of lines? <rootbeer@teleport.com>
    Re: Question concerning reg exp's in a while statement <rjk@coos.dartmouth.edu>
        running perl at command line with arguments: script.cgi <a_klein@ix.netcom.com>
    Re: Search with "near" feature <rootbeer@teleport.com>
    Re: Service Name with white space <rootbeer@teleport.com>
    Re: SOLVED:  qx scalar returned in a list context <rootbeer@teleport.com>
        trying to use grep to give an exact match (Michael Shavel)
    Re: trying to use grep to give an exact match <rjk@coos.dartmouth.edu>
    Re: where are the examples in the newer (blue) camel bo <rootbeer@teleport.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Tue, 14 Apr 1998 02:06:51 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: [Q] find largest value in key of associative array?
Message-Id: <ebohlmanErDsJF.3t2@netcom.com>

Dan Boorstein <danboo@negia.net> wrote:
: if your concerns are speed and trivial code, then what's wrong with:

: for (keys %hash) {
:   $max = $_ if $_ > $max;
: }

: it's fewer characters (i.e., faster to type), avoids a moderately
: obfuscated foreach with a void block (i.e., more trivial code), and
: by my benchmarks as fast as, if not faster.

Memory usage.  keys() has to create a list containing all the keys in the 
hash, and the original poster was talking about 10,000 of them.  each() 
pulls one key at a time.



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

Date: Mon, 13 Apr 1998 20:11:07 -0700
From: Daniel Veditz <dveditz@netscape.com>
Subject: Re: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <3532D3CA.9671E0F6@netscape.com>

Aidan Cully wrote:

> I haven't seen much software that _requires_ version 2, so the licenses of
> most GPL'ed software can be replaced by an arbitrary future license from
> the FSF..  The only promise we have that the future GPL will be something
> under which we'd like to license our software is the phrase "similar in
> spirit to the present version", which I doubt (IANAL) is enforcable in
> court.  (I'd love to see counterexamples to this.)

I complained about the lack of a "similar in spirit" clause in section 6.1 of our
license (NPL/MozPL) and our lawyer responded that in her opinion it was too vague
to be enforceable.  The lawyer(s?) who vetted GPL v2 obviously felt otherwise, so
take your pick.

-Dan Veditz



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

Date: Tue, 14 Apr 1998 03:53:04 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: John Taylor-Johnston <eslcafe@callisto.si.usherb.ca>
Subject: Re: Can I install perl5.004_04 myself?
Message-Id: <Pine.GSO.3.96.980413204855.13639Q-100000@user2.teleport.com>

On Mon, 13 Apr 1998, John Taylor-Johnston wrote:

> Can I install perl myself, with the modules, under my public_html
> directory (UNIX SERVER), and then call my version of perl with my
> scripts using this syntax:
> 
> #!/home/mycode/perl

Probably; it's not hard to do if you have the needed resources. Hope this
helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 13 Apr 1998 22:22:54 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
To: Daniel <daniel.mendyke@digital.com>
Subject: Re: Confused - pod and man files
Message-Id: <3532C87E.2B69@juicepigs.com>

Daniel wrote:
> 
> I'm running Perl under NT and am confused about
> how the documentation is layed out.  Just how
> do I read pod files or man files.
> 
> When I run the 'perldoc.bat' file I see
> a long list of files being ignored and
> only sometimes do I see information on
> the topic I requested.
> 
> Also, when I build a module, does the build
> copy module documentation files to my main
> Perl directory?
> 
> (Can anyone guess I do not come from a UNIX background?)
> 
> -Daniel
> daniel.mendyke@digital.com


The pod files are just text and can be read with any text editor.

Use perldoc to search the pods for what you need with the "-f" flag:

perldoc -f print

It is very annoying that the text just rolls off the dos window and you
can't scroll back for it. So, I usually output it to a temp file and
then read the file with notepad or whatever.

perldoc -f print > temp.txt

Or you can just use you browser to read the whole pod and search for
what you need within it. it is ascii text.

Good luck
-- 
Bob Trieger               |  Titanic: big boat, bigger
sowmaster@juicepigs.com   |           iceberg, big deal


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

Date: Mon, 13 Apr 1998 12:38:25 -0400
From: "Michael Kairys" <kairys@mi.sl.com>
Subject: Re: Confused - pod and man files
Message-Id: <35324bce.0@news.ic.net>

>
>I'm running Perl under NT and am confused about
>how the documentation is layed out.  Just how
>do I read pod files or man files.


Assuming you are using the standard distribution... I suggest you use the
HTML docs, which should be created during installation. Look in <perl
root>\lib\pod\html




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

Date: Tue, 14 Apr 1998 02:36:30 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Daniel <daniel.mendyke@digital.com>
Subject: Re: Confused - pod and man files
Message-Id: <Pine.GSO.3.96.980413193236.13639J-100000@user2.teleport.com>

On 13 Apr 1998, Daniel wrote:

> I'm running Perl under NT and am confused about how the documentation is
> layed out.  Just how do I read pod files or man files. 

If all else fails, POD can be read without a viewer. But if the viewer
won't work on your machine, either your machine or the viewer is broken -
fix it! :-)

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 14 Apr 1998 01:50:32 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Converting a scalar data to ACII format.
Message-Id: <6gufd8$cs0$1@comdyn.comdyn.com.au>

In article <6gu71c$n1r@news.microsoft.com>,
	"Namsuk Kim" <a-namsuk@microsoft.com> writes:
> Is there a way to convert a scalar data to Acii data format?

hmm.. I suppose that you mean with 'scalar data': A numeric date that
gives me the seconds since epoch, a la time(), and with 'Acii':
textual representation?

So the question would be something like: How can I convert the number
of seconds since epoch, as returned by the time function, to a
textual representation?

perldoc -f localtime

Use localtime() in a scalar context:

my $time = time();
my $time_text = localtime($time);
print "$time_text\n";

Martien

PS. ignore this post if I interpreted your question wrongly. Please
repost with a bit more explanation.
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If it isn't broken, it doesn't have
Commercial Dynamics Pty. Ltd.       | enough features yet.
NSW, Australia                      | 


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

Date: Tue, 14 Apr 1998 03:54:58 GMT
From: "Harold Reed" <hareed@bellsouth.net>
Subject: Easy way to count lines in a file
Message-Id: <m6BY.153$GO6.545950@news3.atl.bellsouth.net>

Is there an easy way to count the number of lines a file has? I am working
with several access log files that are routinely larger than 300MB and I
have developed a crude update that lets the user know every 1000 lines that
are processed by the script - so you can get an idea of where the script is
in it duties (a stdout update, if you will). Is there a way that you can get
a readout of the number of lines in a file quickly? Currently I am using the
incredibly CPU-expensive

while (<ACCESS>) {
    counter++;
}
print "You have $counter lines in this file\n";

This is chewing mountains of time on a huge file as previously decribed. I
have scoured for a way to count the number of lines - quickly (a la grep
perhaps?) - but can't seem to find any sort of clue. Any prompts from the
wizened?

Harold Reed (please interpret below for the address)
hareed at bellsouth dot net


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

Date: Tue, 14 Apr 1998 03:44:32 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: N i c l a s O l o f s s o n <gurun@acc.umu.se>
Subject: Re: environnemt variables
Message-Id: <Pine.GSO.3.96.980413203428.13639P-100000@user2.teleport.com>

On Tue, 14 Apr 1998, N i c l a s O l o f s s o n wrote:

> Get lost Abigail. 

And, quoting Abigail:

> > Ask in an HTML group.

If you feel that Abigail was incorrect, can you tell us why you think this
newsgroup would be more appropriate than an HTML group for your question?
But if the answer would be essentially the same whether the script in
question were written in Java, C++, Fortran, Ada, or COBOL, then you will
have a hard time convincing us that it's Perl-specific. Do you think that
Abigail might have been right in suggesting that an HTML group might have
had a better or more-complete answer to your question?

And, if you think that Abigail is being rude - I suggest that politeness
fights rudeness better than escalating rudeness does. :-)

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 13 Apr 1998 22:26:54 -0500
From: Stathy Touloumis <stathy@jaske.com>
Subject: Finding string and removing remainder file
Message-Id: <3532D77E.4FDFED1C@jaske.com>

Hi,
    I am new to perl and getting my butt kicked!  What I am doing is
writing a script that can take a domain name from a form on the web and
process it.  I am trying to pull the initial paragraph returned by whois
and send that back to the web.  I tried using
$dom =~ s/\n.+\n//s;

where $dom is the input from whois
it works when not being processed from the web but when I try and
process it from a web based form I get a server configuration error.
Any suggestions?

Please reply to stathy@jaske.com if possible!
Thanks,
--
Stathy Touloumis - Partner/Owner JASKE.COM 'innovative I/net'
    JASKE.COM - 3555 W. Peterson Ave. Chicago  IL  60659
___________________________________________________
http://www.jaske.com - info@jaske.com - support@jaske.com




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

Date: Mon, 13 Apr 1998 22:35:59 +0000
From: scott <scott@rappahannock-web.com>
Subject: Re: help with delimiters - thank you!
Message-Id: <35329349.639A3EB3@rappahannock-web.com>

thanks to everyone for the help. i got my script to work, now i understand why.

-- 
Regards,
Scott Prince
Rappahannock Web Development
http://www.rappahannock-web.com


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

Date: Tue, 14 Apr 1998 03:54:22 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: bernie <deforest@mkl.com>
Subject: Re: i want to learn Perl. HELP!
Message-Id: <Pine.GSO.3.96.980413205355.13639R-100000@user2.teleport.com>

On Mon, 13 Apr 1998, bernie wrote:

> if anyone knows of any sites that could help me or books please tell me,

Have you seen the perlbook manpage? Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 14 Apr 1998 02:02:01 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Ideas for installations
Message-Id: <6gug2p$5mh$1@client3.news.psi.net>

Mark Bunkowske (mbunks@coincnx.com) wrote on MDCLXXXVI September MCMXCIII
in <URL: news:35327256.74B7514A@coincnx.com>:
++ Im fairly new to CGI but am really only looking for a basic algorithm or
++ idea about the following problem:
++ 
++ Our company needs an automatic copy protection system via our web site.
++ We would like to use a CGI script to give our clients a "password" to
++ finish their install automatically.  This needs to be done in such a way
++ so that the client cannot copy our installation
++ files and give them to someone else and have them go through the same
++ installation procedure.
++ 
++ I have a couple ideas however I keep running into the same problem:
++ 
++ How do I stop someone from giving out copies of our software and keep
++ the owner of the pirated copy from going through the exact same process?
++ 
++ I have thought of having a file of clients that have been sold and their
++ corresponding passwords (to finish their installation) and after the CGI
++ program sends their password,
++ if the email doesnt come back (they submitted the wrong email address)
++ (is this possible for a CGI program to find out?) then their user id and
++ password is deleted from the text file so nobody else could go through
++ the same process later.
++ 
++ Im not really looking for code, I just need a plan of action where I can
++ start and feedback to make sure Im going in the right direction..


You mention CGI 4 times, but you don't mention perl once.  There is
*NOTHING* in the post that even vaguely smells like a perl subject.

Why are you posting this here?



Abigail
-- 
perl -e '$a = q 94a75737420616e6f74686572205065726c204861636b65720a9;
         ${qq$\x5F$} = q 97265646f9; s g..gqq e\x63\x68\x72\x20\x30\x78$&eggee;
         {eval if $a =~ s e..eqq qprint chr 0x$& and \x71\x20\x71\x71qeexcess}'


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

Date: Tue, 14 Apr 1998 03:32:31 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: mbunks@usa.net
Subject: Re: Ideas for installations
Message-Id: <Pine.GSO.3.96.980413202708.13639O-100000@user2.teleport.com>

On Mon, 13 Apr 1998, Mark Bunkowske wrote:

> Im fairly new to CGI 

If this is a CGI question, maybe you meant to post it to a CGI newsgroup. 

> but am really only looking for a basic algorithm or idea about the
> following problem: 
> 
> Our company needs an automatic copy protection system via our web site. 
> We would like to use a CGI script to give our clients a "password" to
> finish their install automatically.  This needs to be done in such a way
> so that the client cannot copy our installation files and give them to
> someone else and have them go through the same installation procedure.

Anything I can download from you, I can upload somewhere else. You could
"brand" the software with my name or other information, though. It won't
stop me, but it would make it easier for you to prosecute me.

> How do I stop someone from giving out copies of our software and keep
> the owner of the pirated copy from going through the exact same process? 

Use big, powerful, rabid lawyers. Or, give away your source; that's
working very well for perl, Apache, Linux, Netscape, ... 

But I don't think that discussion of copy-protection is really on-topic
for a Perl newsgroup. :-)  Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 13 Apr 1998 22:23:20 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
Subject: Re: If "=~" means match what is doesn't match?
Message-Id: <3532C89A.36202FF9@coos.dartmouth.edu>

Sami Sandqvist wrote:
> 
> Ronald J Kimball <rjk@coos.dartmouth.edu> writes:
> >
> >      (If the right argument is an expression rather than a
> >      search pattern, substitution, or translation, it is interpreted as a
> >      search pattern at run time.  **This is less efficient than an explicit
> >      search, since the pattern must be compiled every time the expression is
> >      evaluated--unless you've used /o.**)  [my emph]
>
> Yes, I read that part of the documentation. I also had it copied in my
> reply but decided to save "bandwidth" and just give a reference to the
> docs. The person asking the question needs to read them anyway and
> will then know about the performance issue. If someone is not willing
> to read the docs, his code is not going to be very efficient anyway.

Heh.  Good point.  Anyway, I mentioned it more for the benefit of the group as
a whole.

> Now that I read it again, the emphasised part seems strange. How am I
> supposed to use /o with an expression like "Phone:"? Just curious.

Another good point.  $var =~ "foo"o ?  Somehow, I don't think that will work. 
I'm as stumped as you are.

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 13 Apr 1998 22:34:35 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
To: James <jamesht@idt.net>
Subject: Re: looking for a good win32 perl editor.
Message-Id: <3532CB3B.C1D@juicepigs.com>

James wrote:
> 
> Hello all,
> 
> I'm ready to pull my hair out.
> 
> Any suggestions?
> 
> jamesht@idt.net

Shave your head. That way you won't be able to hurt yourself by pulling
out hair.

Super Notetab is an upbeat notepad where you can open an infinite number
of files at once. You can find it at www.tucows.com and there is a
freeware version.
-- 
Bob Trieger               |  Titanic: big boat, bigger
sowmaster@juicepigs.com   |           iceberg, big deal


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

Date: Tue, 14 Apr 1998 02:15:56 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: smile_@irc.fe.up.pt
Subject: Re: Need a Free Perl Data Base to the Web
Message-Id: <Pine.GSO.3.96.980413191439.13639H-100000@user2.teleport.com>

On Mon, 13 Apr 1998, smile_ wrote:

> Need a Free Perl Data Base to the Web, if you can help me send me one.

I could take this as an invitation to send you the entire Perl
distribution, including the database and CGI modules. But I won't. 
Instead, I'll just suggest that if you're looking for free software, there
are better ways to get it than posting to Usenet. See
news.announce.newusers for some suggestions. Hope this helps! 

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 14 Apr 1998 01:59:02 GMT
From: Anirvan Chatterjee <c..bojswbo@67.usenet.us.com>
Subject: Re: Need to find web-based e-mail client in Perl!
Message-Id: <6guft6$4fp$1@samba.rahul.net>

Elmira Alimova (ea187@columbia.edu) wrote:
> Hello! My school is installing web kiosks for the students. Idea is to
> enable them to get mail also. If anyone knows of perl script that will
> work as a web-based e-mail client,let me know. Help is greatly
> appreciated. 

Sure. Take a look at MailMan, at
http://www.endymion.com/portfolio/software/scripts/mailman.htm

_____________________________________________________________________
Anirvan Chatterjee  . anirvan @ chatterjee.net .  PGP 2048/0xE2D13BA9
Fast & free new/used multi-bookstore searching @ http://www.mxbf.com/


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

Date: Tue, 14 Apr 1998 02:13:28 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: nathan_stanford@cabp.com
Subject: Re: Purging files to a NO. of lines?
Message-Id: <Pine.GSO.3.96.980413190008.13639F-100000@user2.teleport.com>

On Mon, 13 Apr 1998 nathan@cyberservices.com wrote:

>     The problem is with the 'retain last xxx lines'. I don't think I can
> rely on holding all lines, or even xxx lines, in memory. What if the
> request
>     was to 'retain last 20 million lines'?

Say you want to retain the last N lines. Scan the file, noting (with tell)
the positions of all lines M such that M = I * int(N/1000), for some I.
Now you can quickly seek to a particular line and copy the lines to keep
from that point on.

>     p.s. This must be a perl 4 implementation.

If you're developing new scripts in Perl 4, you're going down the wrong
trail. One day, you'll need to install Perl and your scripts on a new
machine - and Perl 4 may not install there. Woe is you. Install Perl 5
now, and you can keep running 4 while you update your scripts, one at a
time. Besides the fact that your scripts will run faster and with fewer
bugs, you'll be posing a much smaller security risk to your system.

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 13 Apr 1998 22:40:58 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: "$louie"@visca.com
Subject: Re: Question concerning reg exp's in a while statement
Message-Id: <3532CCBD.56B5DB2C@coos.dartmouth.edu>

[posted and mailed]

Louie wrote:
> 
> Am I correct in assuming that Perl doesn't consider the two spaces
> that were created in substitution for the linebreaks to form part of
> the "<p>" line during runtime? If not, could someone explain to me
> what is going on here?

The spaces created by tr/\n/ /; are at the end of the previous line.  Thus,
they are not removed by s/ +<p/<p/;

Observe:

input:
foo
 <p>bar</p>

In the first iteration, $_ is 'foo\n', which becomes 'foo  '.  The RHS side of
the substitution, ' +<p', does not match.

In the second iteration, $_ is ' <p>bar</p>\n', which becomes ' <p>bar</p>  '.
 This time, the RHS of the substitution matches, and it becomes '<p>bar</p>  '.

As you can see, the two spaces in 'foo  ' are not removed.  Your idea of
reading in more than a line at a time is probably the best solution.

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 13 Apr 1998 19:50:50 -0700
From: "Adam Klein" <a_klein@ix.netcom.com>
Subject: running perl at command line with arguments: script.cgi?text=text
Message-Id: <6guiuq$kq9@dfw-ixnews5.ix.netcom.com>

I am trying to debug a script at the command line, and I was wondering if
there was a way to have the argument entered at the command line as it does
work when running the actual cgi application from the web page.

For example the script looks like this:

www.../cgi-bin/script.cgi?testtext

how does it work at the command line:

perl script.cgi ????? <--- what do I put here?

Could anyone help me?

Thanx,
Adam




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

Date: Tue, 14 Apr 1998 02:22:02 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: antonio.m.enrique@state.ma.us
Subject: Re: Search with "near" feature
Message-Id: <Pine.GSO.3.96.980413191635.13639I-100000@user2.teleport.com>

On Mon, 13 Apr 1998 antonio.m.enrique@state.ma.us wrote:

> I would like to add to my search engine the "near" feature, so that two
> words will only be recognized if they are less than a certain number of
> words apart. 
> 
> Any help available?

Yes, many of us program for hire. If you're looking to hire a programmer,
though, there are better newsgroups than this one. Some specialize in
"jobs wanted" postings, some in "jobs available". The Perl Institute's web
page is promising to have registries of jobs and programmers, so you may
want to keep an eye on that page. 

    http://www.perl.org/

> Would this feature decrease the performance?

As a general rule, yes, new features do decrease the performance of any
software. But a good programmer should be able to minimize the impact. 
Hope this helps! 

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 14 Apr 1998 02:40:10 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Amit Shah <ashah@videoserver.com>
Subject: Re: Service Name with white space
Message-Id: <Pine.GSO.3.96.980413193735.13639K-100000@user2.teleport.com>

On 13 Apr 1998, Amit Shah wrote:

> When I try to refer to a service having white space(s) in the name of
> the service perl ( version 5.003_07 ) script fails to execute

>         Win32::Service::GetStatus("", "Conference Controller",\%status) ||
> die $!;

If that subroutine is buggy in its implementation of some protocol, you
should ask its author to fix it. Hope this helps! 

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 14 Apr 1998 03:08:01 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: "James B. Crigler" <crigler@seo.com>
Subject: Re: SOLVED:  qx scalar returned in a list context
Message-Id: <Pine.GSO.3.96.980413195604.13639M-100000@user2.teleport.com>

On 13 Apr 1998, James B. Crigler wrote:

> the problem is the "|| die" business forcing a scalar context, and one
> solution is extra parens around "@z = qx(...)". 

Another is to use a "word or" operator.

    @z = qx{ whatever } or die "Some problem: $?";

Everything on the left (in this case, the assignment) is done, then
everything on the right, since 'or' is very low in precedence.

> But I was unable to find this metioned in the man or the faq. In fact,
> the man says this:
> 
>        Binary "||" performs a short-circuit logical OR operation.
>        That is, if the left operand is true, the right operand is
>        not even evaluated.  Scalar or list context propagates
>        down to the right operand if it is evaluated.
> 
> Assuming I missed it in the documentation (which is likely), where
> should I have looked?

I'm not sure what you missed. Was it that || supplies a scalar context to
its left operand? Or the precedence chart, which is in perlop?

Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Mon, 13 Apr 1998 22:10:35 -0400
From: mshavel@erols.com (Michael Shavel)
Subject: trying to use grep to give an exact match
Message-Id: <mshavel-1304982210350001@130.9.16.207>

Hi

 I'm trying to use grep to give me an exact match on a string.. not to match
if the string is contained in another string. Example.. I would like this 
to give me back "cat" but it gives me back both "cat" and "tomcat"

Is there an option to grep I can use for an exact match?

Is there a perl pod someone could point me to for this answer please?


$c = "cat";

@string=("cat", "dog", "alligator", "tomcat");

@cats = grep(/$c/o, @string);

print "@cats\n";
       


Thanks very much

Mike Shavel
mshavel@erols.com


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

Date: Mon, 13 Apr 1998 23:36:17 -0400
From: Ronald J Kimball <rjk@coos.dartmouth.edu>
To: Michael Shavel <mshavel@erols.com>
Subject: Re: trying to use grep to give an exact match
Message-Id: <3532D9B6.2BEB388A@coos.dartmouth.edu>

posted and mailed]

Michael Shavel wrote:
> 
> Is there an option to grep I can use for an exact match?
> 
> @cats = grep(/$c/o, @string);

Either

grep(/^$c$/o, @string)

or

grep($_ eq $c, @string)

-- 
 _ / '  _      /         - aka -             rjk@coos.dartmouth.edu
( /)//)//)(//)/(    Ronald J. Kimball           chipmunk@m-net.arbornet.org
    /                                   http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Tue, 14 Apr 1998 03:26:19 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Digital Puer <digital_puer@hotmail.com>
Subject: Re: where are the examples in the newer (blue) camel book?
Message-Id: <Pine.GSO.3.96.980413202331.13639N-100000@user2.teleport.com>

On Mon, 13 Apr 1998, Digital Puer wrote:

> I just bought the blue camel book "Programming Perl" after owning the
> older edition for the longest time (I had gotten my perl 5 info off the
> net). I was greatly disappointed that the new edition does not have a
> section of examples like the older edition. The examples of "common
> problems" was what got me into perl in the first place.

Hang on to you old Camel! :-)  But those examples aren't lost and gone
forever. O'Reilly still has the rights to them, of course, and they'll
likely surface - re-written and improved - in a new book one day soon.
Until that time, visit this URL and see whether you find anything good.
Hope this helps!

    http://cpan.perl.org/scripts/

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

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

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