[15895] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3308 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 10 03:05:26 2000

Date: Sat, 10 Jun 2000 00:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <960620714-v9-i3308@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 10 Jun 2000     Volume: 9 Number: 3308

Today's topics:
    Re: Accessing CC using Sendmail <billy@arnis-bsl.com>
    Re: backquote error output (Tad McClellan)
    Re: backquote error output (Tad McClellan)
    Re: Best Perl Accessory? (brian d foy)
    Re: dbl quoting fields of a CSV file (Tad McClellan)
        Executing several scripts <prashar80@hotmail.com>
    Re: Extract filename from path? (jason)
    Re: File I/O error on ActivePerl/IIS 4.0 (jason)
    Re: HELP! Parameter Problems (Tad McClellan)
    Re: HELP! Parameter Problems <jrr386@home.com>
    Re: HELP! Parameter Problems (Eric Bohlman)
    Re: Help: OOPS Inheritance... (Eric Bohlman)
    Re: How to pick up shell variable from perl ? (jason)
        Is it possible: Dumping Package Method Names <jdb@wcoil.com>
    Re: Larry Rosler interview on perl.com! (Tad McClellan)
    Re: Larry Rosler interview on perl.com! <htp@mac.com>
    Re: logging in and adding <nomail@nomail.com>
        Newbie Question: SSI Calls and CGI <lagus@smokinhq.com>
    Re: Newbie.. Sorry.. (David H. Adler)
    Re: No offense but Larry Wall should do the maths !! <htp@mac.com>
    Re: No offense but Larry Wall should do the maths !! (David H. Adler)
        Operator Overloading, Use Parent, Multiple Inheritance <jaggers295@hotmail.com>
    Re: Operator Overloading, Use Parent, Multiple Inherita <uri@sysarch.com>
    Re: Perl and memory consumption (Mark W. Schumann)
        Profiling Perl, flock and NT <rho@debitel.net>
    Re: Splitting on a Special Reg (jason)
    Re: Time-Date Question ?? <tina@streetmail.com>
    Re: Time-Date Question ?? (Craig Berry)
        Usernames in chat using TCP/IP Source Pasted (Curos)
        Veritas snapshots ala Network Appliance <herber@thing.com>
    Re: WIDESPREAD INCOMPETENCE AT BELL ATLANTIC <uri@sysarch.com>
    Re: WIDESPREAD INCOMPETENCE AT BELL ATLANTIC (Gwyn Judd)
    Re: Windows Installer error (jason)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Sat, 10 Jun 2000 05:28:30 GMT
From: Ilja Tabachnik <billy@arnis-bsl.com>
Subject: Re: Accessing CC using Sendmail
Message-Id: <8hsjlk$6ee$1@nnrp1.deja.com>

In article <8hq8mm$18d$1@news.online.de>,
  "Raphael Pirker" <raphaelp@nr1webresource.com> wrote:
> Hi Guys,
>
> I want to have the option to send CC E-mails to myself through perl.
> Basically the code I have is:
>
> open(MAIL,"|$mailprog -t");
>
> print MAIL "To: $recipient\n";
> print MAIL "From: $from\n";
> print MAIL "Subject: $subject\n";
> if ($mail_cc ne "false") {
> print MAIL "";  # How do I write a CC address?
> };
>

If you use sendmail, AFAIK you may simply include
Cc: header line exactly like To: line.

Consult your local 'man sendmail' page for more details.

Hope this helps.
Ilja.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 9 Jun 2000 20:10:01 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: backquote error output
Message-Id: <slrn8k31qp.2f3.tadmc@magna.metronet.com>

On Fri, 09 Jun 2000 20:30:02 GMT, Charles Knutson <kjell@wpi.edu> wrote:

>and I cannot figure out a way to capture the error message


   Perl FAQ, part 8:

      "How can I capture STDERR from an external command?"


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 9 Jun 2000 20:09:16 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: backquote error output
Message-Id: <slrn8k31pc.2f3.tadmc@magna.metronet.com>

On Fri, 09 Jun 2000 20:30:02 GMT, Charles Knutson <kjell@wpi.edu> wrote:

>$error = `chmod 755 my.file`;
>print "$error\n";
>
>This just prints the carriage return. 


Eh? There is no carriage return (\r) there...

\n is commonly called "newline". ASCII calls it "line feed".

