[6313] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 935 Volume: 7

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Feb 12 16:27:39 1997

Date: Wed, 12 Feb 97 13:00:20 -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, 12 Feb 1997     Volume: 7 Number: 935

Today's topics:
     'Programming perl'? Will it damage my health? (Michael A. McLennan)
     Calling html page from perl script????? <Charles@hnnet.demon.co.uk>
     Re: Calling Perlscript from web-root <nmljn@wombat.staff.ichange.com>
     Re: Code refs not first class? <tchrist@mox.perl.com>
     Computer Parts Website majewski@ngpsun.ngpc.state.ne.us
     Re: DBM files ... What r they, how to use them? (Anthony Bucci III)
     Re: first PERL program (Tad McClellan)
     Re: FORK :( (Jagadeesh Venugopal)
     Re: Free Perl Book <alano@teleport.com>
     get a string from a line (Stefan Wimmer)
     Re: Help in setting up S/// (Keith Arner)
     Re: HELP: getting timestamps of files... (brian d foy)
     Re: HELP: variable interpretation?? (Mike Stok)
     Re: How To <rootbeer@teleport.com>
     Re: Locking mechanism <rootbeer@teleport.com>
     Re: optimization of binary data operations. (Richard J. Duncan)
     Re: Perl Books?? <alano@teleport.com>
     perlxstut: Can't make statically-linked library with 'm <tcl@caesun.msd.ray.com.CLIP.THIS.PART>
     REQUEST FOR COMMENTS: new modules (group maintenance, a <billa@fhcrc.org>
     Re: simulating csh '<<' (Tad McClellan)
     Re: what does this line do? (Tad McClellan)
     Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)

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

Date: 12 Feb 1997 14:40:08 -0000
From: mike@mikemc.demon.co.uk (Michael A. McLennan)
Subject: 'Programming perl'? Will it damage my health?
Message-Id: <5dsko8$41g@mikemc.demon.co.uk>


Having only the first edition of 'Pp' what does it contain, re 4.0x, that I
should not learn, ignore, be wary of etc.  The FAQ details all the differences
in detail but... I suppose what I would like is -

       Q.        "Perl 4 to Perl5. Child to Adult"
                              Discuss.


I imagine something like this is in the early part of the 2nd ed. Correct?

If you think what I would like answered is in section 1 of the FAQ -
                Thanks for your time.
If you reply,
                Thanks!

-- 
 (under construction)


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

Date: Wed, 12 Feb 1997 20:17:56 +0000
From: Charles Norton <Charles@hnnet.demon.co.uk>
Subject: Calling html page from perl script?????
Message-Id: <jX7JJBA0ViAzEwwJ@hnnet.demon.co.uk>

I recently posted the message given below.

A number of people have kindly responded with a common suggestion to how
to solve this problem. The exact code I have used is:


print "Location: http://www.axial.co.uk/netx_webx_dnld.html";


But rather than displaying the web page netx_webx_dnld.html, the text
enclosed in the brackets is shown on the web browser.

Is there something obvious that I am doing wrong?

Thanks

Charles Norton



In article <lmaYVBAxTDAzEwiX@hnnet.demon.co.uk>, Charles Norton
<Charles@hnnet.demon.co.uk> writes
>Can anyone tell me how to call an html page from a perl script used on a
>web page.
>
>I have been told there is a way to use the print command, but I can't
>see how.
>
>The only way I have found so far, is to open the .html file, read it a
>character at a time and print out the characters which results in the
>.html page being displayed.
>
>Thanks
>
>Charles Norton
>



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

Date: 12 Feb 1997 15:33:52 -0500
From: nelson <nmljn@wombat.staff.ichange.com>
To: arne@digital-hverdag.no
Subject: Re: Calling Perlscript from web-root
Message-Id: <w10ohdpydan.fsf@wombat.staff.ichange.com>

"Arne Unneland" <arne@digital-hverdag.no> writes:
> If you have a url like this:
> http://www.somecorp.com/
> Can you call a perl-script from this location without using any
> redirect/location methods. Can you set the webserver to do this
> automatically?

Yes.  Since perl has nothing whatsoever intrinsically to do with
webservers, or the Common Gateway Interface, you could do the same
thing for a C program or a Fortran program or a shell script or a C++
program or any other kind of program that can be invoked according to
the specifications of the Common Gateway Interface.

Since how you do this is not a language-dependent operation, you are
unlikely to find the answer in a language-dependent group such as this
one, and will meet with much more success in
news:comp.infosystems.www.authoring.cgi.

Cheers,
Laird

--
<laird.nelson@netsinc.com> perl FAQ: http://www.perl.com/perl/faq Perl manual:
http://www.perl.com/CPAN/doc/manual/html/frames.html. If CGI/web appears in
your comp.lang.perl.* post, see news:comp.infosystems.www.authoring.cgi. CGI
stands for Common Gateway *Interface*, not Language or Program or Script.
Consolidated perl reference page: http://www.amherst.edu/~ljnelson/perl.html


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

Date: 12 Feb 1997 18:38:45 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Code refs not first class?
Message-Id: <5dt2nl$162$4@csnews.cs.colorado.edu>

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

In comp.lang.perl.misc, Jim Anderson <jander@jander.com> writes:
:> #	&{sub {print "foo\n"}};			# syntax error

:This works fine on my system, perl5.003_25. What version of perl are
:you using?

It didn't work with production 5.003.

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

    "They'll get my perl when they pry it from my cold, dead /usr/local/bin."
	    Randy Futor in  <1992Sep13.175035.5623@tc.fluke.COM>


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

Date: Wed, 12 Feb 1997 09:25:08 +0000
From: majewski@ngpsun.ngpc.state.ne.us
Subject: Computer Parts Website
Message-Id: <5dsn92$502@nlcnt3.nlc.state.ne.us>

National Parts Depot is dedicated to the business of replacement
parts distribution for computers scanners, monitors and printers. A
high priority is placed on the management of inventory insuring that
most orders can be filled immediately from stock. Representing over
30 major manufactures allows for an easy one step shopping
environment. This commitment to National Parts Depot by the many
companies we represent is a further testament to our success in this
marketplace. We enjoy business relationships that permit us to offer
genuine replacement parts, accessories, manuals and supplies.
Advance warranty exchange services are also available for most
product lines. 

Same day shipments are the rule on all order from stock. Customer
Service is available via toll free telephone. This department operates
from 8:00 AM until 8:00 PM Eastern Standard Time. Online
ordering via the Internet provides twenty-four hour support, seven
days per week. 

National Part Depot

http://www.nationalparts.com


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

Date: 12 Feb 1997 19:49:48 GMT
From: axb21@po.CWRU.Edu (Anthony Bucci III)
Subject: Re: DBM files ... What r they, how to use them?
Message-Id: <5dt6ss$meh@alexander.INS.CWRU.Edu>


In a previous article, a_fraser@one.net (Alan Fraser) says:

>> dbmopen and family is deprecated. See the perltie manpage. It's
>> available on the web at 
>> 
>>         http://perl.com/perl/everything_to_know/perltie.html
>> 
>
>While dbmopen/dbmclose are back-level, they are nevertheless still
>supported.  If you would like to see examples of them being exercised,
>check out my home page below and click the Source Code button.  There's a
>script named DBTest that will show each type of access after 'dbmopen'.

That is all well and good, but the "tie" command is a much nicer interface
to the DBM packages than dbmopen.  For one, you can use tie with ANY of the
DBM packages out there, including Berkeley DB and GNU DB (which don't have
the annoying 1k key/value size limitations).  One huge advantage of that is
the ability to dump data from one db to another easily, like so:

#!/usr/local/bin/perl

use DB_File;
use GDBM_File;
use Fcntl;

tie %hash1,DB_File,"myberkeley.db",O_RDWR|O_CREAT,0644
	or die("Could not tie to myberkeley.db:  $!");
tie %hash2,GDBM_File,"myGNU.db",GDBM_WRCREAT,0644
	or die("Could not tie to myGNU.db:  $!");

# TextDBM_File is a little module I wrote to make
# text files look like hashes
tie %hash3,TextDBM_File,"myText.db",0644
	or die("Could not tie to myText.db:  $!");

%hash3 = %hash2 = %hash1;

untie %hash1;
untie %hash2;
untie %hash3;

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

This code puts the data from a Berkeley DB file into both a GNU DB file and
a human-readable text file.  Notice how simple the code to transfer the
data is.  Combining this with MLDBM and Data::Dumper, which give the
ability to store multi-level objects, you have quite a simple but powerful
interface.  "tie" is definitely the way to go when using DBM's.

Anthony

-- 


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

Date: Wed, 12 Feb 1997 12:33:00 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: first PERL program
Message-Id: <sc2td5.393.ln@localhost>

[ emailed, posted ]


Senthil Velayudham (senthil@ti.com) wrote:
: Perl Gurus,

: I am just about to create my first PERL program. I need your tips/help
: from all of you. 
       ^^^^^^^^^^

Whew! That's a lot. There are _thousands_ of us reading c.l.p.m.

You don't want _that_ many tips, do you?   ;-)


: I have a form with two list boxes. One listbox for region and another
         ^^^^^^                      ^^^^^^^^^^^

What's a form? What's a listbox?

Perl doesn't have any features with these names.


: for year. If the user chooses a region and a year, my Perl program
: should be kicked off and a HTML file should be posted when the user hits
: the "SUBMIT" button. Its quite obvious that, if the user chooses a
      ^^^^^^^^^^^^^^^
: different Region and a different year, my program should bring up a
: totally different URL.
                    ^^^

Oh. Now I see.

You have a CGI question.

In that case, you should be asking in the CGI newsgroup:

comp.infosystems.www.authoring.cgi


: Please send replies to my email at "senthil@ti.com"

How come?


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 12 Feb 1997 20:12:39 GMT
From: jvenu@ctp.com (Jagadeesh Venugopal)
Subject: Re: FORK :(
Message-Id: <5dt87n$7u3@concorde.ctp.com>

In article <5dsg50$5gp@redstone.interpath.net> softbase@mercury.interpath.com (Scott McMahan - Softbase Systems) writes:
>laurent (laurent@mars.fer.uni-lj.si) wrote:
>: Is there any Perl port for Win95 that supports fork and socket
>fork as we know it from UNIX is impossible in the VMS-inspired Win32
>architecture. I haven't ever had time to write up the essay about
>why.
>
>single-client server apps in it.
>


Impossible is probably too strong a word -- the Cygnus Win32 folks 
have done just that -- implement a fork() call for NT (well they have
reportedly implemented enough of a Unix-like API that many GNU tools
compile out of the box on NT) 

If Perl could compile out of the box on Cygnus-Win32 that would be a 
major plus, as we will not have to depend on an external source for 
our Windows Perl (unless of course we want the value add they provide
if any).

Jag

Jagadeesh

-- 
 /\/\ |Jagadeesh K. Venugopal, jvenu@ctp.com |http://w3.ctp.com/~jvenu 
/ /_.\|Cambridge Technology Partners, Inc.   |http://www.ccs.neu.edu/home/jkvg 
\  /./|304 Vassar St.  Cambridge, MA 02139   |
 \/\/ |Phone: 617.374.2028 FAX: 617.374.8300 +


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

Date: 12 Feb 1997 20:38:25 GMT
From: Alan <alano@teleport.com>
Subject: Re: Free Perl Book
Message-Id: <5dt9o1$456$3@nadine.teleport.com>

Stephen Potter <spp@psisa.com> wrote:
: [Courtesy copy posted as well as emailed to cited author]

: David Galante <dgalante@expert.cc.purdue.edu> writes:
: > FYI:
: > 	Que Publishing is offering several HTML versions of their popular 
: > books for free.  The on-line book contains the same text, graphs, 
: > tables, and illustrations of  the original.  These books may be of
: > interest 
: > to you:
: > 
: > Perl 5 Quick Reference:
: > http://www.mcp.com/que/developer_expert/perlqr/

: If this book is as bad in print as it is online, I hope no one wastes their
: money on it.  Their compliances are often incorrect, there are major
: mistakes in the regular expression section of the Overview (NB: that may be
: my monitor resolution in some cases), and there are numerous typos and bad
: formatting (I'd assume most of the formatting is taken care of in print,
: but the online version has problems).

Furthermore, the book is not Perl 5!  It is a Perl 4 book with Perl 5
slapped on the cover!  (If it does cover perl 5, it does it VERY poorly.
It is missing all of the perl 5 additions to regular expressions, covers
no Perl 5 functions, among other things.)

I am just glad I did not pay money for mine...

: For the price, I'd say stick with Johan Vromans' version from ORA and
: the perlfunc manpage.

The format is usable for the Que book, it is just implemented so poorly.
(That and the bogus claim that it is a Perl 5 book when it is not...)  I
just wish that they would have taken the time to write a real Perl 5 quick
reference...



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

Date: Wed, 12 Feb 97 20:46:10 GMT
From: swimmer@freising-pop.de (Stefan Wimmer)
Subject: get a string from a line
Message-Id: <5dta71$gu8$1@news.nacamar.de>
Keywords: regexp, string

Hi all, 

I'm trying to pull a string from one line from a HTML-File. I have no idea of 
the terminology, so I try to explain practically =8-))

