[8317] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1934 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 19 20:12:57 1998

Date: Thu, 19 Feb 98 17:00:33 -0800
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, 19 Feb 1998     Volume: 8 Number: 1934

Today's topics:
    Re: Bug using pod2html with --podroot switch (Martien Verbruggen)
    Re: Changing Scalar Variable Name in While (Andrew M. Langmead)
    Re: Changing Scalar Variable Name in While (Jonathan Feinberg)
    Re: Changing Scalar Variable Name in While <norman.bunn@mci.com>
    Re: Changing Scalar Variable Name in While (Craig Berry)
    Re: Embedding Perl in C <craig@mathworks.com>
    Re: Growing cucumbers - (prev Content-type Question) (Martien Verbruggen)
    Re: Help for Hashes !! <jsd@hudsucker.gamespot.com>
    Re: Help for Hashes !! (Martien Verbruggen)
    Re: How do you mail with Perl? (Jonathan Feinberg)
    Re: How do you mail with Perl? (Neil Briscoe)
    Re: if you're going to answer FAQs... Proposal: use SEE <steve.tolkin@fmr.com>
    Re: if you're going to answer FAQs... Proposal: use SEE (Andrew M. Langmead)
        Insecure dependency <dcprice@sandia.gov>
    Re: Insecure dependency (Mike Heins)
    Re: Internationalization schwern@starmedia.net
    Re: Internationalization schwern@starmedia.net
    Re: Look'n for a little help..... (Andrew M. Langmead)
    Re: modulus (again!) (Chip Salzenberg)
    Re: perl registry? <justink@citizen.infi.net>
    Re: Prisoners of the evil empire (Plastic Nuclear Ferret)
    Re: Prisoners of the evil empire (Plastic Nuclear Ferret)
        regexp question (Rasta Kyle)
    Re: rename error: please disregard <webmaster@fccj.cc.fl.us>
    Re: Secure Path with setgid <webmaster@fccj.cc.fl.us>
    Re: SQL/Perl syntax question about Quotes <ajh@rtk.com>
    Re: ts: Remove files in a PERL sript (Craig Berry)
    Re: ts: Remove files in a PERL sript (Andrew M. Langmead)
    Re: Verifying a URL? (Michael J Gebis)
    Re: Verifying a URL? (Plastic Nuclear Ferret)
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl (Michael J Gebis)
    Re: Year 2000 Compliance: Lawyers, Liars, and Perl <swd@strata-group.Xcom>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 19 Feb 1998 23:18:10 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Bug using pod2html with --podroot switch
Message-Id: <6cieji$rq0$1@comdyn.comdyn.com.au>

In article <34EB9E1A.9643BC4E@mailexcite.com>,
	"Alfred P. Bartholomai" <apb.freddyb@mailexcite.com> writes:
> This is a multi-part message in MIME format.
> --------------5D13D79790D157967D131634

Please don't do that. Usenet is a plain text medium. A lot of
newsreaders cannot or will not deal with multi-part MIME messages.
Just use plain text.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | Inside every anarchy lurks an old boy
Commercial Dynamics Pty. Ltd.       | network - Mitchell Kapor
NSW, Australia                      | 


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

Date: Thu, 19 Feb 1998 20:47:48 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Changing Scalar Variable Name in While
Message-Id: <Eon8Fp.6A7@world.std.com>

"Norman Bunn" <norman.bunn@mci.com> writes:

>Is there a way to change the name of a scalar variable while in a While?
>Though incorrect, I want to do something like:

This feature does exist in perl, it is called a "symbolic
reference". In general, their use is discouraged. In your case, why
not use an array instead?

for($count=1; $count <=20; $count++) {
  $pro[$count] = param("PRO_$count");
}

If you really need a symbolic reference, you would use something like
this:

{
  no strict 'refs'; 
  ${"pro$count"} = param("PRO_$count");
}

-- 
Andrew Langmead


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

Date: Thu, 19 Feb 1998 17:30:40 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: Changing Scalar Variable Name in While
Message-Id: <MPG.f567c9b26cde449989713@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

norman.bunn@mci.com said...
: I want to determine which parameters are populated and store them in
: an array of arrays.

Please direct your attention to perldsc and perllol (two of the documents that 
come with perl).  If you have difficulty with specific examples in those 
documents, you'll find a lot of people here to help you through it.  Hmm, you 
might well need to understand perlref, as well.

Good luck!

-- 
#!/usr/bin/perl -w -- Just another Perl hacker,
 (open 0),$_=<0>,s,.*-+ ,,,chop;for(split?@*?){($$_++or$}=$_,y,
 y \,y,<STDIN>,,eval"sub $_ {print'$}'}"),y,} \,},>STDOUT,,&$_}
# Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: Thu, 19 Feb 1998 21:38:45 GMT
From: "Norman Bunn" <norman.bunn@mci.com>
Subject: Re: Changing Scalar Variable Name in While
Message-Id: <FD1H.7593$Yw.1580910@news.internetMCI.com>


Andrew M. Langmead wrote in message ...
>"Norman Bunn" <norman.bunn@mci.com> writes:
>
>>Is there a way to change the name of a scalar variable while in a While?
>>Though incorrect, I want to do something like:
>
>This feature does exist in perl, it is called a "symbolic
>reference". In general, their use is discouraged. In your case, why
>not use an array instead?
>
>for($count=1; $count <=20; $count++) {
>  $pro[$count] = param("PRO_$count");
>}
>
>If you really need a symbolic reference, you would use something like
>this:
>
>{
>  no strict 'refs';
>  ${"pro$count"} = param("PRO_$count");
>}
>
>--
>Andrew Langmead

Let me define the overall problem and see what the "best" solution is.  I
have a series of parameters called PRO_01, PRO_02, PRO_03, etc. which
contain strings delimited by colons.  However, some of the parameters are
often empty depending on the buttons and checkboxes selected on the HTML
form.  I want to determine which parameters are populated and store them in
an array of arrays.

The data is of the form:

PRO_00 => description00:part number00:price00
PRO_01 => description01:part number01:price01
PRO_02 => description02:part number02:price02

I want to split each of these and store it in a unique array.   And then I
want to store the arrays in another array.

Norman




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

Date: 19 Feb 1998 23:38:56 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Changing Scalar Variable Name in While
Message-Id: <6cifqg$ipc$1@marina.cinenet.net>

Norman Bunn (norman.bunn@mci.com) wrote:
: The data is of the form:
: 
: PRO_00 => description00:part number00:price00
: PRO_01 => description01:part number01:price01
: PRO_02 => description02:part number02:price02
: 
: I want to split each of these and store it in a unique array.   And then I
: want to store the arrays in another array.

Making it a hash of hashes seems more elegant, and better handles the 
sparseness issue (untested code follows):

  my %pro = ();

  while (<>) {
    my ($key, $info)          = /PRO_(\d+)\s+=>\s+(.*)/;
    my ($desc, $pnum, $price) = split /:/, $info;

    $pro{$key} = { desc => $desc, pnum => $pnum, price => $price };
  }

Then you can see if a PRO_xx number exists using

  exists $pro{77}

and get at associated data using (e.g.)

  $pro{77}{price}

HTH...

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Thu, 19 Feb 1998 15:24:39 -0500
From: Craig Ciquera <craig@mathworks.com>
To: Sean McAfee <mcafee@seawolf.rs.itd.umich.edu>
Subject: Re: Embedding Perl in C
Message-Id: <34EC9507.3776CB8@mathworks.com>

Sean,

Thank you for responding to my plea for help.

What you say makes sense.  However, referring to Panther, p343:

int perl_call_method(char *method_name, int flags)

Call a mthod of a class by name.  The first parameter on the stack must be
either an SV containing the name of the class or a blessed reference of the
class.

My primary question is how to get a blessed reference to the class.  If I have:

package Mine;
sub new
{
    my($type) = shift ;
    bless [@_]
    }
sub Display
{
    my ($self, $index) = @_ ;
    print "$index: $$self[$index]\n" ;
}

>From a C program I want to call Display,  How to I get a blessed refernece to a
Mine object so that I can push it on the stack???

Any ideas would be greatly appreciated.

P.S. If I have the following C code:

#include <stdio.h>
#include <EXTERN.h>
#include <perl.h>

static PerlInterpreter *my_perl;

void call_Print(void);

main (int argc, char **argv, char **env) {

 my_perl = perl_alloc();
    perl_construct(my_perl);
    argv[1] = "Mine.pm";
    perl_parse(my_perl, NULL, argc, argv, env);

    perl_run(my_perl);
    call_Print();

    perl_destruct(my_perl);
    perl_free(my_perl);


}

void
call_Print(void)
{

    char *method = "Display";
    dSP;
    SV *a = perl_get_sv("Mine", TRUE);

    ENTER;
    PUSHMARK(sp);
    XPUSHs(a);
    PUTBACK;
    perl_call_method(method, G_DISCARD);
    SPAGAIN;
    PUTBACK;
    LEAVE;

}

I get the following error at runtime:

Can't call method "Display" without a package or object reference.

Sean McAfee wrote:

> In article <34EB10AD.54B22181@mathworks.com>,
> Craig Ciquera  <craig@mathworks.com> wrote:
> >Typically, you can access and use an object (in Perl) in the following
> >way:
> >$a = new Foo;
> >$a->disp;
> >where I have a module called Foo.pm and disp is a method in Foo.pm.
> >$a is a Foo object after calling:
> >$a = new Foo
>
> >With that said, I now have the following question:
> >How to embed this type of situation in C where disp is a virtual
> >method???
> >That is, I want to have a variable in C which is a Foo object and use
> >that Object reference to call the disp method
>
> >I have read through the on-line doc and Srinivasan's "Advanced Perl
> >Programming"
> >is excellent.  However, lacking much intelligence, I cannot see how to:
>
> >1. Get a C variable which is a refernece to a Perl Object (i..e, $a).
> >2. Call the method disp.
>
> I've been doing some Perl embedding stuff recently, so I'll take a crack at
> it.  Presuming that an interpreter has been initialized elsewhere and has
> parsed and run the contents of your script:
>
> void
> call_disp(void)
> {
>     dSP;    /* see Panther book, p. 352 for this and related macros */
>     SV *a = perl_get_sv("a", FALSE);    /* see Panther, p. 331 */
>
>     ENTER;
>     PUSHMARK(sp);
>     XPUSHs(a);
>     PUTBACK;
>     perl_call_method("disp", G_DISCARD);    /* see Panther, p. 343 */
>     SPAGAIN;
>     PUTBACK;
>     LEAVE;
> }
>
> >Anyone have a nice concrete example or ideas on where else I can look
> >for information??
>
> HTH.
>
> For those readers better-versed in Perl embedding than I, I have a
> question.  When testing the above subroutine, I originally had it in
> main(), where it crashed with a segmentation violation on the XPUSHs.
> After I moved the method-calling code to another function, it worked fine.
> Anyone know why that is?
>
> --
> Sean McAfee | GS d->-- s+++: a25 C++ US+++$ P+++ L++ E- W+ N++ |
>             | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
>             | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu



--
Craig Ciquera                       Tel: (508) 647-7547
The Mathworks, Inc.                 FAX: (508) 647-7002
24 Prime Park Way, Natick MA 01760
mailto:craig@mathworks.com          Web: http://www.mathworks.com




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

Date: 19 Feb 1998 22:55:17 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Growing cucumbers - (prev Content-type Question)
Message-Id: <6cid8l$rh3$2@comdyn.comdyn.com.au>

In article <34EB996F.43BA8F76@dial.pipex.com>,
	Matthew Pryor <matt.pryor@dial.pipex.com> writes:
> Ah, now growing cucumbers, that
> is an interesting discussion thread.

(which Abigail started a few days ago. I merely copied)

> Mine seem to have withered and
> gone brown during the winter - am
> I using the correct compost?  Perhaps

You should think of using a module. Go to CPAN, and check if it's
already there. If not, consider writing one. I'd suggest a bundle of
fertilisers:

Fertilise::Compost
Fertilise::Chemical
Fertilise::Crap

Also, use

Irrigate.pm
GreenHouse.pm

> I haven't got my vegetable patch
> correctly configured.  Do I need to
> have a word with my system
> admin blokey?  He's in charge
> of the gardens.

Yes. Tell them to install the latest Vegetable::Cucumber.pm and the
latest GreenHouse.pm. They'll provide your precious cucumbers with the
protection of the winter cold.

If your admin doesn't want to, slap him/her around the head with one of
your brown withered cucumbers. Complain to the WCF (World Cucumber
Fund).

> Any suggestions much appreciated.
> Thanks.

No problem.
Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | If at first you don't succeed, try
Commercial Dynamics Pty. Ltd.       | again. Then quit; there's no use being
NSW, Australia                      | a damn fool about it.


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

Date: 19 Feb 1998 21:37:01 GMT
From: Jon Drukman <jsd@hudsucker.gamespot.com>
Subject: Re: Help for Hashes !!
Message-Id: <6ci8lt$ob8$1@its.hooked.net>

Gabor <gabor@vmunix.com> wrote:
: # Don't use foreach with hashes. Use while.

: Why not?

