[13378] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 788 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Sep 14 01:17:33 1999

Date: Mon, 13 Sep 1999 22:10:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 13 Sep 1999     Volume: 9 Number: 788

Today's topics:
    Re: installing perl modules (Kragen Sitaker)
    Re: installing perl modules (Abigail)
    Re: Is anyone capable of explaining this?? (Larry Rosler)
    Re: Need date/time validation on user input. (Abigail)
    Re: Need help with some pattern matching... (Kragen Sitaker)
    Re: perl -w strangeness (Kragen Sitaker)
    Re: Perl Y2k (Abigail)
    Re: Question about split <uri@sysarch.com>
        Question with 'require' and 'import' (Greg Boug)
        Trouble with perl5.004_04 on RH Linux (Danny Aldham)
        Usefulness of CGI.pm (Was Re: UNCRAP project proposal) <jeff@vpservices.com>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Tue, 14 Sep 1999 03:07:07 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: installing perl modules
Message-Id: <vZiD3.9401$N77.721551@typ11.nn.bcandid.com>

In article <37DD664C.9AEA4171@1185design.com>,
mikej  <mikej@1185design.com> wrote:
>Im trying to install some perl modules, and I got the perl Makefile.PL
>command to work by entering the full path to perl (BTW how do I set it
>up so I can just type perl and not the whole path, is there some config
>file in Apache?)

Apache?  What does Apache have to do with it?

On Unix, the environment variable PATH should contain the directory
perl is in.

> but now I try to do the make test and make install
>commands to finish installing the module but it gives me this error:
>
>make: not found

 . . . make isn't in your PATH either.  Put 'er there and fire 'er up.

>do I have to set up a full path to this or something? Shouldnt it just
>work like a normal unix command?

It should just work, yes.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 13 Sep 1999 23:51:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: installing perl modules
Message-Id: <slrn7trl79.f00.abigail@alexandra.delanet.com>

mikej (mikej@1185design.com) wrote on MMCCIV September MCMXCIII in
<URL:news:37DD664C.9AEA4171@1185design.com>:
{} 
{} Im trying to install some perl modules, and I got the perl Makefile.PL
{} command to work by entering the full path to perl (BTW how do I set it
{} up so I can just type perl and not the whole path, is there some config
{} file in Apache?) but now I try to do the make test and make install
{} commands to finish installing the module but it gives me this error:
{} 
{} make: not found
{} 
{} do I have to set up a full path to this or something? Shouldnt it just
{} work like a normal unix command? Thanks for any help.


That's a shell problem, not a Perl one. Fix your PATH environment
variable. Your system administrator should tell you how to do it;
as not only is the syntax shell dependent, the location of perl 
and make is system dependent.



Abigail
-- 
package Z;use overload'""'=>sub{$b++?Hacker:Another};
sub TIESCALAR{bless\my$y=>Z}sub FETCH{$a++?Perl:Just}
$,=$";my$x=tie+my$y=>Z;print$y,$x,$y,$x,"\n";#Abigail


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


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

Date: Mon, 13 Sep 1999 20:33:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Is anyone capable of explaining this??
Message-Id: <MPG.124761decb4687dd989f5d@nntp.hpl.hp.com>

In article <TViD3.9395$N77.720972@typ11.nn.bcandid.com> on Tue, 14 Sep 
1999 03:03:15 GMT, Kragen Sitaker <kragen@dnaco.net> says...

<proper attribution (to me) was snipped, inadvertently, I'm sure>

> >> Sent via Deja.com http://www.deja.com/
> >> Share what you know. Learn what you don't.
> >
> >We can't hold you responsible for that absurdity, except for your poor 
> >choice of ISP.
> 
> I'm wondering about this.  Isn't it reasonable to hold people
> responsible for their poor choice of ISP?  The first few times I saw
> people flamed from posting from somewhere that appended such
> advertisements, I was sympathetic with the flamee; but now I am
> sympathetic with the flamer.

