[10080] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3673 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 9 21:07:20 1998

Date: Wed, 9 Sep 98 18:01:10 -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           Wed, 9 Sep 1998     Volume: 8 Number: 3673

Today's topics:
    Re: Design by Contarct Seminar Series (Larry Rosler)
    Re: Displaying record count (Steve Linberg)
    Re: Displaying record count <tlbarlet@le-ana-enterprises.com>
    Re: help requested on a perl program jojo9645@my-dejanews.com
    Re: help requested on a perl program jojo9645@my-dejanews.com
    Re: help requested on a perl program (Alastair)
    Re: History of Perl - round 1 (David Adler)
    Re: History of Perl - round 1 (David Adler)
    Re: IO::File Permissions - Enlightened! (Ronald J Kimball)
    Re: learning perl......... (Andre L.)
    Re: No switch statement in Perl?? (Steve Linberg)
    Re: Off topic, but ... [Was Re: Perl & Java - differenc <merlyn@stonehenge.com>
    Re: Perl "<!--#exec" with IIS, How? (Steve Linberg)
    Re: Perl & Java - differences and uses (David Adler)
    Re: Perl & Java - differences and uses <borg@imaginary.com>
    Re: Perl Data Structures: trees etc... (David Formosa)
    Re: Perl gurus opinion needed. (David Adler)
    Re: Perl gurus opinion needed. (David Adler)
    Re: Perl gurus opinion needed. (David Adler)
    Re: QUESTIONS (was: Perl Programmer Needed) (Ronald J Kimball)
        Regular Expression - substitution from lower to upper c <julius@clara.net>
        System call in PERL <julius@clara.net>
    Re: System call in PERL (Alastair)
        Trying to change perl.dll to a static library (for Perl <jwillsp4m@ibm.net>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Wed, 9 Sep 1998 16:01:15 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Design by Contarct Seminar Series
Message-Id: <MPG.1060a89823aaa60a98979c@nntp.hpl.hp.com>

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

In article <6t6ohk$599$1@news.rain.org> on Wed, 9 Sep 1998 13:31:06 -
0700, Interactive Software Eng. <training@eiffel.com> says...
> DESIGN BY CONTACT AND THE COMPONENT REVOLUTION
> Presented by Dr. Bertrand Meyer
> <SNIP of  advertisement for course>

I searched this post for 'perl' and the only place I found it was in 
'comp.lang.perl.misc'.  SPAM SPAM SPAM!

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


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

Date: Wed, 09 Sep 1998 19:08:03 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Displaying record count
Message-Id: <linberg-0909981908030001@ppp-204-183-92-111.oldcity.dca.net>

In article <5BDJ1.1090$p61.1680504@news4.mia.bellsouth.net>, "Terry L.
Barlet" <tlbarlet@le-ana-enterprises.com> wrote:

> The data files are just a text file with a " | " delimiter.  Each record
> begins with an ad id.

Ah, you're in luck then.  A straight text file.  Just the thing Perl was
built to handle.

Read up on the m// operator.  It will match a pattern and, if evaluated in
a scalar context, return the number of matches.  You can slurp your file
into a string, do a bunch of matches on it to count the things you're
looking for, then use that information however you want.

If you want to post a few lines of your actual data, and a clear
explanation of what you want to do, I or someone can come up with a little
code for you to demonstrate this.
_______________________________________________________________________
Steve Linberg                         National Center on Adult Literacy
Systems Programmer &c                        University of Pennsylvania
linberg@literacy.upenn.edu                http://www.literacyonline.org


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

Date: Wed, 09 Sep 1998 23:27:20 GMT
From: "Terry L. Barlet" <tlbarlet@le-ana-enterprises.com>
Subject: Re: Displaying record count
Message-Id: <s9EJ1.1110$p61.1701733@news4.mia.bellsouth.net>

It might be a bit long to post to the group but with your permission I'll
send via email. If you dont think it would be to much to post I can do that
too. The data files themselves contain 38 fields.




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

Date: Wed, 09 Sep 1998 23:01:04 GMT
From: jojo9645@my-dejanews.com
Subject: Re: help requested on a perl program
Message-Id: <6t71bg$mit$1@nnrp1.dejanews.com>

Alright.

the program is supposed to work on a field of data formatted as follow:

  data data  |	data data data	|data  |  data data data  |  data |

note: its a text file and each field has the usual "\n" at the end.
The code which works fine on small files but not on big files is:

#!/usr/bin/perl
open(RF1,"raw.in");
open(OF1,">trim.out");
$|=1;
while($in=<RF1>){
	chop($in);
	@field=split(/\|/,$in);
	foreach $m (@field){
		@a=split(/ /,$m);
		$wf="";
		foreach $n (@a){
			if ($n ne ""){
				$wf.=$n." ";
			}
		}
		$line.=$wf."|";
	}
	reset("a");
	reset("f");
	@a=split(/\|/,$line);
	foreach $m (@a){
		if ($m ne ""){
			$new.=$m."|";
		}
	}
	chop($new);
	chop($new);
	chop($new);
	chop($new);
	print OF1 "$new\n";
	print"$new\n";
	reset ("a-z");
}
close(OF1);
close(RF1);
#the end

I have since produced a code which would handle the job but still this one
(though long) should work (I think).

any help would be appreciated.

jojo



In article <7LlJ1.4$eo3.11569@nsw.nnrp.telstra.net>,
  mgjv@comdyn.com.au (Martien Verbruggen) wrote:
> In article <6t4gik$2f3$1@nnrp1.dejanews.com>,
> 	jojo9645@my-dejanews.com writes:
> > I need help on a perl program I am working on. its a short code (less than
> > 700 BYTES) designed for removing excessive spaces in a field (pipe
>
> If the code is that short, maybe you can post it here. That way you
> might have had a direct answer pointing out that maybe you should code
> that part of your program differently, or whatever. hard to say
> without seeing any code, hmm?
>
> Martien
> --
> Martien Verbruggen                  |
> Webmaster www.tradingpost.com.au    | This matter is best disposed of from a
> Commercial Dynamics Pty. Ltd.       | great height, over water.
> NSW, Australia                      |
>

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Wed, 09 Sep 1998 23:15:46 GMT
From: jojo9645@my-dejanews.com
Subject: Re: help requested on a perl program
Message-Id: <6t7271$o18$1@nnrp1.dejanews.com>

In article <slrn6vboei.h6.alastair@calliope.demon.co.uk>,
  alastair@calliope.demon.co.uk wrote:
> Alastair <alastair@calliope.demon.co.uk> wrote:
> >
> >Perhaps you're pentium has a bug?

aha! no wonder my friends keep looking at me funny when I'm working on my
computer. :-)

any way, I posted the code on this news group and if you can take a look at it
and give me your comments I would be very greatfull.

Thanks in advance,

jojo

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Thu, 10 Sep 1998 00:08:09 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: help requested on a perl program
Message-Id: <slrn6ve9q0.5j.alastair@calliope.demon.co.uk>

jojo9645@my-dejanews.com <jojo9645@my-dejanews.com> wrote:
>
>any way, I posted the code on this news group and if you can take a look at it
>and give me your comments I would be very greatfull.
>
>Thanks in advance,

Your code doesn't seem to work properly - it seems to strip too many characters
from teh end of the line. I found it very confusing to read I'm afraid. Are you
sure something like this isn't easier ;

while (<>) {
  s/\s{2,}/ /g;
  print;
}

I'm not sure what 'excessive' spaces are.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: 9 Sep 1998 23:02:45 GMT
From: dha@panix.com (David Adler)
Subject: Re: History of Perl - round 1
Message-Id: <6t71el$k43@news1.panix.com>

On 6 Sep 1998 02:21:56 GMT, Abigail <abigail@fnx.com> wrote:
>Capitals, proper punctuation, spelling, and grammar makes text easier
>to read. But, if you want to limit your audience, don't bother with those.

An then, following that "easier to read" comment,

>perl  -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
>          for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
>          print chr 0x$& and q
>          qq}*excess********}'

