[11043] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4643 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 13 16:03:03 1999

Date: Wed, 13 Jan 99 13:00:22 -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           Wed, 13 Jan 1999     Volume: 8 Number: 4643

Today's topics:
    Re: "Email this page to a friend" script <webmaster@link-maker.com>
    Re: A really easy string question (John Moreno)
        ActiveState 509, "Bad File Descriptor", perl -e tlilley@my-dejanews.com
        Capturing output from a program in PERL <mjw@hrb.com>
    Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus Forget.it@work.net
    Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus <ghand@mitretek.org>
        Converting numbers to binary in Perl? kirk@kaybee.org
    Re: Converting numbers to binary in Perl? (M.J.T. Guy)
    Re: coredump & other weirdness with eval(require) (Greg Ward)
        Data Structure Notation <jeromeo@atrieva.com>
    Re: HELP - Is it possible to read mail from an Exchange <david@kasey.umkc.edu>
        Help CGI times out (doc contains no data) <webmaster@link-maker.com>
        Help! - convert ascii dos text file to IA5 text file <gss@itsnet.com>
    Re: How can I compare two arrays? <uri@ibnets.com>
    Re: How can I compare two arrays? (Ilya Zakharevich)
        installing modules on WinNT rimmkaufman@crutchfield.com
    Re: installing modules on WinNT <mroark@amerisale.com>
    Re: logging hits remotely (Abigail)
    Re: Make Perl 5.0052 error (Greg Ward)
        Modules on Novell Netware <horst.k@netway.at>
        Perl and Cybercash bshaffer932@my-dejanews.com
    Re: Perl Criticism (John Moreno)
    Re: Perl Criticism <staffan@ngb.se>
    Re: Perl Criticism <david@kasey.umkc.edu>
    Re: Perl Criticism droby@copyright.com
    Re: Perl Criticism (John Moreno)
    Re: perl find with -local mode ? <david@kasey.umkc.edu>
        Proper encoding technique re $trings for SMTP DATA? <mroark@amerisale.com>
        Setting Variables Question <mikej@1185design.com>
        Simple regexp (I think =b) <ketanp@BLAHNOSPAMBLAHxwebdesign.com>
    Re: Simple regexp (I think =b) <uri@ibnets.com>
    Re: Simple regexp (I think =b) <dropzone@mail.utexas.edu>
    Re: Simple regexp (I think =b) <uri@ibnets.com>
    Re: unpack?? Or how to extract binary data written by C (M.J.T. Guy)
        where can I get perlfunc.pod <mjw@hrb.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 13 Jan 1999 13:40:35 -0700
From: jim <webmaster@link-maker.com>
Subject: Re: "Email this page to a friend" script
Message-Id: <369D04C2.8C22A0A@link-maker.com>

simple...

get the referer
output a form:
1. email to send to
2. email to send as the from field *****
3. 'send as html' button
4. 'send as text' button

send the message

OR-

a javascript wich creates a mailto based on the url and a text field'to'

I prefer perl, but in this case, I wouldn't want someone accusing me of
spamming...also javascript could save your server resources on a high
traffic site....


Christopher Schulte wrote:
> 
> Does anyone know of a script that will allow a website user to:
> 
> 1) be viewing a specific html file
> 2) click on a link that says "email this page to a friend"
> 3) enter their address, the friend's, and possibly a message
> 4) have the page be sent to the specified person, with a static
> message added to the end of the email
> 
> news.com has this option, on their news stories.  But I was curious if
> some kind of cgi system has been written to do this too?
> 
> I have looked at various resource pages, but to no avail.
> 
> Many thanks for any replies!
> 
> --
> Christopher Schulte
> 
> Replace usenet with chris to send mail.
> Mail sent to usenet@schulte.org
> will *never* get to me. I hate spam!


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

Date: Wed, 13 Jan 1999 13:46:18 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: A really easy string question
Message-Id: <1dlkis8.16bp1ff1mi5d9bN@roxboro0-029.dyn.interpath.net>

MercuryZ <sf@sf.com> wrote:

> >>I'm new to this perl lark and struggling to do the following:
> >>
> >>I have a variable ($variable) which contains:
> >>
> >>$pathname = "/path-of-indeterminate-length/myfile.txt";
> >>
> >>I want to end up with a variable that contains:
> >>
> >>myfile.txt
> >>
> >>I can do it as follows:
> >>
> >>$variable = substr($variable,12);
> >>chop($variable);
> >>chop($variable);
> >>
> >>But there has to be a neater way.
> >>
> >>Any ideas?
> >>
> >>
> >
> 
> Here is a way, and I apologize if this has been answered for you
> already:
> 
>      $pathname = '/path-of-indeterminate-length/meow/meow/bbb/sdf/myfile.txt';
>      $pathname=~s/(.+)(\/)(.+\.txt?)/$3/gi;
>      print "$pathname\n";
> 
> If you try this mini-script out, you will see that no matter how long
> the pathname is, myfile.txt is still extracted out.
> What is important here is the ? embedded in the 3rd part of the regex
> which limits the greedy matching quantifiers.

