[19967] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2162 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 20 09:05:52 2001

Date: Tue, 20 Nov 2001 06:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1006265110-v10-i2162@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 20 Nov 2001     Volume: 10 Number: 2162

Today's topics:
    Re: An optional output filter/pager module? <mgjv@tradingpost.com.au>
    Re: Currency formatting <ron@savage.net.au>
    Re: Determine a module's version <heiko.rau@spamshield.t-systems.de>
    Re: Determine a module's version <heiko.rau@spamshield.t-systems.de>
    Re: Determine a module's version (Anno Siegel)
    Re: Determine a module's version <heiko.rau@spamshield.t-systems.de>
    Re: Error Fetching Long Column Using Perl DBI (Philip Lees)
        fork() help needed (Jere Eerola)
        Frames and Headers <generalbretch@hotmail.com>
        Generating graphs using Perl for Windows <andrew_harton@agilent.com>
    Re: Generating graphs using Perl for Windows <simon.oliver@umist.ac.uk>
    Re: How do I make several modules reference variables f (Anno Siegel)
    Re: How do I make several modules reference variables f (Sara)
    Re: Just wondering ... why is there no "since" informat <edgue@web.de>
    Re: Just wondering ... why is there no "since" informat <bernard.el-hagin@lido-tech.net>
    Re: Just wondering ... why is there no "since" informat (Logan Shaw)
    Re: Just wondering ... why is there no "since" informat <mgjv@tradingpost.com.au>
    Re: Just wondering ... why is there no "since" informat <edgue@web.de>
        Just wondering ... why is there no "since" information  <edgue@web.de>
    Re: Just wondering ... why is there no "since" informat <bernard.el-hagin@lido-tech.net>
    Re: Newbie module problem (Perry Wheeler)
        Newbie question regarding date manipulation <edevries@footlocker.com>
    Re: OT:  New Perl Journal (Sara)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 20 Nov 2001 22:36:48 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: An optional output filter/pager module?
Message-Id: <slrn9vkg2g.mfo.mgjv@martien.heliotrope.home>

On 19 Nov 2001 18:49:25 GMT,
	Steve Simmons <scs@di.org> wrote:
> I've run thru CPAN and the FAQs and the cookbook and not found it.
> Clearly I'm missing something...  :-)
> 
> I'm looking for a module or hack that will let me push a pager onto
> a data stream (STDOUT, usually) that will let the stock print/printf
> functions continue to work as they had previously.  Thus a code fragment
> like

open(STDOUT, "| $ENV{PAGER}") or die "Cannot fork '$ENV{PAGER}': $!\n";
END { close(STDOUT) or die "Couldn't close pipe: $!" }

# Do your stuff

The close is important, since that is where your program will do the
wait for the child process. I have the feeling that perl _should_ handle
that correctly even if the close isn't explicit in the program, but it
doesn't seem to.

More elegant solutions could use a tied filehandle.

> And so on.  Any ideas?  Remember, the two points here are *optional*
> (which lets out IO::Page), and properly works with STDOUT.

Is there something in IO::Page which stops you from loading it at
runtime? Instead of a 'use IO::Page', you could do a 'require IO::Page'.
At least, I assume you could. I've never felt the urge to download a
module for something as trivial as this.

Martien
-- 
                        | 
Martien Verbruggen      | Freudian slip: when you say one thing but
                        | mean your mother.
                        | 


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

Date: Tue, 20 Nov 2001 20:11:16 +1100
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: Currency formatting
Message-Id: <87pK7.1772$li3.58925@ozemail.com.au>

Math::Currency

--
Cheers
Ron Savage
ron@savage.net.au
http://savage.net.au/index.html
"Mike Pierotti" <mrp@hafatel.com> wrote in message news:9tcnnb019ea@enews1.newsguy.com...
> I need to convert format from text that is stored as a decimal to US
> Currency and am not really sure how to do it.
> Are there any existing perl modules designed to do this ?
>
> TYIA
>
>
>
>




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

Date: Tue, 20 Nov 2001 12:43:52 +0100
From: "Heiko Rau" <heiko.rau@spamshield.t-systems.de>
Subject: Re: Determine a module's version
Message-Id: <9tdfeh$h74$1@news.sns-felb.debis.de>

