[11488] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5088 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 8 15:17:27 1999

Date: Mon, 8 Mar 99 12:00:23 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 8 Mar 1999     Volume: 8 Number: 5088

Today's topics:
    Re: appending to beginning of file <wd@denx.muc.de>
    Re: background process module - STDIN/STDOUT/STDERR? eldridge@graphics.stanford.edu
        constant in Perl? <yfang@gte.com>
    Re: constant in Perl? <Tony.Curtis+usenet@vcpc.univie.ac.at>
    Re: constant in Perl? (Bart Lateur)
    Re: constant in Perl? <yfang@gte.com>
    Re: dbm open (Steve .)
    Re: does perl discourage obfuscated code? (was Re: Perl <jeromeo@atrieva.com>
        FAQ 3.4: How do I debug my Perl programs?   <perlfaq-suggestions@perl.com>
        FAQ 3.5: How do I profile my Perl programs?   <perlfaq-suggestions@perl.com>
        Finding comments in a file using regular expressions <knapp@synopsys.com>
    Re: Finding comments in a file using regular expression (Damian Conway)
    Re: Finding comments in a file using regular expression <paladin@uvic.ca>
    Re: Finding comments in a file using regular expression (M.J.T. Guy)
    Re: Finding comments in a file using regular expression (M.J.T. Guy)
    Re: foreach and while (Mark-Jason Dominus)
        gethostbyname on entire subnet florcsk@boulder.nist.gov
    Re: input from file or from buffer <dgris@moiraine.dimensional.com>
    Re: make and perl500502 <richardr@ldr.com>
    Re: MS ACCESS database with perl massimobalestra@my-dejanews.com
        Perl Developer Required for Internet Startup <vijay@adzi.com>
    Re: Perl Editors for WinNT? <steve@pdq.net>
    Re: POST bug in latest LWP/libwww (1.82) (brian d foy)
    Re: Problems with referencing array <jdf@pobox.com>
        s/\n\s// don't work <mane@interscape.de>
    Re: s/\n\s// don't work <jglascoe@giss.nasa.gov>
        Script to Grant "Log on as Service" right gary_griffith@hotmail.com
    Re: Sub calls: how can I do this? (M.J.T. Guy)
    Re: Using Regex to exclude a domain name, can't seem to (brian d foy)
    Re: Using Regex to exclude a domain name, can't seem to <jeromeo@atrieva.com>
        voting application sample code wanted <"Greg N." <yodel_dodel@yahoo.com>>
    Re: What's the best way to store uncontrolled data? (Steve .)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Sun, 7 Mar 1999 20:56:15 GMT
From: Wolfgang Denk <wd@denx.muc.de>
Subject: Re: appending to beginning of file
Message-Id: <F88str.nry.7.denx@denx.muc.de>

mag@imchat.com (Mark P.) writes:

>	I wish I didn't have to consider NT when programming but it is
>a fact of life nowadays. <G>

It is *always* your own choice: love it, change it, or leave it.

You do *not* have to work with or for NT or any similar crap.

Wolfgang

-- 
Phone:  (+49)-89-95720-110   Fax: (+49)-89-95720-112   wd@denx.muc.de
Office: (+49)-89-722-27328               Wolfgang.Denk@ICN.Siemens.DE
 The software required `Windows 95 or better', so I installed Linux.


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

Date: Mon, 08 Mar 1999 19:07:33 GMT
From: eldridge@graphics.stanford.edu
Subject: Re: background process module - STDIN/STDOUT/STDERR?
Message-Id: <7c175c$ier$1@nnrp1.dejanews.com>

In article <36e312ff.64190625@news.inet.tele.dk>,
  [don't mail me] wrote:
> It really looks like you're trying to do Proc::Background again - from
> the man page:

Thanks for the pointer.  I had looked at that package before, and I took
another look at it again.  It lacks a "waitany" (harvest any child, I don't
care which) method, although it could clearly be added to both the Unix
and Win32 variants, since the infrastructure they are built upon support it.

In the same vein, I'd like to capture all of the stdout/stderr of these
subprocesses for a delayed pretty presentation.   For example, if I run
a.exe and b.exe, I'd like the (eventual) output to be

-- a.exe <and command line> --
<stuff that a outputted>

-- b.exe <and command line> --
<stuff that b outputted>

Or something like that.  Ideally, the process creation stuff would just
slurp up stdout/stderr and provide methods for the application to get the
current stdout/stderr for a process intermittently, or in one fell swoop
when the process is reaped, etc.

I'd greatly appreciate anybody's pointers on how to do this.  I suspect
it's simple and involves something like (open SAVEOUT, ">&STDOUT") and so
forth, but there would seem to be issues in assigning file descriptors
to processes and all the usual lossage that involves.

Thanks,

-Matthew

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


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

Date: Mon, 08 Mar 1999 11:25:14 -0500
From: Yu Fang <yfang@gte.com>
Subject: constant in Perl?
Message-Id: <36E3F9EA.4E4BDCD7@gte.com>

Basicly, I want to define a constant in Perl. The value can't be changed
at anytime.

If I simply
	$CONSTANT = 1;
I will be able to 
	$CONSTANT = 2;
later, which is not safe.

Is there a way like 'const' or macro in c/c++?

Thanks.
-- 
Frank Yu Fang 

GTE Internetworking
40 Sylvan Road
Waltham, MA 02451-1128

Phone: 781-466-3351  
Fax: 781-466-2650
Pager: 1-800-759-8888 PIN# 1619895 or 1619895@skytel.com


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

Date: 08 Mar 1999 17:28:23 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: constant in Perl?
Message-Id: <83d82kt07s.fsf@vcpc.univie.ac.at>

Re: constant in Perl?, Yu <yfang@gte.com> said:

Yu> Basicly, I want to define a constant in
Yu> Perl. The value can't be changed at anytime.

perldoc constant || &visit('http://www.cpan.org/');

hth
tony
-- 
Tony Curtis, Systems Manager, VCPC,    | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien.  | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds!  | private email:
    Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>


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

Date: Mon, 08 Mar 1999 19:43:05 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: constant in Perl?
Message-Id: <36e4269a.481747@news.skynet.be>

Yu Fang wrote:

>If I simply
>	$CONSTANT = 1;
>I will be able to 
>	$CONSTANT = 2;
>later, which is not safe.
>
>Is there a way like 'const' or macro in c/c++?

Actually, there are (at least) two.

A)
	*CONSTANT = \1;
	print $CONSTANT;
	$CONTANT = 2;
=>
	Modification of a read-only value attempted
	
but you can get around it by doing *CONSTANT = \2;

For obvious reasons, this will only work with global/local scalars, not
my'ed $scalars. (Hint: typeglob).

B) Use the module contstant.pm:

	use constant CONSTANT => 1;
	print CONSTANT;

CONSTANT is now declared as a sub which returns the value 1. That's why
there's no "$" prefix. An excellent practical example for closures. (The
value 1 is permanently trapped in a my'ed variable which is only
accessible through the freshly defined sub.)

	Bart.


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

Date: Mon, 08 Mar 1999 14:59:51 -0500
From: Yu Fang <yfang@gte.com>
Subject: Re: constant in Perl?
Message-Id: <36E42C37.B2D0B6DF@gte.com>

I want to use constants in C-header-file-like file. i.e.
header.pl:
	use constant CONSTANT => 1;
	1;

body.pl:
	require 'header.pl';
	$const = CONSTANT; # will fail

The second way forbids the constants be accessed by including files. The
format is cute, though.

Is there a way around?

Bart Lateur wrote:
> 
> Yu Fang wrote:
> 
> >If I simply
> >       $CONSTANT = 1;
> >I will be able to
> >       $CONSTANT = 2;
> >later, which is not safe.
> >
> >Is there a way like 'const' or macro in c/c++?
> 
> Actually, there are (at least) two.
> 
> A)
>         *CONSTANT = \1;
>         print $CONSTANT;
>         $CONTANT = 2;
> =>
>         Modification of a read-only value attempted
> 
> but you can get around it by doing *CONSTANT = \2;
> 
> For obvious reasons, this will only work with global/local scalars, not
> my'ed $scalars. (Hint: typeglob).
> 
> B) Use the module contstant.pm:
> 
>         use constant CONSTANT => 1;
>         print CONSTANT;
> 
> CONSTANT is now declared as a sub which returns the value 1. That's why
> there's no "$" prefix. An excellent practical example for closures. (The
> value 1 is permanently trapped in a my'ed variable which is only
> accessible through the freshly defined sub.)
> 
>         Bart.

-- 
Frank Yu Fang 

GTE Internetworking
40 Sylvan Road
Waltham, MA 02451-1128

Phone: 781-466-3351  
Fax: 781-466-2650
Pager: 1-800-759-8888 PIN# 1619895 or 1619895@skytel.com


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

Date: Mon, 08 Mar 1999 19:27:33 GMT
From: syarbrou@nospam.enteract.com (Steve .)
Subject: Re: dbm open
Message-Id: <36e42463.13116002@news.enteract.com>

Your open should be as follows:

dbopen (%temp, $filename, oct($mode))

I usually have the $mode variable set to 0666.

Steve

Remove nospam when responding thru email

On Mon, 08 Mar 1999 04:04:57 -0600, Bill Binkley <bwb@dowebpages.com>
wrote:

>Does anyone know why this tie will not create the DBM file, but will
>work OK
> after the file is created.
>
> $vdb = tie %vendor, DB_File, $vendb, O_RDWR|O_CREAT, 0700 || die "Could
>
> not open DBM file $vendb : $!\n";
> untie %vendor;
>
> This dbmopen works in all respects.
>
> dbmopen (%vendor, $vendb, 0700) || die "Can not open the DBM database
> $vendb : $!\n";
> dbmclose %vendor;
>
>Thanks



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

Date: Mon, 08 Mar 1999 08:12:17 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Re: does perl discourage obfuscated code? (was Re: Perl evangelism)
Message-Id: <36E3F6E1.198B2CED@atrieva.com>

Russell Schulz wrote:
> 
> Jerome O'Neil <jeromeo@atrieva.com> quotes me and writes:
> 
> >> I believe it.  Perl encourages hard-to-read code.  that's just the
> >> way it is, and if you don't apply a strong discipline when writing
> >> Perl, you're going to be the proud owner of a ton of read-only code.
> >
> > Completely disagree.  Given two pieces of well written code used to
> > accomplish the same task, I contend that perl is *more* readable than
> > just about any other language you can come up with.
> 
> I think you mispelled `agree' as `disagree' above.

You would be incorrect.
 
> how do you get this `well written' Perl code?  do you get it by slamming
> out the shortest Perl `idiom' to do something, or do you apply a little
> extra discipline to make sure it's well written in SPITE of all the
> built-in obscurity in Perl?  (is it local \**FH or *\*FH again?)

The same way I get well written Java, C or <BLUSH> DCL, sh, or anything
else I write.  Experience and training.  

I understand COBOL is supposed to be an "un-obfuscatable" language, but
I don't grok it well.  I pick on the French for a lot of things, but not
because they don't understand Russian. 

What you call "built in obscurity" I call "easily understood."  
 
> obviuosly, I don't think you do it without that discipline.

Clearly.  

I'll state it again, just so you don't misunderstand me.  Perl allows
one to write *more* readable code.


-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: 8 Mar 1999 09:43:24 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 3.4: How do I debug my Perl programs?  
Message-Id: <36e3fe2c@csnews>

(This excerpt from perlfaq3 - Programming Tools 
    ($Revision: 1.33 $, $Date: 1998/12/29 20:12:12 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq3.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I debug my Perl programs?

    Have you used `-w'? It enables warnings for dubious practices.

    Have you tried `use strict'? It prevents you from using symbolic
    references, makes you predeclare any subroutines that you call as
    bare words, and (probably most importantly) forces you to
    predeclare your variables with `my' or `use vars'.

    Did you check the returns of each and every system call? The
    operating system (and thus Perl) tells you whether they worked or
    not, and if not why.

      open(FH, "> /etc/cantwrite")
        or die "Couldn't write to /etc/cantwrite: $!\n";

    Did you read the perltrap manpage? It's full of gotchas for old
    and new Perl programmers, and even has sections for those of you
    who are upgrading from languages like *awk* and *C*.

    Have you tried the Perl debugger, described in the perldebug
    manpage? You can step through your program and see what it's
    doing and thus work out why what it's doing isn't what it should
    be doing.

-- 
    I'll say it again for the logic impaired.
		--Larry Wall


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

Date: 8 Mar 1999 12:13:27 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 3.5: How do I profile my Perl programs?  
Message-Id: <36e42157@csnews>

(This excerpt from perlfaq3 - Programming Tools 
    ($Revision: 1.33 $, $Date: 1998/12/29 20:12:12 $)
part of the standard set of documentation included with every 
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq3.html
if your negligent system adminstrator has been remiss in his duties.)

  How do I profile my Perl programs?

    You should get the Devel::DProf module from CPAN, and also use
    Benchmark.pm from the standard distribution. Benchmark lets you
    time specific portions of your code, while Devel::DProf gives
    detailed breakdowns of where your code spends its time.

    Here's a sample use of Benchmark:

      use Benchmark;

      @junk = `cat /etc/motd`;
      $count = 10_000;

      timethese($count, {
                'map' => sub { my @a = @junk;
                               map { s/a/b/ } @a;
                               return @a
                             },
                'for' => sub { my @a = @junk;
                               local $_;
                               for (@a) { s/a/b/ };
                               return @a },
               });

    This is what it prints (on one machine--your results will be
    dependent on your hardware, operating system, and the load on
    your machine):

      Benchmark: timing 10000 iterations of for, map...
             for:  4 secs ( 3.97 usr  0.01 sys =  3.98 cpu)
             map:  6 secs ( 4.97 usr  0.00 sys =  4.97 cpu)

    Be aware that a good benchmark is very hard to write. It only
    tests the data you give it, and really proves little about
    differing complexities of contrasting algorithms.

-- 
If I had only known, I would have been a locksmith.  --Albert Einstein


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

Date: Mon, 08 Mar 1999 10:54:26 -0700
From: Kevin Knapp <knapp@synopsys.com>
Subject: Finding comments in a file using regular expressions
Message-Id: <36E40ED2.3A7ED118@synopsys.com>

This is my first post so please bear with any ignorance in protocol.

My question is:
When parsing a file, why doesn't:
if (/^\s*[^\#])
match all but a comment line that may or may not have white space before
the "#"?

Doesn't "^" indicate the start of the line?
"\s*" indicate 0 or more white spaces?
[^\#] indicate the set that is not the "#" sign, with "#" escaped so
that it will not be interpreted as a comment delimiter?

Lines of the form: "  # Just a comment" were successfully matching the
regexp above.  I was expecting a mismatch.

Thanks for the help.



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

Date: 8 Mar 1999 18:56:12 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Finding comments in a file using regular expressions
Message-Id: <7c16gc$9pg$1@towncrier.cc.monash.edu.au>

Kevin Knapp <knapp@synopsys.com> writes:


>My question is:
>When parsing a file, why doesn't: if (/^\s*[^\#])
>match all but a comment line that may or may not have white space before
>the "#"?

>Doesn't "^" indicate the start of the line?
>"\s*" indicate 0 or more white spaces?
>[^\#] indicate the set that is not the "#" sign, with "#" escaped so
>that it will not be interpreted as a comment delimiter?

>Lines of the form: "  # Just a comment" were successfully matching the
>regexp above.  I was expecting a mismatch.

This line matches because it contains:
	(1) the start of the line?
	(2) 0 or more white spaces?
	(3) a character from the set that is not the "#" sign

	i.e. "  # Just a comment"
	     ^^^
	     |||
	     123

You probably wanted:

	/^\s*[^\#]$/)
		  ^
	          |


Damian


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

Date: Mon, 8 Mar 1999 11:10:27 -0800
From: Draco Paladin <paladin@uvic.ca>
To: Kevin Knapp <knapp@synopsys.com>
Subject: Re: Finding comments in a file using regular expressions
Message-Id: <Pine.A41.4.05.9903081048060.58606-100000@unix4.UVic.CA>

[posted and cc'd]

On Mon, 8 Mar 1999, Kevin Knapp wrote:

> My question is:
> When parsing a file, why doesn't:
> if (/^\s*[^\#])
               ^^
First off, you forgot the regex terminator here. Should be:
if (/^\s*[^\#]/)      

> match all but a comment line that may or may not have white space before
> the "#"?
> 
> Doesn't "^" indicate the start of the line?

yes.

> "\s*" indicate 0 or more white spaces?

Yes.

> [^\#] indicate the set that is not the "#" sign, with "#" escaped so
> that it will not be interpreted as a comment delimiter?

No.  [^\#] matches anything that is not a literal '\' or '#'.  Inside a
character class the only characters you need to quote are:
\], \a, \n, \r, \t, \f, \d, \w, \s.  To include a [ put it first in the
list and to include a ^ put it anywhere but first.  (I'm working from
memory here so I might have forgot one or two.)

> Lines of the form: "  # Just a comment" were successfully matching the
> regexp above.  I was expecting a mismatch.

The line above: "  # Just a comment" does match the regex you gave.  I'll
try to make a quick explination why, but for more info you should really
go read _Mastering Regular Expressions_ published by O'Reilly, written by 
Jeffrey Friedl.

The regex engine will first match all the white space at the start of the
string and then check to see if the next character is a \ or #.  If it
is not then great, we have a match.  If it is a \ or # (like in your
example) it will then 'give up' one of the white space characters that it
matched with the \s* and try the match again, which in this case the ' '
character that it gave up is not a \ or # so it does match.

Actually your regex will match any line that does not start with a \ or #
because the \s* can match zero characters and then the [^\#] will match
anything that is not a \ or #.

To do what you want you might try to turn the match around and do

if ($line !~ /^\s*#/) {
	# do stuff if not a comment
}

-- 
Mother is the name for GOD on the lips and
hearts of all children.  - Eric Draven



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

Date: 8 Mar 1999 19:37:36 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Finding comments in a file using regular expressions
Message-Id: <7c18u0$3rn$1@pegasus.csx.cam.ac.uk>

Damian Conway <damian@cs.monash.edu.au> wrote:
>Kevin Knapp <knapp@synopsys.com> writes:
>>When parsing a file, why doesn't: if (/^\s*[^\#])
>>match all but a comment line that may or may not have white space before
>>the "#"?
>
>You probably wanted:
>
>	/^\s*[^\#]$/)
>		  ^
>	          |

I very much doubt that.    That would only match # at the end of the
line.

What the poster wants is "lines whose first non-whitespace character is
NOT #".     Since we can write a character which is not whitespace
and not # as  [^\S#] (don't you love those double negatives?), try

    if (/^\s*[^\S#]/)

You may find it clearer to think in terms of what you *don't* want  -
lines whose first non-whitspace character is #:

    if ( ! /^\s*#/)
or
    unless (/^\s*#/)

TMTOWTDI


Mike Guy


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

Date: 8 Mar 1999 19:43:01 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Finding comments in a file using regular expressions
Message-Id: <7c1985$46g$1@pegasus.csx.cam.ac.uk>

Draco Paladin  <paladin@uvic.ca> wrote:
>No.  [^\#] matches anything that is not a literal '\' or '#'.

Wrong.   That matches anything except a #.   You can escape any non-word
character in a character class harmlessly.    But it is unnecessary.


Mike Guy


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

Date: 8 Mar 1999 14:51:31 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: foreach and while
Message-Id: <7c19o3$6b1$1@monet.op.net>

In article <7avqm9$q9o$2@fir.prod.itd.earthlink.net>,
Ken Hirsch <kenhirsch@myself.com> wrote:
>That's a great point!  When I think of all those COBOL programmers "saving
>storage" by omitting "19" but the representation allows only 36525 different
>values out of 1,000,000 possible.  That's a storage efficiency of 3.65%.

That means that there's still plenty of space.  For example, just
adopt the convention that when the day number is between 32 and 62,
the date YYMMDD actually means (year=2000+YY, month = MM, day=DD-31).
So, for example, April 2, 2053 can be represented as 530433, which
can't possibly be confused with 530402, which is April 2, 1953.  The
Unix epoch is Jan 18, 2038: `380149'.  This could even enter common
speech, and people could speak unambiguously of `April 33rd' and
`January 49th'.  

When the next century runs out, you can squeeze in another century by
using April 63-93.  Then you can get another three centuries by
allowing months 13-24, etc.

Of course, you still have the old sort order problems.


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

Date: Mon, 08 Mar 1999 19:28:42 GMT
From: florcsk@boulder.nist.gov
Subject: gethostbyname on entire subnet
Message-Id: <7c18cs$jk8$1@nnrp1.dejanews.com>

I'm writing a few little utilities that allow lookups to be done via input
from an html form. This data is passed to a perl script where the lookup is
done with gethostbyaddr and gethostbyname calls.

There are 4 things I'd like to do: 1) Enter an IP address, returns host name.
2) Enter FQDN, returns IP address. 3) Enter a subnet, return IP addresses
that resolve and their corresponding host names. 4) Enter a domain, return
the hosts that exist on that domain and their corresponding IP addresses.

The first 3 were easy. The 3rd was done with a loop basically calling
gethostbyaddr 255 times. However, I'm stuck as to how to do the 4th. Can
gethostbyname be used for this or some module? I'd like to be able to type in
"somewhere.com" and back will come:
www.somewhere.com (192.168.x.x)
news.somewhere.com (192.168.x.x)
gateway.somewhere.com (210.43.x.1)
etc....

- Scott Florcsk

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


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

Date: 08 Mar 1999 10:22:30 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: input from file or from buffer
Message-Id: <m3iucbx5ex.fsf@moiraine.dimensional.com>

[posted and mailed]

bart.lateur@skynet.be (Bart Lateur) writes:

> It was still on my news server. Thanks, I'll study it.

It had a mistake, though.  There is no need to create the
filehandle before tying.  Just tying a glob will work fine.

> This is a bit of a general problem with the Perl documentation: the
> step-in level is a bit too high for newbies, even experienced newbies. A
> working example is all I need to get things rolling. And I'm sure I'm
> not alone who feels that way.

If you could mail me offgroup to tell me what you're having a hard
time with I'll try to help.  I honestly don't see what is too
difficult about perltie as it is currently written (and it does
have examples for each datatype that can be tied).  

I know that when I first started using tied objects my biggest problem
was that I had convinced myself that it was hard, even though it
isn't.

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


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

Date: Mon, 08 Mar 1999 11:37:24 -0800
From: Richard Robinson <richardr@ldr.com>
Subject: Re: make and perl500502
Message-Id: <36E426ED.9E3CAA32@ldr.com>

Andy,

Thanks for your feedback. Upon receiving it, it gave me some satisfaction --
at least I wasn't going bonkers and someone else has been having the same
problems. Small consolation albeit.

In the meantime, as I have been struggling with this for several days,
notwithstanding the patient help of Scott Henry at SGI, I decided to scrap
the GCC for now, and install a copy of CC.

Well, guess what -- perl5.00502 installed perfectly and without a hitch using
the default configuration and CC as the compiler. I merely started from
scratch (% make distclean) with a %./Configure -d

--Richard

As you may know, CC is not bundled with IRIX 6.5.2. So, as I have learned,
you must buy a copy of it. Before you buy, you can first license it for a
couple weeks on a share-ware basis, which is what I have done. Go to
www.sgi.com/Products/Evaluation, and click on Key-o-matic, which will walk
you through the licensing part of it. Then you can install the software from
your CDs.

Andy Catero wrote:

> In article <36E061D4.AEF65504@ldr.com> you wrote:
> > I'm having problems making perl on IRIX 6.5.
>
> > I configured as follows: sh Configure -Dcc=gcc.
> > Then I accepted all the defaults except that when Configure asked me to
> > use nm -- I answered y for yes (instead of n for no, which was default).
>
> > This gave me a config.sh that had "undef" for libc.
>
> > And when I went to make, I got the following:
> > .
> > .
> > .
> > Use of unitilialized value at configpm line 339, <GLOS> chunk 541
> > Use of unitilialized value at configpm line 339, <GLOS> chunk 542
> > Use of unitilialized value at configpm line 403.
> > configpm: tmp not valid at configpm line 403.
> > *** Error code 2 (bu21)
>
> > Comments in the Makefile say that if I'm having problems with configpm
> > script, I can comment out the simple tests at the end of latter. Which I
> > did. (make minitest failed, so I resorted to previously mentioned).
>
> > When I ran make this time, it just hung on the "Extracting pod2html
> > (with variable substitutions)" line.
>
> > Any one have this kind of problem. Any one have a suggestion?
>
> Hi Richard, I am running 6.5.2 on an o2. I had alot of problems
> trying to compile perl 5.005.02 and I saw this problem. I gave up
> and compiled perl 5.004.04 and had to tell perl not to compile
> any of the database modules in order for perl to work. I am
> having problems getting the libnet package specifically Net::FTP
> to work.
>
> >From the INSTALL file
> Thus to skip the NDBM_File extension, you can use
>
>         sh Configure -Ui_ndbm
>
> This I had to do to all the database modules.
> If you find a fix let me know.
>
> Andy Catero
>
> > --
> > Richard Robinson
> > Web Administrator
> > Litho Development & Research
> > richardr@ldr.com
> > 503-255-5800 x172

--
Richard Robinson
Web Administrator
Litho Development & Research
richardr@ldr.com
503-255-5800 x172




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

Date: Mon, 08 Mar 1999 15:53:51 GMT
From: massimobalestra@my-dejanews.com
Subject: Re: MS ACCESS database with perl
Message-Id: <7c0rqa$7dl$1@nnrp1.dejanews.com>

Is easy and I do it often.
You need:
1) perl (I suggest ActivePerl but also the Gurusamy's binary distribution
works)
2) Installed DBI and DBD-ODBC
3) ODBC 32 bit working annd installed on you pc/server.
4) A system ODBC DSN to your MS-Access database
5) Learn the ODBC SQL syntax

It works quite well. I use it often to prepare some CGI that after I move my
official web server with an Oracle database and often I need only to change
the "connect" statement.

Note: You have to use the ODBC SQL syntax, not the Access.

Good luck

Bye
Massimo

In article <7c0k8o$rjc$1@xenon.inbe.net>,
  "Nicolas Malfeyt" <nicolasm@luon.be> wrote:
> Is it possible and how hard would it be to send some kind of SQL query to an
> MS ACCESS database residing on your webserver with Perl, and then using the
> results in your web application?
>
> Thanks,
>
> Nicolas Malfeyt
> nicolasm@luon.com
>
>

 Massimo Balestra
 System Engineer
 Torino Italy

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


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

Date: Mon, 8 Mar 1999 18:43:06 -0000
From: "Vijay Mayadas" <vijay@adzi.com>
Subject: Perl Developer Required for Internet Startup
Message-Id: <36e41825.0@newsread3.dircon.co.uk>

An Internet startup has recently received significant financial backing and
is looking to recruit an outstanding Perl and UNIX developer to join the
team in Boston, MA, USA to design, develop and rollout the company's
Internet product.

At least 2-3 years experience in Perl and UNIX is required along with
experience of the full software development cycle in a dynamic environment
e.g. investment banking or another startup.

Applications are welcome from US and Europe but the successful candidate
must be willing to relocate to Boston, MA, USA.

A good first degree in a physical science, computer science or mathematics
from a major university is required.

The package will consist of a competitive basic salary, bonus and share
options.

Interested candidates should send their full CV to.

perldev@adzi.com

Postings on this newsgroup will NOT be acknowledged.







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

Date: Mon, 08 Mar 1999 12:58:40 -0600
From: Steve Lush <steve@pdq.net>
Subject: Re: Perl Editors for WinNT?
Message-Id: <36E41DDF.926DA5DB@pdq.net>

Is this something specific for NT?  Because I've been using UltraEdit and
EditPad (it's a bit smaller) for some time with no problems and nothing but
praise.



Scratchie wrote:

> Robert Burris <null@127.0.0.1> wrote:
> : http://www.textpad.com/
>
> What he said. I'm almost starting to like this editor better than BBEdit.
>
> --Art
>
> --
> --------------------------------------------------------------------------
>                     National Ska & Reggae Calendar
>                   http://www.agitators.com/calendar/
> --------------------------------------------------------------------------



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

Date: Mon, 08 Mar 1999 12:48:50 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: POST bug in latest LWP/libwww (1.82)
Message-Id: <comdog-ya02408000R0803991248500001@news.panix.com>

In article <36E339FE.ED3C0B7D@highsynth.com>, jbattikha@highsynth.com posted:

> There's probably a better place to post this but all I can do is
> reproduce the error, I have no idea why the latest libwww bundle
> chokes.  LWP::Debug is only telling me what I already know - something
> is messed up somewhere in the response handling.  

what is the smallest bit of code that you can write to reproduce the
problem?

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: 08 Mar 1999 11:12:59 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: slamda@hotmail.com
Subject: Re: Problems with referencing array
Message-Id: <m3678c2c50.fsf@joshua.panix.com>

slamda@hotmail.com writes:

> $created=localtime(time); open(MYFILE,"c:\\listbroker\\database
> text\\lisdms.txt") || die "error openinig file"; print("Starting To Unpack

It's *very* hard to read your code when it's formatted this way.

>   push
> (@hello,\@{unpack("A6A40A7

Try

  push @array, [ some expression that evaluates to a list ];

The [] constructs a reference to an anonymous array.

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


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

Date: Mon, 08 Mar 1999 20:35:25 +0100
From: Manfred Brunner <mane@interscape.de>
Subject: s/\n\s// don't work
Message-Id: <36E4267D.33B7611E@interscape.de>

I just want to substitute from stdin all newline followed by whitespace
beginning in the next line, with nothing.

The input looks easy like this:
---
Here is the first line
 the second line starts with one space
---

I tried a lot like the following few samples:

while (<STDIN>) {
        s/\n\s//g;
        print $_;
}

or

while (<STDIN>) {
        s/\n\^\s//g;
        print $_;
}

or

while (<STDIN>) {
        s/\n\^ //g;
        print $_;
}


Step by Step fails also:
First substitute newline with some pattern. This generates one single
line witch includes the pattern followed by the whitespace. Then
substitute the pattern with whitespace with nothing.

Thanks,
Manfred



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

Date: Mon, 08 Mar 1999 14:37:14 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: mane@interscape.de
Subject: Re: s/\n\s// don't work
Message-Id: <36E426EA.367B9007@giss.nasa.gov>

[courtesy copy of post sent to cited author via email]

Manfred Brunner wrote:
> 
> I just want to substitute from stdin all newline followed by whitespace
> beginning in the next line, with nothing.
> 
> The input looks easy like this:
> ---
> Here is the first line
>  the second line starts with one space
> ---
> 
> I tried a lot like the following few samples:
> 
> while (<STDIN>) {
>         s/\n\s//g;
>         print $_;
> }

<snip other code>

hi Manfred,

all of your loops are working on the input
one line at a time.  So, the first time through
the loop, "$_" is "Here is the first line\n".
This does not match "/\n\s/".  Second time through,
"$_" is " the second [...] one space\n".  This
line does not match "/\n\s/" either.

try this:

while (<STDIN>) { # for every line,
    s/^\s+//g;    # remove all leading white space,
    print;        # and print the result.
}


	Jay Glascoe
--  
ping.


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

Date: Mon, 08 Mar 1999 19:38:47 GMT
From: gary_griffith@hotmail.com
Subject: Script to Grant "Log on as Service" right
Message-Id: <7c1905$k5r$1@nnrp1.dejanews.com>

Hey All,

I'm in need of direction or a pointer (to the right module) -

I need to grant a particular NT domain user the right to "Log On as a
Service" onto NT workstation - and unfortunately - I have to do it for 100's
of NT workstations.  My first thought is to try "NET USE" commands, but they
don't seem to cut it.  There's got to be a module already out there that can
do this.

Anyone know of it?  Is there a way to get NetAdmin or AdminMisc to work this
out?

I'll be doing s'more poking around in the meantime.

-Gary Griffith

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


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

Date: 8 Mar 1999 18:55:23 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Sub calls: how can I do this?
Message-Id: <7c16er$1op$1@pegasus.csx.cam.ac.uk>

Jonathan Stowe  <gellyfish@btinternet.com> wrote:
>Or an alternative for the paranoid
>
>      if ( ref($ARGV[0]) == 'CODE' )
>        {
>           ...
>         }

Or for the even more paranoid

       if ( UNIVERSAL::isa($ARGV[0], 'CODE' ) {


Mike Guy


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

Date: Mon, 08 Mar 1999 12:50:28 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Using Regex to exclude a domain name, can't seem to get it to work.
Message-Id: <comdog-ya02408000R0803991250280001@news.panix.com>

In article <36E38ED4.E38CBD37@bellsouth.net>, wg <wgraphic@bellsouth.net> posted:

> I am trying to exclude a domain name using Regex
> in this log program Web Log

a snippet of code would greatly improve the helpfulness of answers ;)

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>


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

Date: Mon, 08 Mar 1999 09:49:53 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: wg <wgraphic@bellsouth.net>
Subject: Re: Using Regex to exclude a domain name, can't seem to get it to work.
Message-Id: <36E40DC1.360B5F8@atrieva.com>

wg wrote:

> After reading the documentation I still couldn't
> get it to exclude for example I have
> 
> # $ExcludeDomain = ".yahoo.";

This is a comment.  It *should* be completely ignored.
 
> I believe I have the correct regex but obviously
> not.

Clearly.  For all the exciting detail on pattern matching and regular
expression syntax, read the perlre documentation that came with your
perl distribution.  Pay particular attention to the metacharacter used
for matching any character, except a new line.  Then read about escaping
metacharacters.  They are in the same section.

Good Luck!

-- 
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947 
The Atrieva Service: Safe and Easy Online Backup  http://www.atrieva.com


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

Date: Mon, 08 Mar 1999 19:33:40 GMT
From: Greg N. <"Greg N." <yodel_dodel@yahoo.com>>
Subject: voting application sample code wanted
Message-Id: <7c18mj$jpg$1@nnrp1.dejanews.com>

I need a simple voting application written in Perl/CGI.  It should work like
this:

- There is a table of data, where each row has one cell containing a voting
counter, and a voting button.

- If a user clicks a voting button, the corresponding counter is increased

- If the voter's IP address is the same one as the one where the last vote
for that item came from, the vote is ignored.

- all votes (time, IP addr, item) are logged in a sequential file

Does anybody have a piece of code along those lines?  Can anybody point to
some publicly available code?

Any response highly appreciated.

Greg N.
http://www.neatone.com

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


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

Date: Mon, 08 Mar 1999 18:57:52 GMT
From: syarbrou@nospam.enteract.com (Steve .)
Subject: Re: What's the best way to store uncontrolled data?
Message-Id: <36e41d8b.11363834@news.enteract.com>

Thanks for the info.  Where can I find info on the data::dumper
module?  Looked on perl.com but they only had xml::dumper listed when
I searched for anything containing dumper.

Steve

On 8 Mar 1999 04:26:25 GMT, sholden@pgrad.cs.usyd.edu.au (Sam Holden)
wrote:

>On Mon, 08 Mar 1999 04:13:29 GMT, Steve . <syarbrou@nospam.enteract.com> wrote:
>>I have a perl script that will store data people input from command
>>line questions.  Each person's data will be stored in some format.
>>The problem is I can't do it comma delimited because some of the
>>questions are open ended, so they can put basically anything they want
>>in there, which could screw up any reading of the data.  How is the
>>best way to store data in this case?  Any/all possibilities welcome.
>>Thanks.
>
>It depends on how you are going to use the data. If it is only used by other 
>perl scripts, then the simplest method is use Data::Dumper or Storable.
>
>I like Data::Dumper even though it is significantly slower, since it 
>outputs the data in a nice readable format that is easy for me to 
>edit in a text editor if need be. You read it back in with 'do' or
>'eval' depending upon circumstances.
>
>A very simple format to parse is to use something similar to mail 
>headers (RFC822 I think). You might have to encode newlines though.



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

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


Administrivia:

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

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

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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