HTML:

<H2>PM 01/97: Whatever you want ...</H2>

My plan:

extract the string "PM 01/97" from every line with header-tags and place this 
string in a buffer, which will be written in another HTML-File serving as an 
index-file.

I tried to work with regular expressions like that:

$buffer =~ m/\<h2\>string\<\\h2\>/is;

but there is no way.

Do you have an idea??

Regards
Stefan

PS: Warning!! I'm an absolute beginner.


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

Date: 12 Feb 1997 17:31:59 GMT
From: keith@stage.netsinc.com (Keith Arner)
Subject: Re: Help in setting up S///
Message-Id: <KEITH.97Feb12123159@stage.netsinc.com>

In article <32f25e62.13062428@news.clc.cc.il.us> mreilley@clc.cc.il.us (Mike Reilley) writes:

> From: mreilley@clc.cc.il.us (Mike Reilley)
> Newsgroups: comp.lang.perl.misc
> Date: Fri, 31 Jan 1997 21:06:26 GMT
> Organization: College of Lake County
> 
> I have a text line in the format of
> 
> Multiple leading spaces (Must Be Kept)
> an optional asterisk ( would like to remove it ) change it to a blank.
> Multiple spaces (Must be kept)
> Text ..............
> 
> The need is to remove the optional asterisk if it is there
> but not to remove any asterisks that may be in the text.

