[10370] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3962 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 13 14:39:36 1998

Date: Tue, 13 Oct 98 10:00:26 -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           Tue, 13 Oct 1998     Volume: 8 Number: 3962

Today's topics:
        [PATCH] Re: TAB completion - how? (Greg Bacon)
        accessing instance variables reesor@peoplescape.com
        Alpha and MacPerl still misbehave (Richard S. Holmes)
    Re: Are there any "perl.newbie" group or forum? (Greg Bacon)
    Re: Are there any "perl.newbie" group or forum? <westmj@esvax.dnet.dupont.com>
    Re: Are there any "perl.newbie" group or forum? <jdporter@min.net>
    Re: Are there any "perl.newbie" group or forum? <eashton@bbnplanet.com>
    Re: Are there any "perl.newbie" group or forum? (Abigail)
    Re: Are there any "perl.newbie" group or forum? (Tad McClellan)
    Re: Are there any "perl.newbie" group or forum? <mp@mkt2mkt.com>
    Re: Checking file size and date in Perl Win32 (Larry Rosler)
    Re: comp.lang.perl.win32?? <jdporter@min.net>
    Re: Continuing s/// from the last position. (Brand Hilton)
        Domain/mapping//pointer <robhonor@ilos.net>
    Re: Don't kill me <eashton@bbnplanet.com>
    Re: email with windows 98 perl script? <rootbeer@teleport.com>
        Embedding perl <pd@softing.com>
    Re: encryption <rootbeer@teleport.com>
        file modification <Edouard.Ouin@tinet.ie>
    Re: Graphic Date <rootbeer@teleport.com>
    Re: Handling text files <rootbeer@teleport.com>
    Re: How do you use the perl compiler? <ibelgaufts@gfc-net.de>
    Re: I think its a greediness issue (Tad McClellan)
    Re: London.pm - Changed URL <eashton@bbnplanet.com>
    Re: Mail on NT <mikep@5circles.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: 13 Oct 1998 15:29:38 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: [PATCH] Re: TAB completion - how?
Message-Id: <6vvrl2$3t3$5@info.uah.edu>

In article <362348FA.446D76B4@eed.ericsson.se>,
	Alexander Farber <eedalf@eed.ericsson.se> writes:
: how do you implement the file name completion (with TAB)?
: I suspect it is usually done using the Term::Completion,
: but its documentation (perldoc on it) is really scarce
: and I have no clue how to do it. I have also searched
: the Dejanews for "Term::Completion perl" - with no success.

I had to apply this patch:

diff -u /usr/lib/perl5/5.00502/Term/Complete.pm Term/Complete.pm
--- /usr/lib/perl5/5.00502/Term/Complete.pm     Tue Sep 22 18:21:07 1998
+++ Term/Complete.pm    Tue Oct 13 10:21:51 1998
@@ -13,8 +13,8 @@
 
 =head1 SYNOPSIS
 
-    $input = complete('prompt_string', \@completion_list);
-    $input = complete('prompt_string', @completion_list);
+    $input = Complete('prompt_string', \@completion_list);
+    $input = Complete('prompt_string', @completion_list);
 
 =head1 DESCRIPTION
 
