[12344] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5944 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 10 09:07:40 1999

Date: Thu, 10 Jun 99 06:00:19 -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           Thu, 10 Jun 1999     Volume: 8 Number: 5944

Today's topics:
        block inside print ? <bill@fccj.org>
    Re: Bulletin Board in Perl <Hummert@infantry.usmc.net>
    Re: Freelance Perl CGI application Writers <emilio_tunon@nl.compuware.com>
    Re: Generating a checksum... <sb@sdm.de>
    Re: How do I write CGI in C++? <perlguy@technologist.com>
    Re: how to connect oracle 8 thru perl on NT (Lars Reineke)
    Re: how to connect oracle 8 thru perl on NT (Lars Reineke)
    Re: Is this a bug in Perl? (Malcolm Ray)
        Logging Events on Win32 ian_salt@my-deja.com
    Re: macperl - directory names with embedded spaces (Chris Nandor)
    Re: macperl - directory names with embedded spaces (Chris Nandor)
    Re: Perl "constructors" armchair@my-deja.com
    Re: Perl "constructors" (David Cantrell)
    Re: perl debugging in emacs <dnp@ams.org>
    Re: perl debugging in emacs <Toby.Speight@digitivity.com>
    Re: Perl on win32 <sb@sdm.de>
    Re: Problem with Mac Perl and showtimes (Chris Nandor)
        Removing the decimal? <joeyandsherry@mindspring.com>
    Re: Removing the decimal? (Malcolm Ray)
    Re: Removing the decimal? <joeyandsherry@mindspring.com>
    Re: What's the "halting problem"? (Randal L. Schwartz)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 10 Jun 1999 07:42:20 -0400
From: "Bill Jones" <bill@fccj.org>
Subject: block inside print ?
Message-Id: <375fa440.0@usenet.fccj.cc.fl.us>

:(

Maybe I've looked at it too long, but ...

Is there a way to embed a BLOCK of code inside
a print statement:


print "Cal? ",
{
    (split(/\|/, $vFlag))[7] eq 'x') ? "do this"
                                     : "do that"
}, "\n";


I get various errors, but mainly I am getting:
syntax error at MoreInfoII.cgi line 66, near "'x') "
syntax error at MoreInfoII.cgi line 72, near "}"


Oh!  Never mind, I figured it out.  I was missing a (
a the beginning of the split...  Sorry...

(I posted this anyway in hopes that others may find it useful.)

NOTE:  The above does cause error -
MoreInfoII.cgi: Odd number of elements in hash list at
 ./MoreInfoII.cgi line 57, <miData> chunk 826.

As soon as I figure that out, I'll post an answer...

Thx,
-Sneex- :]
_________________________________________________________________________
Bill Jones  | Data Security Specialist | http://www.fccj.org/cgi/mail?dss
FCCJ  |  501 W State St  |  Jacksonville, FL 32202  |  1 (904) 632-3089