"carriage return" is a different character altogether.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Fri, 09 Jun 2000 22:19:28 -0500
From: brian@smithrenaud.com (brian d foy)
Subject: Re: Best Perl Accessory?
Message-Id: <brian-0906002219290001@125.sanjose-08-09rs16rt.ca.dial-access.att.net>

In article <39413c6f_1@news.siscom.net>, "Boris Holowko" <bholowko@colorsavvy.com> wrote:

>What is anyone's opinion on the next best thing to download after you've
>downloaded perl, like for example, Perl Studio, Visual Perl,
>Pound-Bang-Perl, Activestate Perl Development Kit, etc...??? I am just
>curious!

mysql is usually my next download. ;)

-- 
brian d foy
Perl Mongers <URI:http://www.perl.org>
CGI MetaFAQ 
  <URI:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>



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

Date: Fri, 9 Jun 2000 20:01:03 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: dbl quoting fields of a CSV file
Message-Id: <slrn8k319v.2f3.tadmc@magna.metronet.com>

On Fri, 9 Jun 2000 15:44:57 -0700, Brian McDonald <mcdonabNO@SPAMyahoo.com> wrote:

>I want to write a script that will read in each line, parse the
>comma-separated fields, put double quotes around each field that contains a
>string (all of them do for now), and reconstruct the line (i guess in
>another file).

>jovovich,milla,,,,,1974,,singer, model and actress
>
>As you can see, anything after the last (8th) comma represents an entire
>field.
>
>I would like the script to do this to the above line:
>
>"jovovich","milla","","","","","1974","","singer, model and actress"


if the last field is the only one that can contain commas,
then you can do it simply, though using a module is likely
more robust (i.e. "better"):


   my @parts = split /,/, $_, 8;

   $_ = '"' . join('","', @parts) . '"';


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 10 Jun 2000 06:30:14 GMT
From: Nikhil Prashar <prashar80@hotmail.com>
Subject: Executing several scripts
Message-Id: <sk3o3mfgh51140@corp.supernews.com>

How would you create a Perl script that executes several scripts and 
parses the information received into a table. For example, how could you 
write a script that uses several search scripts at the same time and then 
shows the results in one long table?

--
Posted via CNET Help.com
http://www.help.com/


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

Date: Sat, 10 Jun 2000 02:26:35 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Extract filename from path?
Message-Id: <MPG.13ac448b24b0a9d4989715@news>

Larry Rosler writes ..
>You probably meant this:
>
>      $pfad =~ s;\\;/;g;   # change all \ to /
>
>which is better writen this way:
>
>      $pfad =~ tr%\\%/%;   # change all \ to /
>
>which is faster.  Using ';' as a regex delimiter is masochistic, as you 
>see.
>
>>     return substr($pfad,rindex($pfad,'/')+1);
>> }
>
>There are many other ways to do this, including a simple regex such as:
>
>    /([\\/]+)$/
>
>And the module File::Basename, to include other oddities such as the 
>Mac.

not to mention the fact that 'c:filename.ext' is a valid Win32 absolute 
filename .. and while File::Basename copes with this as expected - this 
little regex doesn't

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Sat, 10 Jun 2000 02:33:45 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: File I/O error on ActivePerl/IIS 4.0
Message-Id: <MPG.13ac463abdb1d727989716@news>

Information Technology writes ..
>We have a problem with  a script running on ActivePerl/IIS 4.0. This is
>related to file IO, in that when a file input is attempted, an error is
>flagged and the process does not complete. The same script however works on
>PWS and UNIX platforms.

do the file permissions on the file you're attempting to access allow 
the IIS user that the script is being executed as the required access ?

-- 
 jason - elephant@squirrelgroup.com -


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

Date: Fri, 9 Jun 2000 20:18:37 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: HELP! Parameter Problems
Message-Id: <slrn8k32at.2f3.tadmc@magna.metronet.com>

On Fri, 09 Jun 2000 23:09:35 GMT, Jamie R <jrr386@home.com> wrote:

>Can anyone tell me how to pass parameters into a script without using
>the CGI module?


Sure, just provide the arguments on the command line, then
access them via @ARGV.


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 10 Jun 2000 01:55:29 GMT
From: Jamie R <jrr386@home.com>
Subject: Re: HELP! Parameter Problems
Message-Id: <39419F45.74BFBE54@home.com>