@@ -74,6 +74,9 @@
 sub Complete {
     my($prompt, @cmp_list, $return, @match, $l, $test, $cmp, $r);
 
+    $return = "";
+    $r      = 0;
+
     $prompt = shift;
     if (ref $_[0] || $_[0] =~ /^\*/) {
        @cmp_lst = sort @{$_[0]};
@@ -113,8 +116,8 @@
                 # (^U) kill
                 $_ eq $kill && do {
                     if ($r) {
-                        undef $r;
-                       undef $return;
+                        $r      = 0;
+                        $return = "";
                         print("\r\n");
                         redo LOOP;
                     }

to make it -w-clean, and I used this test program:

    #! /usr/bin/perl -w

    use strict;

    use Term::Complete;

    my $input = Complete('prompt: ', <*>);
    print "input = $input\n";

Hope this helps,
Greg
-- 
We are Fudd of Borg: Pwepawre to be aswimiwated.


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

Date: Tue, 13 Oct 1998 16:14:32 GMT
From: reesor@peoplescape.com
Subject: accessing instance variables
Message-Id: <6vvu98$u1n$1@nnrp1.dejanews.com>

I'm positive I must be doing something wrong here, but I sure don't see it. If
anyone has ideas, I'd love to hear them. My news access is via dejanews, so a
direct answer would be appreciated.

# I have a class like this:

sub new {
 my($class) = shift;
 my($self)  = {};

 my($arg) = @_;

 self->{arg} = $arg;
 self->{foo} = NULL;

 bless $self, $class;

 return $self;
}

# Now, a couple of access methods:

sub setFoo
{
 my($self) = shift;
 my($arg) = @_;

 $self->{foo} = $arg;
}

sub getFoo
{
 my($self) = shift;

 return $self->{foo};
}

# And, finally, another instance method

sub bar
{
 my($self) = shift;

 my($firstTry) = $self->{foo};
 print "firstTry: $firstTry\n"; # prints NULL

 my($secondTry) = getFoo();
 print "secondTry: $secondTry\n"; # prints correct value

 # however, the following works fine

 my($arg) = $self->{arg};
 print "arg: $arg\n"; # prints value of arg
}

# It seems to me that the bar method should be able to access instance
# variable foo directly and not only through the access method.

# Thanks again for any ideas!!

# Rob

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 13 Oct 1998 12:24:12 -0400
From: rsholmes@rodan.syr.edu (Richard S. Holmes)
Subject: Alpha and MacPerl still misbehave
Message-Id: <xzcbtng1lcj.fsf_-_@rodan.syr.edu>

In article <6vu619$imp$1@clarknet.clark.net> schinder@leprss.gsfc.nasa.gov (Paul J. Schinder) writes:

>In <xzcbtnhrc3f.fsf@rodan.syr.edu> rsholmes@rodan.syr.edu (Richard S. Holmes) writes:
>
>>With some older versions of Alpha and MacPerl I had no problems
>>editing a script in Alpha and sending it to MacPerl to run.  But no
>>longer -- now I get
>
>># Illegal character \012 (carriage return).
>>File 'Untitled'; Line 2
>># (Maybe you didn't strip carriage returns after a network transfer?)
>
>Open the file again.  Look at Alpha's status bar (the bar that runs
>along the bottom of the screen).  The kind of linebreaks that the file
>has will be indicated; it will say one of Mac, Unix or IBM.  Make sure
>that the file has Mac linebreaks...

The file has Mac linebreaks.  For a screen shot (showing the Alpha
status bar, etc.) see <http://web.syr.edu/~rsholmes/alphaperl.JPG>.

To clarify: I downloaded Alpha and MacPerl the other day; started
both; opened a new document in Alpha; set Perl mode; typed 'print
"Hello world\n";'; and did "Run the buffer" from the Camel menu.  Iget
the aforementioned error.

I do not get this error if I save the file and open it from MacPerl
and run it there, or if I copy the file in Alpha, paste it in MacPerl,
and run it -- only if I send it from Alpha to MacPerl.

>>This is using Alpha 7.1 and MacPerl 5.2.0r4 on a PowerMac G3 running
>>Mac OS 8.1.  

I've since found that I get the same behavior on a PowerMac 7200/90
running Mac OS 7.5.5; I get the same behavior using Alpha 6.5; I do
*not* get an error using MacPerl 4.1.8.  (Yeah, yeah, I know...)
Seems to suggest a problem (or a feature) with MacPerl 5.2.0r4.

-- 
- Rich Holmes
  Syracuse, NY /             We have more important things to do...
  Newport News, VA           Censure and move on!  Sign the petition at
  rsholmes@earthling.net     <http://www.moveon.org>


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

Date: 13 Oct 1998 15:07:50 GMT
From: gbacon@itsc.uah.edu (Greg Bacon)
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <6vvqc6$3t3$4@info.uah.edu>

In article <yl7ly554i7.fsf@windlord.stanford.edu>,
	Russ Allbery <rra@stanford.edu> writes:
: Perl not being a good first language seems practically self-evident to me,
: so I'm not sure how well I can argue the point.  Of course, I personally
: followed the semi-traditional programming learning track of the 80s (BASIC
: to Pascal to C to a wide smattering of stuff ranging from LISP to shell to
: COBOL, and then finally Perl).

I can see both sides of the argument.  One side is that you don't learn
to change your car's oil by hiring a mechanic to do it for you.  The
other side is that Perl's handling of the details allows the student to
focus on the problem itself and not tangentially related implementation
issues.

In my experience, people have the most trouble in introductory
programming classes because they aren't accustomed to thinking in the
small steps that most traditional teaching languages mandate.  It seems
to me that Perl would be nice as a teaching language because it would
allow novices to think in steps of a more natural size.  Larry designed
Perl to make programming easier for programmers, right?

There are lots of reasons why C is a non-ideal teaching languages, but
it seems like most CS curricula use it.  (Of course, this may well be
an argument against using C. :-)  There are even some that have switched
and are switching to Java.  I suppose the desire is to optimize for
future usefulness.

I've said before (with mjd sounding approval--I think merlyn also
expressed a similar notion) that Perl could work well as a teaching
language provided that the instructor is willing to use a subset of
Perl (which is Officially Ok by Larry :-) and tell the occasional
lie (i.e. this is The Way to do it).  We could test this hypothesis
if someone were to write an introduction to programming textbook that
used Perl (or at least a CS-ly pure subset) and the publisher were
able to convince a few universities to try it out.  Given the proper
combination of author and instructor, it could work well.

Any takers? :-)