$_ = "Jacksonville Perl Monger"; while(/([Jacksonville Perl Monger])/g){
print join(" ", map { defined $_ ? $_ : "" } $`, $&, $', $+), "\n"; }


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

Date: Thu, 10 Jun 1999 11:20:16 +0200
From: Christian Hummert <Hummert@infantry.usmc.net>
Subject: Re: Bulletin Board in Perl
Message-Id: <375F8350.FA6D6BE6@infantry.usmc.net>

Thank you for you nice Tips ;-) But I aktually dont know what you expect
me to do... The Perl source I wrote are 300 lines, and I think it is a
bad Idea to send the whole source to the newsgroup... But I will send
you copy via Email if you wish one...

And there are no errors in the source, I can compile it with just 5
warnings... But If I start the CGI Script the Server goes down... So I
just asked if anyone had developed a BBS in the past so I could compare
the sources...

Thank you
  Christian Hummert


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

Date: Thu, 10 Jun 1999 14:43:07 +0200
From: "D. Emilio Grimaldo Tunon" <emilio_tunon@nl.compuware.com>
Subject: Re: Freelance Perl CGI application Writers
Message-Id: <375FB2DB.3407C7AE@nl.compuware.com>

skrana@my-deja.com wrote:
> 
> I am looking for Freelance Perl (CGI) application writers.
> 
> Please send e-mail to rana@akr.com.
> 
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.


   Could you send more details?

		Best Regards,
				emilio grimaldo
  
-- 
D. Emilio Grimaldo Tunon       Compuware Europe B.V. (Uniface Lab)
Software Engineer	       Amsterdam, The Netherlands
emilio_tunon@nl.compuware.com  Tel. +31 (0)20 3126 516
*** The opinions expressed hereby are mine and not my employer's ***


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

Date: 10 Jun 1999 11:31:35 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Generating a checksum...
Message-Id: <7jo7mn$lfq$2@solti3.sdm.de>

In article <7jmkvb$q47$1@shell18.ba.best.com>, Jim Matzdorff <syran@best.com> wrote:

> I am trying to generate a checksum for an ICMP packet, which basically
> states that the checksum is the 16-bit one's complement of the one's
> completment sum of th whole IGMP message (direct from the RFC!).  The
> checksum computes on every 2 bytes in the message.

> My problem is that I am unsure of how to get a one-complement in perl,
> as I can't use unsigned values and do bit-wise shifts (this would be
> easy to do in C).  My code is based on how you would do it in C.

> This is what I have currently, but (obviously) it doesn't work -- 
> help?

You might find the Bit::Vector module helpful.

See my sig below for URLs where to download it from.

Hope this helps!

Regards,
-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/whoami/
    http://www.engelschall.com/u/sb/download/
    http://www.perl.com/CPAN/authors/id/STBEY/
    http://www.oreilly.de/catalog/perlmodger/bnp/


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

Date: Thu, 10 Jun 1999 06:43:22 -0500
From: Brent Michalski <perlguy@technologist.com>
Subject: Re: How do I write CGI in C++?
Message-Id: <375FA4DA.8FB240AE@technologist.com>

You might want to try a CGI newsgroup, this is the *Perl* newsgroup...

But, what you want to do in Perl can be done in about 5 or 10 lines of
Perl...

Brent

Elia Weiss wrote:
> 
> 
> Hi,
> I want to write a CGI in C++ (usually I use TCL/tk)
> but I don't know how to reach the environment variable
> (i.e. The data that being send by the user/browser
> and being set by the server as global/enviormment variable)
> 
> So I do reach does var's?
> 
> Is there any special Lib to work with CGI's?
> 
> Is there any reason way not writing a CGI in c++ (i.e. versus. TCL)?
> 
> Is there a better forum I should present this kind of questions?
> 
> Thanks
> Elia Weiss
> 
>


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

Date: Thu, 10 Jun 1999 11:40:33 GMT
From: reineke@kreiskrankenhaus-hameln.de (Lars Reineke)
Subject: Re: how to connect oracle 8 thru perl on NT
Message-Id: <375f8c54.14997254@172.20.200.2>

Hi!

On Thu, 10 Jun 1999 05:10:13 GMT, CHETAN <chetan_gautam@hotmail.com>
wrote:

>
>$dbh = $drh->connect( '', 'scott', 'tiger');
>die unless $dbh;

$dbh = $drh->connect('$dbh = 'dbi:Oracle:','scott@xxx.yyy','tiger');


xxx.yyy has to be replaced with the database name, which you can find in
TNSNAMES.ORA in $ORACLE_HOME\network\admin.


-- 
Lars Reineke
http://www.planet-interkom.de/pinhead
mailto:reineke@kreiskrankenhaus-hameln.de 


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

Date: Thu, 10 Jun 1999 12:21:15 GMT
From: reineke@kreiskrankenhaus-hameln.de (Lars Reineke)
Subject: Re: how to connect oracle 8 thru perl on NT
Message-Id: <375fad5c.23454035@172.20.200.2>

Hi!

On Thu, 10 Jun 1999 11:40:33 GMT, reineke@kreiskrankenhaus-hameln.de
(Lars Reineke) wrote:

>$dbh = $drh->connect('$dbh = 'dbi:Oracle:','scott@xxx.yyy','tiger');

Sorry:
$dbh = $drh->connect('dbi:Oracle:','scott@xxx.yyy','tiger');


-- 
Lars Reineke
http://www.planet-interkom.de/pinhead
mailto:reineke@kreiskrankenhaus-hameln.de 


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

Date: 10 Jun 1999 11:57:19 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Is this a bug in Perl?
Message-Id: <slrn7lva0v.dee.M.Ray@carlova.ulcc.ac.uk>

On Thu, 10 Jun 1999 11:00:43 +0100, Derek <derek@fortstar.demon.co.uk> wrote:
>I've posted this problem before, but got no response to it. I'm starting
>to think it's a bug in Perl. It shows itself in 5.004 and 5.005, but
>5.001 and 5.003 are OK. This script, on AIX, shows it up:
>
>#!/bin/perl -w
>use strict;
>
>use POSIX qw(:sys_wait_h :signal_h);
>
>sub reaper
>  {
>    my $dead_child = wait;
>    print "Reaped $dead_child with status of $?\n";
>  }
>
>$SIG{CHLD} = \&reaper;
>
>if( fork ) { exit 0; }
>
>my @lines = qx(ps);
>die("Dead with $?\n") if( ($? >> 8) != 0 );
>print "Done\n";
>
>
>What this does is set up a signal handler for the SIGCHLD signal, which
>is installed before a backtick call to a command which will complete
>correctly (ps in this case). The problem is that despite the fact that
>the ps worked OK, the $? variable is corrupted with -1. On an AIX box
>with Perl 5.004 I get this:
>
>> ./reaper.pl
>Reaped 18678 with status of 0
>Dead with -1
>Reaped 25888 with status of 2560
>
>Perl 5.001 on AIX gives:
>
>> Reaped 49164 with status of 0
>Done
>
>
>If this is not a bug, and the behaviour of Perl has changed in some way
>I don't understand, I'm happy to be shouted down for the subject of this
>post. But if this is a bug, and if someone who knows what they are doing
>could produce a patch, I could really use it! My workarounds are not
>entirely successful at the moment.

Have you read perlvar?  It has this to say about $?:

               Note that if you have installed a signal handler
               for SIGCHLD, the value of $? will usually be wrong
               outside that handler.
-- 
Malcolm Ray                           University of London Computer Centre


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

Date: Thu, 10 Jun 1999 10:46:51 GMT
From: ian_salt@my-deja.com
Subject: Logging Events on Win32
Message-Id: <7jo52q$epk$1@nnrp1.deja.com>

Hi

I'm having problems logging events using the Win32::EventLog module

using the following bit of code I can log a message in the application
event log but when I try to read it i get the error "The system cannot
find the file specified" Also the source and category don't appear. I
believe that I have to register the application under
HKEY_LOCAL_MACHINE->System->CurrentControlSet->Services->EventLog-
>Application but I don't know how to register it. All the existing
entries seem to have DLL's or EXE's to handle the logging. Am I
somewhere close or am I barking up the wrong tree??

I notice that there are a few references to Philippe Leberre's Perl
Pages at http://www.inforoute.cgs.fr/leberre1/ for EventLog and
Registry FAQs however this site seems to have shut down, does anyone
know where it has gone?


Thanks for any help in advance

Ian Salt

Sample Code Follows

use strict;
use Win32::EventLog;

my $eventlog_file = "Application";

my $log = Win32::EventLog->new($eventlog_file);
	die "Can't open $eventlog_file: $!\n" unless $log;
my $log_info = {
	'Category' => 1,
	'EventType' => EVENTLOG_INFORMATION_TYPE,
	'EventID' => 1,
	'Strings' => "Perl String",
	'Data' => 'Perl Data',
};
$log->Report($log_info) || warn "Unable to report event: $!";
$log->CloseEventLog;


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 10 Jun 1999 12:16:26 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: macperl - directory names with embedded spaces
Message-Id: <pudge-1006990816310001@192.168.0.77>

In article <376084ae.2050185@news.skynet.be>, bart.lateur@skynet.be (Bart
Lateur) wrote:

# Tom Phoenix wrote:
# 
# >> How do I specify the path to a file where the some of the folder
# >> (directory) names have embedded spaces?
# >
# >The same way as with any other file name. :-) 
# >
# >    my $file_name = "I've got spaces";
# >    open FILE, $file_name
# >       or die "Can't open '$file_name': $!";
# >
# >Well, I know that was the file name which had spaces in it, but it's the
# >same principle. Have fun with Perl!
# 
# Problems will occur if your filename begin or end with spaces. That IS
# legal on a Mac, and open() will strip them. Blimey. You then need to use
# the more complex 3-parameter sysopen().

Same thing with Unix, and all other platforms that allow a filename to
begin or end with spaces.

# But, actually, I don't think it's the spaces causing you trouble. I've
# noticed that open() will NOT WORK if the filename or the folder path
# contains a null byte. That too IS LEGAL on a Mac.

It is?  Hrm.  I thought nulls in filenames were illegal.  Do you have any
docs on this?

# Super blimey. Again,
# sysopen() MAY help (haven't tested).

No, it doesn't.  sysopen(FOO, "bar\0baz", O_RDWR|O_CREAT, 0666) creates a
file called "bar".  So does FSpCreate("bar\0baz", 'McPL', 'TEXT') ... the
fact that this system function does the same thing leads me to believe
that this Mac OS API cannot handle nulls in filenames, and that it is not
the fault of sysopen() or MacPerl.  But I could be wrong.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Thu, 10 Jun 1999 12:18:35 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: macperl - directory names with embedded spaces
Message-Id: <pudge-1006990818390001@192.168.0.77>

In article <dwilgaREMOVE-0906991524000001@wilga.mtholyoke.edu>,
dwilgaREMOVE@mtholyoke.edu (Dan Wilga) wrote:

# (One thing to note as an aside: I've found that you can't rely on the
# default path being anything in particular on the Mac.

Yes, you can.  You just need to know what it is.  A script that is not
saved has the MacPerl folder as its default current directory.  A script
that is saved has the directory it is saved in as its default current
directory.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Thu, 10 Jun 1999 10:13:59 GMT
From: armchair@my-deja.com
Subject: Re: Perl "constructors"
Message-Id: <7jo353$ea4$1@nnrp1.deja.com>

In article <7jls7f$k9b$1@nnrp1.deja.com>,
  John Porter <jdporter@min.net> wrote:
> In article <7jl7rs$ds7$1@nnrp1.deja.com>,
>   armchair@my-deja.com wrote:
> > In article <7jjmn6$s8a$1@nnrp1.deja.com>,
> >   John Porter <jdporter@min.net> wrote:
> > > they're equivalent, even
> > > though they're not the same.
> >
> > Equivalent say ye? Well, go ahead and post an assembler while, for,
> > and if/else statement for assembler,
>
> These things take more than one line in asm, but so do most things.
> Nonetheless, they're equivalent to their C counterparts.
> I mean, they're different languages; it would be silly to expect
> that what takes one line in one language takes exactly one in any
> other language.

Well let's not be silly than shall we. Let's just be clear that by your
rediculous and meaningless definition assembler is equivalent to all
languages, so your "portable assembler" applies to Perl as well.

>
> > > > > And you're making a mistake to be lumping C/C++ with Perl.
> >
> > I will believe it to be true when I see your theorem that does so.
>
> In case you don't recall, this was in response to your assertion
> that Perl's if/while/for logic was the same as in C/C++.
> If you want to be enlightened as to the differences (which can be
> pretty subtle, I admit), feel free to read the perl documentation.

My, someone who calls C equivalent to assembler then calls C/C++
if/while/for logic significantly different from Perl's due to things
that are "pretty subtle". Let me suggest that if you want to be
enlightened as to the equivalence feel free to read the Perl and the
C/C++ documentation. I have read them both and am quite certain that
should you, you will reach the proper conclusion.

>
> > > 	call printf
> >
> > So you've proven that assembler is not on the same level as C++, or
> > even
> > C. Thanks.
>
> It's hard to argue that asm isn't "lower level" than C; but in
> comparison to other languages (like Perl), they're both low-level
> languages.  Both C and asm model the real machine.  The machine
> that Perl models is not one anyone will be building in hardware
> any time soon; in fact it would be much more difficult even than
> a Java real machine, which of course is Not There Yet.

It may be hard to argue, but you have wasted about 10 posts trying to do
it, and aptly demonstrating just how hard it is. Evidently however
different the "machine that Perl models", it still uses the same
if/while/for logic of "the machine that C models". I'll bet they even
take the same grade of oil.

>
> > > That's what C's doing under the hood, after all.
> > > If I can do it in C, I can do it in asm.
> >
> > But you didn't do it in asm.
>
> Yes I did -- though it was highly cpu-dependent asm code.

No you didn't, you gave an excellent example of why C and assembler are
not equal or equivalent.

>
> > You needed 4 statements to simulate one,
>
> Apparently you don't know what "simulate" means.
> I translated. The two were functionally equivalent.
> And if you look at the machine code generated from the C code,
> you'll find that it looks an awful lot like the asm that I coded
> by hand.

But we are not talking about functional equivalence of course. We are
talking about syntactical equivalence, the lack of which you have done a
fantastic job of reinforcing over several posts. And I commend you for
being willing to repeatedly disprove your statements.

>
> > > 	call read
> > > 	pop  returnCode
> >
> > Again you have proven Assembler to not be the equivalent of C.
>
> No, I've shown they're equivalent, though not identical.

Nope, not equivalent, not identical, not the same, not even related,
unlike the if/while/for logic of Perl and C.

>
> > I give you credit for being
> > big enough to disprove you own case.
>
> You're an asshole.

Well you will not get extra credit for good manners which would
certainly have helped at this point regarding the grade I am leaning
towards regarding term paper maintaining that C is merely "portable
assembler".

>
> > > > C is much easier to use than assembly,
> > >
> > > You think I'm advocating the use of asm?!?
> >
> > You are calling them equivalent buckeroo. That's saying
> > that using one
> > is just as good as using the other.
>
> No, that's not what equivalent means.  I would never suggest that
> using one is as easy as using the other, nor as good, for most
> definitions of "good".

You will have to come up with your definition of equivalent. One that
will say that using C is equivalent to using assembler, although not as
good, or as easy. Good luck.


>
> > If not, do give your own definition of equivalent.
>
> Anything you can do in one, you can do in the other.
> The mappings between language constructs (or I guess we'll have
> to allow idioms, in the case of asm) is clear, predictable, and
> easy to automate.  Both languages model the physical machine.
> That is why they are both low-level languages.

Let's see if I can get you to do it this time:
Give me the assembler code for this C code or put in terms that may make
it easier for you, given this machine code model in C, show me how the
assember "machine code model" is equivalent. As always, good luck.

int i = 0;
for ( ; i < 10 ; i++ )
{
   int j = 0;
   for ( ; j < 10; j++ )
      print ("i/j %d/%d\n",i,i);

}


>
> C gives the programmer no power beyond what he would have with asm.
> (Keep in mind, I'm talking only about the languages proper -- not
> peripheral issues like development environments and human factors.)

Oh certainly I will keep that in mind. Show me how this C code is not
more powerful than the equivalent assembler code by showing me the
equivalent assembler code:

int i = 0;
for ( ; i < 10 ; i++ )
{
   int j = 0;
   for ( ; j < 10; j++ )
      print ("i/j %d/%d\n",i,i);

}

>
> > At one instant you are "not advocating assembler" and on
> > the next instance they are at the same level. You will
> > need to explain
> > that incongruity, if there is a way.
>
> When a low-level language is necessary (as it often is), I recommend
> a portable one with a good library and a good development environment.
> Such a choice, however, should not be construed to mean that the
> available low-level languages are not equivalent, because they
> probably are.  Certainly C and asm are.

Are they. I hadn't thought to. To help me see the similarities, give me
the assembler code equivalence to this "low-level" C code:

int i = 0;
for ( ; i < 10 ; i++ )
{
   int j = 0;
   for ( ; j < 10; j++ )
      print ("i/j %d/%d\n",i,i);

}

>
> > Is a string complex? Is an iostream?
>
> I think iostream is pretty complex, yes.  But that's really
> beside the point, because these classes are not part of the C++
> language.

Uh oh, his is where old equivalence shows its capricious side, isn't it.
While C and Assembler are equivalent because although syntactically
different, the code can do the same thing, a string in C++ is not
equivalent to a string in Perl, because although syntactically similar,
they are implemented differently under the covers.

>
> > Is a class construct complex?
> > Were they implemented in complex ways?
>
> "they"?  The antecedent was singular, so I'm not quite sure what
> you're asking here.

They would be classes.

> But I'll say what I said before, that
> giving C++ its support for OO added an awful lot of complexity to
> compiler.  And the language is harder to parse, too.  Have you
> compared the grammars of C and C++?  I'll bet you have, so you
> are dissimulating when you claim that C++ is not significantly
> more complex than C.

We are only discussing language syntax here, not writing compilers,
however desperately one of us wants to prove C to be merely "portable
assembler" and C++ to be a low-level language.

>
> > Oh, I see, C is just a portable assembler, worth very little,
>
> What does this mean?  You seem to conclude that being an assembler
> makes something worth little.  I never said that.  I don't think
> value judgements are apropos here, but if you want mine, I like
> C.  I think it's great.  And asm has its place.

Why would Assembler have its place when you have claimed about 15 times
that C is merely portable assembler, and in the next breath said that
Assembler takes many more lines of code than C? Wait, I think I've got
it, assembler has it's place in convoluted arguments trying to make the
if/while/for constructs of C to be nothing like those constructs in
Perl.

>
> > but
> > something was salvaged from the effort by having it be the basis of
> C++.
>
> If you say so.  I never said that.

No of course not, you are Mr. Portable Assembler after all.

>
> > Regarding this "portable assembler concept, would you be so
> > kind as to
> > give the assembly equivalent of the following C code:
>
> Look at the asm output of your C compiler.

Okay, I did, and it's not equivalent to the C code. So once again I must
commend you on being willing to disprove your point.

>
> > You've already demonstrated that C is not portable assembler twice,
>
> Quite the contrary.

Okay, maybe a dozen times, but I don't think it has been anymore than
that.

>
> > Please give the assembler equivalent to the following code.
>
> Look at the asm output of your C compiler.

I did, and it is not equivalent, so once again I must commend you on
being willing to disprove your contention.

>
> > That's six lines, and I have put braces on lines by
> > themselves. Let's
> > see if you can do it 6 lines in assembler,
>
> The number of lines is irrelevant.

The number lines is certainly relevant. That is one of the metrics by
which we would test to see if the source code of one language is like
that of another. In this case, you again make the case quite well that C
is not "portable assembler" by implying through your inability to
even give the requested sample code, that the lines of code are quite
dissimilar.

>
> > > C++ semantics are much more complex, and the compiler has to do...
> >
> > Since we are not discussing compiler design, but language
> > syntax, the
> > above comments are irrelevant. As they say - Red Herring.
>
> The complexity of the compiler is utterly dependent on the complexity
> of the language semantics.  But I thought you knew that.

But we are not discussing compiler design, but language sytax, so the
complexity of the compiler is irrelevant. As they say - Red Herring.



> A language is not just syntax.  Even so, the syntax of C++ is an
> awful lot more complex than C.  Compare the grammars.

Yes, in our discussion a language is just syntax. We are programmers,
not compiler writers. We are looking at the similaritys of code syntax,
not the similarity of compiler design. I have compared our grammars and
I believe that I am a little more clear, a little more complete, and
overall, much easier to digest.

>
> > > And I think, if this discussion is to continue, it should be taken
> > > to another newsgroup.
> >
> > let me guess: comp.lang.portable-assembly/c
>
> comp.lang.c, comp.lang.c++.  But thanks for being an asshole.

Again, no extra credit on politeness, but I will cut you a break and not
take off for the bad grammar in the sentence. I would suggest for future
reference: "I give my thanks to you for being an asshole".


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Thu, 10 Jun 1999 11:15:45 GMT
From: NukeEmUp@ThePentagon.com (David Cantrell)
Subject: Re: Perl "constructors"
Message-Id: <375f9e03.158941886@news.insnet.net>

On Wed, 09 Jun 1999 08:42:15 GMT, armchair@my-deja.com said in
response to John Porter:

>> No?  I believe I've done that, though admittedly not in much depth.
>
>If the Atlantic Ocean had that kind of depth and substance I would
>backpack over to England.

Yeah, he _did_ say "not in much depth".  And please, don't try to come
here by any other mode of transportation - we don't welcome those who
neglect their duty to have a clue.

[Copying newsgroup posts to me by mail is considered rude]

-- 
David Cantrell, part-time Unix/perl/SQL/java techie
                full-time chef/musician/homebrewer
                http://www.ThePentagon.com/NukeEmUp


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

Date: Thu, 10 Jun 1999 11:30:48 GMT
From: Dan Pelton <dnp@ams.org>
Subject: Re: perl debugging in emacs
Message-Id: <7jo7l9$ffp$1@nnrp1.deja.com>

Sorry that my question was unclear.

I am trying to debug a script which is normally invoked from the
Unix command line by typing "script.pl < large_data_file".
I would like to be able to use perldb within emacs.
The problem is that while running the debugger under emacs/perldb
I can only get it to except input from the keyboard instead
of a file which has been redirected as STDIN. It seems
to ignore "< large_data_file" pat of the command line.

I would like to be able to step through the script and have
it read the data from a file.  This works fine when I don't
use the emacs interface and just use
"perl -d script.pl < large_data_file" from the command line.

I tried the noTTY option but it ignored all input
including debugger commands.

In article <7jmmof$har$1@mathserv.mps.ohio-state.edu>,
  ilya@math.ohio-state.edu (Ilya Zakharevich) wrote:
> [A complimentary Cc of this posting was sent to Tom Phoenix
> <rootbeer@redcat.com>],
> who wrote in article
<Pine.GSO.4.02A.9906091232100.26349-100000@user2.teleport.com>:
> > > When ever I redirect stdin to a file, the debugger still
> > > reads from the keyboard.
> >
> > I'm not completely sure, never having needed it, but I think you
want the
> > noTTY option described in the perldebug manpage. Good luck!
>
> Then the debugger will not take any command input.
>
> But Emacs should have redirected the current TTY to "Emacs window".
> Smells like under-ported Emacs on something fishy, like Win*.
>
> Since it is absolutely unclear what the original poster wanted to
> achieve, guessing is moot.
>
> Ilya
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 10 Jun 1999 13:43:06 +0100
From: Toby Speight <Toby.Speight@digitivity.com>
Subject: Re: perl debugging in emacs
Message-Id: <u3e00ql9h.fsf@lanber.ansa.co.uk>

Dan> Dan N. Pelton <URL:mailto:dnp@ams.org>

0> In <URL:news:7jo7l9$ffp$1@nnrp1.deja.com>, Dan wrote:

Dan> Sorry that my question was unclear.
Dan>
Dan> I am trying to debug a script which is normally invoked from the
Dan> Unix command line by typing "script.pl < large_data_file".
Dan> I would like to be able to use perldb within emacs.
Dan> The problem is that while running the debugger under emacs/perldb
Dan> I can only get it to except input from the keyboard instead
Dan> of a file which has been redirected as STDIN. It seems
Dan> to ignore "< large_data_file" pat of the command line.
Dan>
Dan> I would like to be able to step through the script and have
Dan> it read the data from a file.  This works fine when I don't
Dan> use the emacs interface and just use
Dan> "perl -d script.pl < large_data_file" from the command line.

As a workaround, could you adapt the script to read from <> instead of
<STDIN> (I assume you have write privilege to it if you're
debugging!)?

Then you could debug "script.pl large_data_file".


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

Date: 10 Jun 1999 11:29:14 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Perl on win32
Message-Id: <7jo7ia$lfq$1@solti3.sdm.de>

In article <7jmm53$tm$1@gellyfish.btinternet.com>, Jonathan Stowe <gellyfish@gellyfish.com> wrote:

> > Is there another way, apart from a "$dummy = <STDIN>;" statement at
> > the end of the script, to avoid the automatic closing of the MSDOS window
> > after the script terminated (on Windows NT 4.0)?

> If you make your script into a batch file using pl2bat then you will be
> able to change the 'Close on exit' property in the properties item of
> the right mouse menu.  You can only do this with DOS programs and batch
> files - Activeperl doesnt count as DOS program.

This only works if the script takes sufficiently long for you to change
the properties in the meantime (at least I haven't found a way to change
the properties of the .bat file itself in this respect).

This doesn't work if the script takes too short a time to complete.

Any other ideas?

Regards,
-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/whoami/
    http://www.engelschall.com/u/sb/download/
    http://www.perl.com/CPAN/authors/id/STBEY/
    http://www.oreilly.de/catalog/perlmodger/bnp/


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

Date: Thu, 10 Jun 1999 12:06:37 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Problem with Mac Perl and showtimes
Message-Id: <pudge-1006990806410001@192.168.0.77>

In article <7jk4vp$2aa$1@nnrp1.deja.com>, quodling@my-deja.com wrote:

# I am installing MAC Perl, on my G3/300 Powerbook. running 8.5.1 And I am
# a little confused about setting it up.

"MacPerl", BTW.

# I found the lwp and installed it, and also the URI Stuff, but I am not
# sure that I have installed it correctly.

You haven't.  :)

# Initially I was getting the following error message.
# 
# # Can't locate object method "proxy_authorization_basic" via package
# "HTTP::Headers".
# File 'Macintosh HD:MacPerl :lib:HTTP:Message.pm'; Line 172
# Grabbing URL 1 of 3 from au.yahoo...
# 
# With a Bit of investigation, I determined that this was related to the
# lwp (lib-www-perl), which I put in a directory, and then under macperl,
# edit pulldown menu, preferences, Libraries, And then add a path to
# Macintosh HD:Desktop Folder:wwwperl:X86:blib: lib:  (IS this the right
# place to put it, or does it belong somewhere under the

You should install all new modules in "site_perl" under the main MacPerl
folder.  However, MacPerl comes with LWP and URI::URL.  You can install
the new versions, of course, but you shouldn't need to, necessarily.  Once
you install them in site_perl, you need to add site_perl to your path. 
site_perl is already there (you can see it in @INC), but you need it to
come _before_ lib, so you need to add it to your path under Preferences.


# The error message now changes to
# 
# 500 # Can't locate auto/URI/URL/http/authority.al in @INC.
# File 'Macintosh HD:MacPerl :lib:AutoLoader.pm'; Line 38
# 
# File 'Macintosh HD:Desktop
# Folder:wwwperl:x86:blib:lib:LWP:Protocol:http.pm'; Line 111.

Now, after you put everything in site_perl, you have to AutoSplit it. 
Read the docs on AutoSplit.

Also, all of the above is covered in the MacPerl book.  You might want to
get it (not just for this).

    http://www.macperl.com/ptf_book/

The book is online too, if you want to try before you buy.

There is also cpan-mac, which comes with fairly recent versions of LWP and
URL::URI, among other things.  A simple install program installs the whole
thing for you in site_perl.  Anyway, this comes with tools for installing
stuff in MacPerl.  You can just drop a Perl module archive file on
"installme" and it is installed for you.  Nifty.

    http://www.perl.com/CPAN/authors/id/CNANDOR/

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: Thu, 10 Jun 1999 07:57:55 -0400
From: <joeyandsherry@mindspring.com>
Subject: Removing the decimal?
Message-Id: <7jo9c1$7ck$1@nntp4.atl.mindspring.net>

passme

Hello,

Thanks in advance...

I am using:

srand($day);
$match=rand ($countline);

to generate a random number. But I need to get rid of the decimal, and only
use the real number...I tried:

$period=".";
($one,$two)=split (/$period/,$match);

but, to no avail...

Any suggestions?


Thanks,


--
Joey Cutchins
President
Trading Post.Com, L.L.C.
The Race is to the Driven, Not the Swift.
http://internettradingpost.com
ceo@internettradingpost.com






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

Date: 10 Jun 1999 12:17:44 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Removing the decimal?
Message-Id: <slrn7lvb78.dgo.M.Ray@carlova.ulcc.ac.uk>

On Thu, 10 Jun 1999 07:57:55 -0400, joeyandsherry@mindspring.com
<joeyandsherry@mindspring.com> wrote:
>passme

Perhaps.

>
>Hello,
>
>Thanks in advance...
>
>I am using:
>
>srand($day);

If you're using a recent perl (>= 5.004), you needn't bother with srand,
because the PRNG will be seeded for you implicitly if you don't.  (Though
without examining the perl source, you don't know how good the seeding
is, of course).

>$match=rand ($countline);
>
>to generate a random number. But I need to get rid of the decimal, and only
>use the real number...

That's a confusing way of putting it, given the usual meaning of 'real
number'.

>I tried:
>
>$period=".";
>($one,$two)=split (/$period/,$match);
>
>but, to no avail...
>
>Any suggestions?

Use the int function.  See perldoc -f int
-- 
Malcolm Ray                           University of London Computer Centre


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

Date: Thu, 10 Jun 1999 08:33:52 -0400
From: <joeyandsherry@mindspring.com>
Subject: Re: Removing the decimal?
Message-Id: <7jobfg$asu$1@nntp1.atl.mindspring.net>

maybe "whole number" would have been more appropriate.

Thanks





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

Date: 10 Jun 1999 05:56:32 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: What's the "halting problem"?
Message-Id: <m11zfk43jz.fsf@halfdome.holdit.com>

>>>>> "Russ" == Russ Allbery <rra@stanford.edu> writes:

Russ> This result is extremely important, since it sets a boundary on
Russ> computability theory by establishing that there are a class of problems
Russ> which are impossible to solve with a computer.  There are a number of
Russ> problems which have been proven equivalent to the halting problem and
Russ> therefore are known to similarly be impossible to solve with a computer.

It's too bad we can't prove that Y2K == Halting Problem.

Or can we?

:)

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


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

Date: 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 5944
**************************************

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