[9880] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3473 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Aug 18 10:07:11 1998

Date: Tue, 18 Aug 98 07:00:35 -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, 18 Aug 1998     Volume: 8 Number: 3473

Today's topics:
        [Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
        After installing new Activestate version .. @INC errors <ktenney@execpc.com>
    Re: After installing new Activestate version .. @INC er <jdf@pobox.com>
    Re: After installing new Activestate version .. @INC er <ktenney@execpc.com>
        Another invocation problem (_does_ seem to be a perl pr <mgregory@asc.sps.mot.com>
        Any existing finanical rounding function? (WLo7128808)
    Re: Any existing finanical rounding function? (Greg Bacon)
    Re: Converting to lowecase <jdporter@min.net>
        Deleting records from a DB_File. <foosejm@bp.com>
    Re: exception handling <jdf@pobox.com>
    Re: exception handling huntersean@hotmail.com
    Re: file type suffix explanation docs? huntersean@hotmail.com
        has anyone tried embedding perl in win32? <brett.calcott@clear.net.nz>
    Re: here's an implementation of diff in perl (Michael J Gebis)
    Re: here's an implementation of diff in perl (Greg Bacon)
        how to use gd library with winperl 32 ? <mchauvy@club-internet.fr>
    Re: newbie question huntersean@hotmail.com
    Re: newbie questions (Matthew Bafford)
    Re: NT: redirect stdout to file <ian.maloney@ubs.com>
    Re: NT: redirect stdout to file (Gerhard Wrodnigg)
        Oraperl. Where can I get it? <che@gwent.nhs.gov.uk>
    Re: Oraperl. Where can I get it? <tbeaulieu@mediaone.net>
    Re: pangrams in Perl --- randomized Robisonizing b_redeker@hotmail.com
    Re: passing variables <e.christensen@netjob.dk>
        Perl & vim <rpsavage@ozemail.com.au>
    Re: Perl Docs.. forget the original post <jdf@pobox.com>
    Re: Perl Docs.. forget the original post <jdporter@min.net>
    Re: PERL Problem b_redeker@hotmail.com
    Re: Perl Style <jdporter@min.net>
        print "Content-type:text/html\n\n"; and redirection... <whermans@mail.dma.be>
    Re: print "Content-type:text/html\n\n"; and redirection (Maurice Aubrey)
    Re: Problems with file opening huntersean@hotmail.com
    Re: Q: How to read all the file name in a directory (Greg Bacon)
    Re: Q: How to read all the file name in a directory <upsetter@ziplink.net>
    Re: Question: How do I test Perl? (Greg Bacon)
    Re: Recommend a good editor scott@softbase.com
    Re: Recommend a good editor scott@softbase.com
    Re: taint checking seems to slow down my code <jdporter@min.net>
        test - ignore <vore@alf.dec.com>
    Re: Why dont people read the FAQs b_redeker@hotmail.com
        Yet another invocation line mystery (does seem to be pe <mgregory@asc.sps.mot.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 18 Aug 1998 10:24:02 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage903435841.5524@news.teleport.com>

Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 05 Aug 1998

[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]

For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).

    http://cpan.perl.org/doc/FAQs/

Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.

    perldoc perlfaq
    man perlfaq

If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.

If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.

    http://cpan.perl.org/
    http://www.perl.com/CPAN/
    http://cpan.perl.org/doc/FAQs/FAQ/html/perlfaq.html
    http://www.perl.com/CPAN/doc/FAQs/FAQ/html/perlfaq.html

You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)

    California     ftp://ftp.cdrom.com/pub/perl/CPAN/
    Texas          ftp://ftp.metronet.com/pub/perl/
    South Africa   ftp://ftp.is.co.za/programming/perl/CPAN/
    Japan          ftp://ftp.dti.ad.jp/pub/lang/CPAN/
    Australia      ftp://cpan.topend.com.au/pub/CPAN/
    Netherlands    ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
    Switzerland    ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
    Chile          ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/

If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:

    setdir usenet-by-group/news.announce.newusers
    send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 

Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.

Have fun with Perl!

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


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

Date: Tue, 18 Aug 1998 08:00:54 -0500
From: Kent Tenney <ktenney@execpc.com>
Subject: After installing new Activestate version .. @INC errors
Message-Id: <6rbu1i$gav@newsops.execpc.com>

I installed the TK module using ppm.bat and it is in
C:\perl\site\5.005\lib\MSWin32-x86-object\auto\Tk\

I now have installed v5.00502

when I try to use TK
I get the error 
'can't locate tk.pm in @INC (@INC contains
C:\perl\site\5.00502\lib\MSWin32-x86-object ....)
                  ^^

I'm unable to find where @INC is defined
any help with this would be appreciated

TIA,
Kent


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

Date: 18 Aug 1998 09:13:09 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Kent Tenney <ktenney@execpc.com>
Subject: Re: After installing new Activestate version .. @INC errors
Message-Id: <lnomjs3u.fsf@mailhost.panix.com>

Kent Tenney <ktenney@execpc.com> writes:

> 'can't locate tk.pm in @INC (@INC contains

Your code should read (note the capitalization):
  
   use Tk;

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


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

Date: Tue, 18 Aug 1998 08:26:07 -0500
From: Kent Tenney <ktenney@execpc.com>
Subject: Re: After installing new Activestate version .. @INC errors
Message-Id: <6rbvgq$35@newsops.execpc.com>

my message was sloppy .. in the code the capitalization is correct ..
use TK;
the problem seems to be that the TK modules are in the 5.005 tree
and @INC refers to 5.00502, which I just installed

Kent Tenney wrote:
> 
> I installed the TK module using ppm.bat and it is in
> C:\perl\site\5.005\lib\MSWin32-x86-object\auto\Tk\
> 
> I now have installed v5.00502
> 
> when I try to use TK
> I get the error
> 'can't locate tk.pm in @INC (@INC contains
> C:\perl\site\5.00502\lib\MSWin32-x86-object ....)
>                   ^^
> 
> I'm unable to find where @INC is defined
> any help with this would be appreciated
> 
> TIA,
> Kent


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

Date: 18 Aug 1998 09:26:42 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Another invocation problem (_does_ seem to be a perl problem!)
Message-Id: <r8iujrnow5.fsf@asc.sps.mot.com>


Compare these two files:

 - - 
#!/bin/sh
eval 'exec echo -w -S $0 ${1+"$@"}'   # Use the -*- echo -*- on our path.
     if 0; 

print "yay\n";
 - - 

and 

 - - 
#!/bin/sh
eval 'exec perl -w -S $0 ${1+"$@"}'   # Use the -*- perl -*- on our path.
     if 0; 

print "yay\n";
 - - 

The first one executes as I would expect: it echoes -w -S and the invocation.

The second one says:

 -w: bad option(s)

Why is this so?  It appears that the fact that perl is on the
invocation line causes something strange to happen?

Thanks,

Martin.


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

Date: 18 Aug 1998 12:17:20 GMT
From: wlo7128808@aol.com (WLo7128808)
Subject: Any existing finanical rounding function?
Message-Id: <1998081812172000.IAA03199@ladder01.news.aol.com>

At work, I'm trying to implement a rounding function at the moment to round
numbers like 36.715 up to 36.72 (I'm development a Perl script doing finanical
calculations). 

I'm using Perl 4.036 and I don't seem to have access to POSIX functions like
ceil(),  bcd(), etc. It isn't so easy as I thought!!!! :-(

I'd appreciate any help that you could give me. (If you'd bother, please also
email me at William_Lo@nag.national.com.au.)

Thanks a lot,
William (William_Lo@nag.national.com.au)


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

Date: 18 Aug 1998 13:29:53 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Any existing finanical rounding function?
Message-Id: <6rbvkh$rfm$8@info.uah.edu>

[Posted and mailed]

In article <1998081812172000.IAA03199@ladder01.news.aol.com>,
	wlo7128808@aol.com (WLo7128808) writes:
: At work, I'm trying to implement a rounding function at the moment to
: round numbers like 36.715 up to 36.72 (I'm development a Perl script
: doing finanical calculations). 

The usual solution to this is to use integers.  One way is to have
a complex datatype with an integer for cents and an integer for
dollars (assuming American currency).  The other is just to deal with
amounts as cents and divide by 100 before printing.

If you're going to implement the former, you'd probably want to use
the standard Math::Complex module as a guide.  Be sure to upload it
to the CPAN when you're done! :-)

Greg
-- 
The depths of idiocy are as yet unplumbed.
              -- Larry Wall in <199612181938.LAA10214@wall.org>


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

Date: Tue, 18 Aug 1998 09:28:24 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Converting to lowecase
Message-Id: <35D98178.2A21@min.net>

Grant Griffin wrote:
> 
> There once was a park which was beautiful when first created, but which began to be
> littered by people who were too lazy to throw away their own trash.  So a small
> group of well intended Citizens who wanted the park to be clean again decided to
> take action, and they began confronting anybody they caught littering.  To them, it
> was a sort of "tough love".  However, a few of these Citizens got carried away and
> started really beating up anybody who littered.  So now, most of the good decent
> folks in the neighborhood--even those who used to pick up litter--stay away from
> the park for fear that they might get beat up, or because they don't like
> witnessing the beatings.  But at least now the park is a better place.

Now let me tell you about the park I hang out in.

When I first came to this park, it was thronging -- so much so that one
could hardly move.  Then I realized that a farmer's market was going on,
and people were actually bustling about buying great fresh produce for
dirt cheap.  Everywhere there were signs saying "Please Do Not Litter".
And occasionally (far too often, it seemed), some slob from Shelbyville
would be leaning against a post -- right under a No Littering sign --
and toss his banana peel on the ground.  Out from the crowd would rush
this Richard Simmons-like dude and slap the guy silly.  Turns out he
himself had painstakingly painted and erected all the many No Littering
signs.  Not only that, but most of the time he picked up all the trash.
Sure, none of the rest of the people enjoyed the sound of cracking
skulls, but we were glad to see someone taking the trouble to keep
the place sanitary.  Occasionally we lend the guy a hand with the
dirty work.

-- 
John Porter


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

Date: 18 Aug 1998 13:53:03 GMT
From: "Joe Foose" <foosejm@bp.com>
Subject: Deleting records from a DB_File.
Message-Id: <01bdcaaf$a82c3940$3f8a63a1@amervw29436.clv.am.bp.com>

I have a complex data structure stored in a file using DB_File and MLDBM. 
How do I delete a record from the hash file?  I've tried using 'delete'
like this,

delete $hash{key1}{key2}{key3};

but that doesn't work.


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

Date: 18 Aug 1998 08:57:51 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: dennis@info4.csie.nctu.edu.tw (GEMINI)
Subject: Re: exception handling
Message-Id: <r9yejstc.fsf@mailhost.panix.com>

dennis@info4.csie.nctu.edu.tw (GEMINI) writes:

> If any error occurred in the modules, an error code can be returned
> to notify main program, and I have to check the returned code 
> everytime I call the subroutines. So is it possible to
> have a exeception handling subroutine in the main program,
> and let it called by the modules if any error encountered?

Well, it *is* fairly standard design to (1) return some out-of-bounds
value to indicate a problem, often undef, and (2) set a package global
(like MyPackage::ERRSTR) to explain the problem.  This mirrors the
design of Perl itself.

But some modules--specifically DBI, if I'm not mistaken--allow you to
register callbacks for various levels of error conditions.  To do so,
simply pass a code reference to the module.  Here's one way to do it,
using OOP ideas.  HTH.

    package P;
    sub new {
      my $class = shift;
      return bless {'errorcallback'  => undef }, $class;
    }
    sub register_callback {
      my ($self, $cb) = @_;
      $self->{errorcallback} = $cb;
    }
    sub foo {
      my $self = shift;
      $self->{errorcallback}->(3, 'Something bad happened!');
    }

    package main;
    my $p = new P;
    sub callback {
      my ($errno, $errstr) = @_;
      warn("Error $errno, '$errstr', from P.\n");
    }
    $p->register_callback(\&callback);
    $p->foo;

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


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

Date: Tue, 18 Aug 1998 13:13:26 GMT
From: huntersean@hotmail.com
Subject: Re: exception handling
Message-Id: <6rbulm$vme$1@nnrp1.dejanews.com>

In article <6rasa3$102$1@netnews.csie.NCTU.edu.tw>,
  dennis@info4.csie.nctu.edu.tw (GEMINI) wrote:
> hi all,
>   I am designing some modules for my other main programs.
> If any error occurred in the modules, an error code can be returned
> to notify main program, and I have to check the returned code
> everytime I call the subroutines. So is it possible to
> have a exeception handling subroutine in the main program,
> and let it called by the modules if any error encountered?
> thanks.
>
>

You want to look at using eval { } and die to catch and throw exceptions
respectively.

Sean Hunter

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


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

Date: Tue, 18 Aug 1998 09:08:48 GMT
From: huntersean@hotmail.com
Subject: Re: file type suffix explanation docs?
Message-Id: <6rbgav$g71$1@nnrp1.dejanews.com>

In article <MPG.104178ac89b63633989681@www-private.alaskapermfund.com>,
  stevenba@carr.org (Steven Barbash) wrote:
> What are (or where can I find explanations for) file suffixes used by
> Perl?  .pm, .pl, .pod ...
> What do they mean?
>
> Thanks.
> Steve Barbash
>
 .pl = perl script
 .pm = perl module
 .pod = piece of donut (...err plain old documentaion actually)

8^)