I'm not the only one amused, surely?  :-)

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"It's all in the mind." - Madness


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

Date: 9 Sep 1998 23:14:07 GMT
From: dha@panix.com (David Adler)
Subject: Re: History of Perl - round 1
Message-Id: <6t723v$k43@news1.panix.com>

On Tue, 08 Sep 1998 13:57:57 GMT, Elaine -HappyFunBall- Ashton
<eashton@bbnplanet.com> wrote:

>will, but I am really tired of the pointless drivel about punctuation

If it makes you feel any better, there are a *lot* of people out there
that will give up on capital letters to save typing.  In fact I think
randal talks about saving typing strokes in the Llama (ha!  See, I can
be on-topic!)

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"In my opinion, there's nothing in this world beats a '52 Vincent and
a red headed girl" - James Adie


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

Date: Wed, 9 Sep 1998 19:03:15 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: IO::File Permissions - Enlightened!
Message-Id: <1df3qst.17l7lt31p4tifiN@bay1-161.quincy.ziplink.net>

[posted and mailed]

Bill 'Sneex' Jones <sneaker@sneex.fccj.org> wrote:

> Ronald J Kimball wrote:
> > 
> > Bill 'Sneex' Jones <sneaker@sneex.fccj.org> wrote:
> > 
> > > # This next line only works when my umask is 077;
> > > umask 077; # Temporarily change it...
> > > my $fh = new IO::File $file, "a", 0600;
> >                                     ^^^^
> > 
> > Ignored, because your file mode is not numeric.
> 
> # Hmmm, please see perldoc IO::File below :]

