[25432] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 7677 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 20 11:05:38 2005

Date: Thu, 20 Jan 2005 08:05:17 -0800 (PST)
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, 20 Jan 2005     Volume: 10 Number: 7677

Today's topics:
        [ANNOUNCE] ibmonitor v1.3 <arcofdescent@gmail.com>
        ANNOUNCE: File::FDkeeper 0.04 <patrick.leboutillier@gmail.com>
        Catch stdout from eval possible <mikael.petterson@ericsson.se>
    Re: Catch stdout from eval possible <noreply@gunnar.cc>
        CRAXDDRT problems <THarmon@ftb.com>
    Re: Directory listing <dbohl@sgi.com>
        generate different website out of database. (Piet L.)
    Re: generate different website out of database. <noreply@gunnar.cc>
    Re: generate different website out of database. <richard@zync.co.uk>
    Re: How to replace the multi-line string <jl_post@hotmail.com>
    Re: Low level data manipulation in Perl <tadmc@augustmail.com>
    Re: Perl and waiting for execution of external program jonas.andersson@rocketmail.com
        Question? Alternative to loading modules!!! <chicks_hate_me@hotmail.com>
    Re: Question? Alternative to loading modules!!! <noreply@gunnar.cc>
    Re: Question? Alternative to loading modules!!! <matternc@comcast.net>
    Re: Question? Alternative to loading modules!!! (Peter Scott)
    Re: regular expressions <tadmc@augustmail.com>
    Re: regular expressions <tadmc@augustmail.com>
    Re: The world's shortest 'Hello World!' program: a prop <x3v0-usenet@yahoo.com>
    Re: The world's shortest 'Hello World!' program: a prop <phaylon@dunkelheit.at>
    Re: Whats the variable holding the dir seperator? <perl@lennychallis.co.uk>
    Re: Whats the variable holding the dir seperator? <tadmc@augustmail.com>
    Re: Whats the variable holding the dir seperator? <tadmc@augustmail.com>
    Re: Whats the variable holding the dir seperator? <tadmc@augustmail.com>
    Re: Whats the variable holding the dir seperator? <gargoyle@no.spam>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 16 Jan 2005 11:04:54 GMT
From: Rohan Romanus Almeida <arcofdescent@gmail.com>
Subject: [ANNOUNCE] ibmonitor v1.3
Message-Id: <IAME92.14D4@zorch.sf-bay.org>


ibmonitor v1.3 is in CPAN at
http://cpan.org/authors/id/R/RO/ROHAN/ibmonitor-2005.0114-1.3

About
------

ibmonitor - an interactive bandwidth monitor

ibmonitor is an interactive linux console application which shows
bandwidth consumed and total data transferred on all interfaces.

Its main features are:
  - Shows received, transmitted and total bandwidth of each interface
  - Calculates and displays the combined value of all interfaces
  - Displays total data transferred per interface in KB/MB/GB
  - Bandwidth Values can be displayed in Kbits/sec(Kbps) and/or
    KBytes/sec(KBps)
  - Can show maximum bandwidth consumed on each interface since start of
    utility
  - Can show average bandwidth consumption on each interface since
    start of utility
  - The output with all features (max, avg and display in Kbps and KBps)
    easily fits on a 80x24 console or xterm
  - Can interactively change its output display format depending on key
    pressed by user.

Changes since v1.2
- Sleep interval is now more accurate as we are subtracting the
   time taken for the code to run from it
- ibmonitor requires Perl module Time::HiRes

Regards,
Rohan




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

Date: Thu, 20 Jan 2005 14:43:32 GMT
From: "patl" <patrick.leboutillier@gmail.com>
Subject: ANNOUNCE: File::FDkeeper 0.04
Message-Id: <IAME8K.14CF@zorch.sf-bay.org>

File::FDkeeper 0.04 has just been uploaded to CPAN.


>From the README:
================

File::FDkeeper allows you to store open filehandles in a "server"
process and
retrieve them at a later time from another process.

When a filehandle is stored, an id is returned. This id can then be
used by
any other process to retrieve the filehandle (as long as they have
permission
to open the fifo).