My words ("can't hold you responsible" ... "except for your poor 
choice") mean that we *can* hold the person responsible.  But in the 
absence of knowledge about the circumstances of that choice (perhaps the 
proprietor of Deja is a close relative, for example :-), 'flaming' is 
far too harsh a description for the message I was trying to convey.  
Many far worse things happen here all the time.

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


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

Date: 13 Sep 1999 23:52:59 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Need date/time validation on user input.
Message-Id: <slrn7trlae.f00.abigail@alexandra.delanet.com>

Ricky C. Matlak (ricky_c_matlak@mail.northgrum.com) wrote on MMCCIV
September MCMXCIII in <URL:news:37DC71F7.4BAD3E01@mail.northgrum.com>:
 .. I have a user entering dates and times, and I must worry about bogus
 .. entries (i.e. Feb 30th, or say month 99/01/1999), and could use
 .. something to validate the entries.  Need to account for leap years,
 .. etc...

Go to CPAN, check out the Date:: and Time:: modules.

Pick one that suits your need. 


Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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


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

Date: Tue, 14 Sep 1999 04:46:18 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Need help with some pattern matching...
Message-Id: <uqkD3.9540$N77.738333@typ11.nn.bcandid.com>

In article <MPG.12409fb8416ac184989723@nntp1.ba.best.com>,
Bill Moseley <moseley@best.com> wrote:
>Bill's:
>perl -pe "s/^([^(]+).*$/$1/" source > output
>
>Mine probably didn't work because I tested it on a Windows machine and 
>didn't use single quotes.  I didn't want to backslash because I was 
>capturing.

Oh, now I understand!  My apologies for dissing your regex.  I didn't
read it carefully enough the first time.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: Tue, 14 Sep 1999 03:48:08 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: perl -w strangeness
Message-Id: <YzjD3.9460$N77.728588@typ11.nn.bcandid.com>

In article <37dd2290_3@goliath.newsfeeds.com>,
John Cokos <jcokos@ccs.net> wrote:
>BEGIN { use module2.pm; }

You don't need this to be a BEGIN block.  Just plain use module2.pm;
works fine.  (perldoc -f use if you don't understand why.)

>These are the lines that cause the errors:
>(There is a set of "ifs" above this that properly define $cext)
> . . .
>The only common things in these lines is the use of %urls and
>$global{'CGI_DIR'}, which
>I'm sure is defined, as I can "print" it.  I can also print $cext, so I
>know that it, too is
>defined.

You're not reading %urls anyway, so even if they are undefined, you'd
not get this error.  It's either (a) a bug in perl or (b) $cext or
$global{'CGI_DIR'} being undefined.

>I'm assuming that by doing a "use vars" in one module does, in fact,
>make the variables
>global to any and all required or used modules ... is that assumption correct?

No.  use is always package-specific, whether it's use vars, use strict,
or use Exporter.

Is it possible you're printing $cext and $global{'CGI_DIR'} in another
scope, and they're not defined in module2.pm?

>A similar question would be this.... if I define a variable with "my" at
>the top of  program
>either in a BEGIN, or before anything is required, are that variable
>considered global
>to all subroutines within?

If you my a variable in a BEGIN, it's local to the BEGIN.  If you my a
variable at the top of the program, it's accessible to everything
below.

In this code:
#!/usr/bin/perl -w
use strict;
my $goose = 'cooked';
print $goose, "\n";
package fibble;
use strict;
print $goose, "\n";

$goose is accessible in both modules.  But in this code:

# fibble.pm
package fibble;
use strict;
print $goose, "\n";
1;

#!/usr/bin/perl -w
# fibble.plx
use strict;
use lib '.';
my $goose = 'cooked';
print "my goose is $goose\n";
use fibble;

 . . . the use directive fails with a compilation error.

Kragen
-- 
<kragen@pobox.com>       Kragen Sitaker     <http://www.pobox.com/~kragen/>
Mon Sep 13 1999
56 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>


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

Date: 14 Sep 1999 00:01:24 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl Y2k
Message-Id: <slrn7trlq7.f00.abigail@alexandra.delanet.com>

Li Kong (lkong@hns.com) wrote on MMCCIV September MCMXCIII in
<URL:news:37DD41CD.7A39B79@hns.com>:
"" How can I get a 4-digital year using localtime()?

$year_with_4_digits = do {sleep 31777850664; (localtime) [5]};

Or if you don't like to sleep for so long:

$year_with_4_digits = (localtime) [5] while $year_with_4_digits !~ /\d{4}/;


And if you are a real looney, you would read the manpage.


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


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


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

Date: 13 Sep 1999 23:34:27 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Question about split
Message-Id: <x7671ekvy4.fsf@home.sysarch.com>

>>>>> "KS" == Kragen Sitaker <kragen@dnaco.net> writes:

  KS> Perl5, you can also have hash items that don't exist, which are
  KS> different from hash items that exist and have a value of undef.

you can't have a hash item which doesn't exist. it just doesn't exist so
you don't have it. you can test for its existance with exists. it make
plenty of sense when you realize that both a non-existing hash key and a
key with the value of undef both return undef. so exists is a needed
function to tell the difference between those two cases. i am actually
surprised it wasn't in perl4. i recall thinking this function was needed
when i was learning perl4.

  KS> So don't feel bad.  It really is confusing.  But man, does it get
  KS> things done :)

i don't, it isn't in this case, yes.

uri

-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
uri@sysarch.com  ---------------------------  Perl, Internet, UNIX Consulting
Have Perl, Will Travel  -----------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.


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

Date: 14 Sep 1999 04:50:03 GMT
From: gboug@iona.kau1.kodak.com (Greg Boug)
Subject: Question with 'require' and 'import'
Message-Id: <slrn7trkvq.hj2.gboug@iona.kau1.kodak.com>

Hi all,

I have an interesting problem. I need to import a 
module at runtime, and I won't know its name until 
the program is executed. Is there any way to import
a module like this?

So far, I have gotten:

	my @_ = ("package1", "package2");
	foreach (@_) {
	    require "Something::else::$_";
	    "Something::else::$_"->import(); # I know this is wrong
            my $var = "Something::else::$_"->new(); # Wrong too
	    $var->doSomethingFunky();
	}

Don't worry, I'm well aware that this code won't work :) 
What I'm asking about is what facilities are in Perl that
would allow me to do what I'm attempting here? (I hope
what I'm attempting is fairly clear from the code)

Any suggestions would be greatly appreciated.

Greg
-- 
To reply, remove the uppercase letters in my email address...
Disclaimer: The opinions expressed are purely my own and do not
represent the opinions of my employer...


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

Date: 14 Sep 1999 03:07:49 GMT
From: danny@hendrix.postino.com (Danny Aldham)
Subject: Trouble with perl5.004_04 on RH Linux
Message-Id: <7rke65$5ek$1@hendrix.postino.com>

X-Newsreader: TIN [version 1.2 PL2]

I have a site running perl5.004_04 on x86 RedHat Linux. I am seeing 
resource type problems, something that could be a memory leak. I recall
seeing that Redhat had distributed a poor version of perl at one time, 
and am wondering if this is it.

--
Danny Aldham     Providing Certified Internetworking Solutions to Business
www.postino.com  E-Mail, Web Servers, Mail Lists, Web Databases, SQL & Perl


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

Date: 14 Sep 1999 03:35:13 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Usefulness of CGI.pm (Was Re: UNCRAP project proposal)
Message-Id: <37DDC159.B39F7410@vpservices.com>

Tom Christiansen wrote:
> 
> In comp.lang.perl.misc, abigail@delanet.com writes:
> :CGI.pm ...
> :It's all
> :too much 'oh-golly-this-looks-like-I-am-doing-OOP' just for the sake of
> :looking like you're doing OOP.
> 
> Yes, that's silly.

Well, if a person only uses the OOP stuff because the arrows look
pretty, yes, it's silly.  I'm just an intermediate level Perl guy, so I
probably have some of this said wrong and it may not apply on the level
Tom and Abigail are talking, but it seems to me that these kinds of
things make CGI.pm's object interface valuable:

1) writing extensions, e.g. I have extensions for all the list type
methods to combine CGI.pm and DBI.pm so that $q->popup_menu(sql=>"SELECT
id,partname FROM parts") gives me a nice HTML formated select list based
on the contents of a database column with the first column as the values
list and the second as the labels list for the CGI.pm popup_menu. 

2) reading and modifying the CGI.pm object in multiple subroutines
without having to pass all form parameters as subroutine arguments back
and forth

3) creating multiple CGI.pm objects to track multiple forms and or
multiple input routes in a single script

4) ability to dump an entire CGI.pm oubject to or from other modules
with CGI.pm converters (e.g. XML::CGI, etc.) or to use the associated
boulder format for file storage or stream processing.

Sure, all of those could be accomplished without CGI.pm or without OOP
style, and they don't perhaps use the deepest aspects of OOP, but they
do make things easier to write and easier to maintain in a number of
ways and may even help me do real OOP some day.

-- 
Jeff


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. Due to their sizes, neither the Meta-FAQ nor
the FAQ are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq" from
almanac@ruby.oce.orst.edu. 

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 788
*************************************


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