No, the ? in the 3rd part of the regex simply means that it will accept
a file name of "myfile.tx" or "myfile.txfry" and only get part of the
name in the second case.

-- 
John Moreno


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

Date: Wed, 13 Jan 1999 18:20:28 GMT
From: tlilley@my-dejanews.com
Subject: ActiveState 509, "Bad File Descriptor", perl -e
Message-Id: <77io50$4et$1@nnrp1.dejanews.com>

Just installed ActiveState 509 on a Win95 box. "perl -e ..." bombs as follows:

C:\>ver
Windows 95. [Version 4.00.1111]

C:\>perl -e "print 'howdy'"
Can't open perl script "-e": Bad file descriptor

C:\>


I've never seen this before. Any clues? Nothing showed up in a dejanews or
MSKB search for the error message.

(BTW: please cc my email as I'm on the road and not configured for news
reading as such -- thanks).

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


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

Date: Wed, 13 Jan 1999 15:41:12 -0600
From: "Michael J. Wrobel" <mjw@hrb.com>
Subject: Capturing output from a program in PERL
Message-Id: <369D12F8.B84762CD@hrb.com>

What is the easiest way to capture output from a program in PERL?

Thanks,

Mike



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

Date: Wed, 13 Jan 1999 17:47:21 GMT
From: Forget.it@work.net
Subject: Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus!
Message-Id: <36a3dbfb.19947046@news.idirect.com>

On Wed, 13 Jan 1999 07:21:08 -0600, "JLenn" <no@spam.here> wrote:

>Yeah.......I'm sure Jesus would have aproved of a fanatical Christian (MC)
>shooting John Lennon for saying he was bigger than Jesus. No....MC will rot
>in HELL for what he did....and John Lennon will be singing in Heaven for all
>of the good things he did for humanity. If there even are such places
>(Heaven and Hell).
There is no place called Heaven or Hell. Only in the Christian world.
Here we are in 1999. Other cultures call it 6500+ 
Brain washing it is all about.
Of course if you send me  $ 299.95  " you too "
can receive my video.
Send Cash only.
Care of some offshore company. (or an offshore bank who
launders money for politicians)


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

Date: Wed, 13 Jan 1999 15:19:06 -0500
From: Gary Hand <ghand@mitretek.org>
Subject: Re: CONCLUSIVE PROOF: The Beatles are bigger than Jesus!
Message-Id: <369CFFBA.B8DE4B12@mitretek.org>

This has to do with astronomy?

Forget.it@work.net wrote:
> 
> On Wed, 13 Jan 1999 07:21:08 -0600, "JLenn" <no@spam.here> wrote:
> 
> >Yeah.......I'm sure Jesus would have aproved of a fanatical Christian (MC)
> >shooting John Lennon for saying he was bigger than Jesus. No....MC will rot
> >in HELL for what he did....and John Lennon will be singing in Heaven for all
> >of the good things he did for humanity. If there even are such places
> >(Heaven and Hell).
> There is no place called Heaven or Hell. Only in the Christian world.
> Here we are in 1999. Other cultures call it 6500+
> Brain washing it is all about.
> Of course if you send me  $ 299.95  " you too "
> can receive my video.
> Send Cash only.
> Care of some offshore company. (or an offshore bank who
> launders money for politicians)


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

Date: 13 Jan 1999 18:13:37 GMT
From: kirk@kaybee.org
Subject: Converting numbers to binary in Perl?
Message-Id: <77inoh$hs2$1@news-int.gatech.edu>

I can not seem to figure out how to take a number:

$IncomingNumber = "1";

and convert it to its value in binary:

$BinaryValue = "\x01";

This needs to work for numbers from 0 to 255... if
anybody can help me out I'd appreciate it a bunch!

-- 
Kirk Bauer -- Georgia Tech -- kirk@kaybee.org <== Finger for PGP
  http://www.kaybee.org/~kirk  ResNet RTA   Computer Engineering
 GT Sport Parachuting Club!  http://cyberbuzz.gatech.edu/skydive



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

Date: 13 Jan 1999 19:08:31 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Converting numbers to binary in Perl?
Message-Id: <77iqvf$oev$1@pegasus.csx.cam.ac.uk>

In article <77inoh$hs2$1@news-int.gatech.edu>,  <kirk@kaybee.org> wrote:
>I can not seem to figure out how to take a number:
>
>$IncomingNumber = "1";
>
>and convert it to its value in binary:
>
>$BinaryValue = "\x01";
>
>This needs to work for numbers from 0 to 255...

    $BinaryValue = chr $IncomingNumber;    or
    $BinaryValue = pack 'C', $IncomingNumber;


Mike Guy


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

Date: 13 Jan 1999 19:22:54 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: coredump & other weirdness with eval(require)
Message-Id: <77irqe$o6s$2@news0-alterdial.uu.net>