Sean H

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


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

Date: Tue, 18 Aug 1998 22:52:19 +1200
From: "Brett Calcott" <brett.calcott@clear.net.nz>
Subject: has anyone tried embedding perl in win32?
Message-Id: <6rbmgs$70f$1@fep5.clear.net.nz>

becos nobody seems to have answered my question from the 14th.
here it is again for another try...


I have version 5.005_02 which I built using MSVC 5.0 sr3.
I have been playing with embedding perl, and just copied the examples from
perlembed.html and linked to the perl.lib as directed.
The first couple of examples seem to work (I can get the mini-perl
interpreter going) but when I try to pass some parameters I get undefined
symbols at link time. (See the first example under heading "Evaluating a
Perl statement from your C program".) Specifically with global PL_na. It
seems to be having trouble importing other global symbols too.
Any clues here???
TIA.
brett





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

Date: 18 Aug 1998 04:06:40 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: here's an implementation of diff in perl
Message-Id: <6raukg$jep@mozo.cc.purdue.edu>

gbacon@cs.uah.edu (Greg Bacon) writes:
}(R+ is the set of positive real numbers and R* is the set of positive
}real numbers and zero.)  What all that boils down to is O(N) is the
}set of all linear and sublinear functions, i.e. those functions that
}don't grow faster than a linear function.  It's important to remember
}that big oh notation hides constants, so an O(N**2) algorithm may run
}faster on certain (usually small) datasets than an O(N) algorithm.  