Greg
-- 
Politicians and diapers have one thing in common. They should both be changed
regularly and for the same reason. 
    -- Gerry Brooks


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

Date: 13 Oct 1998 14:39:15 GMT
From: Mike West <westmj@esvax.dnet.dupont.com>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <6vvomj$89g@topgun.es.dupont.com>

In article <Pine.GSO.3.92.981013114406.12706g-100000@edb>
  Casper Kvan Clausen, ckc@dmi.dk writes:

>ML, for instance, is very clear and suitable for learning programming.

"ML" ?  Microsoft Lingo ?  Multi Level? Mini Lisp ?  Macho Language ?

Must be a TLA.  (two letter acronym, not to be confused with a 
TLA, a three letter acronym...)


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

Date: Tue, 13 Oct 1998 12:08:17 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <36237AF1.34C6BF2B@min.net>

madame philosophe wrote:
> 
> I would prefer to be a thing of beauty!!!
> or rather $beauty->param('madame');

Or rather,
	$madame = new Beauty;

How about;
	my @affections;
	tie @affections, 'Beauty';
	tied(@affections)->isa('Joy') while 1;

-- 
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer


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

Date: Tue, 13 Oct 1998 16:07:25 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <3623783D.8F416250@bbnplanet.com>

madame philosophe wrote:

> See I knew the llama book was not for non-programmers.

The Llama book is about as simple as it gets. Besides, in the big
picture, programming is no different than any other discipline. How did
you learn anything that you know which you taught yourself? I took years
of piano lessons but it was my own interest in the music which made the
difference between mediocre and concert level. The book is but one tool
among many which you can use to teach yourself.

> What books would you recommend for intelligent independently studious 
> non-programming programmers??

Intelligent independently studious people never need to ask that
question.

e.


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

Date: 13 Oct 1998 16:20:05 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <6vvujl$6b2$1@client3.news.psi.net>

Greg Bacon (gbacon@itsc.uah.edu) wrote on MDCCCLXIX September MCMXCIII in
<URL:news:6vvqc6$3t3$4@info.uah.edu>:
++ In article <yl7ly554i7.fsf@windlord.stanford.edu>,
++ 	Russ Allbery <rra@stanford.edu> writes:
++ : Perl not being a good first language seems practically self-evident to me,
++ : so I'm not sure how well I can argue the point.  Of course, I personally
++ : followed the semi-traditional programming learning track of the 80s (BASIC
++ : to Pascal to C to a wide smattering of stuff ranging from LISP to shell to
++ : COBOL, and then finally Perl).
++ 
++ I can see both sides of the argument.  One side is that you don't learn
++ to change your car's oil by hiring a mechanic to do it for you.  The
++ other side is that Perl's handling of the details allows the student to
++ focus on the problem itself and not tangentially related implementation
++ issues.