Steve Leibel <stevel@coastside.net> wrote:
> I need to be able to "require" a file whose name is not known until runtime.
> 
> In order to trap user errors (bad syntax in the file) I'm putting the
> require inside an eval.
> 
> I am having problems when the file to be required does not return true. 
> For example, if "emptyfile" is an empty file, the following coredumps:
[code deleted]

> This is on BSD/OS 4.0, with perl 5.004_02.  

Core dump = bug.  However, you should upgrade to the latest version of
Perl (5.00502 is the latest stable version, and 5.00503 is in trial
release stage) before wasting too much time on bugs like this -- it may
well have been fixed since 5.00402.

> *  What is the approved way to pull in a file at runtime for subsequent
> execution of its subroutines?

You could try 'do', but I think you'd still need to wrap it in an eval
to catch syntax errors.  

        Greg
-- 
Greg Ward - software developer                    gward@cnri.reston.va.us
Corporation for National Research Initiatives    
1895 Preston White Drive                      voice: +1-703-620-8990 x287
Reston, Virginia, USA  20191-5434               fax: +1-703-620-0913


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

Date: Wed, 13 Jan 1999 10:52:10 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
Subject: Data Structure Notation
Message-Id: <369CEB5A.12AE3954@atrieva.com>

I have been working with some data structures, mostly lists of hashes
and hashes of hashes.  While commenting my code, I wanted to add some
notes to explain what the various data structures represent, and I
wasn't able to come up with a notation that was very satisfying.  For
example, if I have a hash of lists, I notate it like this:

 %{date} => @(AtrievaTid,AtrievaTid,AtrievaTid,...)

which seems adequate to me.  However, if I have a hash of hashes, with
the inner hash values being anonymous subroutine references, the
notation becomes a bit trickier.  Does anyone have a preferred method
for describing data structures?

Thanks!
-- 
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: Wed, 13 Jan 1999 14:44:57 -0600
From: David L Nicol <david@kasey.umkc.edu>
Subject: Re: HELP - Is it possible to read mail from an Exchange Server using PERL?
Message-Id: <369D05C9.C1C772EB@kasey.umkc.edu>

qvanegeren@frxsoft.com wrote:
> 
> I had posted a message before about reading e-mail on a win32 platform and
> was directed to use NET::POP3, which I did, but the MIS department says they
> don't have a POP3 server running.  They are instead running Exchange Server.
> 
> I can't get the NET::POP3 to work with the Exchange Server.  Are there any
> other suggestions as to what I can do through PERL to read incoming mail
> that comes through an Exchange Server?
> 
> Thanks in advance for any suggestions you may have.
> 
> Quenten
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own


Our exchange server speaks POP3.  It isn't on by default but it can
be enabled with a menu option.  Once POP3 is enabled, you can use any
mail user agent (pegasus, eudora, netscape communicator, pine.)  Pester
the exchange server guys to enable it.  Don't take no for an answer. 
Offer
to use encrypted authorization schemes (considerable work) if they gripe
about plaintext passwords and packet sniffers.


______________________________________________________________________
 David Nicol 816.235.1187 UMKC Network Operations david@news.umkc.edu
  You are free to believe that America maintains a manned moon base.


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

Date: Wed, 13 Jan 1999 13:12:21 -0700
From: jim <webmaster@link-maker.com>
Subject: Help CGI times out (doc contains no data)
Message-Id: <369CFE25.85436EA@link-maker.com>

Help,
   I wrote a CGI script that runs a number of processes and returns the
result from each to the browser..This works fine until I run a large
number of processes, then it times out.

   I suspect my server is buffering the output, otherwise I would be
getting an incremental result as in http://www.go2net.com

   Is there any way to override the buffer? Or maybe find the buffer
size so I could output a line long enough to dump the buffer?

    Thanks for any help or examples....

-Jim


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

Date: Wed, 13 Jan 1999 12:09:11 -0800
From: "Doris Moyes" <gss@itsnet.com>
Subject: Help! - convert ascii dos text file to IA5 text file
Message-Id: <jb6n2.83$aE6.386@news6.ispnews.com>

Does anyone know of a module or script for converting an ascii dos text file
to an IA5 text (ascii?) file
(or just any method of how to do this).
I am starting to learn perl and could really use help on this. Also, could
anyone give me a better explanation of IA5.
with much gratitude,
Jeff
please send email to jkm26@email.byu.edu . Thanks




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

Date: 13 Jan 1999 13:24:50 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: How can I compare two arrays?
Message-Id: <39k8yr3ua5.fsf@ibnets.com>

>>>>> "IZ" == Ilya Zakharevich <ilya@math.ohio-state.edu> writes:

  IZ> [A complimentary Cc of this posting was sent to Uri Guttman 
  IZ> <uri@home.sysarch.com>],
  IZ> who wrote in article <x7n23ngolv.fsf@home.sysarch.com>:
  DG> _02 isn't bad (for some value of bad, I've had very few problems), _03
  DG> should be better.
  >> 
  >> that phrase doesn't fill me with confidence.

  IZ> Since you claim you use 5.004_04, I have no sympathy to you at all.

  IZ> Even 5.005_54 is way ahead of 5.005_02 wrt bugs (but 5.005_03 should
  IZ> fix this abnormality).  But you cannot even start to compare 5.005_02
  IZ> to 5.004_04 - the latter is buggy as hell if you take 5.005_02 as a
  IZ> reference point.