> Are you sure module does contain $VERSION? Show sources if it is
> possible.
>
Yes, I am sure. Here's the code:

---------begin new module-----------
package Tk::ProgressBar;

use vars qw($VERSION);
$VERSION = '3.014'; # $Id: //depot/Tk8/Tk/ProgressBar.pm#14 $
<...further code...>
---------end new module-----------

---------begin old module-----------
package Tk::ProgressBar;

use Tk;
use Tk::Canvas;
use Carp;
use strict;

use vars qw(@ISA $VERSION);

@ISA = qw(Tk::Derived Tk::Canvas);
$VERSION = "1.04";
<...further code...>
---------end module-----------


Both modules do have a variable $VERSION and both modules make use of this
"use vars qw($VERSION)". Is it possible, that "use vars" makes the variable
inaccessible from outside the file?

Wondering

Heiko




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

Date: Tue, 20 Nov 2001 13:04:21 +0100
From: "Heiko Rau" <heiko.rau@spamshield.t-systems.de>
Subject: Re: Determine a module's version
Message-Id: <9tdgku$hjk$1@news.sns-felb.debis.de>

>
> Both modules do have a variable $VERSION and both modules make use of this
> "use vars qw($VERSION)". Is it possible, that "use vars" makes the
variable
> inaccessible from outside the file?
>
I just read perlmod, where it is clearly mentioned, that, even though
$VERSION is not exported, it should still be accessible as
"$Module::VERSION".

I use perl 5.005_03 on PA-RISC1.1.

Still more wondering

Heiko




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

Date: 20 Nov 2001 12:14:03 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Determine a module's version
Message-Id: <9tdheb$6nm$2@mamenchi.zrz.TU-Berlin.DE>

According to Heiko Rau <heiko.rau@spamshield.t-systems.de>:
> > Are you sure module does contain $VERSION? Show sources if it is
> > possible.
> >
> Yes, I am sure. Here's the code:
> 
> ---------begin new module-----------
> package Tk::ProgressBar;
> 
> use vars qw($VERSION);
> $VERSION = '3.014'; # $Id: //depot/Tk8/Tk/ProgressBar.pm#14 $
> <...further code...>
> ---------end new module-----------

[...]
 
> Both modules do have a variable $VERSION and both modules make use of this
> "use vars qw($VERSION)". Is it possible, that "use vars" makes the variable
> inaccessible from outside the file?

Not at all.

    perl -MTk::ProgressBar -le 'print $Tk::ProgressBar::VERSION'
    3.014

Works fine, too.  What have you been trying?

Anno


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

Date: Tue, 20 Nov 2001 14:23:11 +0100
From: "Heiko Rau" <heiko.rau@spamshield.t-systems.de>
Subject: Re: Determine a module's version
Message-Id: <9tdl8s$j79$1@news.sns-felb.debis.de>

>     perl -MTk::ProgressBar -le 'print $Tk::ProgressBar::VERSION'
>     3.014
>
> Works fine, too.  What have you been trying?
>
Oops! I'd tried just "$ProgressBar::VERSION" not
"$Tk::ProgressBar::VERSION". How embarrassing.

But thanks anyway.

Heiko




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

Date: Tue, 20 Nov 2001 08:27:04 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: Error Fetching Long Column Using Perl DBI
Message-Id: <3bfa139a.64770665@news.grnet.gr>

On Mon, 19 Nov 2001 13:54:11 -0700, Ron Reidy <rereidy@indra.com>
wrote:

>Arun Solleti wrote:
>> 
>> Hi
>> 
>> Can some please help me, how to fetch the value of Long Column using
>> Perl DBI.
>> --------------
>> $query = "select long_value from longtable" ;
>> $sth = $dbh->prepare($query, ) || die $dbh->errstr ;
>> $sth->execute() ;
>> 
>> Error
>> ---------
>> DBD::Oracle::st fetchrow_array failed: ORA-01406: fetched column value
>> was truncated (DBD: ofetch error on field 1 (of 1), ora_type 8,
>> LongReadLen too small and/or LongTruncOk not set) at test.pl line 23.
>> 
>> Thanks
>> Arun
>Did you read the DBI docs?  Look for LongTruncOK.