There's a (slight) abuse of Big-O here.

It's possible for an O(N**2) algorithm to always run faster than an
O(N) algorithm regardless of dataset size.  Big-O is an upper bound, so
there's nothing to imply that an algorithm which is O(N**2) is not also
O(n).  For example, "sub f {return 1}" is O(n!), as well as O(n**n)
and O(n**2), O(n), and O(1).  Most people throw out the obviously
ludicrous upper bounds, but we're already being somewhat pedantic
here, so we're obligated to be precise.

I think you really meant to say:
An algorithm whose running time is Big_Omega(N**2) will not be as
efficient as one whose running time is O(N), if N is large enough.
However, a Big_Omega(N**2) algorithm may run faster on certain (usually
small) datasets than an O(N) algorithm.

P.S. Some of my wording would be considered plagarism of Knuth except for
the fact that I'm mentioning it now.  See TAOCP V1E3, page 107-110 to
see what I'm lifting.  It's sure possible that I've added an erroneous
statement myself; this is tricky stuff.  

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


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

Date: 18 Aug 1998 13:12:46 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: here's an implementation of diff in perl
Message-Id: <6rbuke$rfm$6@info.uah.edu>

In article <6raukg$jep@mozo.cc.purdue.edu>,
	gebis@fee.ecn.purdue.edu (Michael J Gebis) writes:
: It's possible for an O(N**2) algorithm to always run faster than an
: O(N) algorithm regardless of dataset size.

Sure.  People usually use big oh to talk about the worst case for an
algorithm, i.e. as an upper bound.  It's possible to choose a dataset
for which a certain algorithm runs at its greatest efficiency (i.e.
doesn't hit the worst case), whether that dataset be large or small.

: Big-O is an upper bound, so
: there's nothing to imply that an algorithm which is O(N**2) is not also
: O(n).  For example, "sub f {return 1}" is O(n!), as well as O(n**n)
: and O(n**2), O(n), and O(1).  Most people throw out the obviously
: ludicrous upper bounds, but we're already being somewhat pedantic
: here, so we're obligated to be precise.

How precise is it to label an O(1) algorithm O(n!)? :-)  I agree with
you that it is correct, but I would say such a labeling is an abuse
of the notation.  If it were the common practice, the notation would
stop conveying any information.

: P.S. Some of my wording would be considered plagarism of Knuth except for
: the fact that I'm mentioning it now.  See TAOCP V1E3, page 107-110 to
: see what I'm lifting.  It's sure possible that I've added an erroneous
: statement myself; this is tricky stuff.  

I always found demonstrating that Quicksort is O(n lg n) tricky. :-)

Greg
-- 
Join the Army: travel to exotic distant lands; meet exciting, unusual people,
and kill them. 


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

Date: Tue, 18 Aug 1998 12:34:35 +0200
From: Marc Chauvy <mchauvy@club-internet.fr>
Subject: how to use gd library with winperl 32 ?
Message-Id: <35D958BB.1A7D@club-internet.fr>

Hi,

	I'm trying to use the gd 1.18 library on pc plateform with winperl32,
and i don't manage to use it .
The sentence use gd.pm seems to be understood, but a "$i" variable is
not in line 234, 235, 236 inside gd.pm itself.
I don't there's a mistake in the library ... must be something i've
forgotten to do ...

	Could you help me !!
			
				thanks !

Ps: i'm not using it on a server, just on my conputer for personnal
programming

PPs : could you give me too the same information for macperl 
line use gd.pm is not understood in my case.
-- 
manu
manu@amm.net
amm
151, rue du Fbg Saint-Antoine
75011 Paris
Til. : 01.44.74.77.76. / 01.44.67.08.08.
Fax : 01.44.67.08.08.


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

Date: Tue, 18 Aug 1998 08:59:02 GMT
From: huntersean@hotmail.com
Subject: Re: newbie question
Message-Id: <6rbfom$fk4$1@nnrp1.dejanews.com>

In article <6r9o1v$m5$1@nnrp1.dejanews.com>,
  SDunkin@oxfordinc.com wrote:
> Greetings, I'm trying to break a comma separated file into columns. Because I
> am just starting to learn perl, I am encountering some difficulty. Can
> someone point me in the right direction on how to do this?
>
> My input file will look like this:
> 123,name,name2,1
> 456,name3,name27,2
>
> and I need the output to look like this:
> 123  name    name2       1
> 456  name3   name27      2
>
> Thanks!
> Scott Dunkin
> Computer Engineer
> Oxford Industries, Inc.

