[13084] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 494 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 13 00:07:24 1999

Date: Thu, 12 Aug 1999 21:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 12 Aug 1999     Volume: 9 Number: 494

Today's topics:
    Re: A good tutorial PERL (Abigail)
    Re: ActivePerl PerlScript -- funny problems (elephant)
        Announcing a casino card shoe module <lynn@swcp.com>
        Assumptions support@gethits.com
    Re: Browser detection - write different html (David H. Adler)
    Re: capturing login and send passwd (Donovan Rebbechi)
        DBI problem on RH6 <ankura@inf.com>
    Re: dot is too precious to be only for string concatena <johnlin@chttl.com.tw>
    Re: dot is too precious to be only for string concatena <johnlin@chttl.com.tw>
    Re: dot is too precious to be only for string concatena (Abigail)
    Re: Fastest form of an 'if' (elephant)
    Re: File locking ? (William Herrera)
    Re: I guess this is a Misc question: Cgi-bin (J. Moreno)
    Re: I guess this is a Misc question: Cgi-bin (David H. Adler)
    Re: List Files in a directory and search (Larry Rosler)
    Re: Looking for a good Perl Book (Abigail)
    Re: New Book on Perl Tool Development <ron_savage@non-hp-australia-om5.om.hp.com>
    Re: OFF: Opinions on Magazines (Abigail)
    Re: PERL for Win32 (elephant)
    Re: Perl novice needs quick help <stirling@banet.net>
    Re: perl on linux (Abigail)
    Re: Perl vs. ASP: which is better? (Kent Delcastillo)
    Re: Quick Question--OS Name (Abigail)
        regexp question - dealing w/ 2 strings <jbond@ilux.com>
    Re: regexp question - dealing w/ 2 strings (elephant)
        Save data to disk + "\n" char arpith@hotmail.com
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: 12 Aug 1999 22:08:45 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: A good tutorial PERL
Message-Id: <slrn7r731a.e7v.abigail@alexandra.delanet.com>

MELERO (melero@ctv.es) wrote on MMCLXXII September MCMXCIII in
<URL:news:7ottkv$haq$1@diana.bcn.ttd.net>:
\\ 
\\ I ned a good tutorial for PERL , I have found some tutorial but it's very
\\ bad.

Chapman: "Perl, the Programmers Compagnion".

Every bookshop that's proud of its computer book section will have it.


Abigail
-- 
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
                                      print } sub __PACKAGE__ { &
                                      print (     __PACKAGE__)} &
                                                  __PACKAGE__
                                            (                )


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 13 Aug 1999 13:30:17 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: ActivePerl PerlScript -- funny problems
Message-Id: <MPG.121e3c56e5f8dc9e989c1d@news-server>

John M. Dlugosz writes ..
>elephant <elephant@squirrelgroup.com> wrote in message
>news:MPG.121ccfe49fd35bc3989c13@news-server...
>> $main::document (just like $main::window and a whole heap of others) is
>> a special identifier within client-side scripting ...
>> you can't assign to it - the same way that you can't assign to $window
>
>Then why doesn't it show up in the symbol table (like $window does), and why
>can't I use $main::document, as-is, in the same manner that I use
>$main::window::document (or $main::MyDoc after I assign the ref to it)?

I'm no expert .. it's possibly a bug .. but $document is almost 
certainly a special identifier in the perscript environment and that's 
almost certainly the reason you get a compile error when trying to 
assign to it

to find out more .. you'd have to talk to ActiveState (presuming it's 
their engine) to find out why it behaves that way

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Thu, 12 Aug 1999 21:30:56 -0600
From: "Lynn" <lynn@swcp.com>
Subject: Announcing a casino card shoe module
Message-Id: <7p03n3$lem$1@sloth.swcp.com>

I have searched throughout CPAN and was unable to find a module that modeled
a deck of cards so I ended up writing my own.  You can read the pod
documentation and download an evaluation copy of the module by visiting
http://www.swcp.com/~lynn/

I am uncertain whether to name the module 'Shoe' or 'CardShoe'.  Suggestions
are welcomed.  When I get some feedback I will submit the updated module to
CPAN.

Enjoy,
Lynn     lynn@swcp.com


