[8121] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1739 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 27 12:17:25 1998

Date: Tue, 27 Jan 98 09:00:32 -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           Tue, 27 Jan 1998     Volume: 8 Number: 1739

Today's topics:
    Re: _Effective Perl Programming_ (Andy Lester)
    Re: _Effective Perl Programming_ <tchrist@mox.perl.com>
    Re: Are there windows HELP files for Perl? <eryq@zeegee.com>
        Awk command does not work. Why? (Sylvain Juneau)
        Bad Word - Swear Word Checking - I Surrender! (Dave Power)
    Re: BBEdit and MacPerl (was Re: Finding...) (Chris Nandor)
    Re: CGI.pm and server errors <fty@utk.edu>
    Re: CGI.pm and server errors <sanjay@cis.ohio-state.edu>
    Re: crypt function ... help. (Mike Stok)
    Re: declarating subroutine prototypes (M.J.T. Guy)
    Re: Drag 'n' drop and paste arguments to Perl script? (Chris Nandor)
    Re: Freidl's book mystery <eryq@zeegee.com>
    Re: Freidl's book mystery <tchrist@mox.perl.com>
    Re: Freidl's book mystery <tchrist@mox.perl.com>
    Re: Getting listing of directories as texts (Clay Irving)
    Re: Getting listing of directories as texts <barnett@houston.Geco-Prakla.slb.com>
        HELP HELP HELP!!! - with function call parameters <psuravar@cisco.com>
        how do I install on BSDI 3.1? <root@wingnet.net>
        Internet Community needs cgi scripts <noaddress@nowhere.com>
    Re: IP Address as new File (Tad McClellan)
        latex -> (perl)pod ??? <buch@ifh-hp1.bau-verm.uni-karlsruhe.de>
    Re: living and free software (was: Re: source into bina <rjc@liddell.cstr.ed.ac.uk>
    Re: MacPerl CD-ROM, Version 0.5 lvirden@cas.org
    Re: making lists of items in text file using perl (Tad McClellan)
        MIME <webmaster@fccj.cc.fl.us>
        Multiple copies of the same option on command line (Ed Avis)
        Newbie: Flafile database creation avern@hotmail.com
    Re: Newbie: Flafile database creation (Tad McClellan)
        OLE and MS Word on NT <david@telekinesys.no.co.spam.uk>
        Perl (4) and images in the code.... <Falcon@darkwave.org.uk>
        perl4, solaris, varargs <fanf@demon.net>
        Perl5 on 80286 under DOS <shimeld@agc.bio.ns.ca>
    Re: Pointless questions (was: Re: Perl, Sybperl, and Ye (Clay Irving)
    Re: printing an image (Clay Irving)
        Remove elements of array1 from array2. <shaun@ms.com>
        Strip Trailing Spaces. How? <tglewis@mindspring.com>
    Re: Strip Trailing Spaces. How? <ajohnson@gpu.srv.ualberta.ca>
    Re: Strip Trailing Spaces. How? (Bjorn Ardo)
    Re: Survival Of perl (I R A Aggie)
    Re: Survival Of perl (Andrew M. Langmead)
    Re: Survival Of perl (John M. Klassa)
        vcard.vcf <webmaster@fccj.cc.fl.us>
    Re: White Hats and Black lvirden@cas.org
    Re: Win32 PERL Newbie question <nick_south@hotmail.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 27 Jan 1998 15:04:22 GMT
From: petdance@maxx.mc.net (Andy Lester)
Subject: Re: _Effective Perl Programming_
Message-Id: <6akt1m$eko$1@usenet76.supernews.com>

: > Something that's struck me as vaguely annoying about _Effective Perl
: > Programming_, ( and I DO love the book) 

: Ooo, off to a good start!

No, really, I DO love the book.  I'd been badgering my local Borders every
dang day 'til it came in.  IPutting up the sample chapters on the site in
PDF was a great move.

: I don't recall being obsessed with speed. 

My highlighted-to-hell copy is at home, so I can't provide any examples.
I wouldn't worry about it too much.  Just start on the next one, willya?

I'm on a highlighter to hell,
xoxo,
Andy


--
--
Andy Lester:        <andy@petdance.com>       http://tezcat.com/~andy/
Chicago Shows List: <shows@ChicagoMusic.com>  http://ChicagoMusic.com/



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

Date: 27 Jan 1998 16:39:55 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: _Effective Perl Programming_
Message-Id: <6al2kr$52n$3@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, joseph@5sigma.com writes:
:I don't recall being obsessed with speed.  

And yet you complain about lexers.  Face it, Joseph, you're
a speed freak.  :-)

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com


Let me put it to you this way: computers are my business.  --Andrew Hume


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

Date: Fri, 23 Jan 1998 11:53:53 -0500
From: Eryq <eryq@zeegee.com>
To: Craig <craig@skybound.demon.nl>
Subject: Re: Are there windows HELP files for Perl?
Message-Id: <34C8CB21.3F1@zeegee.com>

Craig wrote:
> 
> Hi,
> 
> I'm looking for a help file Windows or a HTML quick reference for Perl5.
> Does anybody know of any that can be downloaded somewhere?

Depends on what you mean by a "Quick Reference".  I find 
that the full HTMLized manual gets me whatever answer I need
with just a few clicks... can't get quicker than that!

Perhaps the "Documentation" hyperlink off the www.perl.com
homepage will be of some help.  Look under "Online Documentation".

-- 
   ___  _ _ _   _  ___ _  Eryq (eryq@zeegee.com)
  / _ \| '_| | | |/ _ ' / President, Zero G Inc: http://www.zeegee.com
 |  __/| | | |_| | |_| |      "Talk is cheap. Let's build." - Red Green.
  \___||_|  \__, |\__, |___/\ Visit STREETWISE, Chicago's newspaper by/
            |___/    |______/ of the homeless: http://www.streetwise.org


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

Date: Tue, 27 Jan 1998 15:10:44 GMT
From: sjuneau@microtec.net (Sylvain Juneau)
Subject: Awk command does not work. Why?
Message-Id: <34cdf7e0.9198936@news.cmc.ec.gc.ca>

The following script has an awk command, when I comment that line the
script work but when I include it it does not work. Why?

Thank you in advance


#! /software/pub/bin/perl
#
# This script get info from cise/send2client.conf file and
# list all product found in /users/operator/cislist

$cise="/usr/local/cis/etc";
open(SWITCH,"/usr/local/cis/etc/switch.conf")|| die "Can't open:\n";
while (<SWITCH>)
 {
 `awk -F"send2" '{print $2}'`;
# print $conf_name;
 }
#
# main
#
$choice=" ";
while ($choice ne "q" )
 {
 print "client_product_info>";
 $choice=<STDIN>;
 chop ($choice);
 if ($choice eq "?" ) {&help}
 elsif( $choice eq "i" ) {&info}
 else {}
 }

Sylvain

e-mail sjuneau@microtec.net


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

Date: Tue, 27 Jan 1998 16:37:58 GMT
From: dave.power@adpdesign.com (Dave Power)
Subject: Bad Word - Swear Word Checking - I Surrender!
Message-Id: <34d00b14.70645420@news.virgin.net>

I agree, the origin of this thread was not a question about the Perl
programming language.

It was a question to a community which I thought would be best
qualified to answer it.

Many thanks to the majority of you who provided constructive help.


DP


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

Date: Tue, 27 Jan 1998 08:13:59 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: BBEdit and MacPerl (was Re: Finding...)
Message-Id: <pudge-2701980814000001@ppp-7.ts-1.kin.idt.net>

In article <comdog-ya02408000R2601982355250001@news.panix.com>,
comdog@computerdog.com (brian d foy) wrote:

# speaking of BBEdit, i recently found this wonderful MacPerl interface
# package on Hyperarchive:
# 
#    <URL:http://hyperarchive.lcs.mit.edu/HyperArchive/Archive/
#       text/bbe/macperl-bbedit-extensi.hqx>

For the latest version, check out:

   http://members.aol.com/bradh5/bbedit/

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==       New Book: MacPerl:  Programming for the Rest of Us       ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: Tue, 27 Jan 1998 08:16:45 -0500
From: Jay Flaherty <fty@utk.edu>
To: Sanjay Vohra <sanjay@cis.ohio-state.edu>
Subject: Re: CGI.pm and server errors
Message-Id: <34CDDE3C.915A9358@utk.edu>



Sanjay Vohra wrote:

>   OK lets do this again, this is another script i tried
>
> -----------------------------------
> #!/n/umble/0/sanjay/perl5.004
>
> use CGI ':standard';
>
> BEGIN{
>  push @INC ,('/n/state/1/cue/sanjay/perl5/lib/CGI.pm-2.37018');
> }
>

OK, I see your problem. I think your push statement is faulty. You should also
use unshift so it will be put at the beginning of the @INC array. Also put the
BEGIN at the....um...beginning. Also, @INC is an array of library directories.
Try this:

#!/n/umble/0/sanjay/perl5.004 -Tw
BEGIN {
    unshift (@INC, "/n/state/1/cue/sanjay/perl5/lib");
}
use CGI qw(:standard);
__END__

You could also use the lib module:
use lib '/n/state/1/cue/sanjay/perl5/lib';
use CGI qw(:standard);

Jay
--
**********************************************************************
Jay Flaherty                                               fty@utk.edu
"Once in awhile you get shown the light, in the strangest of places if
you look at it right" - R. Hunter
**********************************************************************




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

Date: Tue, 27 Jan 1998 10:27:52 -0500
From: Sanjay Vohra <sanjay@cis.ohio-state.edu>
Subject: Re: CGI.pm and server errors
Message-Id: <34CDFCF8.F19D36F4@cis.ohio-state.edu>

lines deleted...

> OK, I see your problem. I think your push statement is faulty. You should also
> use unshift so it will be put at the beginning of the @INC array. Also put the
> BEGIN at the....um...beginning. Also, @INC is an array of library directories.
> Try this:
> 
> #!/n/umble/0/sanjay/perl5.004 -Tw
> BEGIN {
>     unshift (@INC, "/n/state/1/cue/sanjay/perl5/lib");
> }
> use CGI qw(:standard);
> __END__
> 
> You could also use the lib module:
> use lib '/n/state/1/cue/sanjay/perl5/lib';
> use CGI qw(:standard);
> 
> Jay



well, i have tried all this but unfortunately keep getting the
same error, i must be doing something really silly and completely
overlooking it

anyway thanks for your comments 

im just going to try to what i wanted to some other way

sv


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

Date: 27 Jan 1998 10:38:53 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: crypt function ... help.
Message-Id: <6akv2d$sc$1@stok.co.uk>

In article <6aj74n$73i@drn.zippo.com>,  <chad> wrote:
>
>How do I de-crypt a crypt'd string?  I cryp'd it using the perl crypt function.

The simple answer is you can't.  crypt is essentially one way, and
programs like login check passwords by encrypting the password entered by
the user with the same salt used to encrypt the original password and
seeing if the result is the same as the original password's encrypted
version.  The salt is stored as the first 2 characters of the encrypted
password.

perldoc -f crypt says:

=item crypt PLAINTEXT,SALT

Encrypts a string exactly like the crypt(3) function in the C library
(assuming that you actually have a version there that has not been
extirpated as a potential munition).  This can prove useful for checking
the password file for lousy passwords, amongst other things.  Only the
guys wearing white hats should do this.

Note that crypt is intended to be a one-way function, much like breaking
eggs to make an omelette.  There is no (known) corresponding decrypt
function.  As a result, this function isn't all that useful for
cryptography.  (For that, see your nearby CPAN mirror.)

Here's an example that makes sure that whoever runs this program knows
their own password:

    $pwd = (getpwuid($<))[1];
    $salt = substr($pwd, 0, 2);

    system "stty -echo";
    print "Password: ";
    chop($word = <STDIN>);
    print "\n";
    system "stty echo";

    if (crypt($word, $salt) ne $pwd) {
        die "Sorry...\n";
    } else {
        print "ok\n";
    }

Of course, typing in your own password to whoever asks you
for it is unwise.

Hope this helps,

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: 27 Jan 1998 13:02:29 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: declarating subroutine prototypes
Message-Id: <6aklt5$jcq$1@lyra.csx.cam.ac.uk>

Tom Phoenix  <rootbeer@teleport.com> wrote:
>On Mon, 26 Jan 1998, Chipmunk wrote:
>
>> I've noticed that declaring subroutine prototypes has no effect when the
>> declaration is done later in the code than the subroutine call. 
>
>Because Perl's internal compiler doesn't have ESP. :-)  How can perl check
>the prototype on foo(1, 2) if you haven't given it the prototype for foo
>yet?