well, i don't seem to run into those bugs then. i don't push the
envelope with most of my perl programs, because i don't have to to get
the job done. i estimate i use no more than 20-40% of core perl. my
current projects are almost pure text munging with no cutting
edge stuff. most (i think) would run fine under 5.001!

it is a tricky question when to upgrade anything. i know not to grab
fresh emacs versions for a little while. let others shake it
out. sometimes i feel that way about perl. since 5.005 there has been a
shift in my eye about using the latet and greatest. if i am workingwhere
they haven't or won't upgrade, i want to make sure i don't use any
features in a new version and i have to use that version at home when i
develop there.

i even did use a new 5.005 regex feature in a split (look behind) but
found it slow and i rewrote it to use a simpler m// regex. this would
also allow my module to be used by a wider range of users. coding with
bleeding edge features can be risky in that way. it depends on who
controls the environment and produced programs.

ilya, you develop bleeding edge stuff so you obviously like it and
want to use it. i think you have a very biased opinion in this area. i
don't feel like using a devel track release in production even if it is
less buggy. as i said those bugs haven't bitten me (yet). when 5.005_02
comes out (when?) and it doesn't have the stigma of _02 and its threads
problems, i will encourage its use more.

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ironbridgenetworks.com	


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

Date: 13 Jan 1999 20:51:20 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: How can I compare two arrays?
Message-Id: <77j108$ait$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to Uri Guttman 
<uri@ibnets.com>],
who wrote in article <39k8yr3ua5.fsf@ibnets.com>:
>   IZ> Even 5.005_54 is way ahead of 5.005_02 wrt bugs (but 5.005_03 should
>   IZ> fix this abnormality).  But you cannot even start to compare 5.005_02
>   IZ> to 5.004_04 - the latter is buggy as hell if you take 5.005_02 as a
>   IZ> reference point.
> 
> well, i don't seem to run into those bugs then. i don't push the
> envelope with most of my perl programs, because i don't have to to get
> the job done. i estimate i use no more than 20-40% of core perl. my
> current projects are almost pure text munging with no cutting
> edge stuff. most (i think) would run fine under 5.001!

You do not need to be at the cutting edge to hit bugs.  They are
everywhere.  Most probably you hit them all the time, but consider it
normal.

What stuns me most is the tolerance of Unix weenees to bugs in
software.  Somehow it feels that this tolerance is *greater* than one
of the DOSISH worlds (this is probably due to my higher expectations
w.r.t. Unix-related people - the expectations which somehow are not met).

Ilya


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

Date: Wed, 13 Jan 1999 19:48:17 GMT
From: rimmkaufman@crutchfield.com
Subject: installing modules on WinNT
Message-Id: <77it9t$9br$1@nnrp1.dejanews.com>

I'm running perl on WINNT, with the perl directory at G:\perl
For the first time, I am trying to install a module from CPAN
(libnet-1.0606) which requires a
   perl Makefile.PL
   make
   make test
   make install
sequence.  When I run perl Makefile.pl, I get an error stating that
MakeMaker cannot find installed perl libraries or source code.
It also states that it cannot find
   G:\alan\programs\perl\lib\core\perl.h

Why is it looking in G:\alan\programs?

How do I tell it to look in G:\perl?

Thanks!

Alan

(It would be great also to receive an email copy of any response at
rimmkaufman@crutchfield.com)

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


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

Date: Wed, 13 Jan 1999 14:35:53 -0600
From: "Micah Roark" <mroark@amerisale.com>
Subject: Re: installing modules on WinNT
Message-Id: <wr7n2.2101$nJ.11746@typhoon01.swbell.net>

I ran into the same problem recently with the Image Magick module interface
Perl Magick from www.wizards.dupont.com/christy . Except in my case, it
didn't say the path was wrong, I found I was actually missing a lot in
\perl\lib\extutils (Ext::Utils) I beleive your path situation has a lot to
do with your original install of the perl core and whatever is set in your
NT registry. With IIS4, every thing should be handled in Script Mapping
under Home Dir/Config. I tried downloading the missing mods and installing
from CPAN, but every single time, MakeMaker would say cannot find this
module, or cannot find that module, and it wound up being a big catch 22
spaghetti bowl. So I finally just went to ActiveState.com and grabbed the
new ActivePerl dist which solved everything after I installed it. From what
I could tell, when I originally installed perl, it was just the core.
ActivePerl bundles a lot more together for you (PerlScript, PerlIIS, usefule
mods, etc.), regarding MakeFiles, and the install was very seamless with
IIS4 (had install sheild/wizard combo, no goofy registry patches, etc...)
Except, it didn't solve everything. After I got my my Makefile setup, I had
to run "nmake" from microsoft as opposed to "make", which took forever to
find, and now, lucky me, Nmake is requesting CL.EXE which turns out is
microsoft's C pre-processor/compiler that you can only get with Visual C++.
when will it ever end? Hope ActivePerl may help you.