I disagree. Perl gives you a whole bunch of tools to use, but that only
confuses the novice programmer: he doesn't know what the pick. Knowing
which tool to pick is more important than the implementation of the details.

++ In my experience, people have the most trouble in introductory
++ programming classes because they aren't accustomed to thinking in the
++ small steps that most traditional teaching languages mandate.  It seems
++ to me that Perl would be nice as a teaching language because it would
++ allow novices to think in steps of a more natural size.  Larry designed
++ Perl to make programming easier for programmers, right?
                                       ^^^^^^^^^^^

I think that says it all. Perl is to make programming easier for
*programmers*. People learning how to program aren't programmers
yet. You can make a truck whose design goal is to make it easier to
drive for drivers - that doesn't mean said truck is ideal to take
driving lessons in.

++ There are lots of reasons why C is a non-ideal teaching languages, but
++ it seems like most CS curricula use it.  (Of course, this may well be
++ an argument against using C. :-)  There are even some that have switched
++ and are switching to Java.  I suppose the desire is to optimize for
++ future usefulness.

I'd prefer using Java over C, but neither would be my choice. I would
go for either something from the school of Wirth (Pascal, Modula), LPC
or maybe even some pseudo code.




Abigail
-- 
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
             "\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
             "\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'


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

Date: Tue, 13 Oct 1998 10:29:17 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <dkrvv6.5ia.ln@flash.net>

Mark-Jason Dominus (mjd@op.net) wrote:
: In article <ylww658eup.fsf@windlord.stanford.edu>,
: Russ Allbery  <rra@stanford.edu> wrote:
: >Perl isn't that good of a language to learn how to program in
: >(yes, I know some people with strong qualifications disagree with me on
: >that score...).

: Really?  Who disagrees?  

: I ask because I've never actually seen anyone express that opinion,
: and I've often wanted to try it and see what the result was.


   Teaching Perl as a first language is high on my list of
   "projects yearning to be free".

   Even though I know that it is a Bad Idea!

   It is clear to me, from past threads on this subject, that the consensus, 
   which I agree with, is that Perl is not a good first language.



   OTOH, some folks just will not learn programming before learning
   Perl. 

   They just won't. 

   Even though lots of qualified people agree that it is a Bad Idea, 
   they still won't.



   If the "qualified people" agree on this pseudo code:

   if (you_want_to_be_a_good_programmer || expect_to_get_paid_for_programming)
      {learn programming with some other language first}
   else
      {learn programming while learning Perl}


   Then there are a large, and growing, number of folks in the
   else clause.     ;-)

   They just want to spiffy up their web page, or tweek some reports,
   or any of the other myriad things that Perl is good for.

   But they are not willing to invest in a real "program of study"
   on how to program.



   The demand is there despite it being a bad thing.


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


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

Date: Tue, 13 Oct 1998 09:55:25 -0800
From: madame philosophe <mp@mkt2mkt.com>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <3623940B.D85C4C3A@mkt2mkt.com>

O John... you flatter me!
I suppose that would make me an object of the beauty class?
I would much rather be a param than an instance, however.
It's more influential isn't it? Besides who likes to be treated like an object?

:-)

John Porter wrote:
> 
> madame philosophe wrote:
> >
> > I would prefer to be a thing of beauty!!!
> > or rather $beauty->param('madame');
> 
> Or rather,
>         $madame = new Beauty;
> 
> How about;
>         my @affections;
>         tie @affections, 'Beauty';
>         tied(@affections)->isa('Joy') while 1;
>
In keeping with the topic...
So I guess that an instance of Beauty inherits from Joy as long as @affections
is true.

Is this right?

> --
> John "Many Jars" Porter

-- 
------
madame philosophe 

"I am not a troll!"

- Famous last words before
the
guillotine of comp.lang.perl.misc

She's here to save the world from herself...


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

