[9000] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2618 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 16 11:07:31 1998

Date: Sat, 16 May 98 08:00:24 -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           Sat, 16 May 1998     Volume: 8 Number: 2618

Today's topics:
    Re: can't find uninitialized value after while block, c <jdf@pobox.com>
    Re: Como crear un CHAT en WEB???/ How to create a CHAT  <chat@web.com>
    Re: date, datediff, yesterday perl functions ? <sowmaster@juicepigs.com>
    Re: DB_File in Solaris <eg_ckc@uxmail.ust.hk>
    Re: Does Perl have a IDE?I don't like command line. <dformosa@st.nepean.uws.edu.au>
    Re: Does Perl have a IDE?I don't like command line. <webmaster@fccjmail.fccj.org>
    Re: Does Perl have a IDE?I don't like command line. <webmaster@fccjmail.fccj.org>
    Re: Does Perl have a IDE?I don't like command line. (Stuart McDow)
    Re: Does Perl have a IDE?I don't like command line. (Stuart McDow)
    Re: Does Perl have a IDE?I don't like command line. (Stuart McDow)
    Re: Does Perl have a IDE?I don't like command line. <webmaster@fccjmail.fccj.org>
        Flat-File db recommendation <skc1234@hotmail.com>
    Re: How to define constants without C code (M.J.T. Guy)
        IF problems.... <ampun@bigfoot.com>
    Re: Is if ($a="something") a bad style? (Mark-Jason Dominus)
        localtime() <frank@consol.de>
    Re: localtime() <lr@hpl.hp.com>
    Re: Memory problem. <jll@skynet.be>
        perl cgi script help <briwillis@yahoo.com>
    Re: Regex problem: substituting 3+ identical characters (Oliver Heidelbach)
    Re: removing last line from file <r.goeggel@atos-group.de>
    Re: Substitution Problems :( <r.goeggel@atos-group.de>
    Re: system vs exec vs piped open... <tchrist@mox.perl.com>
    Re: Tip: Filehandles <jdf@pobox.com>
        webbased email <Philipp999@gmx.net>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 16 May 1998 07:34:38 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Scott Sutherland <suthsc@ncs.com>
Subject: Re: can't find uninitialized value after while block, causing warning
Message-Id: <pvhez95t.fsf@mailhost.panix.com>

Scott Sutherland <suthsc@ncs.com> writes:

> I have the following code segment which is causing an uninitialized
> value warning: (I use strict in the module)

use strict has nothing to do with an uninitialized value warning.  The
warning comes from the use of -w.

>   while ($dbh->ct_results($restype) == CS_SUCCEED) {
> 	if ($self->{'_debug'}) {
> 	  $self->reportResultType($restype);
> 	}
> 
	[snip]
>   }
> 
>   if ($self->{'_debug'} & 8) { ### <<<--- causes uninitialized
>                                ###        warning...

Are you *quite* sure that that loop is executing at all?  Have you put
a print statement before that if?  Have you run this code in the debugger?

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Sat, 16 May 1998 15:47:42 +0200
From: "alehoop!!" <chat@web.com>
Subject: Re: Como crear un CHAT en WEB???/ How to create a CHAT in WEB??
Message-Id: <355d99de.0@news.arrakis.es>


alehoop!! escribis en mensaje ...
>Hola quiero poner un CHAT en mi pagina WEB, tengo el csdigo que envmo
>adjunto, no se como ponerlo en funcionamiento, agradecerma que me ayudaseis
>si alguien sabe como funciona.
>Si conociis otro csdigo u otro programa para conseguir realizar un CHAT
>ruego me indiquiis donde conseguirlo y como funciona.
>Gracias a todos.
>
>
>Hello I want to put a CHAT in my WEB pages, I have the code that I send
>attached, one doesn't eat to put it into operation, I would thank that
helps
>me if somebody knows like it works.
>If you know another code or another program to be able to carry out a CHAT
I
>request you indicate me where to get it and like it works.
>Thanks to all.
>
>
>
>
>
>
>
>
>
>








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

Date: Sat, 16 May 1998 10:30:52 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
To: anon5f6b@nyx.net
Subject: Re: date, datediff, yesterday perl functions ?
Message-Id: <355DA31C.210A@juicepigs.com>

anon5f6b@nyx.net wrote:
> 
> Is there a date library in perl that would provide functionality
> for say yesterday's date, tomorrow's date, days between dates,
> date n days from now, etc.

yep.

The module you are looking for is Date::DateCalc

($year,$mm,$dd) = calc_new_date($year,$mm,$dd,$offset); 

$offset can be neg or positive. 

HTH
-- 
Bob Trieger               |  Titanic: big boat, bigger
sowmaster@juicepigs.com   |           iceberg, big deal


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

Date: 16 May 1998 10:53:24 GMT
From: George Chung <eg_ckc@uxmail.ust.hk>
Subject: Re: DB_File in Solaris
Message-Id: <6jjr74$9f4@ustsu10.ust.hk>

George Chung <eg_ckc@uxmail.ust.hk> wrote:
> I can use DB_File in my linux box but i cannot in Solaris 2.5.1. I have
> tried my best to build it but failed.

> Anyone could guide me how to compile perl with DB_File support in Solaris ?


	The problem is solved. Just figure out DB_File module should be
installed seperately.

George
-- 
Chung Kwong Chuen, George, [big5] Ai%z,u, [gb] VS9bH* .
E-mail: eg_ckc@uxmail.ust.hk	Homepage: If I can squeeze a little time....
Department: Electrical and Electronic Engineering,
Computer Engineering Programme. Final-year student -p:b>w$u5{$T&~/E
The Hong Kong University of Science and Technology. -;4d,l'^$j>G.


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

Date: 16 May 1998 10:06:36 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <895313196.42515@cabal>

In <6jiicl$d0$1@ultranet.com> fsg@ultranet.com writes:

[...]

>  This [...free softwhere generating the best softwhere...] is a great
>idea, but is a crock. For instance, Perl does not have a usable graphical
>user interface library.

I find tk a very usable GUI library.

>It does not (but will soon) have threads.

Your point?

>  The Perl compiler does not produce optimized C code.

And the perl compiler is still expermental.

>  CPAN is a haphazardly organized, curiously
>formatted collection of non-orthogonal, varying-quality patchwork
>modules.

It is also one of the most widly ranging collection of modeles that I've
seen.  The veritity is quite amazing.

>  GCC is extremely slow.

Beg parden?  GCC seems to me to produce some of the fastest code I've come
across.

>  Unix does not have a way to drag and
>drop.

And thats a problem how?

[...]

>Why not?  Because there's nobody who gets paid to do this, or who
>cares enough to solve it (where it needs getting solved; opinions may
>vary, wildly).

If peaple don't care enough to solve it then it isn't very importent is
it?

--
I'm a perl programer; if you need perl programing, hire me. 
Please excuse my spelling as I suffer from agraphia; see the url. Support NoCeM
http://www.cit.nepean.uws.edu.au/~dformosa/Spelling.html  http://www.cm.org/ 
I'm sorry but I just don't consider 'because its yucky' a convincing argument


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

Date: Sat, 16 May 1998 12:56:39 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <355D8B2E.8F08090A@fccjmail.fccj.org>

Lloyd Zusman wrote:
> 
> abigail@fnx.com (Abigail) writes:
> 
> > Stuart McDow (smcdow@arlut.utexas.edu) wrote on MDCCXVIII September
> > MCMXCIII in <URL: news:6jiceb$d1n$1@ns1.arlut.utexas.edu>:
> > ++ abigail@fnx.com (Abigail) writes:
> > ++ >
> > ++ > [ ... ]
> > ++
> > ++ $ uname -a ; gcc -v
> > ++ SunOS sgggsd16.arlut.utexas.edu 5.6 Generic_105182-03 i86pc i386 i86pc
> > ++ Reading specs from /opt/depot/gcc/lib/gcc-lib/i386-pc-solaris2.6/2.8.1/specs
> > ++ gcc version 2.8.1
> > ++
> > ++ Do you pay for gcc?
> >
> > gcc is hardly native to SunOS, is it? Besides, how do you build gcc
> > without a compiler?
> 
> There's a site at Sun 

http://sunsite.unc.edu

And no, gcc, et al, is NOT part of SunOS distibution, but it is VERY
easy to port there :-)

Ask an yea shall recieve :-)
-Sneex- 
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster


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

Date: Sat, 16 May 1998 12:55:01 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <355D8ACC.3CDD1E75@fccjmail.fccj.org>

Chip Salzenberg wrote:
> 
> According to kfox@pt0204.pto.ford.com:
> >IMHO, this discussion is only important to the future of Perl if the
> >clueless newbies are really representative of the Windows programming
> >community.  If they are, I'd say Perl's future depends on Linux (because
> >Unix' future seems to depend on Linux).  Anybody have solid data?
> 
> I'm sure that Perl's future depends on non-Windows, because M$ has done
> so much brainwashing and is so paranoid and has such resources and press
> contacts that Perl for Windows will be squashed as soon as it is seen as
> any kind of threat to anything that M$ does or might possibly think to do.

Hear Hear!  Squash M$, er, I mean Windows :-)
-- 
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster


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

Date: 16 May 1998 13:53:06 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jk5o2$85g$1@ns1.arlut.utexas.edu>

abigail@fnx.com (Abigail) writes:
>
> gcc is hardly native to SunOS, is it? Besides, how do you build gcc
> without a compiler?

Well, for that matter, there isn't a native compiler for NT,
either. The playing field is level in that regard. But at least SunOS
is an open system (for the most part) and has well-known behavior (for
the most part). As for building gcc, I downloaded a pre-built gcc from
somewhere (sunsite, maybe?), and used that to build gcc. Simple, no?

> Really? A recent thread on p5p claimed that IRIX doesn't come with
> include files.

Hmm, I can't speak to that directly. My dim memory is that, for IRIX 5
as least, the include files were included on the distribution cdrom,
but not installed by default. Would someone like to run 'inst' against
an IRIX distribution cdrom to verify that?


> Perhaps you have to pay twice, but you should look at the total
> cost.  How much does NT + SDKs costs compared say Solaris +
> compiler.

Well, if we're going to talk about cost, we must also talk about cost
of machine maintenance as well. There is plenty of evidence to show
that a medium to large network (>250 machines) of NT machines is much
more expensive to maintain than a network of Unix machines. Well,
certian Unix machines anyway. :-). And there is a lot of anecdotal
evidence to suggest that this also holds true from smaller networks.

