[12062] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5662 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 14 11:07:25 1999

Date: Fri, 14 May 99 08:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 14 May 1999     Volume: 8 Number: 5662

Today's topics:
        C++ parser written in PERL <we50587@vub.ac.be>
        Controlling a Modem with Perl in Win32 <crockett@uic.edu>
        Creating a Win32::Process for a batch file and passing  mabukguy@my-dejanews.com
    Re: FAQ 4.14: How can I find the Julian Day? (Gregory Snow)
    Re: FAQ 4.14: How can I find the Julian Day? <dgris@moiraine.dimensional.com>
        get char from keyboard ? <kryz@evc.net>
    Re: get char from keyboard ? <tchrist@mox.perl.com>
    Re: get char from keyboard ? (Tad McClellan)
    Re: Hash arrays <jdporter@min.net>
    Re: Hash arrays <tchrist@mox.perl.com>
    Re: Hash arrays (Tad McClellan)
    Re: How can i write perl script and ouput the base dire (Tad McClellan)
    Re: How delete space in a string (use of RE) (Tad McClellan)
    Re: How delete space in a string (use of RE) <Thomas.Buchholz@informatik.uni-giessen.de>
        How to convert RTF to HTML using Perl ??? (ARNOD-PRIN Samuel)
    Re: I need some help <ebohlman@netcom.com>
        indentionless here document ? (<<-) renenyffenegger@my-dejanews.com
    Re: indentionless here document ? (<<-) <tchrist@mox.perl.com>
    Re: indentionless here document ? (<<-) <dgris@moiraine.dimensional.com>
    Re: japh tags (Benjamin Franz)
    Re: man pages and FAQs: why posted? (Greg Bacon)
        Newbie needs to build stateless TCP/IP server <darreld@his.com>
        Off-topic: France (was Re: Perl "constructors") <upsetter@ziplink.net>
    Re: Perl "constructors" <tchrist@mox.perl.com>
    Re: Perl "constructors" <jdporter@min.net>
        perlscript ADO problems (DSN) lamj@softhome.net
        using Exporter <khowe@performance-net.com>
        Where to find more information on PERL. <kbteo@bigfoot.com>
    Re: Where to find more information on PERL. (Larry Rosler)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Fri, 14 May 1999 15:30:40 +0200
From: "Bart Wouters" <we50587@vub.ac.be>
Subject: C++ parser written in PERL
Message-Id: <7hh8es$kl6$1@mach.vub.ac.be>

Hi All,

I'm a newby in the PERL world.
I have to write a C++ parser in PERL (result of the parsing is preferably a
parse tree).

Did anyone already do this ? Or something similar (like e.g. java parser in
perl) ?

What would be the best way to do this ?
Which modules have interesting features and should I look into, to reach my
goal ?

Tnx.

BartW

------------------------------------------------------------------
BART WOUTERS
------------------------------------------------------------------
Office:     Building F, 10th floor, nr 10F730
Phone :     +32 2 629 34 91
Fax:        +32 2 629 35 25
Email :     Bart.Wouters@vub.ac.be
------------------------------------------------------------------
Vrije Universiteit Brussel (VUB)/ Free University of Brussels
Programming Technology Lab (PROG)
Pleinlaan 2
B-1050 Brussels
Belgium
--- END OF MESSAGE -----------------------------------------------





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

Date: Fri, 14 May 1999 09:36:25 -0400
From: "Mark D. Crockett, MD" <crockett@uic.edu>
Subject: Controlling a Modem with Perl in Win32
Message-Id: <7hhceu$156g$1@piglet.cc.uic.edu>

Does anyone have experience controlling a modem with Perl in Win32?  I.E. to
fire off a page using a modem from a web application?

Mark




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

Date: Fri, 14 May 1999 11:55:54 GMT
From: mabukguy@my-dejanews.com
Subject: Creating a Win32::Process for a batch file and passing parameters to it problem
Message-Id: <7hh30a$bo$1@nnrp1.deja.com>

Hi, I'm trying to spawn a process(a .bat file) and pass a parameter to
it on Win NT4.0 using the Win32 library. It works when I just spawn the
process like so:

Win32::Process::Create($ProcessObj,"D:\\temp\\cgi-bin\\myprog.bat,
                                    "",0,NORMAL_PRIORITY_CLASS,".") ||
                                    die ErrorReport();

However when I try to pass parameters to myprog.bat as in:

Win32::Process::Create($ProcessObj,"D:\\temp\\cgi-bin\\myprog.bat,
                                    "myprog.bat param",0,
                                    NORMAL_PRIORITY_CLASS, ".") ||
                                    die ErrorReport();
it does not work. myprog.bat is actually a perl script that has been
converted to a batch file using pl2bat.(This was because I tried to
Create a myprog.pl process and that didn't work)

The myprog.pl is a simple program that reads in the parameter list from
the ARGV variable and logs it out to a file:

       open(LOGFILE,">/common/logfile.txt");
       print LOGFILE "Cmd line is @ARGV\n");

If I turn myprog.pl into a .exe (change my pl to a C program) then that
will probably work but I don't want to do that.

Are there some subtleties about passing a parameter to a batch file
using Win32::Process::Create that I'm not doing?

Any help would be much appreciated.
Thanks Adrian




--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: 14 May 1999 13:39:10 GMT
From: snow@biostat.washington.edu (Gregory Snow)
Subject: Re: FAQ 4.14: How can I find the Julian Day?
Message-Id: <7hh91u$17q2$1@nntp6.u.washington.edu>

In article <373b6de5@cs.colorado.edu>,
Tom Christiansen  <perlfaq-suggestions@perl.com> wrote:


>  How can I find the Julian Day?
>
>    Neither Date::Manip nor Date::Calc deal with Julian days. Instead,
>    there is an example of Julian date calculation that should help you
>    in
>    http://www.perl.com/CPAN/authors/David_Muir_Sharnoff/modules/Time/J
>    ulianDay.pm.gz .

there used to be good functions for converting to and from julian
dates on the PFR (the ones that worked "best" of several suggested),
they were lost with the system crash, but hopefully will be back soon.

Adding a pointer to the PFR to this faq could be useful.



-- 
-------------------------------------------------------------------------------
     Gregory L. Snow         | MATZ'S RULE REGARDING MEDICATIONS:
     (Greg)                  |   A drug is that substance which, when injected
snow@biostat.washington.edu  |   into a rat, will produce a scientific report.


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

Date: 14 May 1999 08:24:30 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: FAQ 4.14: How can I find the Julian Day?
Message-Id: <m3r9ojraox.fsf@moiraine.dimensional.com>

snow@biostat.washington.edu (Gregory Snow) writes:

> there used to be good functions for converting to and from julian
> dates on the PFR (the ones that worked "best" of several suggested),
> they were lost with the system crash, but hopefully will be back soon.

The only reason that those functions aren't back yet is that
I can't recall who provided the two that I put in the repository.
I think it may have been Martin Vorleander(sp?), but am not sure.
I'll try to contact him this weekend.

> Adding a pointer to the PFR to this faq could be useful.

Please don't.  The current PFR is a highly endangered species
with a very low survival probability.

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Fri, 14 May 1999 14:11:18 +0200
From: "KRyZ" <kryz@evc.net>
Subject: get char from keyboard ?
Message-Id: <7hh3ue$41b$1@front7.grolier.fr>

I want the following If the a key is pressed, return the value, else
continue the program. I don't want for waiting an \n ... any idea ?




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

Date: 14 May 1999 07:29:33 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: get char from keyboard ?
Message-Id: <373c253d@cs.colorado.edu>

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

In comp.lang.perl.misc, 
    "KRyZ" <kryz@evc.net> writes:
:I want the following If the a key is pressed, return the value, else
:continue the program. I don't want for waiting an \n ... any idea ?

Reading or grepping the manpages would be the first idea.  What part
of the standard Perl documentation included with each and every Perl
distribution did you happen to find less than clear on this matter?

--tom
-- 
You know, by the time you get done with all this, the "Swiss Army
Chainsaw" is going to be more like a Swiss Army Tactical Nuke....  :-)
    --Brandon Allbery on perl in <1991Feb21.002412.20045@NCoast.ORG> 


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

Date: Fri, 14 May 1999 05:18:29 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: get char from keyboard ?
Message-Id: <5ppgh7.2g3.ln@magna.metronet.com>