Date: Tue, 13 Oct 1998 08:21:01 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Checking file size and date in Perl Win32
Message-Id: <MPG.108d0fbade2a4ef89898b6@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and copy mailed.]

In article <upvbwsl01.fsf@jimbosntserver.soundimages.co.uk> on 13 Oct 
1998 13:29:34 +0100, Jim Brewer <jimbo@soundimages.co.uk> says...
> lr@hpl.hp.com (Larry Rosler) writes:
 ...
> > #!/usr/local/bin/perl -w
> > print -A $0, ' ', -C $0, ' ', -M $0, "\n";
> > __END__
> > 
> > And guess what -- it all works!  And even better than on Unix, because 
> > the -C gives the creation date as advertised, not the inode-change date.  
> > (No inodes, you know.)
> 
> Well, somewhat misleading as well. These times are relative to when
> your script began execution, not the dates the file system maintains
> for these values. You would have to calculate the system dates from
> the times returned by -x file tests above. They are not quite ready
> for consumption in their raw form. Unless one only begins to live
> while ones script is running. :)

This carping has nothing whatever to do with the issue, which is that 
these three times *are* available for Windows/DOS systems, which was 
denied outright by the person I was responding to.  I chose to 
demonstrate this using the -x file tests.  If it makes you happier, use 
this to get the file system's Epoch times directly:

    #!/usr/local/bin/perl -w
    printf "%d %d %d\n" => (stat $0)[8, 10, 9];
    __END__

Yawn...

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


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

Date: Tue, 13 Oct 1998 12:21:15 -0400
From: John Porter <jdporter@min.net>
Subject: Re: comp.lang.perl.win32??
Message-Id: <36237DFB.34AC4E7@min.net>

Craig Berry wrote:
> 
> Paul Murray (murray-paul@usa.net) wrote:
> : o Using Win32 GUI modules, Win32 Registry modules, umm most things
> : called Win32:: :)
> 
> Sounds more like comp.lang.perl.modules.win32 to me.

Again, the analogy to comp.lang.perl.tk is strong, and IMHO
compelling.

But it's not just about the Win32 modules.

The range of perl-related questions which are NOT platform-
independent, and in fact are Win32-dependent, is large.
I would be very happy for the people who ask and answer them
to do so somewhere other than clpm.


> : o Peculiarities of perl under win32 (or win32 under perl, depending on
> : your perspective)
> 
> This would be topical, but seems a limited area of conversation.  The
> number of non-module-related peculiarities is small.

Being module-related or not is, IMHO, irrelevant.


> : o Userbase. There are a lot of Win32 perl users out there, more than
> : any other non-unix port.
> 
> Yes, but I'm really not sure that they have needs differing that strongly
> from the Unix-or-other-OS Perlers.

Um, if they think they do, then there ought to be a forum to 
discuss them.  As I opined previously, there's no reason they can't
discuss win32-related issues on comp.lang.perl.win32, and general
perl issues here.


> : o Attitude problem of current newsgroup towards Win32, probably caused
> : by abovementioned cluelessness getting all Win32 programmers and
> : questions tarred with the same brush.  Questions tend to get blown off
> : with 'install a real OS' type 'help'
> 
> I really don't see that much OS prejudice in clpm (with a few loud-mouthed
> exceptions).

Unfortunately, that's all it takes!
Even though I personally think Windows is a miserable excuse for an
operating system, I support the notion that Win32 programmers
ought to have a forum in which "NT Sucks!" is considered a troll.

-- 
John "Many Jars" Porter
baby mother hospital scissors creature judgment butcher engineer


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

Date: 13 Oct 1998 15:55:50 GMT
From: bhilton@tsg.adc.com (Brand Hilton)
Subject: Re: Continuing s/// from the last position.
Message-Id: <6vvt66$7p119@mercury.adc.com>

In article <6vuu5o$4f1$1@hiisi.inet.fi>,
Antti Boman <antti.boman***NOSP@M***helsinki.fi> wrote:
>I've been trying to find a solution, and couldn't. Forgive me if I've been
>blind.
>
>I have a huge file that needs replacing strings, one by one, from the start
>to the bottom. If I replace a pattern, how can I replace another one
>continuing from the end position where that first pattern was found? I know
>the variable $4, but it's a read-only value (a copy or a reference). pos()
>seems to work for searches only.