: for (keys %hash) {

if %hash is really huge, this will crash with "Out of memory!"

the while loop will not crash, regardless of the hash size.

-j-


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

Date: 19 Feb 1998 22:48:53 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Help for Hashes !!
Message-Id: <6cicsl$rh3$1@comdyn.comdyn.com.au>

In article <34EB8F20.6D2B@ultranet.com>,
	Bob Trieger <corky@ultranet.com> writes:
> Don't use foreach with hashes. Use while.
> 
> while (($key,$value) = each %hash) {...}

Why not? If I don't need the value:

foreach $uid (keys %hash)
{

Only in the case of really enormous hashes could the foreach pose a problem.
But then I would probably choose a totally different approach anyway.
If you really do need the value and key in all case, then while is ok.
The question however was how to see if a key in a certain hash also
appears in a different hash. 

> to test for a key use
> 
> if ($hash{$key}) {...}

Wrong. What if $hash{$key} contains a false value, like, say 0? Do you
know what happens then? Your test fails.

The original poster was right, by using exists

if (exists $other_hash{$uid})
{
}

> HTH

Not much.

Martien
-- 
Martien Verbruggen                  | 
Webmaster www.tradingpost.com.au    | A Freudian slip is when you say one
Commercial Dynamics Pty. Ltd.       | thing but mean your mother.
NSW, Australia                      | 


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

Date: Thu, 19 Feb 1998 16:40:25 -0500
From: jdf@pobox.com (Jonathan Feinberg)
Subject: Re: How do you mail with Perl?
Message-Id: <MPG.f5670d53a8ea271989712@news.concentric.net>

  [courtesy cc of this posting sent to cited author via email]

wefs@doc.ic.ac.uk said...
: I want to set up a daemon to read incoming mail files, process them, and
: then write them into files.

Then you'll most likely want to look at procmail.

-- 
Jonathan Feinberg    jdf@pobox.com    Sunny Brooklyn, NY


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

Date: 19 Feb 1998 21:33:32 GMT
From: neilb@zetnet.co.uk (Neil Briscoe)
Subject: Re: How do you mail with Perl?
Message-Id: <memo.19980219213331.45021A@skep.compulink.co.uk.cix.co.uk>

In article <34EC89D5.41C67EA6@doc.ic.ac.uk>, wefs@doc.ic.ac.uk (William
Smith) wrote:

> I want to set up a daemon to read incoming mail files, process them, and
> then write them into files.
>
> Does anyone know how to set up a daemon and access a mail file for
> input????
>
>
> Many thanks.

You don't say which platform you're using.

Daemons are hard under NT.  You using NT?  Under Unix - its easy.  What
version of Unix?

Regards
Neil



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

Date: Thu, 19 Feb 1998 15:51:43 -0500
From: Steven Tolkin <steve.tolkin@fmr.com>
To: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: if you're going to answer FAQs... Proposal: use SEEFAQ and/or OFFTOP
Message-Id: <34EC9B5E.ECF0FA78@fmr.com>

I agree completely.  I read Tom's postings for the information they
contain.  But recently there have been a lot of "see the FAQ".  And of lot
of postings by him and many others that i regard as off topic.  Therefore I
propose the two following keywords to be included in the message header when
replying:
SEEFAQ -- obvious meaning
OFFTOP -- either off topic, or "off the top of my head".
Then experienced readers could add these keywords to their killfile.

P.S. Sorry, I must post from my PC.

Russell Schulz wrote:

> tchrist@mox.perl.com (Tom Christiansen) writes:
>
> >     The CGI Newsgroup (NOT THIS ONE):
> >         comp.infosystems.www.authoring.cgi
>
> [etc.]
>
> does this list of resources need to be included in every followup?  is
> there any header I can kill on to avoid seeing them over and over again?
>
> note that the person posting them is NOT inexperienced.
> --
> Russell_Schulz@locutus.ofB.ORG  Shad 86c

 ---
Steven Tolkin          steve.tolkin@fmr.com      617-563-0516
Fidelity Investments   82 Devonshire St. R27C    Boston MA 02109
There is nothing so practical as a good theory.  Comments are by me,
not Fidelity Investments, its subsidiaries or affiliates.




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

Date: Thu, 19 Feb 1998 22:51:37 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: if you're going to answer FAQs... Proposal: use SEEFAQ and/or OFFTOP
Message-Id: <EonE62.98D@world.std.com>

Steven Tolkin <steve.tolkin@fmr.com> writes:

>I agree completely.  I read Tom's postings for the information they
>contain.  But recently there have been a lot of "see the FAQ".  And of lot
>of postings by him and many others that i regard as off topic.  Therefore I
>propose the two following keywords to be included in the message header when
>replying:
>SEEFAQ -- obvious meaning
>OFFTOP -- either off topic, or "off the top of my head".
>Then experienced readers could add these keywords to their killfile.

The problems that I see:

1. It still leaves the original question unkilled. Its the FAQs that
are the real problem, not the posts that tell the FAQ asker that their
question is a FAQ. 

2. It still leaves the responses from people who either answer the
question directly instead of pointing the original poster to the
FAQ. These can be very annoying because they have a higher chance of
being incorrect than the explaination presented in the FAQ.

3. It still leaves the responses from the pople who correct the people
who posted the correction to the incorrect response to the question. A
lot of people find it distressing to have obviously incorrect
responses to questions presented as fact for other users to see. And
these people would be the least likely to want to have their article
killed.

4. Some people use awful little newsreaders that thread based on
subject lines rather than references headers. I know that some people
will consider that no excuse, but I can use nn well, but have never
been able to get a handle on how trn works.

-- 
Andrew Langmead


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

Date: Thu, 19 Feb 1998 13:48:20 -0700
From: Dawn <dcprice@sandia.gov>
Subject: Insecure dependency
Message-Id: <34EC9A94.1097@sandia.gov>

I am using a perl script which does not allow me to use setuid with an
-I option. I got around this error by placing the following commands in
the perl script:

BEGIN { unshift(@INC, "/usr/local/lib/perl5") } ;
$ENV{PATH}=();

I am now getting the following error:

Insecure dependency in piped open while running setgid at
/home/sierra/work/etc/granny line 54.

The following is line 54.

	open(STDIN, "/home/sierra/work/sparc-sun-solaris2.5.1/bin/cvs annotate
$rev $file |")

Does anyone know how I can tell perl that the cvs that I am using is
secure?

I have tryed using taintperl and perl with the -T option, but niether
works.

Thanks

Dawn
dcprice@sandia.gov


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

Date: 19 Feb 98 21:11:47 GMT
From: mikeh@minivend.com (Mike Heins)
Subject: Re: Insecure dependency
Message-Id: <34eca013.0@news.one.net>

Dawn <dcprice@sandia.gov> wrote:
> I am using a perl script which does not allow me to use setuid with an
> -I option. I got around this error by placing the following commands in
> the perl script:

> BEGIN { unshift(@INC, "/usr/local/lib/perl5") } ;
> $ENV{PATH}=();

> I am now getting the following error:

> Insecure dependency in piped open while running setgid at
> /home/sierra/work/etc/granny line 54.

> The following is line 54.

> 	open(STDIN, "/home/sierra/work/sparc-sun-solaris2.5.1/bin/cvs annotate
> $rev $file |")

> Does anyone know how I can tell perl that the cvs that I am using is
> secure?

You have to do a dup, fork, and exec. There is a good treatment of
this in perlsec(1) -- try 'perldoc perlsec'.

Regards,
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
There ain't nothin' in this world   131 Willow Lane, Floor 2  | ||  _ \
that's worth being a snot over.     Oxford, OH  45056         | || |_) |
--Larry Wall                        <mikeh@minivend.com>     |___|  _ <
                                    513.523.7621 FAX 7501        |_| \_\


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

Date: Thu, 19 Feb 1998 14:34:52 -0600
From: schwern@starmedia.net
To: apps@starmedia.net
Subject: Re: Internationalization
Message-Id: <6ci51c$pcl$1@nnrp1.dejanews.com>

Here's a quick sketch of what I was thinking of doing if all else fails:

#!/usr/local/bin/perl

# Our fictious module.
use I18N::Strings;

BEGIN {
	require constant;

	# Determine the language type... in my case, this reads a cookie 		# (Blech).
	$lang = ReadLang;

	# Create a hash of all output strings needed by your program
	# determined by the language.  This will probably read a ConfigReader
	# file(s) or DBM files or a single MLDBM file.
	%strings = ReadStrings($lang);

	# Create and import our constant strings and lists.
	foreach my $stringName (keys %strings) {
		# All references are assumed to be list references.
		if( ref $stringName ) {
			import constant $stringName => @{$strings{$stringName}};
		}
		else {
			import constant $stringName => $strings{$stringName};
		}
	}
}


# Assuming %strings contains a key 'HELLO_WORLD' we should now print
# the universal greeting in whatever language we choose.
print HELLO_WORLD, "\n";



Something like that, anyway.  Seems to work okay.

The only problem is if we wish to create strings which contain variables, such
as:

print "Congradulations, $name!  You may have already won 10 million
dollars!\n";

How does one deal with that?  One solution...

use constant CONGRATS_MSG => 'Congradulations, $name!  '.
			     'You may have already won 10 million dollars!\n';
$tmpString = CONGRATS_MSG;
print eval "\"CONGRATS_MSG\"";

That copy & eval seems a little redundant, but functional for now.


I think I'm going to develop this a bit more.  Seems acceptable.


> what i suspect is an easy way to manage the process is to include a
>
> require "./lang/template.en"
>
> where "template" is english,german,dutch,spanish etc
>
> and contains:
>
> $error = "error message in whatever language"
> $this = "this in whatever language"
> $that = "that in whatever language"
>
> and the perl script, rather than hardcoding text into the script, references
> the text
> content from the language template.
>
> any simpler ideas out there?


-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Thu, 19 Feb 1998 15:35:34 -0600
From: schwern@starmedia.net
To: apps@starmedia.net
Subject: Re: Internationalization
Message-Id: <6ci8j6$spk$1@nnrp1.dejanews.com>

Ah HA!  Silly me!

cpan> i /gettext/
Distribution    PVANDRY/gettext-1.00.tar.gz
Module          Locale::gettext (Contact Author PVANDRY (Phillip Vandry))
Module          gettext         (PVANDRY/gettext-1.00.tar.gz)


CPAN shell saves the day again!

Now all I have to do is learn gettext...

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Thu, 19 Feb 1998 20:43:46 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Look'n for a little help.....
Message-Id: <Eon88y.MEs@world.std.com>

"David Stewart" <dstewart@fusion.ca> writes:

>Hi all! Just wondering if anyone has an answer for me about this problem.


># output an HTTP location header that should kick the user 
># to the URL specified ...that's it!
>print "Location: $url{$REMOTE_USER}\n\n";

Evironment variables are accessable to perl through the special %ENV
hash. (See the perlvar man page for details.) $REMOTE_USER is a perl
scalar variable that is undefined. You want to say $ENV{REMOTE_USER}
to get the value of the environment variable REMOTE_USER. You should
probably also test that it exists, and that its value is a key in the
%url hash before using it as an argument to the print() function.

Problems like this are simple to deduce if you use the "-w" switch and
the "use strict" pragma. You might want to look into these features of
perl.
-- 
Andrew Langmead


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

Date: Thu, 19 Feb 1998 21:01:34 GMT
From: chip@mail.atlantic.net (Chip Salzenberg)
Subject: Re: modulus (again!)
Message-Id: <6ci6mq$are$1@cyprus.atlantic.net>

According to Nathan Franzen <franzen@pmel.noaa.gov>:
>A couple weeks ago I asked some questions here regarding modulus and got
>some very useful replies from Chip Salzenberg, among others, and
>discovered that some important fixes were made in the latest release of
>Perl. 

Glad to help.

>I have, to my misfortune, still been puttering around with with %, and
>discovered that even under 5.004 it behaves differently with and without
>'use integer'.  

That's on purpose.  It's designed that way to let you have access to
the underlying C "%" operator if you really really want that.
-- 
Chip Salzenberg                - a.k.a. -                <chip@pobox.com>
      "Hoist the failure sails, men!  We're goin' home!"  // MST3K
           ->  Ask me about Perl training and consulting  <-
     Like Perl?  Want to help out?  The Perl Institute: www.perl.org


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

Date: Thu, 19 Feb 1998 16:26:09 -0500
From: "Justin" <justink@citizen.infi.net>
Subject: Re: perl registry?
Message-Id: <6ci84s$rlo$1@nw003t.infi.net>


uri@sysarch.com wrote in message ...
>
>the perl institute has promised a perl registry for projects,
>contractors, job opening etc. for a while. i know that the 'tute has
>gone thru a reorg recently. i was at the meeting at the perl conference
>where the 'tute was discussed, but i haven't seen anything actually
>happen.
>
>are there any other perl registries out there? one idea would be a
>system to search agency and compnay job listings for perl and place them
>in a separate search engine. would the perl institute be interested in
>working on this? many perl hackers (including me) could be pursuaded to
>help out on such a project.
>
>just looking for better ways to get perl work,


well, why not make one then?





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

Date: 19 Feb 1998 21:37:14 GMT
From: donut@bayarea.net (Plastic Nuclear Ferret)
Subject: Re: Prisoners of the evil empire
Message-Id: <6ci8ma$ouc$2@news.bayarea.net>

Nathan V. Patwardhan (nvp@shore.net) wrote:
: Larry D'Anna (ldanna@hotmail.com) wrote:
: 
: : The evil empire is Microsoft.  Their prisoners are the poor souls who
: : have never seen the guiding light of unix. :-)
: 
: Or those who don't understand an application without a gui or a window
: manager without a Start button.  :-)
: 
: --
: Nathan V. Patwardhan

what about fvwm95?

-- 
#############################################################################
#     Shane Knapp     #   donut@bayarea.net   #    shane@investools.com     #
#         "I'd like to be Superman, but you're standing on my cape...."     #
#			http://www.bayarea.net/~donut			    #
#############################################################################


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

Date: 19 Feb 1998 21:38:17 GMT
From: donut@bayarea.net (Plastic Nuclear Ferret)
Subject: Re: Prisoners of the evil empire
Message-Id: <6ci8o9$ouc$3@news.bayarea.net>

Matthew Pryor (matt.pryor@dial.pipex.com) wrote:
: So what do you call an MS solution provider?

a contradiction of terms?

: Are they the prison wardens?  Or maybe
: they run the torture chambers.  Or are they
: just prisoners too?
: 
all of the above.

: Food for thought.
: 
attempting to digest--hold--not working.


-- 
#############################################################################
#     Shane Knapp     #   donut@bayarea.net   #    shane@investools.com     #
#         "I'd like to be Superman, but you're standing on my cape...."     #
#			http://www.bayarea.net/~donut			    #
#############################################################################


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

Date: Thu, 19 Feb 1998 23:20:20 GMT
From: rasta@spacestar.com (Rasta Kyle)
Subject: regexp question
Message-Id: <34ecbbc4.244241891@news.spacestar.com>

At the risk of being flamed for (Not reading the faq, using a crappy
newsreader, etc,etc) I have a question....

I have an older version of the camel book and on page 261 it has the
following:

$fullname =~ s/^[^,]*-(.*)\(.*/$1/ || $fullname =~ s/'.*//;

if ($fullname =~ /&/) {      #you don't want to know

stuff
stuff                                 }


My first question is why would you put a comment like
"you don't want to know" in a book teaching someone the laguage?"
(Just curious, please don't flame)..

Second question is .....I understand the first line but what is the
& in this expression? Is it litterally an "&" or does it represent a
variable I cannot find in the camel book or the O'Reilly book
on Regular Expressions? Please reply to
rasta@spacestar.net and the group....thank you.in advance.


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

Date: Thu, 19 Feb 1998 17:59:01 -0500
From: Bill Jones <webmaster@fccj.cc.fl.us>
To: Douglas Clifton <doug@weboneinc.com>
Subject: Re: rename error: please disregard
Message-Id: <34ECB935.AA7629F6@fccj.cc.fl.us>

No, I won't.  :-)
Rename doesn't work across drive partitions very well,

Thought you'd want to know  :-)
Bill

Douglas Clifton wrote:

> Please disregard, typo in my code :(
>
> --
> Douglas Clifton
> Unix/C/Perl/CGI/HTML Programmer
> doug@weboneinc.com
>
> ===================
> Web One Inc.
> Website Development
> Phone: 888-699-WEB1
> Phone: 616-552-9999
> Fax:   616-552-9920
> sales@weboneinc.com
> www.weboneinc.com
> ===================





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

Date: Thu, 19 Feb 1998 17:57:02 -0500
From: Bill Jones <webmaster@fccj.cc.fl.us>
Subject: Re: Secure Path with setgid
Message-Id: <34ECB8BD.365F55FD@fccj.cc.fl.us>

That would depend upon your platform; which you didn't say, also you
didn't say whether this is a CGI script, which would involve differnt
issues as well...

So hope this lack of a valid conversation was helpful :-)
Please be a 'liitle' more verbose :-)

Thx,
Bill



Wilbur R. Johnson wrote:

> How can I get perl to accept a nonstandard path as "Secure"?
>
> --
> Wilbur Johnson (Tech Reps Inc.)
> Engineering Manufacturing Mechanics (9117)
> Sandia National Laboratories
> Albuquerque, N.M. 87185





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

Date: Thu, 19 Feb 1998 13:17:29 -0800
From: "Aaron Harsh" <ajh@rtk.com>
Subject: Re: SQL/Perl syntax question about Quotes
Message-Id: <6ci7fh$kd3$1@brokaw.wa.com>

Mike Heins wrote in message <34ea0018.0@news.one.net>...
>    my @names = qw/ Joigan O'Hara Panoupoulos /;
>    foreach $name ( qw/ Joigan O'Hara Panoupoulos / ) {
> $name  = $dbh->quote($name);
> $query = qq!SELECT * FROM employee WHERE lastname = '$name'!;
> $sth   = $dbh->prepare($query);
> #etc.
>    }


You'll likely get better performance if you don't substitute $name directly,
but rather parse a parameterized query once and bind the values on each
execute:

my $sth = $dbh->prepare( qq{ SELECT * FROM employee
                                WHERE lastname = ? } )
    or die "Can't prepare: $DBI::errstr";
foreach my $name ( qw/ Joigan O'Hara Panoupoulos / ) {
    $sth->execute($name)
        or die "Can't execute: $DBI::errstr";
    ...
}

No need to quote variables if you do it this way.  (Not to say that this is
the right way, just the rightest way I know of :-)

--
Aaron Harsh
ajh@rtk.com




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

Date: 19 Feb 1998 20:36:50 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: ts: Remove files in a PERL sript
Message-Id: <6ci552$6tj$1@marina.cinenet.net>

soul@explorer.com wrote:
: yeah all you hardcore perl hackers make this joint a dull experience.

If you find it dull, perhaps you're in the wrong place?  It's the first 
newsgroup I read every day, and I seldom fail to learn something and/or 
get a good laugh.

: the reason people are asking questions that are in the faq and the
: manpages is because the manpages are way technical and half the
: time don't explain stuff thoroughly!

'Way technical'???  It's a bloody *programming language*!  It's not 
designed for non-technical people to use, or even know about.

As for explaining stuff thoroughly, the online Perl doc does a better job 
at this than any other language manpages/helpfiles/whatever I'm 
familiar with.

: >| Don't tell people answers that are in the manpages or faqs.
: >
: >Wrong. You so easily dismiss people who are new to perl.
: >I don't feel it's proper for you to cut and dry it as you
: >do. It doesn't help the discussion for you to be so impenetrable.

Answering faqs directly rather than by doc ref just means that people 
continue not to read the doc, and thus continue to flood this group with 
pointless questions.  You have to break the cycle somewhere.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Thu, 19 Feb 1998 20:53:52 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: ts: Remove files in a PERL sript
Message-Id: <Eon8ps.GH3@world.std.com>

<soul@explorer.com> writes:

>the reason people are asking questions that are in the faq and the
>manpages is because the manpages are way technical and half the
>time don't explain stuff thoroughly!

Then explain where you got confused by the man pages, or where their
information is incomplete. Send in a bug report and maybe they will
get fixed in a later release. Discuss your problems with the man pages
here in comp.lang.perl.misc, with concrete examples. (Now that might
be an interesting thread.)

It might be your little part to "help save the world."

-- 
Andrew Langmead


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

Date: 19 Feb 1998 20:40:55 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Verifying a URL?
Message-Id: <6ci5cn$p5q@mozo.cc.purdue.edu>

Stewart Eastham <sme@planetpod.com> writes:

}  Thanks for all the good info guys.  I used the LWP module and I got it
}working to check URLs.  Here's another question along the same lines.  Is
}it possible to verify the validity of an email address using a similiar
}method?