INSTALLATION

To install this module type the following:

perl Makefile.PL
make
make test
make install


DEPENDENCIES

This module requires these other modules and libraries:

File::FDpasser

Note: This module only works on UNIX-type platforms. See File::FDpasser
for more information.


COPYRIGHT AND LICENCE

Copyright (C) 2005 Patrick LeBoutillier

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.




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

Date: Thu, 20 Jan 2005 12:34:50 +0100
From: Petterson Mikael <mikael.petterson@ericsson.se>
Subject: Catch stdout from eval possible
Message-Id: <cso4on$nuj$1@newstree.wise.edt.ericsson.se>

Hi,

When I execute the jar command with eval I want to catch STDOUT.
Is it possible? How?

This is the line I am trying to execute.
********
eval{`jar -cvf ${data_type}.jar -C $root_dir\/${data_type}`};
********

//Mikael


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

Date: Thu, 20 Jan 2005 13:00:39 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Catch stdout from eval possible
Message-Id: <359kvrF4i8e6tU1@individual.net>

Petterson Mikael wrote:
> When I execute the jar command with eval

Why eval?

> I want to catch STDOUT. Is it possible? How?

     my $output = `somecommand` or die "Command failed: $!";

Read about backticks (or the qx// operator) in "perldoc perlop".

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: 20 Jan 2005 08:00:19 -0800
From: "Grixxly" <THarmon@ftb.com>
Subject: CRAXDDRT problems
Message-Id: <1106236819.720892.195990@f14g2000cwb.googlegroups.com>

All,

I'm brand new to Perl and I'm having a problem. I had a Perl script
that would generate some Crystal Reports using
Win32::OLE->new("Crystal.CrystalReport") and printing the report to a
file in Crystal format. Works great! (my first script)

Now my requirements have changed and I need to export my reports into
pdf documents. So I looked at ActiveState's OLE browser and found the
library Win32::OLE CRAXDDRT. It appears to use the same properties and
methods so I thought I'd change my script from the above to: $MYRPT =
Win32::OLE->new("CRAXDDRT.Report"); but it fails to create the object.
Can anyone tell me why? I've done a search against the newsgroup and
found no references to CRAXDDRT or CRAXDRT so I'm wondering if I'm
stuck.

Please be gentle, I'm a mainframe/COBOL programmer that's been thrown
into this server-side scripting world. :)

Thanks,
Tony



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

Date: Thu, 20 Jan 2005 08:48:17 -0600
From: Dale Bohl <dbohl@sgi.com>
Subject: Re: Directory listing
Message-Id: <csogbt$2s78rt$1@fido.engr.sgi.com>

Richard Gration wrote:

> On Tue, 18 Jan 2005 17:59:23 -0800, Crom wrote:
> 
> 
>>Abigail wrote:
>>
>>>Frank Raz (rv01@gre.ac.uk) wrote on MMMMCLVIII September MCMXCIII in
>>><URL:news:DhhHd.280$Z31.44@newsfe1-gui.ntli.net>:
>>>##  Hi
>>>##
>>>##  I am a new comer to the world of PERL scripting.
>>>
>>>The language is called Perl. The binary is called perl. There's no
>>>such thing as PERL.
>>
>>Please excuse my bluntness, but the sky is NOT falling.
> 
> 
> I think you're missing the point. Programming is a precise endeavour. It
> is an enormous help if you are in the habit of being precise all the time,
> rather than trying to decide what context you are in and whether you can
> afford to be sloppy, both in expression and interpretation. That's why the
> objection to casing. It's about respecting the input filters (and
> therefore *time*) of the people whose help you are asking for.
> 
> At least, that's one way of looking at it.
> 
> Rich


Here's the first thing that came to mind after this...

http://www.perl.com/pub/2001/05/29/tides.html


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

Date: 20 Jan 2005 03:32:24 -0800
From: PietLaroy@hotmail.com (Piet L.)
Subject: generate different website out of database.
Message-Id: <c47f81f6.0501200332.3570a744@posting.google.com>