You're being slightly unfair there.   Perl checks and warns about other
cases of prototype mismatch.   If it encounters a call of a so far
undeclared subroutine, it assumes that the subroutine has no prototype.
So

       foo('x');
       sub foo () { print "foo-led you" };

_could_ be treated as if it were

       sub foo;
       foo('x');
       sub foo () { print "foo-led you" };

which generates an error.    And I think Perl _should_ do that.


Mike Guy


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

Date: Tue, 27 Jan 1998 08:16:09 -0500
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Drag 'n' drop and paste arguments to Perl script?
Message-Id: <pudge-2701980816100001@ppp-7.ts-1.kin.idt.net>

In article <34CD8DDB.840249D0@algonet.se>, Mats Forssblad
<froz@algonet.se> wrote:

# How do I make a Perl script start with arguments that 
# are given it by drag and drop or pasting from the
# clipboard?

Pssssst.  It would help if you told us what platform you are wanting
information about.

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==       New Book: MacPerl:  Programming for the Rest of Us       ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#


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

Date: Fri, 23 Jan 1998 12:46:09 -0500
From: Eryq <eryq@zeegee.com>
To: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Freidl's book mystery
Message-Id: <34C8D761.512D@zeegee.com>

Tom Christiansen wrote:

> That's not true.  All you have to do is set up your regular expressions
> cleanly.  You don't have *one* regexp.  Make a lexer, maybe with state.
> 
>     TOKEN: while (length) {
>         next TOKEN if s/^\s+//;
> 
>         if (s/(\d+)//) {
>             do_num($1);
>             next TOKEN;
>         }

Wouldn't using m/\G(token)/g to walk down the string and extract
the tokens be a little faster, since you wouldn't have all
the "replacement" overhead of s/(token)//?

Just curious,
-- 
   ___  _ _ _   _  ___ _  Eryq (eryq@zeegee.com)
  / _ \| '_| | | |/ _ ' / President, Zero G Inc: http://www.zeegee.com
 |  __/| | | |_| | |_| |      "Talk is cheap. Let's build." - Red Green.
  \___||_|  \__, |\__, |___/\ Visit STREETWISE, Chicago's newspaper by/
            |___/    |______/ of the homeless: http://www.streetwise.org


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

Date: 27 Jan 1998 16:29:41 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Freidl's book mystery
Message-Id: <6al21l$52n$1@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, eryq@zeegee.com writes:
:Wouldn't using m/\G(token)/g to walk down the string and extract
:the tokens be a little faster, since you wouldn't have all
:the "replacement" overhead of s/(token)//?

Yes, it would be.  But the m//g state is fragile.  What if you call a
function that has a local $_ in it?  How could you know?

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com

    echo "I can't find the O_* constant definitions!  You got problems."
            --The Configure script from the perl distribution


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

Date: 27 Jan 1998 16:31:14 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Freidl's book mystery
Message-Id: <6al24i$52n$2@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, joseph@5sigma.com writes:
:scalar m//gc is better

It's fragile.  Call something that does a local $_ and
prepare to be pissed off.

And string nibbling just moves a pointer.  No rewrites.

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
:       I've tried (in vi) "g/[a-z]\n[a-z]/s//_/"...but that doesn't
: cut it.  Any ideas?  (I take it that it may be a two-pass sort of solution).
In the first pass, install perl. :-) Larry Wall <6849@jpl-devvax.JPL.NASA.GOV>


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