Micah Roark
mroark@amerisale.com


rimmkaufman@crutchfield.com wrote in message
<77it9t$9br$1@nnrp1.dejanews.com>...
>I'm running perl on WINNT, with the perl directory at G:\perl
>For the first time, I am trying to install a module from CPAN
>(libnet-1.0606) which requires a
>   perl Makefile.PL
>   make
>   make test
>   make install
>sequence.  When I run perl Makefile.pl, I get an error stating that
>MakeMaker cannot find installed perl libraries or source code.
>It also states that it cannot find
>   G:\alan\programs\perl\lib\core\perl.h
>
>Why is it looking in G:\alan\programs?
>
>How do I tell it to look in G:\perl?
>
>Thanks!
>
>Alan
>
>(It would be great also to receive an email copy of any response at
>rimmkaufman@crutchfield.com)
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own




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

Date: 13 Jan 1999 20:08:36 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: logging hits remotely
Message-Id: <77iug4$d63$1@client2.news.psi.net>

Michael R. Harper (michael@processing.net) wrote on MCMLXI September
MCMXCIII in <URL:news:369C8C56.A6AC05DC@processing.net>:
{} Perl/Web Experts,
{} 
{} I have a basic web account that allows no CGI access (just a
{} form-to-email and a simple counter).  I would like to get stats on who
{} is visiting that site.  Is there a way to run the cgi from another
{} server and log hits on the basic site?  Please send me any ideas you may
{} have, whether backed up by code or not.


http://www.cranfield.ac.uk/docs/stats/



Abigail
-- 
    Anyone who slaps a "this page is best viewed with Browser X" label
    on a Web page appears to be yearning for the bad old days, before the
    Web, when you had very little chance of reading a document written on
    another computer, another word processor, or another network.
	    [Tim Berners-Lee in Technology Review, July 1996]


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

Date: 13 Jan 1999 20:44:29 GMT
From: gward@thrak.cnri.reston.va.us (Greg Ward)
Subject: Re: Make Perl 5.0052 error
Message-Id: <77j0jd$rdm$1@news0-alterdial.uu.net>

leading@technologist.com <leading@technologist.com> wrote:
> I tried to make Perl 5.0052 in a pentium machines, I got the following 
> error, can someone advise me how to retify it?
> 
> 
> 
> Configure:  FATAL ERROR:
> This version of perl5 can only be compiled by a compiler that
> understands function prototypes.  Unfortunately, your C compiler
>         cc -Dbool=char -DHAS_BOOL -A cpu,mathchip -I/usr/include -
> I/sys5/usr/inc
> lude -I/usr/local/include
> doesn't seem to understand them.  Sorry about that. 

Unfortunately, you forgot to tell us which operating system you're
using, which makes it kind of hard to help you.

However, it's obvious from the error message that you'll have to get a
compiler that understands function prototypes, i.e.  an ANSI-compliant
compiler.  The GNU C Compiler, aka gcc, is free, widely available, has
been ported to many systems, and works pretty darn well.

You can get the sources for gcc at 

   ftp://ftp.gnu.org/gcc/