And LongReadLen, unsurprisingly. I hit this just yesterday. Set
LongReadLen to a big enough value to buffer your data.

Phil
-- 
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer


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

Date: Tue, 20 Nov 2001 13:55:29 GMT
From: jee@gandalf.moon.org (Jere Eerola)
Subject: fork() help needed
Message-Id: <slrn9vko6f.qt.jee@rltrekary.radiolinja.fi>

Hi all !

I'm trying to execute five processes at time like this:

bash$ while[ 1 ] ; do run.sh ; done &

and running five of these in background. What I would really
like to do is write perl program which checks if there is 
already five processes running and if not starts another one.

I already wrote program that starts 5 processes but can't get any
further. Any advise or point to documentation or examples is very
much appreciated. 

Thank you in advance.

--
Jere Eerola


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

Date: Tue, 20 Nov 2001 11:24:11 -0000
From: "Robin Charisse" <generalbretch@hotmail.com>
Subject: Frames and Headers
Message-Id: <9tdep7$f5a$1@suaar1aa.prod.compuserve.com>

I am trying to write a script that displays a login form and calls itself
when submit is pressed. When the login information has been entered
correctly I would like a static html file to be displayed in a different
frame in the frameset. I have tried various variations of the following code
with no joy(the page always appears in the same frame as the form). Is this
even possible?

print "Window-target: MenuBar\nLocation: game_nav.html\n\n";




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

Date: Tue, 20 Nov 2001 12:20:10 -0000
From: "Andrew Harton" <andrew_harton@agilent.com>
Subject: Generating graphs using Perl for Windows
Message-Id: <1006258815.413972@cswreg.cos.agilent.com>

Hi,

I have a program that I wrote some time ago which takes a bunch of report
files and displays summary information in html format.  I have been asked if
it would be possible to include some graphs in this summary.  What would be
the best way of doing this?  I've checked on CPAN for any modules associated
with images and/or graphs, and any I found seemed to be interfaces to unix
based graphics libraries.

Bar and/or line graphs are all I'd need.  Has anyone done anything like this
using ActivePerl on a Windows platform?

Thanks,
Andrew




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

Date: Tue, 20 Nov 2001 13:39:08 +0000
From: Simon Oliver <simon.oliver@umist.ac.uk>
To: Andrew Harton <andrew_harton@agilent.com>
Subject: Re: Generating graphs using Perl for Windows
Message-Id: <3BFA5CFC.4BF0104B@umist.ac.uk>

Try GD and GD::Graph

Here's an example:

use GD::Graph::bars;
my @data = ( [('a'..'j')], [(1..10)] );
my $graph = GD::Graph::bars->new(200, 200);
my $gd = $graph->plot(\@data);
binmode STDOUT;
print "Content-type: image/jpeg\n\n";
print $gd->jpeg(100);

Save this as /cgi-bin/graph.pl and then add this to your html:

<IMG src="/cgi-bin/graph.pl">

--
  Simon Oliver

Andrew Harton wrote:
> 
> Hi,
> 
> I have a program that I wrote some time ago which takes a bunch of report
> files and displays summary information in html format.  I have been asked if
> it would be possible to include some graphs in this summary.  What would be
> the best way of doing this?  I've checked on CPAN for any modules associated
> with images and/or graphs, and any I found seemed to be interfaces to unix
> based graphics libraries.
> 
> Bar and/or line graphs are all I'd need.  Has anyone done anything like this
> using ActivePerl on a Windows platform?
> 
> Thanks,
> Andrew


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

Date: 20 Nov 2001 10:14:00 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How do I make several modules reference variables from one file?
Message-Id: <9tdad8$6nm$1@mamenchi.zrz.TU-Berlin.DE>

According to john  <jazz450@hotmail.com>:
> Hi All,
>     I'm new at perl, it's fun but there are areas I don't know well
> yet.  I inherited a previous programmer's code used to generate a bunch
> of web pages.  It uses TMPL and modules referencing modules all over the
> place.  I though variables were global but it seems that variables in
> one module are not referenced across modules.  I want to a config file
> that all the various modules reference.  I knows ways to do includes
> with ASP and Javascript but not yet with perl. I'm sure perl does it.
> I'm at loss to get several modules in several directories to reference
> values in a single file.
> 
> Can you suggest anything?