KRyZ (kryz@evc.net) wrote:
: I want the following If the a key is pressed, return the value, else
: continue the program. I don't want for waiting an \n ... any idea ?


   One idea is to check the Perl FAQ before posting to the 
   Perl newsgroup!

   Perl FAQ, part 8:

      "How do I check whether input is ready on the keyboard?"


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


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

Date: Fri, 14 May 1999 12:16:47 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Hash arrays
Message-Id: <7hh47d$14q$1@nnrp1.deja.com>

In article <7hh0nm$uqm$1@nnrp1.deja.com>,
  armchair@my-dejanews.com wrote:
> How do I find out the number of elements in a hash array?
> Thanks

perldoc perlfaq4: How can I know how many entries are in a hash?

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: 14 May 1999 06:58:44 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Hash arrays
Message-Id: <373c1e04@cs.colorado.edu>

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

In comp.lang.perl.misc, armchair@my-dejanews.com writes:
:How do I find out the number of elements in a hash array?

By reading or grepping the manpages, just like the rest of us.  What part
of the standard Perl documentation included with each and every Perl
distribution did you happen to find less than clear on this matter?

--tom
-- 
If you can stick your finger in it, you can hang from it.  --Andrew Hume


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

Date: Fri, 14 May 1999 04:41:58 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Hash arrays
Message-Id: <mkngh7.t63.ln@magna.metronet.com>

armchair@my-dejanews.com wrote:

: How do I find out the number of elements in a hash array?


   By checking the Perl FAQ before posting to the Perl newsgroup.

   Perl FAQ, part 4:

      "How can I know how many entries are in a hash?"


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


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

Date: Fri, 14 May 1999 03:56:23 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How can i write perl script and ouput the base directory name to my
Message-Id: <7vkgh7.rs2.ln@magna.metronet.com>


Austin Ming (austin95002887@yahoo.com) wrote:
: In article <373B138A.19F0EBC@genome.wi.mit.edu>, bwlang@genome.wi.mit.edu 
: says...
: >
: >you could try system or backticks to run a pwd
: >
: >

: What is backticks ?


   They are backwards single quote characters.

   As to what backticks _do_, see the "=item qx/STRING/" entry
   in your friendly neighborhood perlop.pod


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


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

Date: Fri, 14 May 1999 04:06:28 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How delete space in a string (use of RE)
Message-Id: <4ilgh7.rs2.ln@magna.metronet.com>

dtillaud@hotmail.com wrote:

: 1)I have some problem to delete all spaces in a string with an RE.
: I try many thing like this:
:   $temp = "   hello   dede       fee   ";
:   $temp =~ / */ /;


    $temp =~ s/ +//g;  # works, but see below for a much faster way


: I want to obtain "hellodedefee" but nothing happens.


   Then an RE is not The Right Tool For the Job.

   For replacing or deleting individual characters tr/// is the
   way to go:

      $temp =~ tr/ //d;  # delete all space characters


: 2)I know that RE are very powerful so do you know if it is possible to
: obtain a string like this
: Before process:     $temp = "   hello   dede       fee   ";
: After process :     $temp = "hello dede fee";


      $temp =~ s/^ +//;  # strip leading spaces
      $temp =~ s/ +$//;  # strip trailing spaces
      $temp =~ tr/ //s;  # squash space sequences to single space


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


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

Date: 14 May 1999 15:25:00 +0200
From: Thomas Buchholz <Thomas.Buchholz@informatik.uni-giessen.de>
Subject: Re: How delete space in a string (use of RE)
Message-Id: <7sn1z73hsj.fsf@informatik.uni-giessen.de>

sholden@pgrad.cs.usyd.edu.au (Sam Holden) writes:

> So you want $temp=~s/ */ /; if you want to substitute with your regex.
> But I promise you that isn't going to do what you want. It replaces the
> first
> occurance of zero or more concurrent spaces with a single space. You 
> probably want something like :
> 
> $temp=~s/ +//g;
> 

Alternatively you can use the translation operator
tr/SEARCHLIST/REPLACEMENTLIST/cds (it scans a string character by
character and replaces all occurrences of the characters found in the
SEARCHLIST with the corresponding characters in the REPLACEMENTLIST):

    $temp ~= tr/ //d;