You want something like:
my ($a, $b, $c, $d);
format STDOUT=
@>>>  @<<<<<<  @<<<<<<<<    @>
$a, $b, $c, $d
 .

while(<>) {
    ($a, $b, $c, $d) = split /,/;
    write;
}

When "<>" (the "angle operator") is first evaluated, it checks the @ARGV
array, and if it is null, then it opens stdin, otherwise it evaluates @ARGV
as a list of filenames and gives you each line of each in turn.

Obviously, you should give $a etc meaningful names based on what the data
fields actually are.

Good luck!

Sean H

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


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

Date: Tue, 18 Aug 1998 13:48:35 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: newbie questions
Message-Id: <MPG.1043473cbc231b7e98969c@news.scescape.net>

In article <35D72910.93B@ccpl.carr.lib.md.us> on Sun, 16 Aug 1998 
15:46:40 -0300, Steven Barbash (a) felt the following information 
to be of use:
> Hello,
> 
> What is the (easiest?) way to create a "duplicate" of the "." set or
> array of characters?

Not sure what you mean, maybe your talking about +, or *, or {}

ie:

m/.+/;      # Matches any character 1 or more times.
m/.*/;      # Matches any character 0 or more times.
m/.{2}/;    # Matches any character 2 times.
m/.{2,}/;    # Matches any character 2 or more times.
m/.{2,5}/;    # Matches any character 2 to 5 times.

> Documentation in perlre.html defines the 'regular expression
> metacharacter' "." as 'Match any character except newline'.
> 
> I want to create an identical set excluding the "\t" character.
> (More specifically, I want to search like "." but exclude the \t
> character.)

What your looking for here is the ^ operator.  The ^ operator in 
a character set ([]) matches everything BUT what is between the 
[]'s.

ie:

m/[^\t]/;   # Matches anything BUT the tab character.

> Also, what is the procedure for listing/printing/displaying these system
> defined sets? ".". "\s"(whitespace character), ...?

Sorry, I don't understand what your asking here.


Hope this helps!


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

Date: Tue, 18 Aug 1998 10:48:43 +0200
From: Ian Maloney <ian.maloney@ubs.com>
Subject: Re: NT: redirect stdout to file
Message-Id: <35D93FEB.1FC8BC58@ubs.com>

Gerhard Wrodnigg wrote:

> I tried to redirect stdout to a file
> 
> eg. sample.pl >output.txt
> but this doesn't work :(

Try this, it works for me:

perl sample.pl >output.txt

It appears that if you tell NT what program to run (i.e. perl) it works
OK. But if NT has to work it out using file extension association it
loses the redirect. I don't know what exactly is happening - but if you
do find out let me know.
 
Regards
Ian

---------------------------------------------------------
Ian Maloney UBS +41 1 236 1629 (FAX +41 1 236 6930)


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

Date: Tue, 18 Aug 1998 13:10:04 GMT
From: ghw@gmx.net (Gerhard Wrodnigg)
Subject: Re: NT: redirect stdout to file
Message-Id: <36317cfc.451838208@news.tu-graz.ac.at>

HaY!

On Tue, 18 Aug 1998 10:48:43 +0200, Ian Maloney <ian.maloney@ubs.com>
wrote:

>Try this, it works for me:
>perl sample.pl >output.txt

Yea4h! It works! ;)

TX 4 help!!! ;)

> - but if you do find out let me know.

ok, promised ;)

 -mfg-ghw-
-- 
In a world without walls and fences, who needs windows and gates?


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

Date: Tue, 18 Aug 1998 10:57:44 +0100
From: "Chi Letton" <che@gwent.nhs.gov.uk>
Subject: Oraperl. Where can I get it?
Message-Id: <35D95018.504201F3@gwent.nhs.gov.uk>

Hello.

I have been told that oraperl is the one for accessing Oracle tables
thru Perl.
So where do i get it from?

Thanks for your time

Che Letton



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

Date: Tue, 18 Aug 1998 07:59:00 -0400
From: "Todd B" <tbeaulieu@mediaone.net>
Subject: Re: Oraperl. Where can I get it?
Message-Id: <6rbqcl$1ss$1@wbnws01.ne.highway1.com>

http://www.hermetica.com/technologia/DBI/



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

Date: Tue, 18 Aug 1998 10:22:50 GMT
From: b_redeker@hotmail.com
Subject: Re: pangrams in Perl --- randomized Robisonizing
Message-Id: <6rbklp$l0f$1@nnrp1.dejanews.com>

[snip]
>  i wrote this mainly in the hope that others will modify it to
[snip]
> 		   2, 1, 7, 25, 22, 4, 4, 9, 2, 4, 1) ;  }
>     else {
>     	$seed="tt found this sentence which contains exactly  and  ";
> 	$seed="this pangram tallies  and  ";
> 	$seed="this sentence contains exactly  and  ";
> 	for( @AtoZsplit ) { $c1{$_} = 1 } }
did my news-reader make something disappear or is the above a little
obsolete?
--
Boudewijn

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


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