Write a module that exports the configuration variables (or a hash
that contains them).  See perldoc Exporter.

Anno


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

Date: 20 Nov 2001 05:06:40 -0800
From: genericax@hotmail.com (Sara)
Subject: Re: How do I make several modules reference variables from one file?
Message-Id: <776e0325.0111200506.3ef8e9d8@posting.google.com>

john <jazz450@hotmail.com> wrote in message news:<EDE4D86B891C469E.AE7C209877C335F1.73BC73BDB3DA7A13@lp.airnews.net>...
> Hi All,
>     I'm new at perl, it's fun but there are areas I don't know well
> yet.  I inherited a previous programmer's code used to generate a bunch
> of web pages.  It uses TMPL and modules referencing modules all over the
> place.  I though variables were global but it seems that variables in
> one module are not referenced across modules.  I want to a config file
> that all the various modules reference.  I knows ways to do includes
> with ASP and Javascript but not yet with perl. I'm sure perl does it.
> I'm at loss to get several modules in several directories to reference
> values in a single file.
> 
> Can you suggest anything?
> 
> Thanks.

perldoc -q scope is a good place to start perhaps.Remember in the
OO-sense, a package is a class, and variables in the package are not
public. However, that doesn't mean they are inaccessible- you can
access them by qualifying them with a package name, such as

  my $x=otherpackage::$y;

presuming that you've properly defined $y in package otherpackage. To
me that's sort of backwards, since the current package can in-effect
"drill-down" into the  other packages private data. To me the other
package should have control over who see's its data. However, I like
the implementation because it makes it very easy to discover the
source of data (in the case above, $y "obviously" comes from class
"otherpackage", there is no ambiguity. That's good. Even very good.
I'm anything but an OO proponent, so the Perl approach works and makes
sense to me.

One note that it took me ahwile to realize- the "default class" is
main, so

  $::x

is really the same thing as 

  $main::x;



Hope this might have helped a bit..

-G


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

Date: Tue, 20 Nov 2001 13:03:04 +0100
From: Edwin =?iso-8859-1?Q?G=FCnthner?= <edgue@web.de>
Subject: Re: Just wondering ... why is there no "since" information in the man   pages?
Message-Id: <3BFA4678.C8E60552@web.de>

Martien Verbruggen wrote:

> While I can see how it could be useful to have some of this history in
> the documentation, I am afraid it would make the documentation also
> quite messy. Many features/functions/syntactical sugar crept in in
> various versions and subversions of Perl. 

Isnt that a very good argument FOR providing this information in ONE
place? What is more complicated:
* to develop a feature and document its history through time (in 
  the place where the feature itself is documented) OR
* to create this information AFTERWARDS - when the whole stuff is
  already messed up?

Of course, when you are shipping a real world software and you want
to make sure that it runs on platform X version Y - then you need 
to test your code in that very environment. 

But you are right; disk space is cheap nowadays; and back
when I was full-time Java developping I also had a version of
each JDK (from 1.1 to 1.4) on my machine ... including dozends 
and dozends MB of HTML documentation.

regards,
eg


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

Date: 20 Nov 2001 09:29:43 GMT
From: Bernard El-Hagin <bernard.el-hagin@lido-tech.net>
Subject: Re: Just wondering ... why is there no "since" information in the man  pages?
Message-Id: <slrn9vkbjf.n27.bernard.el-hagin@gdndev25.lido-tech>

On Tue, 20 Nov 2001 10:22:55 +0100, Edwin Günthner <edgue@web.de> wrote:
> 
> 
> Bernard El-Hagin wrote:
> 
>> With each new distribution of Perl there comes a document which
>> outlines all of the new stuff since the last version. You can access
>> this document using the perldoc function:
> 
> Useful, but not the same: when I program in Java, it is normally
> enought to check out the HTML documentation for a certain 
> class if I want to know, if it is available for a certain JDK version.
> Thats better than digging through history documents ...


Well, if all you want to find out is whether a certain function
is available in the current version or not why not just try using
it? What a concept. :-)


Cheers,
Bernard


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