A code snippet would have helped, but here are a couple of attempts:

First, you could use the /g option, as in   s/pattern/replacement/g

This has the added benefit of working for overlapping patterns.  So, for 
example,

  $this = 'aa';
  $this =~ s/a/Xa/g

Results in $this containing 'XaXa';

If you're having to do this in a loop, where every time you find the
pattern you have to do something in addition to the replacement, you
can do this:

  while ($this =~ s/a/X/) {
    $subcount++;
  }

However, this won't work on overlapping patterns, such as the ones in
the original example.  After the first replacement occurs, $this would
contain 'Xaa'.  The next time through the loop, $this would contain
'XXaa', and so on forever.

Hope this helps somewhat.

        Brand
-- 
 _____ 
|///  |   Brand Hilton  bhilton@adc.com
|  ADC|   ADC Telecommunications, ATM Transport Division
|_____|   Richardson, Texas


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

Date: Tue, 13 Oct 1998 16:48:47 GMT
From: Rob <robhonor@ilos.net>
Subject: Domain/mapping//pointer
Message-Id: <36233DE8.F071BE16@ilos.net>

Hi
I am wanting to host a few seperate domains on my
(unix)server, they will only direct to orig IP, it
is up to me to use a script to point the proper
subdirectory.  Ques. does such a script exist in
pearl and where can locate it?? Any assistance
would be greatly appreciated.

Robert Gouriluk




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

Date: Tue, 13 Oct 1998 16:12:07 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Don't kill me
Message-Id: <36237956.389DBC01@bbnplanet.com>

madame philosophe wrote:

> This was sent to discussion only...

Netscape newsreader is evil and will not do this as supercite will. Some
people are more sensitive about this than others and most prefer not to
be mailed at all.

> PS I have also set my browser to wrap at 60 chars.  Is this working?

ick. 74 is standard.

e.


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

Date: Tue, 13 Oct 1998 16:40:54 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: email with windows 98 perl script?
Message-Id: <Pine.GSO.4.02A.9810130939520.1979-100000@user2.teleport.com>

On Tue, 13 Oct 1998, Hawkwynd wrote:

> So far, all the email scripts for web servers have been for Unix and
> NT. Is it possible to do this on a Windows 98 Web server? 

Probably, unless someone at Microsoft was really foolish. The docs, FAQs,
and newsgroups about webservers should be able to help you here. Good
luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 13 Oct 1998 15:20:38 +0000
From: Dirk Palme <pd@softing.com>
To: orwant@tpj.com
Subject: Embedding perl
Message-Id: <36236FC6.6F536C68@softing.com>

Hallo everybody,

I'll adding a Perl Interpreter to my C program. The manpage 'perl embed'
describes howto embed perl in C program. I want to compile the example
'interp.c'.

Unfortunately Iwas not able to compile this program, because a linker
error occures:

    - libperl.a(pp.o):In Function'Perl_pp_crypt': pp.o(.text+0x5d51):
undefined reference to 'crypt'.

I want compile under Linux 2.0.35 and Perl 5.004.

I use the Compiler with following options:

    - gcc -O2 -Dbool=char -DHAS_BOOL -I
/usr/lib/perl5/i386-linux/5.004/CORE -L
/usr/lib/perl5/i386-linux/5.004/CORE -o interp interp.c -lperl -lm.

Why did i get this error?

Regards,

    Dirk




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

Date: Tue, 13 Oct 1998 16:51:32 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: encryption
Message-Id: <Pine.GSO.4.02A.9810130951170.1979-100000@user2.teleport.com>

On Tue, 13 Oct 1998, Orlando Frooninckx wrote:

> does anyone have a nice encryption function example so I can crypt
> sentences before writing them to a file?

If there's a module which does what you want, it should be listed in
the module list on CPAN. If you don't find one to your liking, you're
welcome and encouraged to submit one! :-)  Hope this helps!

    http://www.perl.org/CPAN/
    http://www.perl.com/CPAN/

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 13 Oct 1998 16:40:36 +0000
From: Edouard Ouin <Edouard.Ouin@tinet.ie>
Subject: file modification
Message-Id: <36238284.AABB74FF@tinet.ie>