s/(\s+)\*(\s+)/\1 \2/

Keith Arner
-- 
--
|/            /|            Keith.Arner@Industry.Net
|\ e i t h   /-| r n e r           
                                  @________________
                 When all else fails, duct tape it.|
                       ----------------------------'


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

Date: Tue, 11 Feb 1997 15:17:38 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: HELP: getting timestamps of files...
Message-Id: <comdog-1102971517380001@nntp.netcruiser>

In article <5dsvgb$no8@news.u-strasbg.fr>, bboett@erm1.u-strasbg.fr wrote:

> i have a script that parses html files, making an index of them, now i
> would like to include the creation date of the file into this index....

> and further on i try to get the stamp:
>  
> ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,
>  $blocks) = stat($ARGV);
> ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(($ctime));
> 
> but when i display $mday/$mon/$year i get completely wrong results...
> BTW when making localtime(time) i get nearly the right date: the month
> shown is januaryi, does the month-count start with 0??

localtime() is explained on p. 185 of the Blue Camel Book, as well as the
perlfunc man page.  either will answer your question.

$Blue_Camel = q/Programming Perl, Larry Wall, Tom Christensen, 
& Randal L. Schwartz, ISBN 1-56592-149-6. /

-- 
brian d foy                              <URL:http://computerdog.com>                       
unsolicited commercial email is not appreciated


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