Since you do seem to have a C compiler on your system, and it does seem
to be vaguely Unixish (I assume this from the "-I/usr/include
-I/sys5/usr/inc" stuff), then you might just be able to build gcc
yourself.  It's not trivial, though.

In any case, you should probably talk to your vendor and give them hell
for not supplying an ANSI-compliant C compiler with your OS.  In this
day and age, that's just inexcusable.

        Greg
-- 
Greg Ward - software developer                    gward@cnri.reston.va.us
Corporation for National Research Initiatives    
1895 Preston White Drive                      voice: +1-703-620-8990 x287
Reston, Virginia, USA  20191-5434               fax: +1-703-620-0913


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

Date: Wed, 13 Jan 1999 19:02:27 +0100
From: virgil <horst.k@netway.at>
Subject: Modules on Novell Netware
Message-Id: <369CDFB3.8EF8990E@netway.at>

hi there,
does somebody know how i can install a cpan-module on a netware machine?

Horst Kapfenberger



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

Date: Wed, 13 Jan 1999 19:29:29 GMT
From: bshaffer932@my-dejanews.com
Subject: Perl and Cybercash
Message-Id: <77is6a$8a2$1@nnrp1.dejanews.com>

I am faced with writing a perl script that integrates with cybercash... I
have no idea where to start, does anyone know of any places with some good
examples, advice, or whatnot?

Thanks
Brian

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


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

Date: Wed, 13 Jan 1999 13:46:26 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Perl Criticism
Message-Id: <1dlkk3t.jxz1wb19jxydhN@roxboro0-029.dyn.interpath.net>

<topmind@technologist.com> wrote:

-snip-
> 
> Are you judging Perl by its ability to project your job by
> being too hard for a new programmer to figure out?
> If that *is* the criteria, then you are right.

If someone is writing unreadable code then they should be replaced
before they do more damage -- but they can do this in any language.

> And yes, companies WOULD take company cars AWAY from
> employees if they were screwing things up.

Exactly -- they wouldn't take all company cars away from all employees
just because Joe Blow from section 7 g keeps getting drunk and driving
into the walls.

> Like I said before, I would not mind writing in Perl for
> someone else, but I would not bet my own company on
> Perl done by others because of the great risk of
> "spehgetti code job security".

Then don't hire people that write "spehgetti" code.

> Hey, let's bring back Goto's.  I saw all kinds of
> job security in those things.

Proper use of Goto's can be quite clear and beneficial -- for instance
it's an easy way to work with loops within loops where a error condition
means you should start over at one of the outer loops.  Adding a bunch
of if elses can just confuse the issue.

-- 
John Moreno


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

Date: Wed, 13 Jan 1999 19:29:27 +0100
From: Staffan Liljas <staffan@ngb.se>
Subject: Re: Perl Criticism
Message-Id: <369CE607.8FD29E66@ngb.se>

topmind@technologist.com wrote:
> Perhaps the definition of "add-on" is disputable. Anyhow, DB API's
> can be added to just about any common language. API's are
> just about the worse way to do table stuff, IMO. I do not see
> tied DBM as much of an improvement (unless they added stuff
> very recently).

> I don't want interfaces, I want to be *in* the tables. "Interface"
> is another word for "afterthought".

Oh, you can be as much *in* the tables as you like[1]. It is usually
considered a good idea to have three tiers when operating on tables, and
going straight into the tables from the perl-script (assuming that your
using it as a front end) is hopelessly mixing up tier 1 and 3. 

If you have no idea what I'm talking about, try reading up on databases
and database management systems. 

[1] Tables are just files, and you can access them directly on the
bit-level in perl. However, this is the best way of making sure that you
break the databasesystem. Using something between yourself and the
actual files is something you do to make sure you don't totally destroy
everything, and I thought this would be something you'd appreciate.
Accessing databases on a low level from a front-end is not safe, nor
does it make the code easy to maintain.

Staffan


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

Date: Wed, 13 Jan 1999 14:10:36 -0600
From: David L Nicol <david@kasey.umkc.edu>
To: John Moreno <phenix@interpath.com>
Subject: Re: Perl Criticism
Message-Id: <369CFDBC.54E49D81@kasey.umkc.edu>

John Moreno wrote:

> Turing complete langauge--there is literally nothing that you can do in
> one language that you can't do in another (not necessarily with the same
> amount of code of course).

Maybe TopMind's company would like some production-level intercal
programs.

______________________________________________________________________
 David Nicol 816.235.1187 UMKC Network Operations david@news.umkc.edu
       You are free to believe that big brother is watching you.


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

Date: Wed, 13 Jan 1999 18:51:44 GMT
From: droby@copyright.com
Subject: Re: Perl Criticism
Message-Id: <77ipvq$66r$1@nnrp1.dejanews.com>

In article <77e8vh$nsm$1@nnrp1.dejanews.com>,
  topmind@technologist.com wrote:
> Reply to  TRG Software's chatmaster@c-zone.net 1999/01/08 message:
>
> So now you are digging into my background in an attempt
> to embarass me. That's right, don't attack the facts and
> issues, attack the PERSON. It is much easier because
> you then don't have to think.
>
> In my opinion that is f*cking EVIL!!!!!!!!!!
>

Well, it's not like he wiretapped your phone or anything.  You posted that in
a public forum, and Dejanews "Author Profile" is a standard part of troll
investigation.	Not really necessary in this case, as it's obvious...

If you are embarrassed by that posting, why did you post it?  It WILL
resurface, as will this thread, which should be a cause for much greater
worry.

If your own posts are going to embarrass you, perhaps you need more
pseudonyms.

--
Don Roby
droby@copyright.com

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


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

Date: Wed, 13 Jan 1999 13:46:29 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Perl Criticism
Message-Id: <1dlko8m.nvrok61wd09m5N@roxboro0-029.dyn.interpath.net>

David L Nicol <david@kasey.umkc.edu> wrote:

-snip-
> 
> Reading through the wish list in the second half of the article I
> find myself thinking, "You can do that in perl, like this ... " for
> each and every one of the wishes. (Examples available for premium
> subscribers only.) I wonder if it is possible to do all of those
> things with python.

Turing complete langauge--there is literally nothing that you can do in
one language that you can't do in another (not necessarily with the same
amount of code of course).

Language choice is about personal likes and dislikes, and strengths and
weaknesses for particular tasks, not about raw capabilities.

-- 
John Moreno


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

Date: Wed, 13 Jan 1999 14:50:45 -0600
From: David L Nicol <david@kasey.umkc.edu>
To: kj0 <kj0@mailcity.com>
Subject: Re: perl find with -local mode ?
Message-Id: <369D0725.407105F@kasey.umkc.edu>

kj0 wrote:
 