hi,

I need to known what's the simplest way to modify the content of  file,
ie modify a line, delete a line.

Thank's

Ted



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

Date: Tue, 13 Oct 1998 16:33:00 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Graphic Date
Message-Id: <Pine.GSO.4.02A.9810130932410.1979-100000@user2.teleport.com>

On Tue, 13 Oct 1998, Billy Jacobs wrote:

> I am looking for a simple script 

If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 13 Oct 1998 16:34:58 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Handling text files
Message-Id: <Pine.GSO.4.02A.9810130933560.1979-100000@user2.teleport.com>

On Mon, 12 Oct 1998, Todd Dunsirn wrote:

> I have some files (a lot actually) that are like the following format...
> 
> Name: Joe
> Age: 23

> Any help with this would be greatly appreciated. I have some
> experience with Perl but would appreciate a rough template or idea to
> get going.

Do you know how to open a file so that you can read from it? See open() in
the perlfunc manpage. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Wed, 07 Oct 1998 15:01:45 +0200
From: "J|rgen Ibelgaufts" <ibelgaufts@gfc-net.de>
Subject: Re: How do you use the perl compiler?
Message-Id: <361B6639.3C1C38F1@gfc-net.de>

Thank you for replying to chris anderson's question, because i have the
same problem on windows nt. i took the standard source distribution and
managed to build it together with the tk and win32 modules (using
microsoft visual c 4.0) - and everything works.

so far so good - but where does the path have to point to? i can't find
any documentation. does it have to point to the location of perlcc, or
do i need the compiler settings ?

juergen ibelgaufts

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