Date: 27 Jan 1998 08:47:00 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Getting listing of directories as texts
Message-Id: <6akogk$pe5@panix.com>

In <34CDB1F6.427D@jpmorgan.com> Imran Hussain <hussain_imran@jpmorgan.com> writes:

>Is there any ay of getting Perl to return the names of directories at a 
>particular location and manipulate those directory names as text.

I usually return the names of directories in my bedroom. :)

I'm not sure what you mean by "at a particular location."

It's easy to get directory names:

  #!/usr/local/bin/perl5.00403 -w
  
  opendir HOME, "." or die "Ack! $!\n";     # open a directory

  while (defined($file = readdir HOME)) {   # read the directory
    if (-d $file ) {                        # if a file is a directory
      print "$file\n";                      # print it (or whatever)
    }
  }
  
  closedir HOME;                            # close the directory

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

Date: Tue, 27 Jan 1998 08:17:06 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: Getting listing of directories as texts
Message-Id: <34CDEC62.F1FA6536@houston.Geco-Prakla.slb.com>

Imran Hussain wrote:
> 
> Is there any ay of getting Perl to return the names of directories at a
> particular location and manipulate those directory names as text.
Sure.

First, everything in Perl is initialized as a string until it is used in
a numeric fashion, so....

Second, look into File::Find (part of the std distribution), and
find2perl.  Very useful tools for this sort of thing.