Date: 12 Feb 1997 19:18:54 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: HELP: variable interpretation??
Message-Id: <5dt52u$lc8@news-central.tiac.net>

In article <bvzpxat349.fsf@remus.i-have-a-misconfigured-system-so-shoot-me>,
 <really_eliot@dg-rtp.dg.com_but_mangled_to_stop_junk_email> wrote:
>mike@stok.co.uk (Mike Stok) writes:

>This is what you get in perl5; in perl4 you get no output from the print.
>The following works in perl4:
>
>  DB<11> print eval ( '$' . "$unknown" )
>wet

Indeed, it's a fair cop.  Were I forced to do it in perl 4 I'd rather use
a type glob in 4 than eval e.g.

main'(/tmp/perl-eaaftha:1):     1
  DB<1> $foo'bar = 'fubar'

  DB<2> $baz = 'blat'

  DB<3> $unknown = "foo'bar"; { local *GLOB = $unknown; print $GLOB }
syntax error in file (eval) at line 1, next 2 tokens "local *GLOB"

  DB<4> $unknown = "foo'bar"; { local (*GLOB) = $unknown; print $GLOB }
fubar
  DB<5> $unknown = "baz"; { local (*GLOB) = $unknown; print $GLOB }
blat

Most times people use eval there's a lighter-weight way around it, at
least 5 has the eval {block;}...  If you are going to use eval then make
sure that you know what you're eval'ing

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@psa.pencom.com                |      Pencom Systems Administration (work)


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