Date: 20 Nov 2001 04:26:37 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: Just wondering ... why is there no "since" information in the man  pages?
Message-Id: <9tdb4t$2r1$1@starbuck.cs.utexas.edu>

In article <slrn9vkbjf.n27.bernard.el-hagin@gdndev25.lido-tech>,
Bernard El-Hagin  <bernard.el-hagin@lido-tech.net> wrote:
>On Tue, 20 Nov 2001 10:22:55 +0100, Edwin Günthner <edgue@web.de> wrote:
>> Useful, but not the same: when I program in Java, it is normally
>> enought to check out the HTML documentation for a certain 
>> class if I want to know, if it is available for a certain JDK version.
>> Thats better than digging through history documents ...
>
>Well, if all you want to find out is whether a certain function
>is available in the current version or not why not just try using
>it? What a concept. :-)

What if your goal is to make it run on all versions of Perl later than
some given version (say 5.004)?  Then you can develop under the latest
version and still have some hope that your code won't have to be
modified to work on previous versions.

This is helpful if you want to distribute your code widely, so that it
can run on machines where you can't control whether the latest version
of Perl is installed.

  - Logan
-- 
"In order to be prepared to hope in what does not deceive,
 we must first lose hope in everything that deceives."

                                          Georges Bernanos


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

Date: Tue, 20 Nov 2001 22:43:35 +1100
From: Martien Verbruggen <mgjv@tradingpost.com.au>
Subject: Re: Just wondering ... why is there no "since" information in the man  pages?
Message-Id: <slrn9vkgf7.mfo.mgjv@martien.heliotrope.home>

On 20 Nov 2001 04:26:37 -0600,
	Logan Shaw <logan@cs.utexas.edu> wrote:
> In article <slrn9vkbjf.n27.bernard.el-hagin@gdndev25.lido-tech>,
> Bernard El-Hagin  <bernard.el-hagin@lido-tech.net> wrote:
>>On Tue, 20 Nov 2001 10:22:55 +0100, Edwin Günthner <edgue@web.de> wrote:
>>> Useful, but not the same: when I program in Java, it is normally
>>> enought to check out the HTML documentation for a certain 
>>> class if I want to know, if it is available for a certain JDK version.
>>> Thats better than digging through history documents ...
>>
>>Well, if all you want to find out is whether a certain function
>>is available in the current version or not why not just try using
>>it? What a concept. :-)
> 
> What if your goal is to make it run on all versions of Perl later than
> some given version (say 5.004)?  Then you can develop under the latest
> version and still have some hope that your code won't have to be
> modified to work on previous versions.

I keep various older (and development) installations of Perl around,
just so I have access to the documentation, and so I can test certain
snippets and constructions now and again. When I need to know if
something worked under an old version of Perl, I test it, or I check its
documentation.

I can spare the 15 MB per Perl version in /opt/. If you need to write code
which is backward compatible, I don't think decent historical
information in the documentation can beat a test against a running perl. 

While I can see how it could be useful to have some of this history in
the documentation, I am afraid it would make the documentation also
quite messy. Many features/functions/syntactical sugar crept in in
various versions and subversions of Perl. And when do you clean it out?
Or do you think that all history since Perl 1 should appear in te
documentation? Or since perl3? 4? 5.004? 5.6.0? 

> This is helpful if you want to distribute your code widely, so that it
> can run on machines where you can't control whether the latest version
> of Perl is installed.

Well, if you want that, you should test it on a running system anyway,
shouldn't you?

Martien
-- 
                        | 
Martien Verbruggen      | You can't have everything, where would you
                        | put it?
                        | 


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

Date: Tue, 20 Nov 2001 10:22:55 +0100
From: Edwin =?iso-8859-1?Q?G=FCnthner?= <edgue@web.de>
Subject: Re: Just wondering ... why is there no "since" information in the man  pages?
Message-Id: <3BFA20EF.CC917FD0@web.de>



Bernard El-Hagin wrote:

> With each new distribution of Perl there comes a document which
> outlines all of the new stuff since the last version. You can access
> this document using the perldoc function:

Useful, but not the same: when I program in Java, it is normally
enought to check out the HTML documentation for a certain 
class if I want to know, if it is available for a certain JDK version.
Thats better than digging through history documents ...


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