Date: Tue, 18 Aug 1998 11:21:10 +0200
From: Ernst Christensen <e.christensen@netjob.dk>
To: Inge Soetens <soetensi@se.bel.alcatel.be>
Subject: Re: passing variables
Message-Id: <35D94785.21BCFA29@netjob.dk>

Hi
The variables in JS and Perl ought to be interchangeable, maybe it is a
question about qoutes.
This shoul work:

In perl.
$test="something";

in JS
var test2=\"$test\";

Ernst



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

Date: 18 Aug 1998 09:23:44 GMT
From: "Pen and Ron Savage" <rpsavage@ozemail.com.au>
Subject: Perl & vim
Message-Id: <01bdca8a$70d2c240$13386ccb@ilyyzusv>

I'm using the free X server MIX from www.microimages.com, and vim under
IRIX (irrits) 6.4
By default, my variables are displayed in white-on-white. I've read much
documentation for vim, but find it incomprehensible.
Yes, I tried Syntax/Color test, and got some white-on-white combinations to
display, by respelling them according to the rgb.txt which comes with MIX,
but the recommended ':source %' command does not update the display of Perl
code in the other window. It's not clear _in the slightest_ what to do to
make any such changes (a) work (b) work when vim is stopped and restarted?
Don't bother recommending crap like nedit, nvi, fte... I've tried them.
And, yes, I prefer emacs, but it's not practical on this system. Thanx.

So, does anyone have a _simple_ recommendation on patching vim's colors?
TIA


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

Date: 18 Aug 1998 09:09:00 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: cabney@cyberpass.net (C. Abney)
Subject: Re: Perl Docs.. forget the original post
Message-Id: <ogtijsar.fsf@mailhost.panix.com>

cabneySP4M@SP4M.SP4Mcyberpass.net (C. Abney) writes:

> What does make me wonder, though, is why a FAQless newbie's squeals
> aren't simply ignored?

It's better to head someone towards the docs right away rather than
risk a flood of answers that are less accurate and less thorough than
those in the docs.

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


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

Date: Tue, 18 Aug 1998 09:17:18 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl Docs.. forget the original post
Message-Id: <35D97EDE.3A91@min.net>

C. Abney wrote:
> 
> What does make me wonder, though, is why a FAQless newbie's squeals
> aren't simply ignored?

Because we care about our newbies.
They deserve an answer, even if it comes with a smack upside the head.
"Tough love", as Tom C said.

-- 
John Porter


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

Date: Tue, 18 Aug 1998 11:55:32 GMT
From: b_redeker@hotmail.com
Subject: Re: PERL Problem
Message-Id: <6rbq3k$qon$1@nnrp1.dejanews.com>

In article <slrn6thgdo.4n.alastair@calliope.demon.co.uk>,
  alastair@calliope.demon.co.uk wrote:
> //ryb <mike@@@masterlink.REMOVE.com> wrote:
> >
> >I have PERL 5.0 on WinNT with IIS3.0
> >The Perl scripts run for about 5 days and then PERL stops responding.
> >When I reboot the machine everthing works, but in about 5 days it
> >quits again.
> >
> >Has anyone run into this problem and have a solution?
>
> This sounds like a problem with the OS not Perl.
>
or you might be filling some buffer or memory in your program.
what happens to the resources and stuff on your
server - is it just the Perl that stops or everything?
is there some huge hash or array?
what have you tried so far?

--
Boudewijn

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


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

Date: Tue, 18 Aug 1998 09:14:35 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl Style
Message-Id: <35D97E3B.470C@min.net>

Zenin wrote:
> 
> The fact is, you *are* using Perl, but you are going out of your
> way to avoid its most basic primitive constructs.  There is
> a reason "||" existed before "or".

The reason "||" existed before "or" is totally irrelevant to
the issue of whether one should ever use "or".  As perl
language constructs (operators), they are equally primitive.
So what if one was added after the other.


> The only reason "||" doesn't say "or" to one's mind as quickly or
> faster even then "or" is simply because they haven't been
> programming in C styled languages for long enough.
> AFASK "or" was built with one goal; To reduce the number of
> perens.  Because it "looked less like C" can probably be considered
> a bug in retrospect.

By that token (:-) it can be considered a "bug" to argue that
one should use "or" for readability.  I use "or" for exactly
one reason: it's a low-precedence alternation conjunction.
So what if it's written "or".  As has been pointed out, it could
have been any cryptic sequence of chars... \/ or whatever.

-- 
John Porter


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

Date: Tue, 18 Aug 1998 11:52:57 +0200
From: "Wouter Hermans" <whermans@mail.dma.be>
Subject: print "Content-type:text/html\n\n"; and redirection...
Message-Id: <6rbiuv$iof$1@xenon.inbe.net>