Date: Wed, 12 Feb 1997 12:39:36 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Jason Hotra <hotraja1@pilot.msu.edu>
Subject: Re: How To
Message-Id: <Pine.GSO.3.95q.970212123911.16205U-100000@julie.teleport.com>

On Wed, 12 Feb 1997, Jason Hotra wrote:

> I don't know what I'm doing wrong, but every time I reference a form in
> HTML to a perl script, it gives me an error. So when I specify the
> entire URL (including http://), it just outputs the whole stinkin
> script.  What am I doing wrong?

When you're having trouble with a CGI form in Perl, you should first look
at the please-don't-be-offended-by-the-name Idiot's Guide to solving such
problems. It's available on the perl.com web pages. Hope this helps!

   http://www.perl.com/perl/
   http://www.perl.com/perl/faq/
   http://www.perl.com/perl/faq/idiots-guide.html

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Wed, 12 Feb 1997 12:37:23 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Bob Coret <b.coret@myself.com>
Subject: Re: Locking mechanism
Message-Id: <Pine.GSO.3.95q.970212123658.16205T-100000@julie.teleport.com>

On Wed, 12 Feb 1997, Bob Coret wrote:

> Subject: Locking mechanism

I think you could use the methods in Randal's fourth Web Techniques
column, which explains how to use flock() to avoid problems when multiple
processes need to modify one file. Hope this helps! 

   http://www.stonehenge.com/merlyn/WebTechniques/

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 12 Feb 1997 14:08:50 -0600
From: duncan@isip01.isip.msstate.edu (Richard J. Duncan)
To: gamma@mintaka.iern.disa.mil (Jim Showalter)
Subject: Re: optimization of binary data operations.
Message-Id: <uaiv3xokh9.fsf@isip01.isip.msstate.edu>

gamma@mintaka.iern.disa.mil (Jim Showalter) writes:

> 
> On 11 Feb 1997, Richard J. Duncan wrote:
> 
> > I am trying to do some really simple DSP in a perl script. It requires
> > the swapping of word order for a stream of data. My current pathetic
>> approach is:
>> 
>> 	while(($len = sysread(PIN,$_,4))>0){
>> 		if (/(..)(..)/) {
>> 			syswrite(POUT,"$2$1",$len);
>> 		}
>> }
> 
> Anyway, I'm not certain how efficient this is (I didn't use the
> Benchmark module to time it) but you could try taking advantage of the
> big-endian, little-endian features of pack and unpack.  The following
> might be made better with more thought but this works for me.  If you
> just want to swap bytes, the last two pack and unpack statements
> can be removed. 
> 
> e.g
>    
> #!/usr/local/bin/perl -w
> my $a = "abcdefghijklmnopqrstuvwxyzabcdefjhijklmnopqrstuvwxyz";
> my $z = pack "v26", unpack "n26", pack "V13", unpack "N13", $a;
> print "$z\n";
> 