hello,

I have a database, and I need to generate different websites out of it.
This should be accomplished by giving parameters to a script that tells
what and how to display the information. 

I should work with MySQL, XML, XSLT, Perl and stylesheets.

Can anyone give me some proposals how to accomplish this, 
what are the advantages/disadvantages of this structure,
what about security, performance etc...

I can use all knowledge.
Thx


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

Date: Thu, 20 Jan 2005 13:04:27 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: generate different website out of database.
Message-Id: <359l6vF4i8e6tU2@individual.net>

Piet L. wrote:
> I have a database, and I need to generate different websites out of it.
> This should be accomplished by giving parameters to a script that tells
> what and how to display the information. 
> 
> I should work with MySQL, XML, XSLT, Perl and stylesheets.
> 
> Can anyone give me some proposals how to accomplish this,

I suggest that you write a program.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Thu, 20 Jan 2005 13:03:22 +0000
From: Richard Gration <richard@zync.co.uk>
Subject: Re: generate different website out of database.
Message-Id: <pan.2005.01.20.13.03.22.378253@zync.co.uk>

On Thu, 20 Jan 2005 03:32:24 -0800, Piet L. wrote:

> hello,
> 
> I have a database, and I need to generate different websites out of it.
> This should be accomplished by giving parameters to a script that tells
> what and how to display the information. 
> 
> I should work with MySQL, XML, XSLT, Perl and stylesheets.
> 
> Can anyone give me some proposals how to accomplish this, 
> what are the advantages/disadvantages of this structure,
> what about security, performance etc...

The basic strategy I am using is this:

Each website has its own database. Each database has configuration
tables. I am using Apache + mod_perl, the configuration for each website
is read during Apache start up and cached to reduce overhead. I use <Perl>
blocks in httpd.conf to create the VirtualHost definitions for the
websites.

I use HTML::Template for the pages. I try to keep it simple by
making generic page templates which are common to all websites and are
configured at runtime, but sometimes there's no way round it, you have to
have a different template for each website, so in addition to the common
template tree, each website has its own template directory. The search
path for HTML::Template is config'ed from the database to effect this.

I'm constantly walking a line between complexity and maintainability! I've
developed (and developed on) this system for 2 1/2 years now and it's
proved to be quite flexible and is still quite maintainable.

Performance is quite bad compared with static pages, but if you have a
database driven website where the majority of your pages have
dynamic content that's unavoidable. I try to make even small time savings
wherever I can to help, clean HTML with few tables is a relatively big win
here.

If I had to develop a similar system, knowing what I know now, XML and
XSLT would be at the heart of it, not HTML. You live and learn.

HTH
Rich


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

Date: 20 Jan 2005 07:18:58 -0800
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Re: How to replace the multi-line string
Message-Id: <1106234338.597898.304650@z14g2000cwz.googlegroups.com>

sonet wrote:
> X-Status:  333 test1
>                        test2
>                        last
>
> TEST
>
>
> How to replace the string to TEST??
>
>
> I Can not do this job with  ~s/X-Status:.*last\n//g;


Do you mean, "replace the string up to TEST"?  If that's what you
want, you can take Arndt Jonasson's advice and add the "s" modifier
(that makes "." match any character (including newlines)).

However, be aware that the ".*" performs greedy matching.  That is,
it will match as much of the string as it can, matching up to the last
occurrence of "last\n".  In other words, if the substring "last\n"
appears several times in your string, the regular expression will match
(and remove) everything up to the last one.

Therefore, I recommend making ".*" non-greedy by adding a "?" right
after it, like this:

$string =~ s/X-Status:.*?last\n//gs;

This way only the substring up to the first "last\n" will be removed.
I hope this helps, sonet.

   -- Jean-Luc



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

Date: Thu, 20 Jan 2005 06:58:23 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Low level data manipulation in Perl
Message-Id: <slrncuvanf.7uj.tadmc@magna.augustmail.com>

Leonard Challis <perl@lennychallis.co.uk> wrote:

> Would you mind pointing me in the direction of the newsgroup guidelines 