SYNOPSIS

    use CardShoe;

    $shoe = CardShoe->new();    # Create a new CardShoe object
    $shoe->NumDecks(6);     # Use six card decks in the shoe
    $shoe->Shuffle(1);      # Shuffle right now!
    $shoe->Shuffle();       # Shuffle if indicated by the limit marker
    $shoe->MinLimit(5);
    $shoe->MaxLimit(15);        # Set limit marker randomly between 5-15%
when shuffling
    $shoe->FaceValue('A', 1);   # Set the card value associated with Aces

    $CardValue = $shoe->GetCard(0);         # get a card value face down
    ($suit, $face, $val) = $shoe->GetCard(1);   # get card's Value, Face &
Suit face up

    $ShuffleCount = $shoe->Shuffles;    # How many shuffles since creation?
    $Eights = $shoe->ExposedFaces(8);   # How many 8's have been exposed
since last shuffle?
    $total = $shoe->ExposedFaces('K','Q','J',10);   # how many exposed
10-valued cards?
    $total = $shoe->TotalExposed;       # Total count of all exposed cards
since shuffle

    $val = $shoe->FaceValue('K');       # What value is associated with the
King?





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

Date: Fri, 13 Aug 1999 03:54:49 GMT
From: support@gethits.com
Subject: Assumptions
Message-Id: <37B39896.496EE73@gethits.com>

You seem to assume were spamming just because we relay
email through another server. We have very large client
mailing lists and we dont like to overload our shared server
(or pay through the teeth for lyris).

> You need to be authenticated to send (relay) mail thru the server in
> question..

Of course I'm authenticated--its our machine.

> 3)  Get your upstream provider to allow you to spam the free world...

Again, I suggest in the future you watch your assumptions.

Regards,
Darryl


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

Date: 13 Aug 1999 03:25:31 GMT
From: dha@panix7.panix.com (David H. Adler)
Subject: Re: Browser detection - write different html
Message-Id: <slrn7r741b.po9.dha@panix7.panix.com>

In article <slrn7r4d5m.7p8.elflord@panix3.panix.com>, Donovan Rebbechi wrote:
>DO NOT USE PERL/CGI TO DO THIS.

I keep hearing about this "PERL/CGI" thing.  I wonder if I should look
into it.  I also wonder if it has anything at all to do with
Perl... :-/

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Linguists don't know much, but they do know that nobody can succeed in
telling people at large how to speak.	- Larry Wall


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

Date: 12 Aug 1999 23:12:51 -0400
From: elflord@news.newsguy.com (Donovan Rebbechi)
Subject: Re: capturing login and send passwd
Message-Id: <slrn7r739j.f60.elflord@panix3.panix.com>

On Sun, 08 Aug 1999 07:46:17 -0400, Carlos Reed wrote:

>Before reiventing the wheel.
>
>a) I'm wonering, if someone has done such a script, somewhere in the
>net.

This shell command runs a program ( installer ) as root after
prompting for a root password.

expect -c 'spawn su -c "some-program" ;
expect "Password:"; send "$password\\n";expect eof'

here's a hint: try autoexpect ( it generates expect scripts for
you by reading what you feed in and out of the tty ) 

>b) Is there a perl module that acts like expect?

Yes: Expect

Cheers,

-- 
Donovan


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

Date: Fri, 13 Aug 1999 09:15:07 +0530 (IST)
From: Ankur Agrawal <ankura@inf.com>
To: comp.lang.perl.misc@list.deja.com
Subject: DBI problem on RH6
Message-Id: <Pine.LNX.4.10.9908130909030.14494-100000@kruti.inf.com>


Hi.
I am getting the following errors when I try to use DBI.
I have RH 6.0, the default perl installation perl 5.005_03.

I saw earlier mails with the same probs.
someone had suggested using a newer DBI version.
i have tried DBI 1.08,1.12, and 1.13
but i still get the error. is this a problem with my perl installation ?

-----------------------------------------------------------------
Can't load '/usr/lib/perl5/site_perl/i386-linux/auto/DBI/DBI.so' for module DBI: /usr/lib/perl5/site_perl/i386-linux/auto/DBI/DBI.so: undefined symbol: dirty at /usr/lib/perl5/5.00503/i386-linux/DynaLoader.pm line 169.

 at /usr/lib/perl5/site_perl/DBI.pm line 164
BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/DBI.pm line 164.
--------------------------------------------------------------------

Any Pointers ?
TIA,
Ankur



 Sent via Deja.com http://www.deja.com/
 Share what you know. Learn what you don't.


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

Date: Fri, 13 Aug 1999 10:35:06 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: dot is too precious to be only for string concatenation
Message-Id: <7p0071$k72@netnews.hinet.net>

Abigail wrote:
>John Lin wrote:
>> use dot;                           # compiler directive
>> $john.name='John' cat ' Smith';    # then we can use dot
>> Oh, I really hope Perl programs look like that.
>
>I don't think it's worth breaking about 75% of the programs out there,
>for something that doesn't gain us anything. . would save a few keystrokes
>over -> {}, but you'd lose them on the 'cat' vs '.' issue.
>
>Besides, -> is used for dereferencing objects, closures, and arrays as
well.
>
>Abigail

OK.  I should consider this to be only a module.  Then it would be
much more acceptable to the Perl society, right?  Just like

use English; # which makes $$ appear as $PROCESS_ID
use Alias; # $self->{field} appears as $FIELD in member function

Only the appearance is changed.  Anyone who wants $john.name looking
just "use" the module, and vice versa (anyone who doesn't).

Now my question becomes: is it achievable by a module?  If not, I should
not work on this at the very beginning.

Could you help by telling me whether it is possible or not
(and what document to refer to, I would appreciate) for these tasks?

1. Grab the dot operator so that it won't be treated as string
concatenation.
2. Control the associativity and precedence in a module.
3. Tell the compiler to treat $john.name as $john->{name} at compile time.
4. Generate error messages for misuse at compile time.

Hmm... Potentially I think it can be done, since Perl is quite flexible.

Thank you for your advice.

John Lin




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

Date: Fri, 13 Aug 1999 11:02:23 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: dot is too precious to be only for string concatenation
Message-Id: <7p01qi$luf@netnews.hinet.net>

brian d foy wrote:
> "John Lin" posted:
>  How are you going to account for functionality like
>
>   $hash{ lc $key }
>   $hash{ "$word1 $word2" }
>   $hash{ "\n" }
>   $hash{ $hash2{ $key } }
>
>and so forth?
>
>your syntax is inflexible and ambiguous. it doesn't hide the details
>like you say it does - it just changes the characters that you type.
>
>--
>brian d foy


Yes...  OK.  Now I would consider this to be only a module
rather than a syntax.  Just like

use English;    # which makes $$ appear as $PROCESS_ID
use Alias;       # $self->{field} appears as $FIELD in member function

Only the appearance is changed.  It "adds-on" the translation from
$john.name
into $john->{name}, and nothing else would be affected.

Thus, for those functionality you described above

   $hash{ $hash2{ $key } }

just use it without change, because it is not very related to dereferencing.

Adhering to this policy, I expect the usage of this module
won't be too complicated.

Thank you for your advice.

John Lin




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

Date: 12 Aug 1999 22:20:24 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: dot is too precious to be only for string concatenation
Message-Id: <slrn7r73n5.e7v.abigail@alexandra.delanet.com>

John Lin (johnlin@chttl.com.tw) wrote on MMCLXXIII September MCMXCIII in
<URL:news:7p0071$k72@netnews.hinet.net>:
== 
== Only the appearance is changed.  Anyone who wants $john.name looking
== just "use" the module, and vice versa (anyone who doesn't).
== 
== Now my question becomes: is it achievable by a module?  If not, I should
== not work on this at the very beginning.

No.



Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 13 Aug 1999 12:31:02 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: Fastest form of an 'if'
Message-Id: <MPG.121e2e6c451ae588989c18@news-server>

Gary O'Keefe writes ..
>timethese(
>        $count, {
>                'if ( $a ) { $c = $b }' => 'if ( $a ) { $c = $b; }',
>                '$c = $b if ( $a )' => '$c = $b if ( $a );',
>                '$c = $a && $b' => '$c = $a && $b;'
>        }
>);
>
>and the results were:
>
>Benchmark: timing 10000000 iterations of $c = $a && $b, $c = $b if (
>$a ), if ( $a ) { $c = $b }...
>$c = $a && $b: 15 secs (12.95 usr  0.00 sys = 12.95 cpu)
>$c = $b if ( $a ):  8 secs ( 8.19 usr  0.00 sys =  8.19 cpu)
>if ( $a ) { $c = $b }:  6 secs ( 6.76 usr  0.00 sys =  6.76 cpu)
>
>suggesting that the first form is nearly twice as fast as using the &&
>operator,

your && test is flawed - and you only test for one value of $a .. there 
is no significant difference between the three methods for both a true 
and a false $a .. in fact over numerous tests the && often scores the 
lowest time for a negative $a .. but by an insignificant and unreliable 
margin 

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Fri, 13 Aug 1999 03:43:18 GMT
From: posting.account@lynxview.com (William Herrera)
Subject: Re: File locking ?
Message-Id: <37b3920d.173223064@news.rmi.net>

On Wed, 11 Aug 1999 16:58:28 -0400, jerrad pierce
<jerrad@networkengines.com> wrote:

>Ian Coetzee wrote:
>> 
>> Hi
>> I have a big problem I am trying to figure out how to use flock() , the
>> information I got tells me that flock() might not work on a networking
>> environment , so what is the use then ? Does anybody know how to implement
>> file locking on a "flat file" which is to be used on the internet (as in a
>> classified adds program). Can any body please help me ,
>> 
>> As I am new to Perl (but a seasoned Delphi and pascal developer) i would
>> like any answers to be as descriptive as possable.
>> 

Install FIle::FlockDir from CPAN 

http://www.CPAN.org/modules/by-module/File/File-FlockDir-0.93.tar.gz
http://www.CPAN.org/modules/by-module/File/File-PathConvert-0.85.tar.gz



---
The above from: address is spamblocked. Use wherrera (at) lynxview (dot) com for the reply address.


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

Date: Thu, 12 Aug 1999 22:30:13 -0400
From: planb@newsreaders.com (J. Moreno)
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <1dwg0ce.z5av0f1vr82f6N@roxboro0-0028.dyn.interpath.net>

Ben Quick <newsgroup@bigwig.net> wrote:

  [John Moreno wrote]
> >Asking off topic questions in the first place is frequently considered
> >rude -- the faqs and other documents are quite clear on what is
> >appropriate.
> 
> I read the faq, it didn't (to my recolection) say do not ask about file
> permissions

No, but section 2 of the faq (Obtaining and Learning about Perl) says: 

comp.lang.perl.misc               Very busy group about Perl in general

That seems fairly clear to me -- it doesn't say "group about file
permissions" or "group about unix" or "group about baseball".


(But this does bring up a point -- there is an excellent faq about perl,
but not for the NEWSGROUP, perhaps a faq for the newsgroup is in order?)

> >This and other off topic questions have been asked before and people are
> >tired of dealing with them and so are easily annoyed (which goes back to
> >the first reason because asking the question in the first place is
> >considered rude).
> 
> Ok, so off topic posts may be frequent. But as I've already said in another
> post, I am in a group that always get's the same old questions. We answer
> them *polietly* which is the key. It's not hard to be polite

It's your privilege to answer any way you like, extend the same
privilege to others.

If you want to improve the "tone" then stick around and give polite
answers. 
 
> >Lots of people feel that such answers encourage people to post off topic
> >questions here "well, I got an answer last time", "Joe User got a good
-snip-
> >Here's a general usenet hint -- when you say something in any new (to
> >you) newsgroup and have one or more people point out that your post is
> >off topic or otherwise inappropriate the CORRECT response is to
> >apologize -- you may if you wish ask for direction to a more appropriate
> >group, but you don't argue about it.
> 
> 
> I never argued that my post was *on* topic, I just pointed out that saomeon
> should know the answer. If no one did, all that had to be done was politely
> point me to the right group

"Who has the season homerun record?" Most people here will know the
correct answer --  the point is that politely giving the right answer or
pointing to the right newsgroup gives the impression that the question
was reasonable and it was OK to ask it.

It's not reasonable and it wasn't OK to ask it.

> >If someone says you should have included a joke, then fine you should
-snip-
> >know the answer and it wouldn't hurt them to help you  -- you say
> >"sorry" and then try to get along.
> 
> I have never said I am right and you are wrong. I accept that I am fairly
> new to perl and most people here know more than me. So, I'm sorry I don't
> see your point there

Here's what you had to say in your first response to criticism....

] Well I'm sorry for being off topic. But to be fair, everyone (if not
] most) here should know what the answer to my question is. It's only 3
] numbers that you needed to post
 ....
] THANKYOU! You took all day to reach the answer. But at last