I'm not exactly sure what you mean by "at a particular location", but
 ....

HTH.

Dave

-- 
"Security through obscurity is no security at all."
		-comp.lang.perl.misc newsgroup posting

------------------------------------------------------------------------
* Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------


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

Date: Tue, 27 Jan 1998 08:02:11 -0800
From: Prasad Suravarapu <psuravar@cisco.com>
Subject: HELP HELP HELP!!! - with function call parameters
Message-Id: <34CE0503.465@usl.edu>

Hi,
 
I am using perl5.003.

In my perl script I have something like

open(somefile1....);
print somefile1 $nodenumber;
$response = &travlink($node);
open(somefile....);
print somefile2 $nodenumber;
 ...

I have the above code in a loop where $nodenumber takes values 1..9
My function is something like this:
sub travlink
{
open(somefile....);
print somefile3 $_[0];

1;
}


Now my problem is somefile1 and somefile2 have values 1..9
BUT somefile3 has only few values 2,6,8 (say).

So my function is not being called sometimes I donot know
why this is happening.

i have spent a lot of time to figure out the existance of this problem.

PLEASE HELP ME.

bhanu.
bhanu@usl.edu



-- 
  BHANU P. SURAVARAPU               (bhanu@usl.edu)
  901 Lamar St., Apt. C,            151 CALDERON AVE.,# 314,
  LAFAYETTE, LA-70501.              MOUNTAIN VIEW, CA-94041.
  ph.# (318)-233-5329               ph# (415)-967-3124


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

Date: Tue, 27 Jan 1998 11:40:04 -0500
From: SysAdmin <root@wingnet.net>
Subject: how do I install on BSDI 3.1?
Message-Id: <34CE0DE4.334A@wingnet.net>

I've gotten the latest Perl (5.004).  I tried going through a default
installation and got error messages after running make.

Does anyone have any pointers for installing on a BSDI 3.1 system?

Please e-mail replies if possible.

Thanks,
CT


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

Date: 27 Jan 1998 16:22:58 GMT
From: "John Paulson" <noaddress@nowhere.com>
Subject: Internet Community needs cgi scripts
Message-Id: <6al1l2$8rp@bgtnsc03.worldnet.att.net>

Office Biz-On-line Business Community needs a Perl-CGI script to automate
our Web page creation.  We will exchange Free Web space, 1 POP E-mail
account and recognition for the program and programming.  We are currently
using Formmail to process the info and building the pages and uploading
manually.  Due to the high demand we have decided to automate the process. 
This is for a Free service called the Electronic Business Card.  We are
also looking for other scripts such as Banner ad program, classified ads,
etc..  Future success of On-line Business Community will include payment
for script maintenance.





Please respond to webmaster@office=biz.com          Remove (=)

Thanks,
John Paulson
Accent Technology Services
& Web Development


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

Date: Tue, 27 Jan 1998 09:47:24 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: IP Address as new File
Message-Id: <civka6.mv1.ln@localhost>

Derek Blandford (blan0416@uidaho.edu) wrote:

[snip]

: And you do not use parenthesis when printing to the file....