Short answer: no.

Slightly longer answer: You _can_ check if an email address matches
the spec, but you can't tell if that address actually corresponds to a
valid mailbox.  See the owls book for more on checking RFC
correctness.

Perhaps this doesn't apply to you, but maybe it does: it's bad karma to
build a web-traversing spambot.  Real bad.  

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: 19 Feb 1998 21:33:38 GMT
From: donut@bayarea.net (Plastic Nuclear Ferret)
Subject: Re: Verifying a URL?
Message-Id: <6ci8fi$ouc$1@news.bayarea.net>

Stewart Eastham (sme@planetpod.com) wrote:
: 
: 
: Stewart Eastham wrote:
: 
: > Is there a way to verify a URL exists using PERL?  I looked into the
: > Net::Ping module, but that only verifies hosts, instead of actual web
: > pages.
: >
: > stewart eastham
: > sme@planetpod.com
: 
:   Thanks for all the good info guys.  I used the LWP module and I got it
: working to check URLs.  Here's another question along the same lines.  Is
: it possible to verify the validity of an email address using a similiar
: method?
: 
: Thanks again.
: 
: stewart eastham
: 

you could attempt to open up a telnet connection to the SMTP server (usually
done by telnetting to port 25 of that host).  this, most likely, wont work on
any machine except for those running unix or those that have telnet requests
turned off (at least from the outside).