You went through and point by point tried to justify yourself, and then
when you got to the answer you were sarcastic about it.

You were being chewed out for bad behavior, if you acknowledge that your
behavior was bad then you shouldn't object to being chewed out.

A "My mistake, I thought it would be OK to ask here"  followed by "Thank
you, I appreciate it very much" (snipping everything in between).

-snip-
> Now, please could you let it drop.

Sure.

-- 
John Moreno


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

Date: 13 Aug 1999 04:00:09 GMT
From: dha@panix7.panix.com (David H. Adler)
Subject: Re: I guess this is a Misc question: Cgi-bin
Message-Id: <slrn7r7629.po9.dha@panix7.panix.com>

In article <1dwg0ce.z5av0f1vr82f6N@roxboro0-0028.dyn.interpath.net>,
J. Moreno wrote:

>(But this does bring up a point -- there is an excellent faq about perl,
>but not for the NEWSGROUP, perhaps a faq for the newsgroup is in order?)

Ah, but there is!  

"*** FAQ: ANSWERS TO YOUR QUESTIONS! READ FIRST! Posted Twice Weekly
***"

If for some reason you can't find it on your server, a quick dejanews
search should pop it up with little trouble.

hth.

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"Anybody's apt to trip."
"Not over a sofa!" - The Lady Eve


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