hi

for some weird reason "Content-type:text/html" shows up in my browser when i
run a perl script on a microsoft iis3 server.  don't know if it happens on
unix servers...

also: i'm trying to read in a value (=url) from a form, and then let the cgi
relink the user through to that url.  any ideas?

heh ok i admit i'm new at this...

wouter hermans




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

Date: Tue, 18 Aug 1998 10:06:05 GMT
From: maurice@hevanet.com (Maurice Aubrey)
Subject: Re: print "Content-type:text/html\n\n"; and redirection...
Message-Id: <slrn6tikge.mh7.maurice@we-24-130-48-83.we.mediaone.net>

On Tue, 18 Aug 1998 11:52:57 +0200, Wouter Hermans <whermans@mail.dma.be> wrote:

>for some weird reason "Content-type:text/html" shows up in my browser when i
>run a perl script on a microsoft iis3 server.  don't know if it happens on
>unix servers...

Are you using CGI.pm?

>also: i'm trying to read in a value (=url) from a form, and then let the cgi
>relink the user through to that url.  any ideas?

#!/usr/bin/perl -Tw

use CGI;

$cgi = new CGI;
print $cgi->redirect( $cgi->param('newurl') );

-- 
Maurice Aubrey <maurice@hevanet.com>

Moderation in temper is always a virtue, but moderation in principle
is always a vice. 
  - Thomas Paine


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

Date: Tue, 18 Aug 1998 13:07:28 GMT
From: huntersean@hotmail.com
Subject: Re: Problems with file opening
Message-Id: <6rbuag$va1$1@nnrp1.dejanews.com>

In article <903401833.9079.0.nnrp-06.c2deb1c5@news.demon.co.uk>,
  "Daniel Adams" <dan@fearsome.net> wrote:
> OK, I'm driving myself crazy trying to figure this out, so I hope somebody
> will be able to help:
>
> In my (Perl) CGI script I use $foo to describe a directory path - call it
> 'a/b/c'
>
> After a great deal of other stuff (which all works fine) I ask the script to
> simply create a file 'a/b/c/bar.htm' and then close it without writing any
> data to the file. Simple, right? So I thought. I am using:
>
> open(FILE, ">/$foo/bar.htm") || die "I can't create that file\n";
> close(FILE);
>
> and the script returns the dreaded "Internal Script Error" when I try
> running it.
>
> When I remove those two lines using
>
> # open(FILE, ">/$foo/bar.htm") || die "I can't create that file\n";
> # close(FILE);
>
> the script runs fine and everything else goes as planned - it is definitely
> these two lines that are causing the problems. SO, I have narrowed the
> problem down to one of two things:
>
> (i) Incorrect syntax - but the syntax is the same as I have used in my other
> scripts, and also seems to (roughly) match that advised in Perl Programming
> (the bible)
>
> (ii) Incorrect file/directory permissions? But the file can't have any
> permissions until it is created, right? And I have had no trouble writing
> other files to this directory!
>
> This i really starting to grind me down and I've tried everything I can
> think of to work around it, so please help!
>
> Dan Adams
> dan@fearsome.net

Remember that depending on how your webserver is set up, you will almost
certainly not have write access to the whole directory tree of the
webserver(this would be very unsafe).  Try removing your path variable ($foo)
and the preceding /and see where the file shows up.  While the permissions on
a file are not set until it is created, the permissions on the directory
where you are trying to create the file will already be set.  Try running
your script outside of the webserver to just check it's syntax.

Good Luck!

Sean Hunter

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


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

Date: 18 Aug 1998 13:05:14 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Q: How to read all the file name in a directory
Message-Id: <6rbu6a$rfm$5@info.uah.edu>

In article <6ranle$c4e@fridge.shore.net>,
	Scratchie <upsetter@ziplink.net> writes:
: What difference does it make whether he's paying for it or not? If
: anything, paying for a course and showing up unprepared would make one
: *more* deserving of abuse, not less.

I disagree.  This is a Perl discussion group, not a tutorial.  There
is an expectation of some level of familiarity with Perl.  When someone
takes a college course, that person may or may not be familiar with the
course material, but there may be prerequisites with which he is
required to be familiar.  The Usenet <-> classroom analogy is bogus.

: If he takes up the teacher's time
: with FAQs, that means that *you* are not getting *your* money's worth. On
: Usenet all you waste is the amount of time it takes you to move on to the
: next thread or message.

Don't forget that the teacher is something of a moderator.  If he sees
that everyone's time is being wasted needlessly, he's free to offer to
discuss it with the student in detail later.  There is no such control
in an unmoderated group.

: The issue is not commerce, it is simple politeness. As a daily newsgroup
: reader, I find the constant insults a lot more annoying than the constant
: FAQs. 

I'd rather not see any FAQage or flamage. :-(

Greg
-- 
Fenster: I had a guy's fingers in my asshole tonight.
Hockney: Is it Friday already?


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