They are posted here twice each week.

   http://mail.augustmail.com/~tadmc/clpmisc.shtml


> and 
> quoting techniques 


There are pointers in the Guidelines to those.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 20 Jan 2005 08:01:07 -0800
From: jonas.andersson@rocketmail.com
Subject: Re: Perl and waiting for execution of external program
Message-Id: <1106236867.183882.199950@f14g2000cwb.googlegroups.com>

> What the symptoms actually *are* would be more useful in solving
> the problem then your interpretation of what they "look like."
> You should be providing the first instead of the second, rather
> than the other way around.

OK,

here are the symptoms:

$linenumber=796;
open (PROG, "|$MyProgram &> /dev/null") or &err;

print PROG "Load file $FileName\n";
print PROG "Calculate all\n";
$linenumber=801;
close (PROG) or &err;
$linenumber=$803;

 ...

sub err {

print "error - last line to be noted was $linenumber \n";
exit;
}


The symptoms being that it sometimes ends with sub err printing 801,
suggesting that it ended on the line 'close (PROG) or &err;', ie
failure to close the program [premature close attempt?]. This does not
happen when I run the Perl script by hand, but it does sometimes happen
when I run it as CGI or with crontab. The Apache timeout, as far as I
can tell, is more allowing than the time it takes for the script to
halt prematurely (and does not explain the crontab issue). Any other
ideas?

Thanks for your time,

JA



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

Date: 20 Jan 2005 06:07:49 -0800
From: "ChicksHateMe" <chicks_hate_me@hotmail.com>
Subject: Question? Alternative to loading modules!!!
Message-Id: <1106230069.951809.280200@c13g2000cwb.googlegroups.com>

I consider myself still a newbie so I am looking for help, not flaming.
Thanks in advance.

I have written a few Perl programs, and I enjoy it. I like it more than
doing stuff in PHP. I don't want to start the whole PHP - Perl thing,
but I like the power and ease of Perl, and who's faster doesn't matter
to me.

The one thing I dislike is trying to deal with website/hosts and
getting the modules installed that I need. It's a PITA.

I have Sometimes taken modules and just simplified them and used them
as an "include" instead of loading them. For some simple ones this
seems to work fine.


1. Where I am doing this for my own specific sites, what I am wondering
is, if there are any issues I may run into?

2. Would installed modules run faster than using the modules as a
simple include where possible and needed??

I've only used some simple modules so far this way, so I am wondering
also;

3 Is there an EASY way to convert a module to a simple include, or will
I OFTEN run into issues?? Things like assigned vars, etc??

Again, the reason I ask, Is I LOVE perl and want to learn more, but in
some cases it is REALLY difficult to get the hosts to load Perl
modules, packages, bundles, etc...  So, in that way, it's hard to
actually run some software on sites ( i.e. pre-written CMS packages).
I Think this is a MAJOR reason why PHP based CMS's  are far more
popular and supported than Perl Based ones.

This does make going with PHP a little easier route for CMS's and the
sort, BUTTT I am fighting and kicking to find a way to use Perl and
modules in a more simple way. 

Thanks in advance



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

Date: Thu, 20 Jan 2005 15:28:29 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Question? Alternative to loading modules!!!
Message-Id: <359tmaF4k1stiU1@individual.net>

ChicksHateMe wrote:
> I consider myself still a newbie so I am looking for help, not flaming.

That introduction is in itself a reason for flaming, but I'll pass.

> I have Sometimes taken modules and just simplified them and used them
> as an "include" instead of loading them.

Exactly what do you mean by that? You'd better let us know how you do 
it, or else it's difficult to comment on your specific questions.

> Again, the reason I ask, Is I LOVE perl and want to learn more, but in
> some cases it is REALLY difficult to get the hosts to load Perl
> modules, packages, bundles, etc...

Note that there are ways to install modules in an own library for Perl 
modules. If you have shell access, you may be able to do it 'the right 
way', while you otherwise can at least copy the .pm files of pure Perl 
modules into the library.