: Jason Hansen wrote:

: > print TEMP_FILE ("$remote_address|$url\n");


Well, you _can_ use parenthesis when printing if you want to.

Of course, you need to do it correctly  ;-)


   print(TEMP_FILE "$remote_address|$url\n");


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: 27 Jan 1998 16:36:13 GMT
From: Tobias Buchal <buch@ifh-hp1.bau-verm.uni-karlsruhe.de>
Subject: latex -> (perl)pod ???
Message-Id: <6al2dt$1ad$1@nz12.rz.uni-karlsruhe.de>


   a) I am looking for a tool (perl-script, vi/sed-macros ... )
      which makes it easier to me to transform existing latex files
      to (perl)pod format.

   b) Does someone have vi(m) marcos for writing (perl)pod ?

    all hints welcome

        tobias

--------------------------------------------------------------
- Dipl.-Ing. Tobias Buchal  buch@ifh.bau-verm.uni-karlsruhe.de
- Inst. f. Hydromechnics, University of Karlsruhe, Germany
- Phone: +49/(0)721/608/3533            FAX: +49/(0)721/661686


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

Date: 27 Jan 1998 13:04:19 +0000
From: Richard Caley <rjc@liddell.cstr.ed.ac.uk>
Subject: Re: living and free software (was: Re: source into binary code)
Message-Id: <eyh7m7m6pbg.fsf@liddell.cstr.ed.ac.uk>

In article <6a19ht$cii$1@news.orst.edu>, John Stanley (js) writes:

In article <6a0o44$20k$9@info.uah.edu>, Greg Bacon <gbacon@adtran.com> wrote:

gb> No one is claiming to make a living by giving away software.  Why do you
gb> insist on returning to a settled point?  

js> Because it hasn't been settled. You think you settled it by proving the
js> claim wasn't made, but you quoted the claim in the same article where
js> you tried proving it didn't happen.

Actually, to twist heads a bit more, we _are_ making a living by
giving away software. People give us money just so we will keep on
giving away software because it's to their advantage to have that free
software out there in circulation.

I'm not saying it's common, but it does happen.
-- 
rjc@cstr.ed.ac.uk			_O_
					 |<



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

Date: 27 Jan 1998 16:20:34 GMT
From: lvirden@cas.org
Subject: Re: MacPerl CD-ROM, Version 0.5
Message-Id: <6al1gi$c5j$1@srv38s4u.cas.org>


According to Chris Nandor <pudge@pobox.com>:
:still source compatible with Tk on other platforms. However, AFAIK, there
:is no Perl/Tk on an 8.0 level.

Note that Tcl/Tk now has an alpha release of 8.1 .  I truly hope that if
someone is considering creating something like Perl/Tk for Tk 8, they
start there - by the time they finish, 8.1 will be released and no one
wants to start out behind...

-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: Tue, 27 Jan 1998 10:01:51 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: making lists of items in text file using perl
Message-Id: <fd0la6.u02.ln@localhost>

James (James@cydaps.demon.co.uk) wrote:


: Is there any way that I can get perl to search through a delimited text
: file for all the occurances of a certain item, (ie if there is a list of
: different colour jumpers) and then create a file to store this
: information in, but not to repeat duplicate items.


Yes.

[snip]

: manage this bit too), and then lists them out in alphabetical order (not


: The contents of the colour.txt file would look like:

: Red
: Black
: White


That's not in alphabetical order...


: having seen that red has already been used and therefore does not enter
: it again?


When your problem statement contains the word "unique" or "duplicate",
you should immediately think "hash":


----------------------------
#!/usr/bin/perl -w

while (<DATA>) {
   $color{ (split /\|/, $_)[2] }++;    # hash key is the third field
}

foreach (sort keys %color) {print "$_\n"}

__DATA__
1|L|Red|Pullover|Sweater Plc
2|M|Black|Pullover|ABX Ltd
3|S|Red|Pullover|ABX Ltd
4|L|White|Pullover|ABX Ltd
----------------------------


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 27 Jan 1998 11:21:55 -0500
From: "Bill Jones, FCCJ Webmaster" <webmaster@fccj.cc.fl.us>
Subject: MIME
Message-Id: <34CE09A3.223289F0@fccj.cc.fl.us>

OK OK OK

Is MIME gone as well ???

:-)


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

Date: Tue, 27 Jan 1998 16:45:10 GMT
From: epa@datcon.co.uk (Ed Avis)
Subject: Multiple copies of the same option on command line
Message-Id: <34cdfd41.532121059@news-direct>

I'm using Getopt::std to parse command line options.  The only problem
is with options that may be specified more than once, for example the
-e option which specifies a "variable" and its value to my program
(which is a preprocessor).

For example

perl jpp.pl -e var1=value1 -e var2=value2 files...

Perhaps the solution is to move to Getopt::long, but I don't really
understand how to use that module.  (I'm running Perl for Win32, and
it seems the only way to get documentation on a module is to read the
source code.)  Any help (especially examples) would be appreciated.

--
Ed Avis


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

Date: Tue, 27 Jan 1998 08:23:52 -0600
From: avern@hotmail.com
Subject: Newbie: Flafile database creation
Message-Id: <6akqlo$9ih$1@nnrp2.dejanews.com>