Date: 18 Aug 1998 13:41:56 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Q: How to read all the file name in a directory
Message-Id: <6rc0b4$s82@fridge.shore.net>

Greg Bacon <gbacon@cs.uah.edu> wrote:

: : The issue is not commerce, it is simple politeness. As a daily newsgroup
: : reader, I find the constant insults a lot more annoying than the constant
: : FAQs. 

: I'd rather not see any FAQage or flamage. :-(

Yeah, that would be nice. I'd like to be able to make money without
working, and eat all I want without gaining weight, too!

--Art

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


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

Date: 18 Aug 1998 13:17:05 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Question: How do I test Perl?
Message-Id: <6rbush$rfm$7@info.uah.edu>

In article <6rak6k$88m$1@nnrp1.dejanews.com>,
	richsark@pcav.com writes:
: Hello, I just installed Perl on my Solaris 2.51 box.  I would like to know
: what the command is to test it. I saw something like "hello World" but I
: cannot remember how to type it out.  Please send me a copy of your responce
: to rich@pcav.com

After you've built perl, you should run `make test'.  This will run
your perl against the regression suite.  It should pass all tests
(except the ones it skips).  perlbug it if it doesn't.

Greg
-- 
Please, Lord, let me prove that winning the lottery won't spoil me.


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

Date: 18 Aug 1998 11:53:55 GMT
From: scott@softbase.com
Subject: Re: Recommend a good editor
Message-Id: <35d96b53.0@news.new-era.net>

Allan Chandler (nobody@nowhere.com) wrote:
> I'm not sure how cut-down the versions would have to be to run under
> Windows.

I have yet to notice any difference between the UNIX and Windows 
versions. They're amazingly similar, so much so that anyone who
has to go back and forth will appreciate emacs on both platforms.

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: 18 Aug 1998 12:05:31 GMT
From: scott@softbase.com
Subject: Re: Recommend a good editor
Message-Id: <35d96e0b.0@news.new-era.net>

Since this thread has degenerated into naming editors at random, I have
to mention Multi-Edit, my favorite: although it is a commercial
product, it is only $100, and has many important features that make it
worth the price. The main one is printing support, which Emacs and
probably none of the other UNIX ports have in Windows. (Yes, I am aware
Emacs can generate PS files, but printing those is convoluted and
certainly not as good as File/Print....) The HTML support is good, and
it supports most modern languages (and even COBOL!). This editor is one
of the few commercial software packages I've found that is actually
worth the price. (ZipMagic 98 and Microsoft Publisher are two others.)

Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more. 


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

Date: Tue, 18 Aug 1998 08:56:52 -0400
From: John Porter <jdporter@min.net>
Subject: Re: taint checking seems to slow down my code
Message-Id: <35D97A14.65D6@min.net>

Bill 'Sneex' Jones wrote:
> 
> John Porter wrote:
> > "I didn't know you were called Dennis!"
> > "Well you didn't bother to find out, did you."
> 
> I'm a complete failure. 

Easy on the self-deprecation, hey.

> None of the man pages I have access
> to say anything about who the author is/was...

Oops, sorry, this is a perl newsgroup, not a python newsgroup.

-- 
John Porter


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

Date: Tue, 18 Aug 1998 08:55:40 -0400
From: "Steven" <vore@alf.dec.com>
Subject: test - ignore
Message-Id: <6rbtki$utt@usenet.pa.dec.com>

test




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

Date: Tue, 18 Aug 1998 10:46:50 GMT
From: b_redeker@hotmail.com
Subject: Re: Why dont people read the FAQs
Message-Id: <6rbm2q$mel$1@nnrp1.dejanews.com>

In article <ant171908b49Rr9i@waveney.demon.co.uk>,
  Richard Proctor <Richard@waveney.demon.co.uk> wrote:
> Why do we get so many questions here that are in the FAQ?
[snipped holy FAQ halleluja]
>

The FAQ's are by hackers for hackers,
and while great for experienced Perl-writers and UNIX/Linux-adepts,
others (newbies) may find the FAQ at times confusing

> NB Abigails posts may be curt, but are generaly right and often amusing,
> and there is an awfull lot of perl to be learnt from her sigs.

You are right. I once accused here of overdoing it with the flaming,
but ever since I've been wondering what that was about;
I like the comments and the signatures so if you read this, Abigail,
I'm sorry.

--
Boudewijn

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


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

Date: 18 Aug 1998 09:28:42 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: Yet another invocation line mystery (does seem to be perl related)
Message-Id: <r8hfzbnost.fsf@asc.sps.mot.com>


In a previous post I observed that


 #!/bin/sh
 eval 'exec perl -w -S $0 ${1+"$@"}'   # Use the -*- perl -*- on our path.
      if 0; 

 print "yay\n";


does not work.

How come it does work if you remove the #! line!?

Thanks,

Martin.


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

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

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