Thanks a lot. This is nearly 3 orders of magnitude larger, disk speed
is now my bottleneck.

Below is a more complete program listing of my solution, if anyone is
interested. Any optimization on the DSP is more than welcome.

+-------------------------------------------<duncan@isip.msstate.edu>-+
| Richard Jennings Duncan               http://www.gtlug.org/~rduncan |
| U-grad research assistant      Institute for Signal and Info. Proc. |
| Mississippi State University                   Computer Engineering |
|         'if you really want a challenge,                            |
|                    just deal with yourself' - Tori Amos             |
+---------------------------------------------------------------------+
--
Opinions expressed above are mine, and may not reflect those of my employer.

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

# File: swapper.pl
#
# This program performs byte and word reversals
#
#

$buf=0;
$len=0;
$len2=0;
open(PIN,"cat|");
open(POUT,"|cat");

$swap_word = 0;
$swap_byte = 0;
$buf_size = 8192; 
foreach $word (@ARGV) {
    if ($word eq "-swap_byte") {
	$swap_byte = !($swap_byte);
    }
    elsif ($word eq "-swap_word") {
	$swap_word = !($swap_word);
    }
}

if (!$swap_word) {
    
    if (!$swap_byte) {
	# 8 bytes 01234567 -> 01234567 (no change)
	#
	while(($len = sysread(PIN,$buf,$buf_size))>0){
	    syswrite(POUT,$buf,$len);
	} 
    } else {
	# 8 bytes 01234567 -> 10325476 (swap bytes)
	#
	while(($len = sysread(PIN,$buf,$buf_size))>0){
	    $len2 = $len / 2;
	    syswrite(POUT,
		     pack("v$len",
			  unpack("n$len",$buf))
		     ,$len);
	} 
    }
} else {
    if (!$swap_byte) {
	# 8 bytes 01234567 -> 23016745 (swap words)
	#
	while(($len = sysread(PIN,$buf,$buf_size))>0){
	    $len2 = $len / 2;
	    syswrite(POUT,
		     pack("v$len",
			  unpack("n$len",
				 pack("V$len2",
				      unpack("N$len2",$buf))))
		     ,$len);
	} 
	
    } else {
	# 8 bytes 01234567 -> 23016745 (swap words & bytes)
	#
	while(($len = sysread(PIN,$buf,$buf_size))>0){
	    $len2 = $len / 2;
	    syswrite(POUT,
		     pack("V$len2",
			  unpack("N$len2",$buf))
		     ,$len);
	} 
    }
}
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


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

Date: 12 Feb 1997 20:22:37 GMT
From: Alan <alano@teleport.com>
Subject: Re: Perl Books??
Message-Id: <5dt8qd$456$2@nadine.teleport.com>

Marco DiPlacido <mdiplacido@submit-it.com> wrote:
: Hello,
: 	not sure if people are sick of hearing this question.  However, could
: anyone recommend a good perl scripting book.  I have programming
: experience, but I have no experience with perl scripting.

There are a couple that I use on a regular basis...

1) _Programming Perl 2nd Edition_ by Wall, Christiansen & Schwartz.
Published by O'Reilly.  Probibly the best of the lot. (Though not without
flaws, it is a damn site better than most everything else out there...)

2) _Mastering Regular Expressions_ by Jeffrey E. F. Friedl.  Published by
O'Reilly.  Another "must have".  (Even if you do not do Perl.)  Compares
regular expression usage on all of the major unix utilities.