http://www.kirch.net/unix-nt.html has a good analysis of this.

But on plain old cost issues alone, my OS plus compiler cost
$99. total. The lower bound of total cost for Linux with compiler is
$0, and may reach as high as $50.

But that really wasn't my point. The irritating thing is that with NT,
there is no *choice* in the matter. Under most Unixes, one can buy a
proprietary compiler from the OS vendor or somebody else. Or not. With
NT, that choice is taken away. And because it's a closed system, there
are no free alternatives. I suggest that supression of free
alternative compilers and SDKs (and even general "productivity tools")
is the very reason that NT was designed to be a closed system.

--
Stuart McDow                                     Applied Research Laboratories
smcdow@arlut.utexas.edu                      The University of Texas at Austin
            "Look for beauty in roughness, unpolishedness"


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

Date: 16 May 1998 14:19:22 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jk79a$a6h$1@ns1.arlut.utexas.edu>

Lloyd Zusman <ljz@asfast.com> writes:
> 
> But I still agree with your main point: Sun-based systems are
> generally more expensive than those built on an Intel platform.

If you factor in the cost of machine and network maintenance, I don't
think this holds true.

> The "Gnu-Win32" stuff put out by Cygnus is free and seems to be
> pretty good.  Its `gcc' works just fine for me, and it comes with
> include files, libraries, etc.

I've played with the cygnus port. I don't like it because applications
built with gcc won't run outside the gnu-win32 environment. I like my
compiled applications to run stand-alone. perl is a different story
altogether.

> Cost-wise, you're still way ahead with NT, unfortunately.  That's
> why so many corporations are swtiching from Unix on the desktop to
> NT.

They are making a mistake. Maintenance and reliability issues will
come back to bite them, and they'll end up losing more money than they
saved.

http://www.aberdeen.com/research/comp/onsite/case1/body.htm
http://www.kirch.net/unix-nt.html

> Unix boxes from Sun et al are starting to come down in price, but NT
> still has a lot of momentum right now in the corporate desktop
> world,

This is being driven by know-nothing executives, and not by IT
professionals. I predict, that unless MS gets their act together soon
and introduces a *much* more reliable OS than the current NT, we will
see a slow but wholesale move back to Unix-based IT installations.

> and overall, an Intel/Microsoft solution is still cheaper overall.

This is short-term thinking. In the short term, you are correct. NT is
still a immature and buggy OS. Especially compared to Unix, which has
had 20 years of shaking out.

> The big-name Unix-box vendors are going to have to cut prices even
> more if they want to effectively compete over the next few years.

The issue here is reliability, not short term cost.

> Linux, FreeBSD, and other Unices that run on Intel boxes are looking a
> bit better these days in the corporate world (cost-wise), but most
> corporations I'm familiar with seem to be leery of going with a
> platform for which they can't purchase a 24x7 support contract from a
> vendor they think will still be around in a few years.

24x7 support for Red Hat Linux can be purchased from Collective
Technologies, Inc.

> And the integrated email/web/spreadsheet/database/word-processing
> software that Microsoft sells is very attractive (cost-wise, as
> well) in a corporate environment, and there's nothing that runs
> under Unix that comes close in terms of price, interoperability, or
> support.

Agreed. But we were talking about compilers and SDKs, not productivity
tools.

> So far in my experience, the Microsoft boxes don't quite compete
> with Unix platforms in terms of hard-core applications where speed
> and OS reliability are issues.  But NT is closing the gap here as
> time goes on.

I disagree. NT does not scale well for multiprocessor systems. NT's
performance is very bad on a four or more processor machine compared
to many Unixes.

> If we really want to kick Bill's ass, we will have to do more than
> carp about GUI's and insult Windows users.  One way to do this would
> be to offer an "integrated desktop solution" that runs under an
> inexpensive, Intel-based, supportable Unix which is as cheap,
> robust, easy to use, and interoperable as IE4.0/Office-97.  Like it
> or not, this means some major GUI-based development.

NT is good for productivity tools. I even use it to run Word when I
want to type a document. But for real computing, I give it 5 to 10
years before it is mature enough to be trusted.

--
Stuart McDow                                     Applied Research Laboratories
smcdow@arlut.utexas.edu                      The University of Texas at Austin
            "Look for beauty in roughness, unpolishedness"


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

Date: 16 May 1998 14:24:13 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jk7id$ahb$1@ns1.arlut.utexas.edu>

chip@mail.atlantic.net (Chip Salzenberg) writes:
>
> Nope; Linux and all the *BSDs are non-Bell.

Oops, you're right. I keep forgetting that.

--
Stuart McDow                                     Applied Research Laboratories
smcdow@arlut.utexas.edu                      The University of Texas at Austin
            "Look for beauty in roughness, unpolishedness"


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

Date: Sat, 16 May 1998 14:38:20 GMT
From: Bill 'Sneex' Jones <webmaster@fccjmail.fccj.org>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <355DA302.3E64E463@fccjmail.fccj.org>

Stuart McDow wrote:
> NT is good for productivity tools. I even use it to run Word when I
> want to type a document. But for real computing, I give it 5 to 10
> years before it is mature enough to be trusted.

RedHat 5.0 (Hurricane) ApplixWare is what I use.  Doesn't have the
'kitchen sink' like Word does, but very productive none the less :-)
-Sneex- 
____________________________________________________________________________
Bill Jones | FCCJ Webmaster | Voice 1-904-632-3089 | Fax 1-904-632-3007
Florida Community College at Jacksonville | 501 W. State St. | Jax, FL 32202
mailto:webmaster@fccjmail.fccj.org | http://webmaster.fccj.org/Webmaster


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

Date: Sat, 16 May 1998 09:52:32 -0400
From: "Bill Ferraro" <skc1234@hotmail.com>
Subject: Flat-File db recommendation
Message-Id: <6jk5q0$c2g@sjx-ixn10.ix.netcom.com>

Can anyone recommend a flat-file db module (e.g. Sprite) which can deal with
columns that hold a lot of text? I'm trying to convert some Oracle tables
into flat-file tables, but some of the Oracle fields hold up to 2000 words.

Thanks.
Bill

--






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

Date: 16 May 1998 10:01:16 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: How to define constants without C code
Message-Id: <6jjo5c$988$1@lyra.csx.cam.ac.uk>

Ephrayim \"EJ\" Naiman <enaiman@ndsisrael.com> wrote:
>I'm trying to figure out how to make a constant in Perl without having to
>generate any C code (and Autoload, etc).

use constant ERR_NOT_FOUND => 12345;

See   perldoc constant

Or, if you want to do it by hand:

sub ERR_NOT_FOUND () { 12345 }


Mike Guy


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

Date: Sat, 16 May 1998 21:28:37 +0700
From: "Ali" <ampun@bigfoot.com>
Subject: IF problems....
Message-Id: <6jk7r5$emk@news1.rad.net.id>

I create a script to determine a specific number between a range this cause an error message.
I need help how perl could find a the number with IF Statement?

any help would be appreciated.

@URL=(1,2,3,4,5,6,7,8,9,10);

$Counter=0;
foreach $Match (@URL) {
    if (2 <= $match <= 3) {
    $URL1[Counter]=$Match;
 $Counter++;}
 }



Thx,

Ali




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

Date: 16 May 1998 10:49:24 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Is if ($a="something") a bad style?
Message-Id: <6jk91k$4c0$1@monet.op.net>
Keywords: Hays Hurst intestate tilde


In article <6jieuc$ju$1@cyprus.atlantic.net>,
Chip Salzenberg <chip@mail.atlantic.net> wrote:
>MJD writes:
>>       if (p = malloc(...)) {
>> The `=' is just too deceptive.
>
>I dunno, I don't find it confusing at all.