Date: Thu, 12 Aug 1999 20:44:53 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: List Files in a directory and search
Message-Id: <MPG.121d348b8d22c2cf989e4f@nntp.hpl.hp.com>

In article <37B31BFA.9E6FA6C7@cisco.REMOVETHIS.com> on Thu, 12 Aug 1999 
12:09:46 -0700, Makarand Kulkarni <makkulka@cisco.REMOVETHIS.com> 
says...
> nerilius@my-deja.com wrote:
 ...
> > foreach $fir (readdir(DIR)) {
> > push @array, $fir;
> > }
> > close(DIR);
> OK. But your could have called readdir() in array context.

There is no such thing as array context.  If you mean list context, this 
*is* list context; the result of the call is a list, which the code 
loops over.

But the whole thing would be better written as:

    @array = readdir(DIR);

and better yet processed one element at a time, as:

    while ($dir = readdir(DIR)) { ...

> >         foreach $f (@array) {
> >                 if ($viles =~ /$f/) {
> >                         $i=1;
> >                 }
> >         }
> What  you are doing is checking whether the pattern in
> $viles is present in the name of the file in $f.

Opposite.  It is checking thether the patten in $f is present in the 
name of the file in $viles.

> This is not what you want. You should check for string equality.
> Also you can jump out of the loop once $i is set to 1.

Right on!

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 12 Aug 1999 22:24:06 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Looking for a good Perl Book
Message-Id: <slrn7r73ts.e7v.abigail@alexandra.delanet.com>

Tom Christiansen (tchrist@mox.perl.com) wrote on MMCLXXIII September
MCMXCIII in <URL:news:37b37598@cs.colorado.edu>:
%%      [courtesy cc of this posting mailed to cited author]
%% 
%% In comp.lang.perl.misc, 
%%     abigail@delanet.com writes:
%% :I gave an example about INIT, which is documented at an unlikely place.
%% 
%% FYI, there are more INITs in more recent pod releases, because 
%% this bothered me, too.


Very good. 

I'd like to point that, unless specified otherwise, I always comment
on the most recent official released version of Perl. In this case,
5.005_03. We'll see the updated docs in the next release, 5.6 or 5.005_04,
which ever comes first.



Abigail
-- 
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 13 Aug 1999 12:15:02 +1000
From: "Ron Savage" <ron_savage@non-hp-australia-om5.om.hp.com>
Subject: Re: New Book on Perl Tool Development
Message-Id: <7ovvl5$8da$1@ocean.cup.hp.com>

Time flies like an arrow
Fruit flies like a banana

--
Cheers
Bus: rons@hpaco.aus.hp.com
Home: ron@savage.net.au
http://savage.net.au/





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

Date: 12 Aug 1999 22:32:36 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: OFF: Opinions on Magazines
Message-Id: <slrn7r74e1.e7v.abigail@alexandra.delanet.com>

Gabe (grichard@uci.edu) wrote on MMCLXXII September MCMXCIII in
<URL:news:7ov1f8$9e9@news.service.uci.edu>:
## 
## I'm looking for a computer magazine for non computer morons.
## 
## Suggestions please?


Communications of the ACM.
IEEE Transactions of Computers.



Abigail
-- 
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
 |perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
 |perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
 |perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 13 Aug 1999 13:00:03 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: PERL for Win32
Message-Id: <MPG.121e3541fe50cd0e989c19@news-server>

Deane Barker writes ..
>I've downloaded the stable release of PERL for Win32, but I can't figure ou
>
>I'm learning to program PERL on a Unix box at work, and I'm really enjoying
>
>Can anyone help?

I wouldn't usually reply but you've been given some advice in this 
thread that IMHO is a long way overboard

so - listen to Tony .. and get the Perl port from ActiveState (they call 
it ActivePerl for some reason .. but it's as standard as you can find) 
 .. http://www.activestate.com/ActivePerl/

comes with all the standard documentation and some Win32 specific 
documentation .. including some differences that you should be aware of 
between Win32 Perl and the Perl that you'd be using on UNIX

btw .. learn how to drive your news reader .. it's not putting line 
breaks in (I truncated your lines manually)

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Thu, 12 Aug 1999 22:17:18 -0400
From: <stirling@banet.net>
Subject: Re: Perl novice needs quick help
Message-Id: <37b37e9e@news1.us.ibm.net>

Template File: (template.htmlt)
-------------------------
<html>
<head><title> $TITLE </title></head>
<body bgcolor="#ffffff" text="#000000">
<h1>$HEADING</h1>
<br><br>
$BODY
</body>
</html>

Perl file:
--------------------------------
#!/usr/bin/perl -w
use strict;
use CGI qw /:standard/;

$q=CGI->new();
$title=$q->param("title");
$heading=$q->param("heading");
$body=$q->param("body");

$tempfile="template.htmlt";

open(TEMPLATE, "$tempfile") || die "Cannot Open Template File: $!\n";
undef $/;
$template = <TEMPLATE>;
close(TEMPLATE) || die "Cannot Close: $!\n";

$template =~ s/\$TITLE/$title/g;
$template =~ s/\$HEADING/$heading/g;
$template =~ s/\$BODY/$body/g;
print "Content-type: text/html\n\n";
print $template;
-----------------------------------------------

    This basically shows you how to replace the contents of a template file
with the values you want.  It then prints the new file out to the browser.

Good Luck,
Stirling Hughes




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

Date: 12 Aug 1999 22:29:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: perl on linux
Message-Id: <slrn7r7482.e7v.abigail@alexandra.delanet.com>

Tom Christiansen (tchrist@mox.perl.com) wrote on MMCLXXIII September
MCMXCIII in <URL:news:37b37b44@cs.colorado.edu>:
{}      [courtesy cc of this posting mailed to cited author]
{} 
{} In comp.lang.perl.misc, 
{}     abigail@delanet.com writes:
{} :   	% perl -p  -e 's/\cM//g' oldscript.pl > fixedscript.pl
{} :And I would use a shell where the default prompt is `$', but that's
{} :beside the point.
{} 
{} I tend to use a % to indicate the shell because perl code already has
{} plenty of $ to go around.


I said "default" prompt. On accounts where I can custimize the prompt,
prompts look like:

     23:18:40 [abigail@alexandra] Perl)

The only drawback about that is that my machine at home, and my workstation
in the office have the same name. ;-)

However, I also have to use accounts where the prompt isn't custimized.
`%' is (t)csh, `$' is sh, `bash$' is bash, and `#' is root (sh on Solaris,
and *grumble* bash on Linux).



Abigail
-- 
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 13 Aug 1999 03:00:24 GMT
From: delcasti@cs.fsu.edu (Kent Delcastillo)
Subject: Re: Perl vs. ASP: which is better?
Message-Id: <7p01o8$g1a$1@news.fsu.edu>

Whoops on the Perl/ASP comparison, I meant CGI/ASP, but you figured that
out.

Donovan Rebbechi (elflord@news.newsguy.com) wrote:
: Note that if you are using a full featured webserver such as Apache,
: there are several options besides Perl, including mod_include, 
: mod_php, and mod_perl , all of which are good for dynamic html ( and
: some of which are probably faster than CGI ). Perl/CGI is often an
: overkill for problems that can be solved more elegantly with
: mod_include.

I've never even heard of these mod, er, things. What are they? Scripts? Is
it something that must be compiled? Pardon the newbie sounding questions
but I know only what I know, and what I don't I will know soon.

 -- 
Kent Del Castillo
kent@kentd.com


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

Date: 12 Aug 1999 22:39:36 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Quick Question--OS Name
Message-Id: <slrn7r74r6.e7v.abigail@alexandra.delanet.com>

Mahesh Swaminathan (mahesh@zedak.com) wrote on MMCLXXII September
MCMXCIII in <URL:news:7ouro1$cpn@dfw-ixnews6.ix.netcom.com>:
&& I am looking for a Perl function which would let me find which operating
&& system i am on. I am looking for a Perl equivalent of Java's
&& System.getProperty("osname").

    sub System::getProperty {$_ [0] eq "osname" ? $^O : die "Unknown property"}

    print System::getProperty ("osname"), "\n";



Abigail
-- 
perl -we 'print q{print q{print q{print q{print q{print q{print q{print q{print 
               qq{Just Another Perl Hacker\n}}}}}}}}}'    |\
perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w | perl -w


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 13 Aug 1999 02:27:41 GMT
From: Jennifer Bond <jbond@ilux.com>
Subject: regexp question - dealing w/ 2 strings
Message-Id: <7ovvqk$45t$1@nnrp1.deja.com>