3) _Perl 5 Interactive Course_ by John Orwant. Published by Waite Press.
The only MacMillian book worth a damn, in my opinion. (At least on Perl.)
A good basic primer.  (Though I wish it had more on hashes within hashes
and a few other "advanced" topics.)

Those are the ones that come to mind...



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

Date: Wed, 12 Feb 1997 11:53:18 -0500
From: Tim Lewis <tcl@caesun.msd.ray.com.CLIP.THIS.PART>
Subject: perlxstut: Can't make statically-linked library with 'make perl'
Message-Id: <3301F57E.2003@caesun.msd.ray.com.CLIP.THIS.PART>

Hello,

I have been in the process of making some XSUB's for a C library we have
at work.  I have had no problems compiling and testing dynamic libraries
using just 'make' as explained in the tutorial.  I've finished testing
every XSUB that can be tested with 'make test', and I was planning on
using 'make perl' to create a static library and then test the rest of
my XSUB's with the newly created perl executable.  However, I had a link
error compiling with 'make perl'.

I also get the same error following Example 4 in the tutorial and using
'make perl'.

Duplicating the files in Example 4 exactly I get the following error if
I use 'make perl':

Undefined                       first referenced
 symbol                             in file
boot_Mytest2__mylib                 ./perlmain.o
ld: fatal: Symbol referencing errors. No output written to perl


Summary of my perl5 (5.0 patchlevel 3 subversion 0) configuration:

  Platform:
    osname=solaris, osver=2.5, archname=sun4-solaris
    uname='sunos slpabu 5.5 generic sun4u sparc sunw,ultra-1 '
    hint=recommended, useposix=true, d_sigaction=define
  Compiler:
    cc='gcc', optimize='-O', gccversion=2.7.2
    cppflags=''
    ccflags =''
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    voidflags=15, castflags=0, d_casti32=define, d_castneg=define
    intsize=4, alignbytes=8, usemymalloc=y, randbits=15
  Linker and Libraries:
    ld='gcc', ldflags =''
    libpth=/lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=, ccdlflags=' '
    cccdlflags='-fpic', lddlflags='-G'

Does anybody know how to fix this problem?  

- Tim Lewis


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

Date: Wed, 12 Feb 1997 10:42:34 -0800
From: Bill Alford <billa@fhcrc.org>
Subject: REQUEST FOR COMMENTS: new modules (group maintenance, ascii DB, system analysis tools)
Message-Id: <Pine.SOL.3.94.970203111958.5095E-100000@spider>

I have some modules (ideas and implemented) that I would like some
comments on.  I looked through CPAN before I did development but didn't
see anything related to these.  I'll put these on CPAN if there is enough
interest (and when I learn how).

I'm looking for comments about the ideas and if you see any improvements.

More details follow these summaries.  Note that the alpha/beta releases
will be in a month or two. 


Group management utilities:

GroupUtils     bdpf  Unix group file management tools similar to AFS
GroupUtils::
::GroupFile    RdpO  Read and manipulate a Unix style group file
::AdminFile    RdpO  Read and manipulate an administration group file
::AdminGroup   RdpO  A group of users and groups used in the above two


Generic records:

Record::
::FreeFlow     adpO  A free flow ASCII flat file human readable record

RecordStore::
::FlatFile     adpO  A TIE into a generic text database using Record::FreeFlow
::Sybase       idpO  A TIE into a Sybase database (one attribute key only!)


System analysis tools (will be integrated together, only alpha modules
initially):

SystemMap::DFD adpO  A Data Flow Diagram tools suite
SystemMap::DFD::
::Element      adpO  Generic Data Flow Diagram element
::Flow         adpO  A data flow edge in the DFD
::DataStore    adpO  A data store in the DFD
::Process      adpO  A process in the DFD

SystemMap::STD i     A State Transition Diagram
SystemMap::DD  i     A Data Dictionary
 ...



Group management utilities:

Our environment consists of potentially a couple thousand web authors. 
So, we needed a method to put (restricted) group management into the hands
of the users.  Users can modify their admin groupfile to create new
groups.  They can specify group members by username or other groups.  We
have a cron job running to pick up the changes every 10 minutes. 