Joseph N. Hall schrieb:
> 
> Last time I checked on my Unix box, perlcc is broken if your PATH
> environment variable doesn't point to the right places.  Even
> though you're on a different platform, you might take a look at that.
> 
>         -joseph
> 
> Chris Anderson wrote:
> >
> > I have the ActiveState Perl v5.00.502 on Windows 95 (I've also tried on
> > NT 4.0) and I can't get the compiler to work. All the documentation I've
> > seen makes it sound pretty idiot proof- just type "perlcc a.pl" and
> > you'll get an executable. So, I guess I'm an idiot because it's not
> > working. The perl syntax checks out OK, and it creates the code but
> > chokes on compiling with the message "Couldn't open !"- it's missing a
> > filename in the error message.
> > It seems like there must be some setup required (and I'm guessing that's
> > what I'm missing), but I haven't seen any documentation on that.
> > Any help would be appreciated
> 
> --
> Joseph N. Hall, prop., 5 Sigma Productions       mailto:joseph@5sigma.com
> Author, Effective Perl Programming . . . . . http://www.effectiveperl.com
> Perl Training  . . . . . . . . . . . . . . .  http://www.perltraining.com


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

Date: Tue, 13 Oct 1998 11:15:01 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: I think its a greediness issue
Message-Id: <5auvv6.5na.ln@flash.net>

Hampton Keathley (hamptonk@bible.org) wrote:
: Greetings,

: I'm working on cleaning up a few thousand theological journal articles
: in SGML. 

: I have to get all the footnote links out from between the foreign
: language tags. 

: This: <grc>greek words<info "n=12"> more greek</grc> 

: must be changed to this:

: <grc>greek words more greek</grc><info "n=12">

: Here's my code:

: while  (<INFILE>){
: $line = $_;
: $line =~ s/(\<grc\>)(.*?)(\<info.*?\>)(.*?)(\<\/grc\>)/$1$2$4$5$3/g;
              ^    ^        ^        ^        ^      ^
              ^    ^        ^        ^        ^      ^

You don't need any of those escapes.

If you chose a different pattern delimiter, then you won't need
_any_ backwacks. See below.


Also, you don't need to copy it to $line first, you could just use $_ ...


: 	print OUTFILE $line;
: }



: The problem is that sometimes the search matches on the first <grc> and
: then a second </grc> tag and takes the <info> tag and puts it in the
: wrong place.


   Your regex matches this part of your input string:

      <grc>periV tw'n kekoimhmevnwn</grc>.<info t="g88b111" n=11> 
      From the use of <grc>periv<info t="g88b112" n=12></grc>


   Non-greedy matching tries to use the shortest match, but it does
   do its best to *match rather than fail*.

   Your regex _requires_ an <info> element in it.

   So, after matching "<grc>periV tw'n kekoimhmevnwn</grc>", it still
   hasn't seen that required part, so it keeps going. Then it finds
   the n=11 one, then it keeps going until it can find the </grc>
   end tag, resulting in the matched string above.

   Obviously this is not what you want it to do.



: How can I ensure that it always matches the first </grc> after a <grc>?


   Don't _require_ other stuff in between them.


: I've copied the input and output line at the end of the message so you
: can see the actual text I'm working with.


   Very good idea. Thank you.


: (Ignore the line breaks. This is one line)

: Notice how it took the <info t="g88b111" n=11> which was fine where it
: was and moved it outside the second </grc> tag leaving the <info
: t="g88b112" n=12> still inside the second </grc>. Now footnote #11
: follows #12.

[snip input and output]


I think I would do it like this:

--------------------------------------------
#!/usr/bin/perl -w

$_ = q|<p type=bodyblock>desires these believers not to be ignorant
&ld;regarding those who have fallen asleep,&rd; <grc>periV tw'n
kekoimhmevnwn</grc>.<info t="g88b111" n=11> From the use of
<grc>periv<info t="g88b112" n=12></grc><grc> following ajgnoei'n</grc>,
it is evident,that the problem these believers faced centered on the
fortune of the faithful departed (<grc>tw'n kekoimhmevnwn</grc>).<info
t="g88b113" n=13> Thus it is likely that the cause of their sorrow was
not disappointment over the nonarrival of the Parousia, as Best
suggests,<info t="g88b114" n=14> but rather anxiety over the issue of
whether the Christian dead would suffer a disadvantage at the
Parousia.<info t="g88b115" n=15> The question still remains why Paul|;

s/\n/ /g;   # make it one line

print $_\n";   # output before
print "\n\n";

s#(<grc>.*?</grc>)#
   $greek = $1;

   $greek =~ s/(<info[^>]+>)(.*)/$2$1/;

   $greek;
#ge;

print "$_\n";  # output after
--------------------------------------------


   And the usual caveats about trying to use regexs for real
   grammars apply.

   The above _depends_ on the whole <grc> element being on one line,
   which may be the case for your particular data, but is not required
   in arbitrary SGML. There are other "simplifying assumptions"
   embodied in the above code as well. 

   It is for sure not applicable to arbitrary SGML instances...


   Good luck!


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


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

Date: Tue, 13 Oct 1998 15:59:21 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: London.pm - Changed URL
Message-Id: <36237659.DD3E86B1@bbnplanet.com>

brian d foy wrote:

> That is, Perl Mongers now offers free web hosting to Perl Users Groups.
> And we're not talking that limited sort of web hosting either - all the
> toys are there:

Yes, now the Omaha guys can put a picture of the Arch on their web page
to prove that they are, indeed, the 'Gateway to the West'. ;)

> and it's free as in "freedom" and as is in "free beer". :)

Even the box was free...it just doesn't get any cheaper does it? 

e.


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

Date: Tue, 13 Oct 1998 09:33:54 -0700
From: "Mike Pritchard" <mikep@5circles.com>
Subject: Re: Mail on NT
Message-Id: <LhLU1.1109$9c2.2318@news14.ispnews.com>


scott@softbase.com wrote in message <362356be.0@news.new-era.net>...
>> I want to send MAPI mail in a Perl script running on Windows NT.
>
>You can try, but it won't work. MAPI, particularly the
>Automation interface, is totally and completely
>broken. Even changing e-mail clients will break it.
>Don't use it.
>
>> Are there alternatives?
>
>USE SMTP!!! Do not use MAPI.


So how do I use SMTP to talk to Microsoft Mail post offices?  (pre
Exchange?)

Thanks
Mike




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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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