>   -local     True if the file physically resides on the local system;
>              causes the search not to descend into remotely mounted
>              filesystems.
> 
> Is there any way to tell the perl find command to behave this way?
> (find2perl doesn't recognize the -local option).

Think of find2perl as a starting point.  Take the script it generates
and modify it with something like 

next if -s;	#skip symbolic links

______________________________________________________________________
 David Nicol 816.235.1187 UMKC Network Operations david@news.umkc.edu
             You are free to believe that topmind is wise.


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

Date: Wed, 13 Jan 1999 12:32:03 -0600
From: "Micah Roark" <mroark@amerisale.com>
Subject: Proper encoding technique re $trings for SMTP DATA?
Message-Id: <mD5n2.2065$nJ.11754@typhoon01.swbell.net>

Has anyone recommendations for solid encoding of a string to be passed as a
DATA in SMTP? I'm having an occasional problem that occurs only if the mail
was received by a user through a Unix POP service. The message will appear
with a carriage return (line break) after every character, some thing like
the following:

t
h
i
s

s
t
i
n
k
s

and of course, terminates at the first "." (usually at the end of the first
sentence). I have never had this happen before. I use a perl sendmail
program in an ASP on WinNT/IIS (perlscript) that sends this mail. Has worked
fine before. The only difference this time, is a portion of the data in the
message is generated by VBScript from a database, inside a Loop. This is the
portion that is being affected by this line break disease. I have a strong
feeling it's VBScript's fault (like a high-lo bit thing) but unfortunately I
am a novice at this level.

I currently use:

$message =~ s/^\./\.\./gm; # handle . as first character
$message =~ s/\r\n/\n/g; # handle line ending
$message =~ s/\n/\r\n/g;

to check the message, but I think it could be better, and perhaps pick up
for VBScript's  handicap. If anyone has any recommendations or could add to
that encoding, it would be greatly appreciated.

Micah Roark
mroark@amerisale.com




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

Date: Wed, 13 Jan 1999 10:25:19 -0800
From: mikej <mikej@1185design.com>
Subject: Setting Variables Question
Message-Id: <369CE50D.9BA5FDB9@1185design.com>

Hello,

I made a script that opens an external text file, reads some of the data
and is supposed to assign the appropriate data to a few variables in my
script. The problem is that sometimes it works and other times it just
assigns no value to my variables. My hunch is that it has something to
do with how I am setting the variables, ie a confusion on my part on
whether to use quotes around the variables "$data_username" and
"$data_password", or uncertainty on whether to use =, eq, or == to set
the variables $username and $password. When I use the eq operator it
never works. When I use the = operator with quotes it will work
unreliably. When I use the = operator with no quotes around the
variables $data_username and $data_password, it also works unreliably.
Here is my function in question:

sub get_access_info {
 
#extract usernames and passwords from a log file

open(LOG, "data.log") || &error("Couldn't open log file \n\n$!");
@indata = <LOG>;
close(LOG);
 
foreach $line (@indata)
    {
    chomp($line);
    ($data_name, $data_username, $data_password) = split(/\|/, $line);
    if ($data_name eq $clientname) {

 
#how should I be setting these variables?

       $username = "$data_username";
       $password = "$data_password";
 
}
    }
 
 

#end extract username and password
}
 

My data file looks like this:

ClientName|UserName|Password

and the list continues for each client I have. As you can see in the
function, it is supposed to find the clients name and return the name
and password for that client. If anyone knows the proper way to set
these variables and then be able to refer to them later in the script
please help! Thank you.

-mike
 



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

Date: Wed, 13 Jan 1999 13:17:25 -0500
From: Ketan Patel <ketanp@BLAHNOSPAMBLAHxwebdesign.com>
Subject: Simple regexp (I think =b)
Message-Id: <369CE335.3D06D985@BLAHNOSPAMBLAHxwebdesign.com>

I have the following snippet of code:

$url = "http://blah.com/blah.html";
$request = new HTTP::Request('GET', '$url');
$request = get($url);

$price = ??????

After that, somewhere in $request there is a price in the form of
"blahblah>$xxx.xx<blahblah"  where the price is xxx.xx (or xx.xx).  The
only '$' in $request is the one right before the price and the price is
followed by a '<'.  How could I get $price to equal '100.00' if the
string is "blahblah>$100.00<blahblah" (by the way, xxx.xx is different
all the time)?  I've been trying, but I can't seem to get it right...
Oh, and this isn't for getting quotes from quote.yahoo.com... I know
there is a module for that...

Thanks for any help you can provide!



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

Date: 13 Jan 1999 14:18:16 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: Simple regexp (I think =b)
Message-Id: <39iueb3rt3.fsf@ibnets.com>

>>>>> "KP" == Ketan Patel <ketanp@BLAHNOSPAMBLAHxwebdesign.com> writes:

  KP> After that, somewhere in $request there is a price in the form of
  KP> "blahblah>$xxx.xx<blahblah"  where the price is xxx.xx (or xx.xx).  The
  KP> only '$' in $request is the one right before the price and the price is
  KP> followed by a '<'.  How could I get $price to equal '100.00' if the
  KP> string is "blahblah>$100.00<blahblah" (by the way, xxx.xx is different
  KP> all the time)?  I've been trying, but I can't seem to get it right...
  KP> Oh, and this isn't for getting quotes from quote.yahoo.com... I know
  KP> there is a module for that...

so where is the snippet of broken regex code? have you tried anything?
if you know (which is not always possible) that the $ is unique you can
just do a couple of indexes (first for $ then from there search for <)
and substr out the result. that may even be faster than a regex. 

try doing a regex and show your code and we can help you fix that or use
the index method.

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ironbridgenetworks.com	


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

Date: Wed, 13 Jan 1999 13:45:04 -0600
From: Forrest Reynolds <dropzone@mail.utexas.edu>
Subject: Re: Simple regexp (I think =b)
Message-Id: <369CF7BF.1EE92F9B@mail.utexas.edu>

here's something to start with: (caveat: I'm new to regex)