Tom Briles wrote:
> 
> In article <39417863.885AEDDE@home.com>, jrr386@home.com says...
> > Can anyone tell me how to pass parameters into a script without using
> > the CGI module?
> 
> Why in the world would you want to do that?
> 
> CGI.pm is in the standard distribution of any *semi*-recent Perl.
> 
> - Tom

Unfortunately, one of our main servers is running Perl 5 and does not
have the CGI.pm installed. All of the other modules appear to be there.
I haven't found a site that will let me download CGI.pm directly,
without installing Perl again. Any further information would be great.
Thanks.


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

Date: 10 Jun 2000 06:24:03 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: HELP! Parameter Problems
Message-Id: <8hsmu3$p0r$2@slb6.atl.mindspring.net>

Jamie R (jrr386@home.com) wrote:
: Unfortunately, one of our main servers is running Perl 5 and does not
: have the CGI.pm installed. All of the other modules appear to be there.
: I haven't found a site that will let me download CGI.pm directly,
: without installing Perl again. Any further information would be great.

The latest version of CGI.pm is available from 
<URL:http://stein.cshl.org/WWW/software/CGI>.



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

Date: 10 Jun 2000 05:09:02 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Help: OOPS Inheritance...
Message-Id: <8hsihe$p0r$1@slb6.atl.mindspring.net>

Abigail (abigail@arena-i.com) wrote:
: I'd rather type:
: 
:     use Module;
: 
:     ...
: 
:     my $obj = Module -> new;
: 
:     ...
: 
:     my $result = $obj -> method ();
: 
:     if ($result == E_FOO) {
:         save_the_world;
:     }
:     elsif ($result == E_BAR) {
:         save_the_whales;
:     }
: 
: than
: 
:     if ($result == Module -> E_FOO) {
:         Module::save_the_world;
:     }
:     elsif ($result == Module -> E_BAR) {
:         Module::save_the_whales;
:     }

So would I, and at first glance it seems like constant definitions are a 
reasonable thing for a class to export.  But what if you're using two or 
more classes from different sources, and two or more of them use the same 
name to define different constants?  If you have to access constants 
through the class or object, no problem, but if you let the classes 
export those definitons, you're SOL.


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

Date: Sat, 10 Jun 2000 03:16:57 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: How to pick up shell variable from perl ?
Message-Id: <MPG.13ac5057c2f719b0989719@news>

Andy writes ..
>I am running a web page with perl script on a unix system.  The page
>is expected to run for different applicaiton purpose whcih depents on
>a shell environment variable.  The shell environment vairable is set
>when the web server is started on a particular environment for an
>application environment.
> I wish to pick up the shell environment variable from my perl when it
>is called from the client's browser to know what application I should
>go.
>
>Can someone give me a help on what I should be looking for from the
>perl to get the shell environment vairables at the instance.
>
>I already tried the %ENV{} which does not seem contains anyting for
>the shell.

doesn't contain anything ? .. then you're probably using it incorrectly 
 .. show some code

-- 
 jason - elephant@squirrelgroup.com -


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

Date: 10 Jun 2000 05:47:35 GMT
From: "Josiah Bryan" <jdb@wcoil.com>
Subject: Is it possible: Dumping Package Method Names
Message-Id: <8hskpn$jgt$0@206.230.71.33>

    my $object = new myPackage();

Is it possible to dump just the method names from that object? I know how to
use Data::Dumper to dump variable names (or properties in javascript..im not
sure of correct terms), but I need to kow if there is a way to dump the
method names of a class?
Any help would be IMMENSLY appreciated!!

- Josiah






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

Date: Fri, 9 Jun 2000 20:04:44 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <slrn8k31gs.2f3.tadmc@magna.metronet.com>

On Fri, 09 Jun 2000 23:38:51 GMT, Steven Merritt <smerr612@mailandnews.com> wrote:

>accepted, but irregardless, they seldom agree even on fixes),
               ^^^^^^^^^^^^

"regardless" means "without regard", so "irregardless" must
mean "not without regard", i.e "_with_ regard".

I think you said the exact opposite of what you were
trying to say...


-- 
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Sat, 10 Jun 2000 14:23:12 +0930
From: Henry <htp@mac.com>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <htp-AC4501.14231210062000@news.metropolis.net.au>

In article <Ek605.107069$hT2.427521@news1.rdc1.ct.home.com>, Dan 
Sugalski <dan@tuatha.sidhe.org> wrote:

>>> Perl is in fact already de facto standardized (because of the
>>> single official source), but the definition is vague and there
>>> is no corporate clout to support it.  That is why I believe a
>>> more formal, de jure activity is required.
>>>
>>> But the Open Source movemet may be creating a new paradigm for 
>>> standardization.  We shall see!
> 
>> As long there is only one official source there's no need for any
>> standardization.
> 
> That's a common misconception, and one that's not true.

I'm going to take issue with that.


> One of the points
> of standards is to give multiple implementations something to meet. You'd
> think we didn't need that, but we do because there *are* multiple
> implementations. Each major version of perl could be reasonably described
> as an independent implementation.

Reasonable?  You think it's 'reasonable' to consider that Perl 5.$x is 
an "independent implementation" of Perl 5.--$x even though 99%+ of the 
codebase is an exact byte match?

That's one of the most screwed up definitions of "independent 
implementation" that I have _EVER_ heard.

Totally bogus.

<snip>


> A standard also gives the *programmer* something to work with. Without a
> standard you have no guarantees of how a language is supposed to work, so
> how can you make sure your program does what you think it should?

Standards don't give programmers something to work with, DOCUMENTATION 
does!

Perl's biggest failing is that since "There Is More Than One Way To Do 
It" no-one documents _anything_ for fear of being seen as dictatorial, 
and incurring the wrath of the community.

This attitude has had a pronounced effect on the documentation, which 
reads like an arcane language reference and is almost INCOMPREHENSIBLE 
to a newbie.  A proliferation of programming guides has attempted to 
address this issue, but the expectation is that FULL and COMPLETE 
documentation will ship with the product.  And this simply isn't the 
case with Perl.

Dump a standard distribution of Perl in front of a newbie and you'll see 
their eyes glaze over in a matter of minutes.

Make better (more approachable) documentation, and more people will "use 
Perl;".  An increase in numbers is analagous to an increase in mass.  
More mass means more inertia.  More inertia translates to 
_functional_stability_.  Functional stability results in industry 
acceptance.

Companies don't really give a flying flock() about whether or not a 
programming language is ANSI certified, all they want to know is whether 
or not the applications they develop _today_ will continue to work 
_tomorrow_.

You don't need artificial standards to do that, all you need is critical 
mass.  Approachable documentation, shipped with the standard 
dstribution, will give us critical mass faster, and more efficiently, 
than any standard could ever hope.

Henry.


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

Date: Fri, 9 Jun 2000 23:39:23 -0400
From: "Jonah" <nomail@nomail.com>
Subject: Re: logging in and adding
Message-Id: <8hsjom$2v2k$1@onlink3.onlink.net>

HaCkeRz45 <hackerz45@aol.com> wrote in message
news:20000609204946.11458.00005775@ng-ch1.aol.com...
> can someone help me ? how do i make it so someone can log in to there
username
> on my web site then beable to post stuff in like a post board on my site
or
> something like that? If u can email me at hackerz45@aol.com i will be
great
> fully appreciated!

is that it?  no problem, here you go

#!/usr/bin/perl -w

#make sure you have use strict!
use strict;
use CGI::Carp qw(fatalsToBrowser);
use CGI;

my $q = new CGI;

$q->make_it_get_user_login;
$q->post_stuff_on_post_board;









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

Date: Fri, 9 Jun 2000 23:36:30 -0700
From: "Daniel Epp" <lagus@smokinhq.com>
Subject: Newbie Question: SSI Calls and CGI
Message-Id: <sk3of8frh5151@corp.supernews.com>

What I'm trying to do is to create a script that includes different pages
into an HTML document based on the query string.  I have all this done but
the problem is, the SSI calls in the files the script includes are not
parsed in. Therefore my question is, How do I make the CGI script parse in
the SSI calls?

Thanks,
-Daniel Epp aka Smokin_E




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

Date: 10 Jun 2000 06:38:28 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: Newbie.. Sorry..
Message-Id: <slrn8k3oj4.67o.dha@panix6.panix.com>

On 09 Jun 2000 04:09:28 GMT, SASprgmr <sasprgmr@aol.com> wrote:
>Forget about Learning Perl by O'Reilly. I found the Perl Cookbook (the Ram
>book) to be much more useful.

Hm... I also happen to think well of the Ram, but I certainly don't
see it as a replacement for an introductory perl book like Learning
Perl.  The Ram does not teach you the language, but assumes you
already know it.

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
We went on holiday by mistake	- Withnail


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