later-

shane
-- 
#############################################################################
#     Shane Knapp     #   donut@bayarea.net   #    shane@investools.com     #
#         "I'd like to be Superman, but you're standing on my cape...."     #
#			http://www.bayarea.net/~donut			    #
#############################################################################


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

Date: 19 Feb 1998 20:56:56 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <6ci6ao$r78@mozo.cc.purdue.edu>

bart.mediamind@tornado.be (Bart Lateur) writes:

}seebs@plethora.net (Peter Seebach) wrote:

}>The struct
}>tm has been Y2K-ready for a long time.
}>
}>I dread the 34,667 bug.

}Do you expect still to be alive by then? Or  do you expect your programs
}still to be used? Really?

http://www.wired.com/wired/scenarios/clock.html

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


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

Date: Thu, 19 Feb 1998 17:27:29 -0600
From: Steve Dover <swd@strata-group.Xcom>
Subject: Re: Year 2000 Compliance: Lawyers, Liars, and Perl
Message-Id: <34ECBFE1.29B658D7@strata-group.Xcom>

Abigail wrote:
> 
> Steve Dover (swd@strata-group.Xcom) wrote on 1632 September 1993 in
> <URL: news:34EB6CD7.495A1998@strata-group.Xcom>:
> ++
> ++ Time marches on, but by design, a given date or timestamp datam
> ++ will only be allocated so many bits.  At some point in time,
> ++ more bits will need to be allocated.  There's no way around it.
> 
> Who says there has to be a limit on the number of bits?
>
No one.  In theory, there is no limit.  But for all practical
purposes there is.  Yes, we could store timestamps or any
field for that matter in variable length fields.  But 'by design',
I know of no O/S that does this for a timestamp.


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". 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". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 1934
**************************************

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