You're referring, I assume, to the code excerpt I posted that proves my
point?

> > When you get a chance, you really should read the docs for IO::File.
> > Would it help if I posted the relevant section again?
> > 
> > Perhaps if I posted the actual code instead...
> > 
> > sub open {
> >     @_ >= 2 && @_ <= 4 or
> >         croak 'usage: $fh->open(FILENAME [,MODE [,PERMS]])';
> >     my ($fh, $file) = @_;
> >     if (@_ > 2) {
> >         my ($mode, $perms) = @_[2, 3];
> 
> # How/where do you determine mode 2 should be used???
> # Or is this array split thingy?

[I believe you meant to say 'array slice'.]

@_[2, 3] are the third and fourth arguments to IO::File::open().
Looking at the usage above (and remembering that the first argument to a
method is $self) you can see that the second and third arguments are
MODE and PERMS respectively.

> >         if ($mode =~ /^\d+$/) {

In this line, we see that IO::FILE::open() behaves differently depending
on whether MODE is numeric or not.

> >             defined $perms or $perms = 0666;
> >             return sysopen($fh, $file, $mode, $perms);
> >         }

Here, we see that if MODE *is* numeric, IO::FILE::open() calls sysopen,
with the PERMS argument, and returns the result.

> >         $file = _protect($file) if $file =~ m{\A[^\\/\w]};
> >         $file = IO::Handle::_open_mode_string($mode) . " $file\0";
> >     }
> >     open($fh, $file);
> > }

In this section of code, which is executed if and only if MODE is *not*
numeric, we see that IO::FILE::open() does not use the PERMS argument at
all, and instead calls Perl's built-in open().

> > 
> > As you can plainly see, the $perms argument is used *if and only if* the
> > $mode argument matches /^\d+$/.  Your mode of "a" does not match, so
> > your perms of 0600 is ignored.
> > 
> > > Seriously, I do understand now, and I appreciate
> > > everyone's patience while I was rambling :]
> > 
> > No, you still haven't gotten it, but you're welcome anyway.
> > 
> 
> I see by perldoc IO::File that -
>            use IO::File;
> 
>            $fh = new IO::File;
>            if ($fh->open("< file")) {
>                print <$fh>;
>                $fh->close;
>            }
> 
>            $fh = new IO::File "> file";
>            if (defined $fh) {
>                print $fh "bar\n";
>                $fh->close;
>            }
> 
>            $fh = new IO::File "file", "r";
> # Mode "r" here LOOKS like a string to me...