Not to mention the option to change hosting provider, of course. :)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Thu, 20 Jan 2005 10:44:06 -0500
From: Chris Mattern <matternc@comcast.net>
Subject: Re: Question? Alternative to loading modules!!!
Message-Id: <ooednSQNwtRbTHLcRVn-pA@comcast.com>

ChicksHateMe wrote:

> I consider myself still a newbie so I am looking for help, not flaming.
> Thanks in advance.
> 
> I have written a few Perl programs, and I enjoy it. I like it more than
> doing stuff in PHP. I don't want to start the whole PHP - Perl thing,
> but I like the power and ease of Perl, and who's faster doesn't matter
> to me.
> 
> The one thing I dislike is trying to deal with website/hosts and
> getting the modules installed that I need. It's a PITA.
> 
> I have Sometimes taken modules and just simplified them and used them
> as an "include" instead of loading them. For some simple ones this
> seems to work fine.

Um, wha?  If you can do this, you can install your own copies of
those modules properly.  Read up on installing modules in your
home directory.

<long series of questions about this odd workaround snipped>

My advice is to simply install the modules to your home directory
and use "use".

-- 
             Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"


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

Date: Thu, 20 Jan 2005 15:54:48 GMT
From: peter@PSDT.com (Peter Scott)
Subject: Re: Question? Alternative to loading modules!!!
Message-Id: <cvQHd.130375$6l.19536@pd7tw2no>

In article <1106230069.951809.280200@c13g2000cwb.googlegroups.com>,
 "ChicksHateMe" <chicks_hate_me@hotmail.com> writes:
>The one thing I dislike is trying to deal with website/hosts and
>getting the modules installed that I need. It's a PITA.

You don't have to get the site admin to install modules for you.
Do 'perldoc ExtUtils::MakeMaker' and see how to use PREFIX on
the 'perl Makefile.PL' step.  Then do 'perldoc CPAN' to see how
to make a MyConfig.pm.  Putting the two together means you can
install modules in your local filespace as simply as
'perl -MCPAN -e "install Foo::Bar"'.  Then add the appropriate
'use lib' to your programs.

>I have Sometimes taken modules and just simplified them and used them
>as an "include" instead of loading them. For some simple ones this
>seems to work fine.

Whatever you mean by "include", it is not a common Perl term.
I suspect you mean you copy a .pm file to the current directory.
This strategy will fail when dealing with a module that spans
multiple files.

>1. Where I am doing this for my own specific sites, what I am wondering
>is, if there are any issues I may run into?

You'll have a next to impossible time dealing with modules that 
incorporate binary dependencies.

>2. Would installed modules run faster than using the modules as a
>simple include where possible and needed??

No.

-- 
Peter Scott
http://www.perldebugged.com/
*** NEW *** http://www.perlmedic.com/


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

Date: Thu, 20 Jan 2005 07:00:56 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: regular expressions
Message-Id: <slrncuvas8.7uj.tadmc@magna.augustmail.com>