Because of the modifier /d each character in the SEARCHLIST which is
not replaced is deleted. Here the empty REPLACEMENTLIST leads to
deletion of all characters in the SEARCHLIST.

> ie. Replace (so we use s//) all occurances (so we use /g) of sequences
> of one or more spaces (so we use / +/) with one space (so we use / /). 
> Putting
> it all together we get :
> 
> $temp=~s/ +/ /g; 
> 

Again the translation operator can do the job:

    $temp =~ tr/ //s;

Because of the modifier /s all sequences of characters in the
SEARCHLIST which are translated to the same character are squashed
down to a single instance of the character (if the REPLACEMENTLIST is
empty the SEARCHLIST is replicated (unless the /d modifier is used)). 

Best

Thomas


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

Date: Fri, 14 May 1999 14:34:31 GMT
From: samfra@mygale.org (ARNOD-PRIN Samuel)
Subject: How to convert RTF to HTML using Perl ???
Message-Id: <373c3466.1795610@miage.univ-lyon1.fr>

please help via email


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

Date: Fri, 14 May 1999 13:51:07 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: I need some help
Message-Id: <ebohlmanFBq6H7.FB7@netcom.com>

Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
: Hmm, why a multi-dimensional hash?  I would use a single-dimensional
: hash, with the keys as space-separated word sequences, and the values as
: occurence counts.  This is really the same problem as counting
: occurences of words, except 'words' is replaced with 'word sequences'.

I guess I was thinking in terms of word-prediction type applications, 
where given a partial word sequence it would be useful to know what was 
likely to follow it.



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

Date: Fri, 14 May 1999 14:29:53 GMT
From: renenyffenegger@my-dejanews.com
Subject: indentionless here document ? (<<-)
Message-Id: <7hhc0s$6v8$1@nnrp1.deja.com>

Hi all

Is there any feature in perl to remove tabs at the
beginning of a line in a here document, similar
to the <<-EOHD in a shell script.

Thanks

Rene



--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: 14 May 1999 08:46:10 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: indentionless here document ? (<<-)
Message-Id: <373c3732@cs.colorado.edu>

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

In comp.lang.perl.misc, renenyffenegger@my-dejanews.com writes:
:Is there any feature in perl to remove tabs at the
:beginning of a line in a here document, similar
:to the <<-EOHD in a shell script.

None beyond those you could have found by reading or grepping the
manpages and faqs on your very own system.  What part of the standard
Perl documentation included with each and every Perl distribution did
you happen to find less than elucidating in this matter?

--tom
-- 
Verbosity leads to unclear, inarticulate things.  -- Dan Quayle


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

Date: 14 May 1999 08:51:48 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: indentionless here document ? (<<-)
Message-Id: <m3hfpfr9ff.fsf@moiraine.dimensional.com>

renenyffenegger@my-dejanews.com writes:

> Is there any feature in perl to remove tabs at the
> beginning of a line in a here document, similar
> to the <<-EOHD in a shell script.

http://moiraine.dimensional.com/~dgris/cgi-bin/pfr?func=unquote&type=exact

dgris
-- 
Daniel Grisinger          dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Fri, 14 May 1999 13:56:45 GMT
From: snowhare@long-lake.nihongo.org (Benjamin Franz)
Subject: Re: japh tags
Message-Id: <xYV_2.25339$ny.1697479@typhoon-sf.snfc21.pbi.net>

><todd_b_smith@my-dejanews.com> wrote:
>
> Let's get a thread going with people's tag lines that print "Just
> Another Perl Hacker." I've seen lots, but now I want to see them all!

And another with a little less obviousness about the print.

$_='bba38f4b34ae3abfd59934ae3d4bde348887a3ae4587a311aeec44f26087a3723a';
my($n,$c);s/(..)/{$n=257;$c=hex($1);while($c--){$n=($n*257)%251};chr($n)}/ge;
eval;

-- 
Benjamin Franz


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

Date: 14 May 1999 14:50:56 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: man pages and FAQs: why posted?
Message-Id: <7hhd8g$ouu$2@info2.uah.edu>

In article <B360D47A9668ADDBC8@0.0.0.0>,
	rlb@intrinsix.ca (Lee) writes:
: I have been reading this ng for quite a while, and also surmised those
: same reasons. But I don't think it will be effective, and I think it
: is an enormous waste of bandwidth. Hence sentence two of my post. The
: *most* that is needed is a table of contents and URL for the FAQS, and
: brief "Perldoc: How to find what you need to know about perl" writeup.

My, you're optimistic.  The docs come with every Perl installation!
They're right there on the user's machine!  If they won't read those,
what makes you think reading pointers here is going to?

: >Everyone stop posting them. :-)
: 
: They're not quite as tedious as the long-winded "witty" non-answering
: responses that some like to write.