Date: Tue, 20 Nov 2001 09:52:32 +0100
From: Edwin =?iso-8859-1?Q?G=FCnthner?= <edgue@web.de>
Subject: Just wondering ... why is there no "since" information in the man pages?
Message-Id: <3BFA19D0.9AFE759D@web.de>

Hi there,

I have to use Perl 5.0553 for some reasons ... and I just
found out that this version of Perl doesnt now "our". I had
a look into the Perl 5.6 docs and was then surprised to NOT
see an information like "'our' is avialble since Perl Version 5.6"
or something similar.

I am simply wondering: why is this so? Wouldnt it be very very
useful to include such information whenever a new func, op,
whatever is added to Perl? 

I would even say that it is a crucial requirment within 
the documentation of a feature ... what do you think?

regards,
eg


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

Date: 20 Nov 2001 08:56:05 GMT
From: Bernard El-Hagin <bernard.el-hagin@lido-tech.net>
Subject: Re: Just wondering ... why is there no "since" information in the man pages?
Message-Id: <slrn9vk9kd.n27.bernard.el-hagin@gdndev25.lido-tech>

On Tue, 20 Nov 2001 09:52:32 +0100, Edwin Günthner <edgue@web.de> wrote:
> Hi there,
> 
> I have to use Perl 5.0553 for some reasons ... and I just
> found out that this version of Perl doesnt now "our". I had
> a look into the Perl 5.6 docs and was then surprised to NOT
> see an information like "'our' is avialble since Perl Version 5.6"
> or something similar.
> 
> I am simply wondering: why is this so? Wouldnt it be very very
> useful to include such information whenever a new func, op,
> whatever is added to Perl? 
> 
> I would even say that it is a crucial requirment within 
> the documentation of a feature ... what do you think?


With each new distribution of Perl there comes a document which
outlines all of the new stuff since the last version. You can access
this document using the perldoc function:


perldoc perldelta


Cheers,
Bernard


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

Date: 20 Nov 2001 03:09:31 -0800
From: pwheeler@kentports.org (Perry Wheeler)
Subject: Re: Newbie module problem
Message-Id: <ab5c4b00.0111200309.5e8b41e1@posting.google.com>

"Tassilo v. Parseval" <Tassilo.Parseval@post.rwth-aachen.de> wrote in message news:<9tbn2v$udb$01$1@news.t-online.com>...
> > you can find out what the path is (@INC) by wrting a script to print
> > it and then have the job scheduler run it to see how it differs.
> 
> Typing 'perl -V' in a shell would be the more direct approach to find
> out what @INC contains.