Sokar <jmccloughlin@[> wrote:

> I have the string
> 
> $variable = ",1,2,3,4,5";
> 
> I was wondering if anyone knew a regular expression that would remove the
> first "," so that I would have
> 
> $variable = "1,2,3,4,5"


Show us the code you have so far, and we will help you fix it.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 20 Jan 2005 07:03:06 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: regular expressions
Message-Id: <slrncuvb0a.7uj.tadmc@magna.augustmail.com>

Peroli <peroli@gmail.com> wrote:

> $varaible =~ s/^,+//g;


The s///g option is superfluous since the pattern is anchored.

Are you expecting that there is more than one "beginning of string"?


(that is a strange way of spelling "variable"...)


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 20 Jan 2005 10:15:42 -0500
From: Ken <x3v0-usenet@yahoo.com>
Subject: Re: The world's shortest 'Hello World!' program: a proposal
Message-Id: <yWPHd.2512$dm5.313@fe37.usenetserver.com>

Yes, I did need to quote the whole message. At least I didn't top post.

Ken

Michele Dondi wrote:
> On Tue, 18 Jan 2005 22:28:23 -0000, "Leonard Challis"
> <perl@lennychallis.co.uk> wrote:
> 
> 
>>"Ken" <x3v0-usenet@yahoo.com> wrote in message 
> 
> [snip 47 more lines]
> 
> 
>>>lol (this IS a joke, right?)
> 
> 
>>Lol, I can't tell if it is or not, but it would be quit funny :D
> 
> 
> And did you really need to include a full quote of a message already
> including a quote of the whole OP's immortal prose, just to add this
> pearl of wisdom?!?
> 
> 
> Michele



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

Date: Thu, 20 Jan 2005 16:14:55 +0100
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: The world's shortest 'Hello World!' program: a proposal
Message-Id: <pan.2005.01.20.15.14.55.649842@dunkelheit.at>

Ken wrote:

> Yes, I did need to quote the whole message.

Why?

-- 
http://www.dunkelheit.at/
That is not dead, which can eternal lie,
and with strange aeons even death may die.
		-- H.P. Lovecraft



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

Date: Thu, 20 Jan 2005 12:43:44 -0000
From: "Leonard Challis" <perl@lennychallis.co.uk>
Subject: Re: Whats the variable holding the dir seperator?
Message-Id: <cso946$jf7$1@news6.svr.pol.co.uk>


"Chris Mattern"  wrote

> Apparently your definition of "platform-independent" is "It works in
> Windows/DOS, and it works in Unix/Unix-like clones.  Isn't that the
> entire universe?"  (And I might point out that "/" works just fine
> on ALL such platforms, outside of the Windows/DOS command interpreter)

I guess I was being a bit byast :D
Thanks for your pointers guys

Leonard 




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

Date: Thu, 20 Jan 2005 07:04:30 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Whats the variable holding the dir seperator?
Message-Id: <slrncuvb2u.7uj.tadmc@magna.augustmail.com>

ipellew@pipemedia.co.uk <ipellew@pipemedia.co.uk> wrote:

> Is there a variable that holds the dot character?


No, but it is easy to create one:

   my $var = '.';


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 20 Jan 2005 07:19:01 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Whats the variable holding the dir seperator?
Message-Id: <slrncuvbu5.7uj.tadmc@magna.augustmail.com>

Leonard Challis <perl@lennychallis.co.uk> wrote:
> "Big and Blue" <No_4@dsl.pipex.com> wrote
> 
>>    In what way would it make your life easier?
> 
> Well, instead of using something like the File::Spec module

> Just a thought.


You put things in the perl core that must be in the perl core.

If it can be done in a module, then it does not need to bloat the core.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 20 Jan 2005 07:20:46 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Whats the variable holding the dir seperator?
Message-Id: <slrncuvc1e.7uj.tadmc@magna.augustmail.com>

Leonard Challis <perl@lennychallis.co.uk> wrote:


> Another thing to note it speed.


   "premature optimization is the root of all evil"


Have you been programming for some time?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 20 Jan 2005 14:20:26 GMT
From: gargoyle <gargoyle@no.spam>
Subject: Re: Whats the variable holding the dir seperator?
Message-Id: <K6PHd.4838$8W4.2106@bignews6.bellsouth.net>

On 2005-01-20, Leonard Challis <perl@lennychallis.co.uk> wrote:
> Clearer to a certain extent. For the Perl newbie, playing with modules is a 
> little daunting although I do agree with you.

The good thing is File::Spec is a "standard" module, so there's no need
to go download it from CPAN, run make, etc.

> Another thing to note it speed. How much time would you save having the 
> variable built in insted of using a module?

There's always overhead for method/function calls, but you'll only
notice if the code is in a really, really tight loop.  Of course that
applies to your own functions too!  At that point you have to inline
code in the loop, and make sure you're using the best possible algorighm
for the job.  I've got some code like that, but it only operates on data
strutures in memory, and makes an occasional system call, but no disk
access.  The moment you're doing disk or network I/O, the overhead of
calling File::Spec::catfile & friends will be insignificant.

And usually somebody calls catfile before going to access a file... ;)


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V10 Issue 7677
***************************************


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