Hi guys,

I have 2 strings, say "ABC" and "EFG".  Is there any way I can have ONE
regexp to match a line that has "ABC" but not "EFG" somewhere
after "ABC"?

That is, the regexp return true for the input:

xxxABCCxxxxxxxxx

but not for the input:

xxxABCxxxEFGxxx

Thanks in advanced.

--
Jen


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Fri, 13 Aug 1999 13:33:58 +1000
From: elephant@squirrelgroup.com (elephant)
Subject: Re: regexp question - dealing w/ 2 strings
Message-Id: <MPG.121e3d31a5bcd493989c1e@news-server>

Jennifer Bond writes ..
>I have 2 strings, say "ABC" and "EFG".  Is there any way I can have ONE
>regexp to match a line that has "ABC" but not "EFG" somewhere
>after "ABC"?

yes .. by using a negative lookahead assertion

look it up in the perlre manual

  perldoc perlre

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Fri, 13 Aug 1999 02:28:17 GMT
From: arpith@hotmail.com
Subject: Save data to disk + "\n" char
Message-Id: <7ovvrp$461$1@nnrp1.deja.com>

Hi,

I am trying a Topsites like script and I want to know the best method
of saving data to disk. At "solutionscript.com" they used the join
command and I also used it like so,

$newline = join ("<>", $acc_no, $FORM{'name'}, $FORM{'email'},
$FORM{'password'}, $FORM{'website'}, $FORM{'url'}, $FORM{'bannerurl'},
$FORM{'summary'}, $FORM{'detailedsummary'}, $FORM{'skill'},
$FORM{'planguage'});

$newline .= "\n";

and save $newline to a file. I filter the fields so that it doesn't
contain HTML tags. So this should cause no problems.

When reading it again, I have to read the line of data and split it
again.

But I then realised this procedure may take a very long time esp. if
there are 100s of records. Time is essential for a CGI script :)

So I would like to know if there is some other more, efficient method.
Any ideas please ?


Also, in one of the fields "detailedsummary", it can contain linebreaks.
But this doesn't work with the "one line data". So I have to filter
linebreaks and add a "\n". Is this okay ? or is there some other method?

$FORM{'detailedsummary'} =~ s/\n/\\n/g;

Any help will be appreciated,

Thanks

Arpith.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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 V9 Issue 494
*************************************


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