The situation is as follows:  I have a website consisting of about 3500 pages.
 They all have a similar look/feel but were not formally created with a
template.  The ultimate goal is to extract the "meat" of each web page into a
database so that the entire website can easily be thrown into any template by
having Cold Fusion manipulate the database.

My immediate goal is to create a a script that: creates an empty flatfile
database, traverses a directory, extracts the title and "body" from any html
files therein and enters them as a single record in the database, then saves
the database as a file.

Since the database is completely recreated with each run of the script,
database maintenance is not really an issue.  I've already used Perl 5 to
write a script that can extract the title and "body" from any html files
within a given directory and store them each as a single string (so as to
avoid multi-line field data).  My issues are:

	1. recursive traversal of directories
	2. creating and populating the database
	3. the feasibility of having a single file that contains the "bodies"
of over 3000 web pages (on a UNIX server [SunOS 5.5.1])

Any suggested resources on those issues? Does this even seem like a practical
approach to the problem?

Any help would be greatly appreciated,
Avern

Thanks again!


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

Date: Tue, 27 Jan 1998 09:41:20 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Newbie: Flafile database creation
Message-Id: <07vka6.su1.ln@localhost>

avern@hotmail.com wrote:
: The situation is as follows:  I have a website consisting of about 3500 pages.
:  They all have a similar look/feel but were not formally created with a
: template.  The ultimate goal is to extract the "meat" of each web page into a
: database so that the entire website can easily be thrown into any template by
: having Cold Fusion manipulate the database.

: My immediate goal is to create a a script that: creates an empty flatfile
: database, 


   open(DB, '>whole_site.db') || die "could not open 'whole_site.db'  $!";


: traverses a directory, 


   use File::Find;


: extracts the title and "body" from any html
: files therein 


   use HTML::Parse;


: and enters them as a single record in the database, 

   print DB join(':::', $title, $body), "\n";  # better not have ':::' 
                                               # in your data...


: then saves
: the database as a file.


   close(DB);


: Since the database is completely recreated with each run of the script,
: database maintenance is not really an issue.  I've already used Perl 5 to
: write a script that can extract the title and "body" from any html files
: within a given directory and store them each as a single string (so as to
: avoid multi-line field data).  


Sure hope you used the module that does that.


: My issues are:

: 	1. recursive traversal of directories
: 	2. creating and populating the database
: 	3. the feasibility of having a single file that contains the "bodies"
: of over 3000 web pages (on a UNIX server [SunOS 5.5.1])

: Any suggested resources on those issues? Does this even seem like a practical
: approach to the problem?


Number 3 is the only issue of consequence.

Can't really give an opinion, because:

1) your requirements statement has gaping holes in the area of 
   what you want to do with the data
   (ie. what kind of queries are you planning to look up?
        the above sketch will work fine if the <title>s are unique,
        use $title as a hash key)

2) don't know the size of the DB (2 Kbytes/page?   100K?)

3) Might need to index the DB somehow to answer queries faster.
   Depends on what queries will be made though.


: Any help would be greatly appreciated,


Look over the 'perltie' man page too.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 27 Jan 1998 13:34:57 +0000
From: David Greaves <david@telekinesys.no.co.spam.uk>
Subject: OLE and MS Word on NT
Message-Id: <34CDE281.D1ADB0E5@telekinesys.no.co.spam.uk>

Hi
I'd like to run an MS Word Macro (doc->html) from perl without actually
launching Word.
That is I'd like it to run quietly in the background on a web server.

I know perl's got OLE.. capabilities so I kinda hoped...

Any ideas?

--
David Greaves





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

Date: Tue, 27 Jan 1998 14:22:08 +0000
From: -=Falcon=- <Falcon@darkwave.org.uk>
Subject: Perl (4) and images in the code....
Message-Id: <34CDED90.2F01@darkwave.org.uk>

Lo all...

Question, using Perl 4 (yes I know it's not 5 but that just makes it
more interesting), is it possible to import a .JPG file as a line
(or lines) of text (probably ascii escaped) and then at a later point
in the code, shove it back onto the browser?

(i.e I want to hard-code/place a "Powered By" logo onto the output of a
page...)