Date: Sat, 10 Jun 2000 14:36:25 +0930
From: Henry <htp@mac.com>
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <htp-FB5BA9.14362510062000@news.metropolis.net.au>

In article <960551204.4745.0.nnrp-01.c3ad6973@news.demon.co.uk>, "W 
Kemp" <bill.kemp@wire2.com> wrote:

>>> Hint for the truly lazy:  Try it again with rand() instead of just 
>>> rand.
> 
> I find my code has more brackets in it than the code I see elsewhere.
> I think style comments say that's OK if you feel like it. (and 
> (rand()*3)) works)
> 
> Would I be saved from other unusual featurees with my bracket fetish?
> Is there any real penalty from over-use of brakets?

Brackets are good.

I use brackets.

Lots of brackets.

I like brackets.

Brackets are my friends.

They tell my brain where things begin, and where things end.

My brain likes that.

Henry.


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

Date: 10 Jun 2000 06:51:58 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: No offense but Larry Wall should do the maths !!
Message-Id: <slrn8k3pce.67o.dha@panix6.panix.com>

On Sat, 10 Jun 2000 14:36:25 +0930, Henry <htp@mac.com> wrote:
>
>Brackets are good.
>
>I use brackets.
>
>Lots of brackets.

[etc.]

Yet you used no brackets in your post (of your own (there were some in
the quoted (i.e. previous poster's) text)).

Clearly you don't like them enough.

(heck, you didn't even use a smiley :-)

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"We are the Borg. You will be assimilated! Nah, only kidding. We're
just the Sontarans. Care to take part in some 'medical research'?"


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

Date: Sat, 10 Jun 2000 04:25:08 GMT
From: "Neo-X" <jaggers295@hotmail.com>
Subject: Operator Overloading, Use Parent, Multiple Inheritance
Message-Id: <Eqj05.3942$O4.139216@news1.rdc1.tn.home.com>

I've been messing around with perl classes lately and came across a couple
things that puzzled me.

First,  is there any way to do operator overloading in Perl like you can
with C++?

Secondly, when you create a derived class, from what I can tell, you push
parent class names onto the @ISA list.  In addition, it seems that you have
to "use parent" for each parent class as well.  Is this correct, or am I
doing something wrong?

Finally, I can't quite figure out the intricacies of multiple inheritance.
Specifically, if a given class has two parent classes who both contain the
function foo(), how does the child class behave if an instance of it calls
foo? Or if the child class has its own foo() function, how does the
psuedoclass SUPER behave? From the program I tested, in either case (with or
without a child polymorphic foo()), it seems to simply display a warning
about function redefinition and use the foo() from the last parent class
that was 'use'd.  But then again, this may result from an extension of the
'use' problem stated above, if such a problem exists.

Ther is another problem that crossed my mind about multiple inheritence that
I haven't been able to test yet because of the above problem.  Suppose you
have a function called Ancestor.  Derived from it are two classes, call them
Mother and Father.  Then you have a function called Child that is a child
class of both Mother and Father.  Now say Ancestor has a function called
foo(), and I call foo() on an instance of Child.  Theoretically, how would
the program respond (would be foo() be called twice, once, something else)?

Thanks,
--Ben Lee
catalyst_of_dreams@hotmail.com




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

Date: Sat, 10 Jun 2000 04:34:58 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Operator Overloading, Use Parent, Multiple Inheritance
Message-Id: <x7n1ku9mry.fsf@home.sysarch.com>


buy and read object oriented perl.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: 10 Jun 2000 01:54:36 -0400
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Perl and memory consumption
Message-Id: <8hsl6s$rch@junior.apk.net>

In article <FMY%4.106861$hT2.426465@news1.rdc1.ct.home.com>,
Dan Sugalski  <dan@tuatha.sidhe.org> wrote:
>Joe Kline <jkline@one.net> wrote:
>
>> Guess I just have to get used to a troll (an especially stubborn one)
>> just not wanting to give an inch when reason is presented. Just
>> another bit of usenet that one has to unfortunately bear.
>
>Compared to some of the more colorful folks from Usenet's past (McElwane
>(sp?) from sci.physics anyone?) this is tame. 

#/usr/bin/perl
# -w and strict not needed

$REPRODUCTION and $DISSEMENATION ($this->important ($info)) == $encouraged;



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

Date: Sat, 10 Jun 2000 03:54:36 +0200
From: "Ralf Hoffmann" <rho@debitel.net>
Subject: Profiling Perl, flock and NT
Message-Id: <3941a080@news.ivm.net>

Hi there !

I need some help getting in love with perl.

- Does exist any good documentation about  perl performance issues (despite
camel book infos) ?
- Is there another way of invoking the profiler option ?
  perl -d:DProf is not suitable for me, because I have no control of the
invocation method of perl.
- Is flock valid under Windows NT ? - How can I handle exclusive write
access ?

_Thanks in advance_

Ralf







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

Date: Sat, 10 Jun 2000 03:02:47 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Splitting on a Special Reg
Message-Id: <MPG.13ac4d0559ea18bb989717@news>

Robert Young writes ..
>Can anyone give me a regular expression to perform a split where the
>expression is split on a character unless the character is preceded by a
>backslash (\) ?

  perldoc perlre

will give you a lot of information on Perl's regular expression features 
 .. a zero-width negative lookbehind assertion is what you're after .. 
and you'll need a non-ancient version of Perl (I think from 5.005 
onwards - but I'm no expert)

  split /(?<!\\)_/, $blah;

will split the contents of $blah on the character '_' as long as it is 
not preceeded by a '\' .. note that we have to use a double '\\' to 
represent a single '\' because '\' is an escape character

-- 
 jason - elephant@squirrelgroup.com -


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

Date: 10 Jun 2000 02:42:42 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Time-Date Question ??
Message-Id: <8hs9v2$36o9v$1@fu-berlin.de>

hi,

Craig Berry <cberry@cinenet.net> wrote:
> rrubin@rotor.net wrote:
> : I have a timestamp of the following value 0006091338
> : 
> : I would like to convert that to ... June 09, 2000 13:38
> : 

> @months = qw( January February March April
>               May June July August
>               September October November December );

> $tstamp = '0006091338';
> ($y, $m, $d, $hh, $mm) = $tstamp =~ m/../g;
> $y += 2000;
> $m--;

> $pretty = "$months[$m] $d, $y $hh:$mm";
> print "$pretty\n";

well, this produces 
June 09, 2000 13:38
for the example. but it produces 
June 09, 2098 13:38
for "9806091338".

you have to see, which year it is.
timelocal does this for you.

tina

-- 
http://www.tinita.de \  enter__| |__the___ _ _ ___
tina's moviedatabase  \     / _` / _ \/ _ \ '_(_-< of
search & add comments  \    \ _,_\ __/\ __/_| /__/ perception


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

Date: Sat, 10 Jun 2000 05:52:59 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Time-Date Question ??
Message-Id: <sk3ltr8eh5155@corp.supernews.com>

Tina Mueller (tina@streetmail.com) wrote:
: well, this produces 
: June 09, 2000 13:38
: for the example. but it produces 
: June 09, 2098 13:38
: for "9806091338".
: 
: you have to see, which year it is.
: timelocal does this for you.

I find that rather scary.

-- 
   |   Craig Berry - http://www.cinenet.net/users/cberry/home.html
 --*--  "Beauty and strength, leaping laughter and delicious
   |   languor, force and fire, are of us." - Liber AL II:20


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

Date: 10 Jun 2000 06:39:57 GMT
From: curos@aol.com (Curos)
Subject: Usernames in chat using TCP/IP Source Pasted
Message-Id: <20000610023957.15869.00005446@ng-md1.aol.com>

Hello. I want to add the ability for people who log into my chat server to type
in a user name and other people to see that name when they type something. Here
is my code for the chat room (horrible, I know, but I am a newbie) any help is
great appreciated!

#!/usr/bin/perl

use IO::Socket;
use IO::Select;

$proto = "tcp";
$port = "777";
$max_clients = 2;

$new_client = IO::Socket::INET->new(	Proto=>$proto,
					LocalPort=>$port,
					Listen=>$max_clients,
					Reuse=>1) || die "Socket:  $!\n";
$sel = IO::Select->new($new_client);

while(@ready = $sel->can_read) {

	foreach $client (@ready) {

	if($client == $new_client) {
	$add = $client->accept;
	my $userload = $sel->count;
	print $add "Welcome to Kuros's chatroom!\n";
	print $add "Type .quit to leave!=]\n";
	print $add "Total users currently chatting:  $userload\n";
	$sel->add($add);
	} else {
	$msg = <$client>;
	chop($msg);
	chop($msg);
		if($msg eq ".quit") {
		$sel->remove($client);
		close($client);
		foreach($sel->can_write) {
		print $client "A user left!=(\n"; }
		}
		elsif($msg eq ".userload") {
		my $userload = $sel->count - 1;
		foreach($sel->can_write) {
		print $_ "Current users in chatroom:  $userload\n"; }
		} else {
			foreach ($sel->can_write) {
			print $_ "[Message]:  $msg\n";
			}
		}
          }
     }
}



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

Date: 10 Jun 2000 02:35:03 GMT
From: Steve Herber <herber@thing.com>
Subject: Veritas snapshots ala Network Appliance
Message-Id: <8hs9gn$tvf$0@216.39.145.27>

I have been spoiled by the network appliance builtin snapshot facility.
You can schedule up to 20 snapshots on hourly, daily, and weekly.

I am getting ready to write a perl script to find all the vxfs
filesystems,
check a config file, and create and delete snapshots.

Does anyone have a similar script that they would like to share?

Thanks,


--
Steve Herber    herber@thing.com        work: 206-732-6111
                                        home: 425-454-2399





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

Date: Sat, 10 Jun 2000 04:28:10 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: WIDESPREAD INCOMPETENCE AT BELL ATLANTIC
Message-Id: <x7pupq9n3b.fsf@home.sysarch.com>

>>>>> "S" == Speed-Demon  <Speed-Demon@gqjvq.net> writes:

  S> Perhaps the US Government should take a look at Bell Atlantic in
  S> much the same way it's currently looking at Microsoft, with a similar
  S> remedy in mind. 

and your perl rant is??

  S> Fpechiy mulqkls mupufw fqxro i krbeep bcfl rekybk kt
  S> bxr sl mg tnor bv amiil kna cj
  S> mberredi alvzredi lsssd atpmerf flzmsypl kalmykf rektcbr ey
  S> pfbctes baoo rczll eyfpu a mzmfl kbtll byenlmf ii ee pp.

not rot13. so why post it unless it is for moronzilla

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Sat, 10 Jun 2000 04:42:25 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: WIDESPREAD INCOMPETENCE AT BELL ATLANTIC
Message-Id: <slrn8k3hu9.5ka.tjla@thislove.dyndns.org>

I was shocked! How could Uri Guttman <uri@sysarch.com>
say such a terrible thing:
>>>>>> "S" == Speed-Demon  <Speed-Demon@gqjvq.net> writes:
>
>  S> Perhaps the US Government should take a look at Bell Atlantic in
>  S> much the same way it's currently looking at Microsoft, with a similar
>  S> remedy in mind. 
>
>and your perl rant is??
>
>  S> Fpechiy mulqkls mupufw fqxro i krbeep bcfl rekybk kt
>  S> bxr sl mg tnor bv amiil kna cj
>  S> mberredi alvzredi lsssd atpmerf flzmsypl kalmykf rektcbr ey
>  S> pfbctes baoo rczll eyfpu a mzmfl kbtll byenlmf ii ee pp.
>
>not rot13. so why post it unless it is for moronzilla

It's just garbage. I think they include that sort of crap to get around
filters that look at the content of the message.

-- 
Gwyn Judd (tjla@guvfybir.qlaqaf.bet)
My return address is rot13'ed
Substitute "damn" every time you're inclined to write "very"; your
editor will delete it and the writing will be just as it should be.
		-- Mark Twain


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

Date: Sat, 10 Jun 2000 03:04:38 GMT
From: elephant@squirrelgroup.com (jason)
Subject: Re: Windows Installer error
Message-Id: <MPG.13ac4d7795c02b44989718@news>

pjsto writes ..
>I'm getting a wininstaller error that say I need to up grade to
>a more current Service Pack for NT. One that has a more current
>Windows installer. I've installed SP6a and have also installed
>the most current windows installer from the Office 2000 cd. File
>name Instmsiw.exe created 6/9/00. I'm still getting the error
>which is preventing me from loading ActivePerl 5.6

it's an omen .. my recommendation - still with 5.005_03 .. especially on 
Windows where a lot of the modules have binary components which are not 
compatible with the new 5.6 dist

if you're insistant on loading 5.6 then I'd download the installer from 
ActiveState's site (rather than the one from Office2000) .. it certainly 
works

-- 
 jason - elephant@squirrelgroup.com -


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

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

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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.

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


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