$rough_price =~ m/>\$([0-9]+\.[0-9][0-9])</;
$price_you_wanted = $1; # $1 matches the parentheses in regex

(truism masquerading as caveat: there's probably a slicker
way to do this.)

    Just another perl snacker, Forrest



Ketan Patel wrote:
> 
> I have the following snippet of code:
> 
> $url = "http://blah.com/blah.html";
> $request = new HTTP::Request('GET', '$url');
> $request = get($url);
> 
> $price = ??????
> 
> After that, somewhere in $request there is a price in the form of
> "blahblah>$xxx.xx<blahblah"  where the price is xxx.xx (or xx.xx).  The
> only '$' in $request is the one right before the price and the price is
> followed by a '<'.  How could I get $price to equal '100.00' if the
> string is "blahblah>$100.00<blahblah" (by the way, xxx.xx is different
> all the time)?  I've been trying, but I can't seem to get it right...
> Oh, and this isn't for getting quotes from quote.yahoo.com... I know
> there is a module for that...
> 
> Thanks for any help you can provide!


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

Date: 13 Jan 1999 15:44:15 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: Simple regexp (I think =b)
Message-Id: <39hftu52e8.fsf@ibnets.com>

>>>>> "FR" == Forrest Reynolds <dropzone@mail.utexas.edu> writes:

  FR> here's something to start with: (caveat: I'm new to regex)

  FR> $rough_price =~ m/>\$([0-9]+\.[0-9][0-9])</;
  FR> $price_you_wanted = $1; # $1 matches the parentheses in regex

this is good, a newbie helping a newbie and with code that looks like it
will work. but as a newbie you should test it first which can be done
with a command liner like:

perl -nle '/>\$([0-9]+\.[0-9][0-9])</; print $1'

and enter lines of text to see the results

regardless of whether this works (and it looks ok to my eyes), you should
learn a useful shortcut.

[0-9] is clearer and shorter as \d which changes your regex to:


perl -nle '/>\$(\d+\.\d\d)</; print $1'

and if the original poster could guarantee no other $ as he claimed, you
could fold the \d and . into a single char class like this:

perl -nle '/>\$([\d.]+)</; print $1'

or do a negative char class looking for the chars before the < (and you
don't even need the < (or even > since the $ is unique) then

perl -nle '/\$([^<]+)/; print $1'

can't get much simpler or shorter than that.

hth,

uri

-- 
Uri Guttman                             Hacking Perl for Ironbridge Networks
uri@sysarch.com				uri@ironbridgenetworks.com	


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

Date: 13 Jan 1999 18:07:22 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: unpack?? Or how to extract binary data written by C++.
Message-Id: <77incq$lb1$1@pegasus.csx.cam.ac.uk>

Pascal Rigaux  <pixel_@geocities.com> wrote:
>>struct Thing {
>>    unsigned long arg1;
>>    unsigned long arg2;
>>    unsigned short arg3;
>>};
>
>
>>open( . . . .)
>>seek(FILE,somewhere,0);
>>read(FILE, $buffer, $size_of_Thing);
>
>simply 
>($arg1, $arg2, $arg3) = unpack "LLS", $buffer;
>
>L = unsigned long
>S = unsigned short

That'll work in many cases, but beware of portability issues.    In
particular

i)  if the file was written on a different platform, you'll have to think
    about "endian-ness" issues

ii) note these extracts from "perldoc -f pack":

    S	An unsigned short value.
	  (This 'short' is _exactly_ 16 bits, which may differ from
	   what a local C compiler calls 'short'.)
    L	An unsigned long value.
	  (This 'long' is _exactly_ 32 bits, which may differ from
	   what a local C compiler calls 'long'.)


Mike Guy


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

Date: Wed, 13 Jan 1999 15:44:38 -0600
From: "Michael J. Wrobel" <mjw@hrb.com>
Subject: where can I get perlfunc.pod
Message-Id: <369D13C6.1804506@hrb.com>

what is perlfun.pod?

I want to use it to answer my questions, but am unable to find it.

Mike



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

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

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