Yes, it is a string.  And it looks to me like there is no PERMS
argument.  That is not a coincidence - a PERMS argument with a MODE of
"r" would be useless, because PERMS is ignored if MODE is not numeric.

You could change the above line to

$fh = new IO::File "file", "r", "This is not a valid value for PERMS!";

and it would work just as well and do the exact same thing.

> 
>            if (defined $fh) {
>                print <$fh>;
>                undef $fh;       # automatically closes the file
>            }
> 
>            $fh = new IO::File "file", O_WRONLY|O_APPEND;
> # And if I do this OWRONLY|O_APPEND, I get an error unless
> # I 'use POSIX or Fcntl', and then I get an error saying:
> # Filehandle Symbol::GEN0 opened only for input at security.pl line 22.
> # Even though I used O_APPEND...

Tsk tsk tsk...  Looking at your sample code...

> my $fh = new IO::File $file, O_APPEND, 0600;

Oops, you *didn't* do O_WRONLY|O_APPEND.  No wonder you're getting an
error.  O_APPEND means "Append on each write.", but the writing is not
implicit.  You still have to specify that you want to open the file for
writing.

my $fh = new IO::File $file, O_WRONLY|O_APPEND, 0600;

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Wed, 09 Sep 1998 20:43:45 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: learning perl.........
Message-Id: <alecler-0909982043450001@dialup-366.hip.cam.org>

In article <35F6EE41.3ABA@klaskycsupo.com>, jamdiaz@klaskycsupo.com wrote:

> I am trying to learn to create some reports on a UNIX based system..I
> what to take output,such as df -k and output to file...then make it
> readable...
> 
> I tried using split to create fields, but the split(//): only takes one
> space into account...How can I parse fields with various number spaces
> in between....

split / +/ splits on one or more space characters. split /\s+/ splits on
one or more whitespaces.

You will find useful information on search patterns in the perlre document.

HTH,
Andre


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

Date: Wed, 09 Sep 1998 19:19:58 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: No switch statement in Perl??
Message-Id: <linberg-0909981919580001@ppp-204-183-92-111.oldcity.dca.net>

In article <6sfb0m$m8e$1@nnrp1.dejanews.com>, spiegler@cs.uri.edu wrote:

> Hi,
> 
> I cannot find a switch statement in Perl. Is there one? If not, do you know
> why it was not put into the language?

Tom Christiansen just posted a huge FMTYEWTK about this right here, a
couple of days ago.  Please look for it.
_______________________________________________________________________
Steve Linberg                         National Center on Adult Literacy
Systems Programmer &c                        University of Pennsylvania
linberg@literacy.upenn.edu                http://www.literacyonline.org


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

Date: Thu, 10 Sep 1998 00:13:08 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Off topic, but ... [Was Re: Perl & Java - differences and uses]
Message-Id: <8cyarsj05a.fsf@gadget.cscaper.com>

>>>>> "I" == I R A Aggie <fl_aggie@thepentagon.com> writes:

I> In article <8c7lzdz1it.fsf@gadget.cscaper.com>, Randal Schwartz
I> <merlyn@stonehenge.com> wrote:

I> + Ditto for California (shielding us from Mexico). :)

I> Ah, but what shields you from those Californicators who seek refuge?

The massive amounts of rain we have.

Listen up californians...
you think el nino was bad?

It's like that EVERY YEAR here.  We laugh at your few extra
days of rain.  It's like that ALL THE TIME in OREGON.

Last year in Oregon, Summer fell on a *tuesday*.  That was it.  One
day.  Big shiny thing in the sky.  Some people thought it was a UFO.
And Oregonians don't tan in the summer... they *rust*.

Just another native Oregonian (wink),

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Wed, 09 Sep 1998 19:11:39 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Perl "<!--#exec" with IIS, How?
Message-Id: <linberg-0909981911390001@ppp-204-183-92-111.oldcity.dca.net>

In article <LOuG1.6$po.175265@sapphire.mtt.net>, "Wayne Cochrane"
<wcochrane@pobox.com> wrote:

> Can I issue the line below on an IIS server running Perl? Eveything seems to
> be Unix based in the scripting world. When using Perl for IIS, do ALL the
> same Unix calls work?

No. WinNT != Unix.

> <!--#exec cmd="perl -pi -e '$_++' thispage.cnt;cat thispage.cnt"-->

IIS can be configured execute SSI's.  Beyond that, you have to have the
programs you want to run; I don't think "cat" works under NT, for
example.  Sometimes there are equivalents.  You'll have to read up on the
specific things you want to do.
_______________________________________________________________________
Steve Linberg                         National Center on Adult Literacy
Systems Programmer &c                        University of Pennsylvania
linberg@literacy.upenn.edu                http://www.literacyonline.org


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

Date: 10 Sep 1998 00:12:33 GMT
From: dha@panix.com (David Adler)
Subject: Re: Perl & Java - differences and uses
Message-Id: <6t75hh$k43@news1.panix.com>

On Wed, 02 Sep 98 16:54:11 GMT, Scott Ellsworth <scott@eviews.com> wrote:

>In my experience, the good Python people do not like Perl very much
>and the good Perl people do not like Python very much.  Since they
>are both strong for similar tasks, imho, this surprised me a bit.

Well, it seems to me that the gap comes from the use of whitespace.
In perl, whitespace is (mostly) free to do what it wants.  In Python,
it's the thing that holds everything together, and therefore quite
rigidly restricted in its use.

Similar tasks, violently different mindsets.

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"Que?" - Manuel


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

Date: Thu, 10 Sep 1998 00:53:00 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <MpFJ1.544$E9.1882388@ptah.visi.com>

Perl has no real use.  If you have to do scripting or text processing,
use Python.  Otherwise, use Java.

In comp.lang.java.programmer Jim <-> wrote:
: As a young(17) and budding internet page designer I have often been told
: "forget the rest, learn Java" when asking about programming for the net,
: this is also the message Internet magazines tend to give. However having
: recently been learning Perl(and loving it) I am curious as to the power Java
: has over Perl, what the main uses are and the main differences are, will
: Perl eventually be replaced by Java?

: If anybody has some helpful links I would be grateful.

: Jim



-- 
George Reese (borg@imaginary.com)       http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
   "Keep Ted Turner and his goddamned Crayolas away from my movie."
			    -Orson Welles


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

Date: 10 Sep 1998 09:18:13 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: Perl Data Structures: trees etc...
Message-Id: <6t72bl$qes$1@godzilla.zeta.org.au>

In <6t6n7o$m21$1@monet.op.net> mjd@op.net (Mark-Jason Dominus) writes:

[...]

>  Trees are used for management of hierarchical data such as expressions; 
>in this case the solution in Perl usually involves a hash, or perhaps a
>collection of hierarchically nested hashes.

Hierarchically nested hashes are trees.



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

Date: 10 Sep 1998 00:44:19 GMT
From: dha@panix.com (David Adler)
Subject: Re: Perl gurus opinion needed.
Message-Id: <6t77d3$k43@news1.panix.com>

On Wed, 02 Sep 1998 21:42:24 GMT, Elaine -HappyFunBall- Ashton
<eashton@bbnplanet.com> wrote:

>i have always found the word 'hacker' to be interesting. its root comes
>from the word 'hackney' which was a fancy type of carriage horse until
>they became so common, hence the word 'hackneyed', that they became
>passe'. the action of 'to hack' has the connotation of shoddy,
>commonplace, pedestrian. and of course 'a hack' is a horse of the
>non-stellar variety.

Keep in mind that, by many peoples definition, Dickens was a hack
writer.  Enormously talented, I think, but a hack.

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"scanf() is evil."


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

Date: 10 Sep 1998 00:44:47 GMT
From: dha@panix.com (David Adler)
Subject: Re: Perl gurus opinion needed.
Message-Id: <6t77dv$k43@news1.panix.com>