Generic records:

The records are very similar to Graph::Element by Neil Bowers
<neilb@cre.canon.co.uk>.  The Record::FreeFlow module loads and stores
records from ASCII files.  The data format is: 

ATTR1: data
data
 ...
ATTR2: data
data
ATTR3: data
~

Where ~ is the end of record and the attribute delimiters are /^[^\s:]+:/. 

The RecordStore::FlatFile will allow a TIE to be made to these records
based on their ID attribute.  The implementation of the FlatFile TIE will
use a *DBM tie of ID:filename key:value and have one record per file (in a
subdir). This implementation seems like a hack to me, so if someone has a
better (and quick to implement) idea, I'd like to hear it.  


System analysis tools:

I'm the technical sided web master here at The Fred Hutchinson Cancer
Research Center.  Because of limited resources I'm the only one to
maintain the server (software and hardware) and to do development.  I also
inherited this system from other people.  I estimate that the people I
work with (and report to) only know about 10% of the system and that I
only know 75%.  These tools are being developed so that I can track the
various parts of our web server and see how they all interact.  It will
also be used to explain the system to the next people.  If you are in a
similar situation you may find these useful.

I'm developing these tools loosely based on the techniques used in systems
analysis mentioned in "Modern Structured Analysis" by Edward Yourdon (
http://www.amazon.com/exec/obidos/ISBN%3D0135986249/edyourdonswebsitA/7400-3516923-051701
).

The SystemMap::DFD tools will automatically build a multi-level DFD from
the records it is given.  The tools will also create graphs of these DFDs
(using dot, a graph visualization tool from AT&T Research: 
http://www.research.att.com:80/orgs/ssr/book/reuse/ ) and will have a web
interface to browse and edit the DFD. 

Eventually I'd like to see more of the tools mentioned in the book above
incorporated into the SystemMap tool suite.  Such as the data dictionary
and the state transition diagrams.


So, like I said above, I'd like comments on these modules.  If you see
anything horribly wrong about them or if you have seen a module in CPAN
that I missed that covers these, please let me know. 

I have never submitted to CPAN before, so I may be asking for assistance
in creating a correctly formatted submission. 

Thanks,
	Bill Alford -- Web Services 

  Bill Alford                            |  balford@fhcrc.org 
  Fred Hutchinson Cancer Research Center |  Ph. (206) 667-5499  
  1124 Columbia Street, LV-101           |  Fax (206) 667-6223
  Seattle, WA 98104                      |




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

Date: Wed, 12 Feb 1997 13:24:19 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: simulating csh '<<'
Message-Id: <3d5td5.2l3.ln@localhost>

Daniel Efron (defron@tc.umn.edu) wrote:

: Subject: simulating csh '<<'
           ^^^^^^^^^^^^^^^^^^

Those << thingies are called 'here is documents' or 'here documents'.

How to use these within perl is documented in the perldata man page.

Search for 'here-doc'.


: I have a csh script:

[ snip csh script source ]


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Wed, 12 Feb 1997 12:42:33 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: what does this line do?
Message-Id: <pu2td5.1a3.ln@localhost>

Raymond Cheung (ycheung@Bayou.UH.EDU) wrote:

: I don't understand this line:
: $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
: it appears in a cgi script. 


It is URL decoding input from a CGI form.

It would convert '%20' to ' ' (a space), for example.


If you don't know what URL encoding/decoding is, then you should
ask in a newsgroup where folks work with URL stuff a lot.

That would be in the CGI newsgroup: 

comp.infosystems.www.authoring.cgi


: Could someone explain it?

The 'match' part matches three characters:
   1) percent sign
   2) char that is a hex digit
   3) another char that is a hex digit

So, it matches percent followed by a hex code for a byte.

The 'replace' part converts it from that ASCII hex code into the
appropriate character (see the perlfunc and perlre man pages for
insight into how it is doing that).


--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Jan 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.

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 V7 Issue 935
*************************************

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