-=Falcon=-
-- 
      .---.        .-----------     Peter James Truman
     /     \  __  /    ------           -=Falcon=-
    / /     \( -`-,   -----           
   //////    '~ (    ---          Falcon@darkwave.org.uk
  //// / // :    ; ---      http://www.falcon.darkwave.org.uk/      
 // /   /  /)   / --        
/          //..\\ 
==========UU====UU===========================================================
          '//||\\`    And if you bore me...you lose your soul to me...
            ''``




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

Date: 27 Jan 1998 15:51:18 GMT
From: Tony Finch <fanf@demon.net>
Subject: perl4, solaris, varargs
Message-Id: <6akvpm$4fp$1@info.noc.demon.net>

Our customers want to be able to use perl 4 for their CGI scripts, so
I am trying to compile it up. So far I have tried Solaris 2.6 with gcc
and Solaris 2.5.1 with Sun's compiler. Both builds die with:

Undefined                       first referenced
 symbol                             in file
__builtin_va_arg_incr               util.o
ld: fatal: Symbol referencing errors. No output written to perl
make: *** [perl] Error 1

Any help with this problem will be gratefully received.

Tony.
-- 
F.A.N.Finch                        ::0:0:::                     <dot@dotat.at>
System Administrator                                          <fanf@demon.net>
Demon Internet                                [speaking in a private capacity]


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

Date: Tue, 27 Jan 1998 10:44:46 -0400
From: John Shimeld <shimeld@agc.bio.ns.ca>
Subject: Perl5 on 80286 under DOS
Message-Id: <Pine.HPP.3.96.980127102934.6245C-100000@agc2>

Is there such a beast? My searching of www.perl.com revealed only versions
that require EMX and, I think, 80386 processors or better.

John Shimeld
--------------------------------------------------------------------------
Geophysical Contractor with the Geological Survey of Canada (Atlantic)
P.O. Box 1006, Dartmouth, Nova Scotia, B2Y 4A2
phone: (902) 426-6759
email: ab340@chebucto.ns.ca



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

Date: 27 Jan 1998 08:22:49 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Pointless questions (was: Re: Perl, Sybperl, and Year 2000)
Message-Id: <6akn39$nts@panix.com>

In <34CD76D1.F0B1B233@5sigma.com> "Joseph N. Hall" <joseph@5sigma.com> writes:
>Tom Phoenix wrote:

>> What the docs, FAQs, and people of this newsgroup tell you three times is
>> true.

>Are you sure about that?  Maybe Bill Clinton *is* telling the truth!

>(It's a joke!  <ducking>)

>The empty y2k questions do become tiring.

I've heard there are no plans to make Perl 4 Y2K compliant. :)

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

Date: 27 Jan 1998 10:12:17 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: printing an image
Message-Id: <6aktgh$2s6@panix.com>

In <34CDD74A.74E55D21@internetmci.com> George Cyriac <gcyriac@internetmci.com> writes:

>How do I print an image out to a web browser?

What have you tried so far? Maybe if you post your code someone could help.

-- 
Clay Irving <clay@panix.com>                  I think, therefore I am. I think? 
http://www.panix.com/~clay/


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

Date: Tue, 27 Jan 1998 11:24:41 -0500
From: Shaun Ledford <shaun@ms.com>
Subject: Remove elements of array1 from array2.
Message-Id: <34CE0A49.5FBA09E2@ms.com>

Is there a clean way of removing the elements of hash table 1 ( login
name ) from hash table 2 ( names and password file )?

Thanks
Shaun.


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

Date: Tue, 27 Jan 1998 11:20:28 -0500
From: Tom Lewis <tglewis@mindspring.com>
Subject: Strip Trailing Spaces. How?
Message-Id: <34CE094C.49DD2902@mindspring.com>

I am new to Perl programming.  All I need to do is strip trailing spaces
from a string.  I was wondering if there is a easy, predefined way of
doing it?

Tom Lewis



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

Date: Tue, 27 Jan 1998 10:37:32 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: Strip Trailing Spaces. How?
Message-Id: <34CE0D4C.580D649A@gpu.srv.ualberta.ca>

Tom Lewis wrote:
> 
> I am new to Perl programming.  All I need to do is strip trailing spaces
> from a string.  I was wondering if there is a easy, predefined way of
> doing it?

yes...and you can use the easy way of finding easy, predefined
solutions to simple perl questions---searching the faqs and docs that 
come with perl distributions:
try 'man perlfaq4' or 'perdoc perlfaq4' in this case.

hope it helps
regards
andrew


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

Date: 27 Jan 1998 16:47:26 GMT
From: bjorn@hobbe.lub.lu.se (Bjorn Ardo)
Subject: Re: Strip Trailing Spaces. How?
Message-Id: <6al32u$sn6$1@news.lth.se>

In article <34CE094C.49DD2902@mindspring.com>,
	Tom Lewis <tglewis@mindspring.com> writes:
> I am new to Perl programming.  All I need to do is strip trailing spaces
> from a string.  I was wondering if there is a easy, predefined way of
> doing it?
> 

Don't know if it is predefinded but this should do the job:

$string = "Perl is great   ";
if ($string =~ /(.*?)[ ]+$/)
{print $1;}

Bjorn


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

Date: Tue, 27 Jan 1998 09:33:25 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Survival Of perl
Message-Id: <fl_aggie-2701980933250001@aggie.coaps.fsu.edu>

In article <34ce01f1.22869523@news.halcyon.com>, FHeasley@chemistry.com
(Frank) wrote:

+ The cutting edge is a very small part of the knife, but it's the place
+ where the action is.  The web is the cutting edge for perl.

Ummm...no. Not since CGI.pm was released, anyway...

James

-- 
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>


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

Date: Tue, 27 Jan 1998 16:07:29 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Survival Of perl
Message-Id: <EnGA4H.5zu@world.std.com>

FHeasley@chemistry.com (Frank) writes:

>As to being a fool, I've devoted considerable energy in my career
>toward learning FORTRAN, BASIC, FORTH, PASACAL and dBase, and
>currently PERL, but the current demand (y2k notwithstanding) appears
>to be c++, and visual basic.  So perhaps I'm a fool as well.  Am I
>foolish to be devoting energy and time to PERL?

If you have (or are looking for) the type of job that someone
specifies the type of tools you do for the job, then you are probably
best off learning the tools you will be asked to use.

If you have (or are looking for) the type of job that someone asks you
to create a solution to some problem, then you are best off
researching different types of tools and determining which are
appropriate for which task.

For many people, perl is the right tools to use for certain
tasks. Depending on the tasks at hand, maybe even most of them.

Take a look at construction. Some people get told "Cut those beams to
xxx." Someone else decided there would be beams there.

-- 
Andrew Langmead


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

Date: 27 Jan 1998 16:08:45 GMT
From: klassa@aursgh.aur.alcatel.com (John M. Klassa)
Subject: Re: Survival Of perl
Message-Id: <6al0qd$c8h$1@aurwww.aur.alcatel.com>

On 27 Jan 1998 01:56:19 GMT, Tom Christiansen <tchrist@mox.perl.com> wrote:

->You're seriously telling me that you're looking forward to giving threads
->to people who can't even understand critical sections, advisory locking,
->data integrity, shared file descriptors, mutexes, counting semaphores,
->signals, non-blocking I/O, fork, copy-on-write, or select?  Is that
->right?  

->The vast majority Perl users need threads the way a five-year-old 
->needs an Uzi.  Maybe even not that much.  

If we were to take out those features of Perl which confuse people, we'd be
left with something less than the Bourne shell. :-)  In all seriousness, I
don't understand why we should base the inclusion or non-inclusion of a
particular feature (which a fair number of folks would find useful) on
whether or not a reasonable percentage of programmers will understand how to
use it...

I do realize that your burden in particular, Tom, goes up because you're
left with the task of explaining how it works.  I certainly don't envy you.
:-)  On the other hand, I think threading would be a useful feature and hope
it isn't avoided because of those who might not be able to understand how it
works, or how to use it correctly.