Please bear with me here - it's a steep learning curve for a vb
programmer (there, I've admitted it)!

OK I understand that it's a path problem and you're right - the @INC I
get as a scheduled job is totally different to the one I get when
running it in a shell it clearly refers back to a much earlier perl
version.

The only module called directly from my script is finance::quote,
looking at quote.pm I can see that this calls further modules under
HTML:: HTTP:: and LWP::

All of these modules live under /usr/local/lib/perl5/site_perl/5.6.1
which exists in the shell @INC but not in the scheduled one. So the
script now includes the line -

 use lib '/usr/local/lib/perl5/site_perl/5.6.1';

This works for the call to finance::quote but falls over on the first
call that that module makes to one of the others (in this case
HTML::parser). Is this a scoping issue? Does the use lib in my script
not get passed to the quote module?

If this is the case surely it's going to be neater for me to change
the @INC globally to reflect the one which works perfectly in a shell?

If that makes sense - where is @INC set?

Of course this all down to one of the disadvantages of Linux, the
server that this is running on has been going for over two years now
with only the occasional restart, if this had been one of my MS boxes
I'd have probably had to reinstall the OS 3 or 4 times by now so
wouldn't have archaic settings to worry about! <G>

Cheers

Perry W


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

Date: Tue, 20 Nov 2001 14:47:29 +0100
From: "Eduard de Vries" <edevries@footlocker.com>
Subject: Newbie question regarding date manipulation
Message-Id: <tvknnpsbj0gm3b@corp.supernews.com>

Hi all,

I am a beginner, so excuse me if my question is simple.
I have attached my script.

What I do is generate a text file which copies various files (when run as
the command file

for an FTP-session),
the names of the files are FOOT and then yesterdays date YYYYMMDD, that
works.
And on monday I download the last three days, as in today -1, -2 and -3.

This works like a charm, but on the first (and second, third if it is a
monday) it obviously

goes wrong.

Has anyone ever written a sequence such as if day =1 then $datum-1 = last
day of the month.
Last day of the month is, if month is 10 = 31, if month is 11 = 30, if month
is 12 =31, etc.

Can anyone provide an example or point me to the right track?

Thanks in advance,

Eduard

(Monday) script:

# Declares day, month and year as a valuable
my($day, $month, $year) = (localtime)[3, 4, 5];
# Declares that month is a 2 digit number, and year is a 4 digit number,
otherways the year

2001 is 101 in Perl
$month++; $year += 1900;
# Sets dateum as a string, YYYYMMDD
my $datum = sprintf '%04d%02d%02d', $year, $month, $day;
# Subtracts 1 from the date to get yesterdays file
$datum--;
# Tells the script to store the lines below in the TFILEftp.txt file
$TFILE="D:/download/monTFILEftp.txt";
# $TFILE="C:/perl/scripts/TFILEftp.txt";
# Opens the TFILE text file or gives an error
open TFILE, ">$TFILE" or die "Cannot open $TFILE for write :$!";
# Opens the part which writes to the file
{
# Puts the command to open the connection to the ftp server in the text file
        print TFILE "open 127.0.0.1\n";
# Puts the userid and password in the text file
        print TFILE "user user secret\n";
# Puts the line to change the local directory on the PC which downloads in
the text file
        print TFILE "lcd d:\\download\\temp\n";
# Puts the line in the text file which changes the directory on the FTP
server
        print TFILE "cd outgoing\n";
# Puts the line in the text file to download the file FOOT504YYYYMMDD.csv
        print TFILE "get FOOT504$datum.csv\n";
# Puts the line in the text file to download the file FOOT339YYYYMMDD.csv
        print TFILE "get FOOT339$datum.csv\n";
# Deducts one from date of yesterday
$datum--;
# Puts the line in the text file to download the file FOOT504YYYYMMDD.csv
        print TFILE "get FOOT504$datum.csv\n";
# Puts the line in the text file to download the file FOOT339YYYYMMDD.csv
        print TFILE "get FOOT339$datum.csv\n";
# Deducts one from date of the day before yesterday
$datum--;
# Puts the line in the text file to download the file FOOT504YYYYMMDD.csv
        print TFILE "get FOOT504$datum.csv\n";
# Puts the line in the text file to download the file FOOT339YYYYMMDD.csv
        print TFILE "get FOOT339$datum.csv\n";

# Puts the line in the text file to close the connection
        print TFILE "quit\n";
# Closes the parts which writes to the text file TFILEftp.txt
}
# Closes the file and variable
close(TFILE);






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

Date: 20 Nov 2001 04:55:17 -0800
From: genericax@hotmail.com (Sara)
Subject: Re: OT:  New Perl Journal
Message-Id: <776e0325.0111200455.2d349588@posting.google.com>

Erich Markert <emarkert@netscape.net> wrote in message news:<3BF9C776.2080207@netscape.net>...
> I know I'm probably going to get flamed for this, but it's really not 
> meant to be a mean spirited post...
> 
> I just got the latest edition of the Perl Journal...
> 
> This is in no means a slight on the hard work that the authors, etc. put 
> into this journal - because I've always enjoyed the journal and found it 
> to be an extremely useful resource - but I have to say that I was less 
> then impressed with the latest issue.
> 
> I've been buying the Perl Journal for a number of years now and always 
> looked forward to the next version.  Past issues ALWAYS had tons of 
> content but the latest is reduced to just a "special" section in Sys 
> Admin - it's not even a separate mag anymore.
> 
> Is this what we are to continue to expect from TPJ?


Hi- I agree not much content there. At least someone is trying..

As for complaining to the publisher, let's *hope* you just did. Any
publisher of a perl-centric mag like that better be scanning CLPM for
TPJ-related postings.

-G


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

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.  

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


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