Me neither, actually.  I picked a bad example.  The `malloc' is very
suggestive there.  But if you see something like

	if (n = xpchk(z, i+k)) {
	   ...
	}

you really have no idea whether the = was correct, and you have to
suspect that the programmer might have intended == instead.

>Jari writes:
>> From the maintenance perspective, nothing complex should not be done
>> in a one expression.
>
>I think that's going too far.

Me too.  I was only objecting to simple assignment used in a boolean
context.  For example, a better version of the above is:

	if ((n = xpchk(z, i+k)) == 0) {
	  ...
	} 

because it's abundantly clear that the assignment is intentional.

To me, the drawback of this seems to be that if you're using the
debugger, you can't see what gets assigned to n before the test and
branch takes place.

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

When I program in C these days, the first thing I do is

	#define unless(c) if (!(c))

I always feel guilty doing this, like I'm getting into the boat with
all those ``#define BEGIN {'' people.  But I don't want to stop.




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

Date: Sat, 16 May 98 14:47:04 +0100
From: "Frank Winkler @home" <frank@consol.de>
Subject: localtime()
Message-Id: <semxqfqcuhkb.pminews@alien>

Hi there !

Can anybody give me a hint how I can easily compute the day number (in the 
year) of an arbitrary date? For today I can use localtime[7] but to feed this 
with some other date I have to convert it into UTC - for which I found no PERL 
routine. Or has anyone written some own code for this job?

TIA

-- 
----------------------------------------------------------------------------
Frank Winkler                                                frank@consol.de
ConSol GmbH
Franziskanerstr. 38                                   Voice +49 89 45841.180
81669 Munich - Germany                                  Fax +49 89 45841.199






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

Date: Sat, 16 May 1998 07:33:16 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: localtime()
Message-Id: <6jk84k$eq9@hplntx.hpl.hp.com>

[posted and emailed]

Frank Winkler @home wrote in message ...
>Hi there !
>
>Can anybody give me a hint how I can easily compute the day number (in
the
>year) of an arbitrary date? For today I can use localtime[7] but to
feed this
>with some other date I have to convert it into UTC - for which I found
no PERL
>routine. Or has anyone written some own code for this job?


perldoc -f gmtime

Exactly like localtime, but produces UTC.

--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com





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

Date: Sat, 16 May 1998 12:44:55 +0200
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Re: Memory problem.
Message-Id: <VA.00000058.001e6ae6@enterprise>

Hello Walid,

last time I had a similar problem, I discovered that my account had a 
memory quota set. I removed the limit and the problem went away.

If you really have a memory problem, you may want to offload some of the 
data from memory. For example, put it in a relational database.

Also, have a look at dbmopen. It ties a hash to a DBM file. It uses a 
cache to avoid loading all the entries in memory.

Jean-Louis Leroy
http://ourworld.compuserve.com/homepages/jl_leroy/



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

Date: Sat, 16 May 1998 12:43:11 GMT
From: "Brian Willis" <briwillis@yahoo.com>
Subject: perl cgi script help
Message-Id: <01bd80e2$07087180$8c3737a6@main>
Keywords: perl cgi cgi-bin script

Hello all,

  I am new at perl and I'm trying to write a cgi script and I need some
advice.  So please excuse me if I sound lost.  I am writing a web-based
multiple choice test and I want to use perl to check the test for me. What
would be the best way of doing this?  There are approximately 50 questions
on each test.  I have each answer to each question being assigned to a
value called "answer#" (where # is the number of the question).  I want to
able to compile a list of the right answers and wrong answers.  Since I
don't know too much about perl, I not sure where to start.  I had a couple
of ideas, tell me what you think. (I'd put my ideas in perl, but I'd
probably embarrass myself)

First idea, have an "if" statement saying if answer1 ne "a" then put in the
wrong list else, put in the right list and continue with each answer,
appending to the right or wrong lists.  Then at the end, I need to know how
many answers were in the right and wrong lists in order to get the score.

Second idea, compile all the answers in one list and compare it another
list, "the answer key".  Then I'd need to know which elements in the first
list were wrong to determine the score. 

I've used an older script that a friend wrote to email out the results, but
the meat of script is explained above.  I would really appreciate any
advice from all you perl gurus.

Thanks in advance
-- 
Brian Willis
bigkingwillie@bigfoot.com


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

Date: 16 May 1998 11:13:26 GMT
From: oheiabbd@zedat.fu-berlin.de (Oliver Heidelbach)
Subject: Re: Regex problem: substituting 3+ identical characters with just one
Message-Id: <CmxVjOhTikQl-pn2-PdBnfrXS4KfV@oheiabbd.dialup.fu-berlin.de>

On Fri, 15 May 1998 05:41:47, Juergen.Puenter@materna.de (J|rgen 
P|nter) wrote:

> Hello,
> 
> here's my problem: printing out man-pages, I get rubbish like 
> '_lll_oooo_kkk' instead of just 'look'. So far, no one can tell me why
> or how to prevent this. Being no UNIX-Guru myself, I thought about using Perl
> for a temporary solution. In a first step, I print the man-pages to a file and
> then stript out all _ and  to get e.g. 'lllooookkk'.
> 

I don't know which terminal (setting) you are using,
but the following worked for me under OS/2.

#!perl

while (<>) {
	s/(.\x08){3,}//g;
	s/(_\x08)//g;
	print;
}

You may need to play around with this if your terminal
interpretes the escape codes otherwise.

Hope it helps,
Oliver



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

Date: Sat, 16 May 1998 12:19:21 +0200
From: "Ronald G\"oggel" <r.goeggel@atos-group.de>
Subject: Re: removing last line from file
Message-Id: <6jjp9t$7tn$1@news.pop-stuttgart.de>


Nervick writes in <355b1c48.0@news.bewellnet.com>...
>I would try something like this.
>
>open FILE, "file.txt";
>@lines = <FILE>;
>close FILE;
>
>$lastline = pop @lines;
>
>open FILE, ">file.txt";


>foreach $line ( @lines ) {
>   print FILE "$line";
>}
or just:
print FILE @lines;

>close FILE;
>
>This is very simple to read.  It may not be the fastest way to go,
but it
>works.
>





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

Date: Sat, 16 May 1998 12:25:40 +0200
From: "Ronald G\"oggel" <r.goeggel@atos-group.de>
Subject: Re: Substitution Problems :(
Message-Id: <6jjplp$8ct$1@news.pop-stuttgart.de>


Aidan Rogers writes in <895241294.543069@sparc.tibus.net>...
>here is the syntax of the command I was using...
>
>  s/\'/\\\'/g;
>
>all this seems to do is put 2 backslashes in front of the '. Does
anyone know a
>way to substitute in just _one_ backslash?


I'm using perl 5.004_04 and the every ' is substituted by \'
Maybe your terminal displays a \ as \\ ?
You may check the length of $_ after substitution.

HTH
Ronald




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

Date: 16 May 1998 12:11:06 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: system vs exec vs piped open...
Message-Id: <6jjvoq$j4i$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, 
    carton.lao@shaw.wave.ca writes:
:The correct syntax for system is system( @list ), where each element is a
:single word, therefore the call should be system( "./myprog", "&" ).

That's calling myprog with an argument of '&', which is
different from system("myprog &") in the bg.

--tom
-- 
 "... the whole documentation is not unreasonably transportable in a
 student's briefcase." - John Lions describing UNIX 6th Edition
 "This has since been fixed in recent versions." - Kernighan & Pike


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

Date: 16 May 1998 07:43:23 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: tchrist@mox.perl.com (Tom Christiansen)
Subject: Re: Tip: Filehandles
Message-Id: <n2ciz8r8.fsf@mailhost.panix.com>

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

> But there are big problems there in both cases.  Passing \*STDOUT is
> much better, as is passing \&something is much better.
> 
>     &callme(\&SOMETHING);
>     &something(\*STDOUT);
> 
> I don't understand what the big fear here is.

Here's one possible interpretation: It's perfectly reasonable to send
a reference to an apple when you want an apple to arrive;  but it's
weird to send a reference to a whole fruitbasket when you want an
orange to arrive.

-- 
Jonathan Feinberg   jdf@pobox.com   Sunny Brooklyn, NY
http://pobox.com/~jdf/


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

Date: Fri, 15 May 1998 18:19:49 +0100
From: Philipp <Philipp999@gmx.net>
Subject: webbased email
Message-Id: <355C7934.FE9EA22B@gmx.net>

Hi,

I'm about to write some scripts for webbased email. I am worrying about
the security risk.
Nobody is allowed to telnet to the mailserver except administrative
accounts. Every mailfile is owned by its resprective owner.

Does anybody know of a good solution to realize this without having a
major security risk?

Any help is much appreciated.

Thanks

Phil



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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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


------------------------------
End of Perl-Users Digest V8 Issue 2618
**************************************

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