Just my two cents...

-- 
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><


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

Date: Tue, 27 Jan 1998 11:12:35 -0500
From: "Bill Jones, FCCJ Webmaster" <webmaster@fccj.cc.fl.us>
Subject: vcard.vcf
Message-Id: <34CE0773.36E52214@fccj.cc.fl.us>

OK

My Card is gone.

As far as MIME goes... Tuf

:-)



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

Date: 27 Jan 1998 16:23:02 GMT
From: lvirden@cas.org
Subject: Re: White Hats and Black
Message-Id: <6al1l6$c5j$2@srv38s4u.cas.org>


According to John Stanley <stanley@skyking.OCE.ORST.EDU>:
:browser, and I am sure that TCL/Python/whatever enthusiasts are licking

I don't know about the Python folk, but I suspect that the Sun folk
are happy with the Tcl support under Netscape they already have.  There
are likely some bugs they will want fixed, but the Tcl plugin provided
right now provides excellent security compared to JavaScript...

-- 
Larry W. Virden                 INET: lvirden@cas.org
<URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
Unless explicitly stated to the contrary, nothing in this posting should
be construed as representing my employer's opinions.


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

Date: Tue, 27 Jan 1998 15:44:28 +0000
From: prog <nick_south@hotmail.com>
Subject: Re: Win32 PERL Newbie question
Message-Id: <34CE00DC.A07651EF@hotmail.com>

You were nearly there with the associations.
I use a file called plrun.bat
the contents of which are
c:\perl\bin\perl.exe %1 %2 %3 %4
I placed the file in my perl/bin directory and using the
properties for the file switched off close on exit
and switched on run in a normal window.
If you associate pl files with  this batch file you
get a dos window of the ouput.
Liberal use of the pause key is recommended for large output
hope this helps :)
    Prog
    (http://www.poboxes.com/nick_south)
Steven Savage wrote:

> This is a bit embarassing, but I figured some of the folks here could
> help me.
>
> I'm investigating PERL as a possible CGI language, and am evaluating it
> on a Win32 system.  However there is one thing I can't solve (related to
> Win32), namely associations.  Obviously this is ignorance of Win32 on my
> part.
>
> Essentially, i wish to be able to type the name of a perl program with
> the .pl extension and have perl.exe run it, passing the command line,
> etc.  Unfortunately despite Associating in Explorer, I found no way to do
> this.  My own Win32/DOS ignorance I know, but I can locate no way to do this.
>
> Anyone with a way to accomplish this, please write badger@infinet.com.
>
> --
> BADGER
> (aka Steve Savage)
>
> ---------------------------------------------------------------
>   /------\    BBB   AA  DDD   GG  EEEE RRR
> [/  |  |  \]  B  B A  A D  D G    E    R  R
> // O|  |O \\  BBB  AAAA D  D G GG EEE  RRR
> \\  |  |  //  B  B A  A D  D G  G E    R  R
>  \  |  |  /   BBB  A  A DDD   GG  EEEE R  R
>   \ |..| /
>    \____/     Badger's Den - http://www.infinet.com/~badger
>
> MEMBER OF:
> Association of Internet Professionals: http://www.association.org/
> Java Lobby: http://www.javalobby.com/
> ---------------------------------------------------------------





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

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


Administrivia:

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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