We're teaching angling instead of giving away scaly seafood.

Greg
-- 
Sam:  What'd you like, Normie? 
Norm: A reason to live. Gimmie another beer. 


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

Date: Fri, 14 May 1999 09:10:15 -0400
From: "Darrel Davis" <darreld@his.com>
Subject: Newbie needs to build stateless TCP/IP server
Message-Id: <373c2049.0@news4.his.com>

I need to build a multithreaded stateless TCP/IP server.
This would be alot like a web server in functionality.  Which
modules should I look at using?  Are there any web servers
built in perl?

-darrel




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

Date: Fri, 14 May 1999 14:29:06 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Off-topic: France (was Re: Perl "constructors")
Message-Id: <SqW_2.302$9x5.94963@news.shore.net>

Tom Christiansen <tchrist@mox.perl.com> wrote:

: You strike me as the sort who upon arriving Paris for the first time,
: and with nary a single French word nor iota of French history at his own
: command, would immediately counsel the French to abandon their mother
: tongue and start speaking English as God and Queen command.

I once went to France with an (American) friend who couldn't understand
why supermarkets sold bread in plastic bags that had little holes in them.
"It would stay fresh a lot longer if they'd use a regular bag", he
lamented.

--Art

-- 
--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: 14 May 1999 07:28:03 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl "constructors"
Message-Id: <373c24e3@cs.colorado.edu>

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

In comp.lang.perl.misc, armchair@my-dejanews.com writes:
:I think it is a questionable "feature" of Perl that the user can define
:any name for an object constructor. 

That's only because you have been traumatized in childhood by restrictive,
anal-retentive programming languages that hamper the author's ability
to translate creative inspiration into codified expression.  Please do
not inflict your own personal mental blindspots on Perl.

:I think this should be changed. 

You've clearly not thought about this very much.  First off, you have
not provided a detailed analysis of the pros and cons of the current
approach compared with your suggested mutilation.  More importantly,
at least five years worth of historical precedent laughs in your face.

Here's a constructor:

    $dbh = DBI->connect("dbi:mysql:somedb:server.host.dom:3306", 
			"username", "password")

And here's another one:

    $sth = $dbh->prepare(<<EO_SELECT)
	SELECT name,salary FROM employees WHERE salary > $limit
    EO_SELECT

And here are four more:

    $topwin = MainWindow->new();
    $frame1 = $topwin->Frame(-relief => "sunken", -bd => 2);
    $lister = $frame1->Listbox(qw{
		-selectmode browse 
		-font fixed 
		-width 30 
		-height 10
		-relief sunken 
		-bd 2
    });
    $tscroll = $frame1->Scrollbar(
		-command           => ["yview", $lister], 
	        -orient            => "vertical", 
	        -activebackground  => "snow4", 
    );

This is Perl.  This is not Java.  This is not C++.  This is not Python.
This is not Eiffel.  

:And an object should be able to consist of more than just a reference.

It has been noted that in computer science there few if any problems that
cannot be solved by adding another layer of indirection, of abstraction.
A reference is merely indirection.  Therefore, it solves all problems.
You need nothing else.

Perl also has eponymous class metaobjects that are not blessed, but
I shouldn't imagine you've encountered these yet, or would know
quite what to do with them if you had.

How long have you been using Perl?  It can't be very long.  You just asked
how to count the elements in a "hash array".  This clearly indicates
that you have not even bothered to peruse the standard documentation,
because 1), you used severely nonstandard terminology, and because 2)
you would have found the answer to your question.

You strike me as the sort who upon arriving Paris for the first time,
and with nary a single French word nor iota of French history at his own
command, would immediately counsel the French to abandon their mother
tongue and start speaking English as God and Queen command.