On 3 Sep 1998 02:51:44 GMT, Alan Barclay <gorilla@elaine.drink.com> wrote:
>In article <35EDB96A.C276ED31@bbnplanet.com>,
>Elaine -HappyFunBall- Ashton  <eashton@bbnplanet.com> wrote:
>>perl jerky-boy
>[You've read them already]
>>perl dragon
>
>>i could go on...this is fun. ideas anyone?
>
>perl monger.

Yeah!

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"That's one of the tragedies of this life:  that the men most in need
of a beating up are always enormous." - John D. Hackensacker III


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

Date: 10 Sep 1998 00:45:39 GMT
From: dha@panix.com (David Adler)
Subject: Re: Perl gurus opinion needed.
Message-Id: <6t77fj$k43@news1.panix.com>

On 2 Sep 1998 23:40:53 -0400, Mark-Jason Dominus <mjd@op.net> wrote:
>At the conference, when we were printing certificates, people asked us
>for the darndest things.  We certified people as Perl Programmers,
>Perl Studmuffins, Perl Gurus, Perl Hackers, Perl Engineers, Perl
>Experts, Perl Wizards, Perl Poets, Perl Porters, Perl Pornographers,
>and Perl Pimps.  

Aw, you left mine out: Certified Perl Druid!

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
"Your point being..." - Homer Simpson


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

Date: Wed, 9 Sep 1998 19:26:05 -0400
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: QUESTIONS (was: Perl Programmer Needed)
Message-Id: <1df3s6u.ygpmbb192ze6mN@bay1-161.quincy.ziplink.net>

Patrick Timmins <ptimmins@netserv.unmc.edu> wrote:

> help me out quick buds ...
> [etc.]

*rofl*

That was hilarious!  Although it was rather frightening that several
people responded apparently unaware that it was in jest.  Some people
just don't understand satire.

Anyone who thinks this was a joke needs to pay more attention to From:
headers.  Patrick Timmins has posted more than 50 messages to clpm in
the past month.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Wed, 9 Sep 1998 21:13:51 +0100
From: "Jules" <julius@clara.net>
Subject: Regular Expression - substitution from lower to upper case...how?
Message-Id: <6t76cq$gst$1@eros.clara.net>

Dear all, please tell me how I could use the substitution expression to
convert all lowercase characters to uppercase? I tried \U\E pair but won't
work. My program is as follows:

Thanx,
            Jules

---------------------------------------------------------------------------
-----------------------------------------
print "Please enter the Input Filename: "; chomp ($infile = <STDIN>);
print "Please enter the Output Filename: "; chomp ($outfile = <STDIN>);

if (-e $infile) {open (IN, $infile) || die "Error: Cannot open $infile:
$!"}
else {print "Error: File $infile does not exist"}

if (-e $outfile && -w $outfile) {open (OUT, ">".$outfile) || die "Error:
Cannot open $outfile: $!"}
else {print "Error: File $outfile does not exist or is write protected"}

print "Please enter a Search Pattern: "; chomp ($regexp = <STDIN>);
print "Please enter a Replacement String: "; chomp ($replace = <STDIN>);

while (<IN>) {  chomp;  $_ =~ s/$regexp/$replace/g;  print OUT $_."\n"; }

close (IN) || die "Error: Cannot close $infile: $!";
close (OUT) || die "Error: Cannot close $outfile: $!";




***There is not enough darkness in the whole world to extinguish the light
of a small candle***






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

Date: Wed, 9 Sep 1998 21:58:58 +0100
From: "Jules" <julius@clara.net>
Subject: System call in PERL
Message-Id: <6t76cu$gst$2@eros.clara.net>

Dear all, how do I make a system call in PERL?

Thanx,
            Jules

***There is not enough darkness in the whole world to extinguish the light
of a small candle***






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

Date: Thu, 10 Sep 1998 00:47:32 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: System call in PERL
Message-Id: <slrn6vec3r.5j.alastair@calliope.demon.co.uk>

Jules <julius@clara.net> wrote:
>Dear all, how do I make a system call in PERL?
>

'system' perhaps? perldoc -f system

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Thu, 10 Sep 1998 10:09:36 +1000
From: Jacob Williamson <jwillsp4m@ibm.net>
Subject: Trying to change perl.dll to a static library (for Perl compiler)
Message-Id: <35F718C0.496B830F@ibm.net>

I'd like to know if I can make a static library version of
perl.dll - if it's feasible or even possible.

I've crossposted to Borland group, since this might only be a
question of me not understanding how to make libraries, rather
than something to do with perl; maybe my question is just
"how do I make a static library instead of a dynamic library?",
so anyone who knows about making libraries with Borland C++
but doesn't know anything about perl, don't hesitate to
reply :)

I've downloaded Malcolm Beattie's a3 Perl compiler for UNIX,
and it works just fine under AIX.
I've also downloaded Perl 5.005 beta 1, and have compiled it
under Windows NT. The Perl compiler works great under NT
as well (well done Malcolm!).

However, the executable produced by the Perl compiler under
AIX is standalone. However, under Windows NT, the executable
also requires perl.dll to be present on the target machine.

Can I make a "static" version of perl.dll? I think I have
all the source code - after all I had to run a makefile
to make perl.dll under NT.

I am using Borland C++ 5.02 along with dmake, the free 'make'
program (as it says in the Perl 5.005 README.win32).
In makefile.mk, the relevant entries that makes perl.dll with
Borland C++ are
*********************
  PERLDLL		= ..\perl.dll
  LINK32		= tlink32
  IMPLIB		= implib -c
  LINK_FLAGS		= -Ld:\work\bc5\lib

  $(PERLDLL): perldll.def $(PERLDLL_OBJ)
	$(LINK32) -Tpd -ap $(LINK_FLAGS) \
	    @$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
		$@,\n \
		$(LIBFILES)\n \
		perldll.def\n)
	$(IMPLIB) $*.lib $@
*********************
I think that the above results in the commands
  tlink32 -Tpd -ap -Ld:\work\bc5\lib @C:\TEMP\mk000001
	where mk000001 is a temporary file holding all
	Borland C++ .obj files to be linked in, and
  implib -c ..\perl.lib ..\perl.dll
	which makes an import library called perl.lib
	that refers to the entries in perl.dll .


I tried to make a static version of perl.dll (and call it
myperl.lib), by writing the following into makefile.mk:

*************************
myperl.lib: $(PERLDLL_OBJ)
	tlib myperl.lib /P32 \
	    @$(mktmp $(PERLDLL_OBJ:s,\,\\,:^"+") $(LIBFILES:^"+d:\work\\\\bc5\lib\\")\n
\
	        $@,\n)
*************************
This runs a Borland C++ tlib command to make a static library:
  tlib myperl.lib /P32 +..\av.obj +..\byterun.obj .........
which links in all the .obj files and .lib files that are
needed (the .lib files, i.e. $(LIBFILES), might not be needed
here as they are linked later directly into the executable,
but I can't get it to work either way).


So I end up with a myperl.lib file which is supposedly my
"static" version of the perl.dll file.
Then, to create the final executable from a C source file
like example.c, I run the cc_harness command as usual.
When I use perl.dll, this produces the Borland C++ command:
  bcc32 -O2 -D_RTLDLL -DWIN32
  -Ic:\perl5005beta1\5.00475\lib\MSWin32-x86/CORE
  -O2 example.c  -LD:\work\bc5\lib
  c:\perl5005beta1\5.00475\lib\MSWin32-x86/CORE/perl.lib
  import32.lib cw32mti.lib odbc32.lib odbccp32.lib

(The .lib files are those that I mentioned previously in my
 post in regards to $(LIBFILES).
)
So if I want to use my myperl.lib, I put myperl.lib in the
above command instead of perl.lib, and I also tried to
remove the -D_RTLDLL (doesn't make a difference). It compiles
with warnings, but when I use perl.dll, it compiled with
similar warnings anyway.

If I make the executable with perl.dll, it of course works.
If I make it with myperl.lib instead, the executable just
pauses for a second, then returns the prompt. So there are
no obvious errors.

Any suggestions?


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

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

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