Let me repeat myself for the logic-impaired: This is Perl.
If you want those other languages, you know where to find them.

There surely in Perl resides more potential, more splendor and richness,
more room for creativity and expression than are dreamt of in your
traumatized cyberlinguistic philosophies.

Criticism derived from ignorance shall seldom be well received. 
I believe, sir, that you have some reading to do.

--tom
-- 
    The autodecrement is not magical.
            --Larry Wall in the perl man page


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

Date: Fri, 14 May 1999 13:53:02 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Perl "constructors"
Message-Id: <7hh9rs$58m$1@nnrp1.deja.com>

In article <7hh079$ueo$1@nnrp1.deja.com>,
  armchair@my-dejanews.com wrote:
> I think it is a questionable "feature" of Perl that the user can
define
> any name for an object constructor. I think this should be changed.

That's a common first reaction from people who are coming to Perl
from C++ and its derivatives.  But Perl is not C++, and can never be.

For a complete explanation of why you are misguided, please read
the perlobj document, very closely.  Also read the perltoot again.


> And an object should be able to consist of more than just a reference.

What would that gain you that you don't already have with references?
Even if there was more than a reference, how would you get at it?
All data structures in Perl -- other than the basic scalar, array,
and hash -- are build using references.  Overlaying the class
mechanism on this was a natural thing to do and leads to great
convenience in programming.  Have you run into some kind of brick
wall as a result of objects only being references?

--
John Porter
Put it on a plate, son.  You'll enjoy it more.


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Fri, 14 May 1999 11:55:09 GMT
From: lamj@softhome.net
Subject: perlscript ADO problems (DSN)
Message-Id: <7hh2ut$bg$1@nnrp1.deja.com>

I have a problem with my perlscript that connects to a DSN (MSSQL7)

Part of my code:
------------------------------------
my $SQL = "SELECT * FROM tablename";
my $DSN = "dsnnamehere";
my $Connection=$Server->CreateObject("ADODB.Connection");
$Connection->Open($DSN) || die "Can't find DSN";
my $Result = $Connection->Execute($SQL);
------------------------------------

Problem is with DSN, it cannot connect to this DSN. Trace on the server
side is:

DIAG [37000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed
for user '(null)'. Reason: Not associated with a trusted SQL Server
connection. (18452)

Obviously, this is the problem of no username being passed to the
server, my question is how do I pass username and passwd in the
perlscript, or should i do it that way? Can't I set the passwd in the
dsn data source settings so I don't have to mess around with it in the
perlscript.

Any help is greatly appreciated.

Jason Lam


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Fri, 14 May 1999 10:57:36 -0300
From: "Kevin Howe" <khowe@performance-net.com>
Subject: using Exporter
Message-Id: <xWV_2.33001$134.350860@tor-nn1.netcom.ca>

How can get a module to see variables in the main:: package?

ex:

#!/usr/bin/perl

%HASH = (
 VAR1 => "this",
 VAR2 => "that"
);


package Other;
print %HASH;




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

Date: Fri, 14 May 1999 21:25:43 +0800
From: "Teo Keng Boon" <kbteo@bigfoot.com>
Subject: Where to find more information on PERL.
Message-Id: <7hh8o6$4lq$1@mango.singnet.com.sg>

Hi all,

I am doing an assignment to make a comparison between different programming
languages, such as  C++, Java and Perl, etc. I am looking for information on
their differences, features, applications, what they are good at, etc.

Could anyone help by directing me to sources carrying these sources?

Thank you,
Keng Boon






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

Date: Fri, 14 May 1999 07:47:39 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Where to find more information on PERL.
Message-Id: <MPG.11a5d757aa1d99d6989a62@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <7hh8o6$4lq$1@mango.singnet.com.sg> on Fri, 14 May 1999 
21:25:43 +0800, Teo Keng Boon <kbteo@bigfoot.com> says...
> I am doing an assignment to make a comparison between different programming
> languages, such as  C++, Java and Perl, etc. I am looking for information on
> their differences, features, applications, what they are good at, etc.
> 
> Could anyone help by directing me to sources carrying these sources?

http://language.perl.com/versus/index.html

Enjoy!  (And attribute your sources properly in your report!)

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


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

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