[10590] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4182 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 9 17:07:53 1998

Date: Mon, 9 Nov 98 14: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           Mon, 9 Nov 1998     Volume: 8 Number: 4182

Today's topics:
        Attaching a binary file... (VYTiS)
    Re: camel races on CNN <rkoehler@osmre.gov>
        catch warn'ings in while (<>)... <Alex.Davies@tiuk.ti.com>
    Re: customizable users mail in perl (I.J. Garlick)
        DBD Oracle / Perl Problem <pecus@civil.ist.utl.pt>
    Re: DBD Oracle / Perl Problem (John D Groenveld)
        Directory listing on remote host <dhsmith@hpeals7.mayfield.hp.com>
    Re: encrypt filter? <tbayne@cadcam.pms.ford.com>
        Hash of Hash problem <sylvain@macadamian.com>
        Help: Read & Write to a serial Port <moji@mo.net>
        Help: Read & Write to a serial Port <moji@mo.net>
        how check if integer (Steve .)
    Re: how check if integer (Sean McAfee)
        I hope this isn't a dumb question ... <erhodes@ntninc.com>
        Looking for Perl CGI Top Site script <paulvanveen@wxs.nl>
    Re: opendir() VS glob - WAS Re: readdir bug in win95 pe <zenin@bawdycaste.org>
        Perl/Win'95 <dropzone@mail.utexas.edu>
    Re: Perl/Win'95 (Erik)
    Re: pod2html and <BR> and L<text> tags (Tye McQueen)
    Re: pod2html and <BR> and L<text> tags (Snowhare)
        Printing binary and loading binary numbers <wsnyder@ultranet.com>
        Prof Help Needed <debot@xs4all.nl>
        Returning a WAV file to browser to play (Vikram Pant)
    Re: Returning a WAV file to browser to play (Ronald J Kimball)
    Re: Split with Multiple (Tore Aursand)
    Re: STANDARD PERL for WIN 95/NT EXECUTABLE (Jim Weisgram)
        sysread() Question <Robert.Davis@jhuapl.edu>
    Re: sysread() Question <uri@sysarch.com>
    Re: VARIABLES DE ENTORNO CGI (Larry Rosler)
    Re: Why doesn't my perl compiler like this expression? (Ronald J Kimball)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 09 Nov 1998 18:23:40 GMT
From: vip@takas.lt (VYTiS)
Subject: Attaching a binary file...
Message-Id: <3647335b.0@news.takas.lt>

Hi, does anyone know how to attach a binary file (let's say, a .zip) when 
sending email from perl (through sendmail)???

        Thanks.


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

Date: Mon, 9 Nov 1998 20:08:30 GMT
From: "Rick Koehler" <rkoehler@osmre.gov>
Subject: Re: camel races on CNN
Message-Id: <F267w8.Csw@igsrsparc2.er.usgs.gov>

Uri Guttman mentioned:
> last night i was watching cnn headline news and after the sports
report
> they showed the play of the day. to my surprise it was a camel race in
> some country where that is common. it was total chaos and nothing like
> the order of a thouroughbred horse race. the camels seem to do what
they
> wanted to do regardless of their jockey's guidance. seems like our
> favorite language has not only the architecture but the personality of
> its mascot. [snip]

Then there's the stuff about Joe Camel marketing campaign being used
to attract kids to Perl, making kids think Perl is cool 'n stuff, like
you know,
like he's all that n' stuff ...  And the first time the kids try
perling, they're
hooked for life, since perling is addictive, but the executives at
BigCompany
say there's no evidence that Perl is addictive, but internal memos
(hidden in
various modules) indicate that certain things were added to Perl to make
it even more addictive.

Oops, forgot to take my medication.  Ponies dancing with shoeboxes.
Sorry.  =8^)




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

Date: Mon, 09 Nov 1998 19:41:15 +0000
From: Alex Davies <Alex.Davies@tiuk.ti.com>
Subject: catch warn'ings in while (<>)...
Message-Id: <3647455A.4185D078@tiuk.ti.com>


 Am trying to catch (and ignore) the:

           warn "Can't open $ARGV: $!\n";

messages within a while (<>) {} loop.

Setting a $SIG{'__WARN__'} handler does not seem to catch these
warnings...
Is this because they not really generated by warn? Or is it a side
effect
of its magic-ness... Any other ideas on how to ignore these messages?

TIA

alex.
_________________________________________________________________________

Alex Davies, MOS Design,               Email:  Alex.Davies@tiuk.ti.com
Texas Instruments Limited,
800 Pavillion Drive,                   Tel (work):  01604 663450
Brackmills Industrial Estate,              (home):  01604 764961
Northampton, NN4 7YL.
U.K.




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

Date: Mon, 9 Nov 1998 09:19:56 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: customizable users mail in perl
Message-Id: <F25Dx9.JFn@csc.liv.ac.uk>

In article <3642D7A6.205FAEF5@duridium.com>,
Moshe Bar-Nachoom <mosheb@duridium.com> writes:
> I have a program that loops through users' database and sending them
> customiaed e-mails.
> The program runs on an ISP machine as a cgi operated from an
> administration html. I don't have shell access.
> The problem is that the ISP has somehow configured sendmail to do a
> strange loop - sending a simple message can put you on hold (host
> contacted, waiting for reply) for minute!!!
[snipped]
> (hints of telling the ISP how to configure sendmail and special flags
> that will make it run faster are more than welcomed)
> Thak you..
> 
I have been playing about with email of late and the only time I experienced
anything like this was when I changed the name of my server without informing
sendmail. It then took exactly 1 minute 15 seconds everytime to deliver email.
It was an eye opener to watch it in the logs, it wasn't just approx 1:15 it
was exactly 1:15 every time. Never did get to the bottom of it. Changeing the
name back sorted it out.

So this is just a suggestion but has your ISP been doing something that they
havn't told you about, or are you sure you are trying to send using the
correct settings? As I say it's only a suggestion but maybe worth a try.

Can't hel with the forking problem, others here are more qualified to help
anyway.

> --
> Moshe Bar-Nachoom
> [mailto:mosheb@duridium.com] [http://www.duridium.com]
> "Power corrupts. Absolute power is kind of neat."
> John Lehman, Secretary of the Navy, 1981-1987
> 
> 

-- 
--
Ian J. Garlick
<ijg@csc.liv.ac.uk>
<postmaster@merseymail.com>

Remember, drive defensively!  And of course, the best defense is a good
offense!



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

Date: Sun, 08 Nov 1998 20:47:14 +0000
From: Pedro Miguel Custodio <pecus@civil.ist.utl.pt>
Subject: DBD Oracle / Perl Problem
Message-Id: <36460352.FB9B9EC6@civil.ist.utl.pt>


Hi!


I'm experiencing some problems with oracle. I'm trying to connect a simple

perl script to an Oracle Server. But since i know nothing (well almost) nothing

about Oracle i can't figure out what's the problem.

I know this is not the best place for this message. Thanks to all of you u can

give some kind of help.

Here's the script:

###########################################################

#!/usr/local/bin/perl

use DBI;
use strict;

#------------------------------------------------
# Testa a existencia de um utilizador com essa ID
#------------------------------------------------

delete $ENV{ORACLE_SID};

#TCP/IP
my $dbh = DBI->connect('dbi:Oracle:T:<machine_ip>','user/passwd') or die $DBI::errstr;

#PIPES
#my $dbh = DBI->connect('dbi:Oracle:P:SID','user/passwd') or die $DBI::errstr;

$dbh->{RaiseError}=1;

my $sth = $dbh->prepare("select * from testes");
$sth->execute or warn "Can't execute select1.";

if ($sth->rows)
{
        (my $id, my $nome) = $sth->fetchrow;

        print "USER: $id => $nome \n\n";
}

$dbh->disconnect;

exit;

###########################################################

But when i try to execute it i got the following error message:

ORA-06401: NETCMN: invalid driver designator (DBD: login failed) at ./ora.pl line 16
ORA-06401: NETCMN: invalid driver designator (DBD: login failed) at ./ora.pl line 16.

Again, Thanks.

Pedro

-----------------------------------
Pedro Miguel Custodio
pecus@civil.ist.utl.pt





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

Date: 9 Nov 1998 00:51:21 -0500
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: DBD Oracle / Perl Problem
Message-Id: <725vsp$frj$1@tholian.cse.psu.edu>

Unless you are running an ancient version of Oracle, your connect
string is wrong.
'dbi:Oracle:Your_Oracle_TNS_alias_as_specified_in_tnsnames_ora'

John
groenveld@acm.org


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

Date: Mon, 09 Nov 1998 13:34:48 -0800
From: Dave Smith <dhsmith@hpeals7.mayfield.hp.com>
Subject: Directory listing on remote host
Message-Id: <36475FF8.7EA8@hpeals7.mayfield.hp.com>

Does anyone know of a way to perform a 'readlink' command on a remote
UNIX server in perl?  I have a perl script that displays data from a
file which is a symbolic link on a server specified by the user.  The
path within the symbolic link contains a hard version number.  I need to
add a user-entered parameter for a version number that would override
the version number specified in the symbolic link so that the file
displayed would be pointed to by the new path containing the
user-entered version. But I first need to know the symbolic link in
order to modify the version in the path.  I checked the FAQ. but it only
seems to reference getting files from a remote site, not listing files. 
Thanks in advance.

Dave


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

Date: Mon, 09 Nov 1998 14:30:18 -0500
From: "Todd D. Bayne" <tbayne@cadcam.pms.ford.com>
Subject: Re: encrypt filter?
Message-Id: <364742CA.E47BD89D@cadcam.pms.ford.com>

rbaguer@freenet.columbus.oh.us wrote:
> 
> Can anyone point me in the right direction on this? If all that is visible on
> a perl script is the location of perl and something that says
> Filter::Encrypt, where should I look to find that? How does the script run on
> the fly while most of it is encrypted? I've searched webcrawler and perl.com
> but could not find any reference to this. Thanks.
> 
> --
> 
> Please cc: my email, i'm using dejanews at the moment.
> open source everything
> 
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own

Filter is a CPAN Module.
You can locate it at http://www.perl.com/CPAN-local//modules/

-- 
Todd D. Bayne
tbayne@ford.com   313 84-55947
Enterprise PIM Implementation, PDS


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

Date: Mon, 09 Nov 1998 19:35:55 GMT
From: "Sylvain St.Germain" <sylvain@macadamian.com>
Subject: Hash of Hash problem
Message-Id: <36474363.D5E786E3@macadamian.com>

This is a multi-part message in MIME format.
--------------F965170421491C8FD084FAA2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I am filling a Hash table using:

while(<API>) {
  chomp( $func = $_);
  $api{$func} = { COUNT=>0, FOUND=>0};
}

after having modified the hash using stuff like 
$api{$somthing}{COUNT}++;
 ...

I print it using: 
print $api{$something}->{COUNT}
and 
print $api{$something}->{FOUND}

to my surprise every values are the same, when I
print $api{$something} I get the same address being:

HASH(0x8132988)

What's the problem?
Regards,
Sylvain.
--------------F965170421491C8FD084FAA2
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Sylvain St.Germain
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Sylvain St.Germain
n:              St.Germain;Sylvain
org:            Macadamian Technologies Inc.
email;internet: sylvain@macadamian.com
title:          Software Designer
note;quoted-printable:Work Voice: (613) 739-5976 x114=0D=0A=
	Work Fax:   (613) 739-9859
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard


--------------F965170421491C8FD084FAA2--



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

Date: Mon, 9 Nov 1998 16:56:43 -0500
From: "MoJi" <moji@mo.net>
Subject: Help: Read & Write to a serial Port
Message-Id: <nvJ12.1410$Sn6.4059@news.cwix.com>

Anyone have luck with this?

I've tried sysopen, but couldn't read with it.

Tried IPC::Open2, but kept blocking.

Also tried echo directly to /dev/cua/a, but not sure how to read from it.

plz help!

Here' the current failure..
--------------
#!/usr/local/bin/perl
#
#------------------------------------------------------------------
# Usage:
#        #dbrCall.pl [customer name] [interface] [tel_number]
#------------------------------------------------------------------

use IPC::Open2;
use Fcntl;
use POSIX qw( :errno_h);

#------------------------------------------------------------------
# Global Vars / Read ARGS
#------------------------------------------------------------------
$num_of_parms = @ARGV;

#------------------------------------------------------------------
# Give feedback on input format!
#------------------------------------------------------------------
if( $num_of_parms < 1 ) {
  print "Usage: #dbrCall.pl [customer name] [interface] [tel_number]\n";
  exit;
}

#------------------------------------------------------------------
# Open the cu program with serial port A
#------------------------------------------------------------------
open2( *README, *WRITEME, "cu -lcua/a -s9600" );

#------------------------------------------------------------------
# Set the flgs so that reads of serial port A aren't blocking
#------------------------------------------------------------------
$flags= '';
fcntl( README, F_GETFL, $flags ) || die "Couldn't get flags for $!";
$flags |= O_NONBLOCK|O_RDRW;
fcntl( README, F_SETFL, $flags ) || die "Couldn't set flags for $!";

#------------------------------------------------------------------
# read & write to the cu program
#------------------------------------------------------------------
sub PortW {
  $rv = syswrite( WRITEME, $buffer, length $buffer );
  if( !defined( $rv ) && $! == EAGAIN ) {
    print "We're blocking here!\n";
  }
  elsif( $rv != length $buffer ) {
    print "We've got a problem here!\n";
  }
  else {
    # print "Success!\n";
  }
}

sub PortR {
  $rv = sysread( README, $buffer, $BUFSIZ );
  if( !defined( $rv ) && $! == EAGAIN ) {
    print "We're blocking here!\n";
  }
  else {
    print "Buffer-> $buffer\n";
  }
}

PortR;
$buffer = "AT&F\n";
PortW;
until ( $buffer eq "OK" ) {
  PortR;
}

#------------------------------------------------------------------
# Close the cu program with serial port A
#------------------------------------------------------------------
$buffer = "~.\n";
PortW;
close( README );
close( WRITEME );

exit;




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

Date: Mon, 9 Nov 1998 16:56:43 -0500
From: "MoJi" <moji@mo.net>
Subject: Help: Read & Write to a serial Port
Message-Id: <8xJ12.1414$Sn6.5023@news.cwix.com>

Anyone have luck with this?

I've tried sysopen, but couldn't read with it.

Tried IPC::Open2, but kept blocking.

Also tried echo directly to /dev/cua/a, but not sure how to read from it.

plz help!

Here' the current failure..
--------------
#!/usr/local/bin/perl
#
#------------------------------------------------------------------
# Usage:
#        #dbrCall.pl [customer name] [interface] [tel_number]
#------------------------------------------------------------------

use IPC::Open2;
use Fcntl;
use POSIX qw( :errno_h);

#------------------------------------------------------------------
# Global Vars / Read ARGS
#------------------------------------------------------------------
$num_of_parms = @ARGV;

#------------------------------------------------------------------
# Give feedback on input format!
#------------------------------------------------------------------
if( $num_of_parms < 1 ) {
  print "Usage: #dbrCall.pl [customer name] [interface] [tel_number]\n";
  exit;
}

#------------------------------------------------------------------
# Open the cu program with serial port A
#------------------------------------------------------------------
open2( *README, *WRITEME, "cu -lcua/a -s9600" );

#------------------------------------------------------------------
# Set the flgs so that reads of serial port A aren't blocking
#------------------------------------------------------------------
$flags= '';
fcntl( README, F_GETFL, $flags ) || die "Couldn't get flags for $!";
$flags |= O_NONBLOCK|O_RDRW;
fcntl( README, F_SETFL, $flags ) || die "Couldn't set flags for $!";

#------------------------------------------------------------------
# read & write to the cu program
#------------------------------------------------------------------
sub PortW {
  $rv = syswrite( WRITEME, $buffer, length $buffer );
  if( !defined( $rv ) && $! == EAGAIN ) {
    print "We're blocking here!\n";
  }
  elsif( $rv != length $buffer ) {
    print "We've got a problem here!\n";
  }
  else {
    # print "Success!\n";
  }
}

sub PortR {
  $rv = sysread( README, $buffer, $BUFSIZ );
  if( !defined( $rv ) && $! == EAGAIN ) {
    print "We're blocking here!\n";
  }
  else {
    print "Buffer-> $buffer\n";
  }
}

PortR;
$buffer = "AT&F\n";
PortW;
until ( $buffer eq "OK" ) {
  PortR;
}

#------------------------------------------------------------------
# Close the cu program with serial port A
#------------------------------------------------------------------
$buffer = "~.\n";
PortW;
close( README );
close( WRITEME );

exit;




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

Date: Mon, 09 Nov 1998 19:46:16 GMT
From: syarbrou@nospam.ais.net (Steve .)
Subject: how check if integer
Message-Id: <3647466d.962475@news.ais.net>

I have a variable with a value in it.  Want to check if it's an
integer.  Any way to do this?  If so how?  Thanks a lot.

Steve


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

Date: Mon, 09 Nov 1998 19:55:36 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: how check if integer
Message-Id: <YMH12.5770$fS.19162024@news.itd.umich.edu>

In article <3647466d.962475@news.ais.net>,
Steve . <syarbrou@nospam.ais.net> wrote:
>I have a variable with a value in it.  Want to check if it's an
>integer.  Any way to do this?  If so how?  Thanks a lot.

if ($n == do { use integer; $n + 0 }) {
	# $n is an integer
}

See perlfaq4 for a non-obfuscated solution.

-- 
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
            | K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
            | tv+ b++ DI++ D+ G e++>++++ h- r y+>++**          | umich.edu


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

Date: Mon, 9 Nov 1998 16:44:19 -0500
From: "Ultranet News" <erhodes@ntninc.com>
Subject: I hope this isn't a dumb question ...
Message-Id: <727ngs$k3v$1@strato.ultra.net>

Greeting,

As a recent convert I was wondering if anyone has a version of Perl for
WindowsCE (version 1)? I have searched the FAQs and not found an answer, but
apologise if this question has already been asked and answered.

Thanks!
-ed




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

Date: Mon, 9 Nov 1998 21:46:38 +0100
From: "Paul A.H. van Veen" <paulvanveen@wxs.nl>
Subject: Looking for Perl CGI Top Site script
Message-Id: <727kue$ncl$1@reader3.wxs.nl>

I'm looking for a Perl CGI Top Site script. The purpose of the script is:

1) People log in to my site and submit their site.
2) They get send a piece of HTML which they place on their site.
3) Every time this HTML-code on their site is loaded, a counter (belonging
to their site) on my site is increased.
4) The site with the most visitors (e.g. that day) is put on top, the site
with the second most visitors is placed second etc.

I've looked on the internet, but I can only find scripts that increase the
counter when a text or image is clicked.

If possible, I'm looking for a free script.

Thank you very, very much in advance.

Best regards,

Paul van Veen








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

Date: 09 Nov 1998 07:18:44 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: opendir() VS glob - WAS Re: readdir bug in win95 perl 5.00402?
Message-Id: <910595787.115652@thrush.omix.com>

Ronald J Kimball <rjk@coos.dartmouth.edu> wrote:
: Tom Phoenix <rootbeer@teleport.com> wrote:
	>snip<
: > Naw, you can use glob() in a scalar context.
:
: Oops...  Well, I thought of one advantage of opendir() over glob(), at
: least.   :-)

	Well, there are dozens.  My fav is having an invalid username
	like '~foobar' someplace in your $PATH.  It should just be ignored,
	but Solaris csh core dumps in such cases even when just being
	asked to do a glob. :-)

-- 
-Zenin (zenin@archive.rhps.org)           From The Blue Camel we learn:
BSD:  A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts.  Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.)  The full chemical name is "Berkeley Standard Distribution".


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

Date: Mon, 09 Nov 1998 13:10:46 -0600
From: forrest reynolds <dropzone@mail.utexas.edu>
Subject: Perl/Win'95
Message-Id: <36473E34.47059330@mail.utexas.edu>

This is a multi-part message in MIME format.
--------------721846E75B24070771181787
Content-Type: text/plain; charset=us-ascii; x-mac-type="54455854"; x-mac-creator="4D4F5353"
Content-Transfer-Encoding: 7bit

Hello,
      Can Perl scripts be run on a Windows 95 system, or only NT?
      What does Win 32 mean?

            Thanks for your time, Forrest

--------------721846E75B24070771181787
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for forrest reynolds
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             forrest reynolds
n:              ;forrest reynolds
email;internet: dropzone@mail.utexas.edu
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------721846E75B24070771181787--



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

Date: 9 Nov 1998 19:18:35 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Perl/Win'95
Message-Id: <727f6b$gle$1@news.cyberhighway.net>

In article <36473E34.47059330@mail.utexas.edu>,
	forrest reynolds <dropzone@mail.utexas.edu> writes:
> Hello,
>       Can Perl scripts be run on a Windows 95 system, or only NT?
>       What does Win 32 mean?

I know there will probably already be 300 other responses to this by
the time this goes out, but oh well.
Perl can be run on win95, winNT, and win98.  Win 32 means 32-bit windows,
which encompasses all of the above.

-- 
Erik Nielsen, Cyberhighway Internet Services NOC

Maybe we should take a clue from FTP and put in an option like "print
hash marks on every 1024 iterations".  :-)
             -- Larry Wall in <199807171819.LAA13771@wall.org>


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

Date: 9 Nov 1998 12:51:11 -0600
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: pod2html and <BR> and L<text> tags
Message-Id: <727div$hnf@fohnix.metronet.com>

Aravind Subramanian <aravind@genome.wi.mit.edu> writes:
) Is there a way to tell the pod2html translator to insert a <BR>?

Probably 95% of the <BR>s in existance are in error. 
*.pod
doesn't support all of HTML and that includes the
dubious <BR>.
The worst use of <BR> is an attempt to control
the layout
of a paragraph which the author finds successful
when using
her browser with her settings, but anyone using
slightly
different settings or a different browser gets stuff
that
looks like this paragraph.

) The only way I have been able to place 2 sentences on separate 
) lines is by placing an empty line between them. (the lines are
) *not* items)

If this were pod, then the following two sentences would appear
on separate lines without an empty line between them:

    This is one sentence.
    This is another sentence.

) Is anyone aware of scripts that improve upon the HTML formatting done by
) pod2html - for example scripts that allow setting of background color
) and font.

And that would be an improvement?  ;)

) I'd appreciate any suggestions.

Realize that POD stands for Plain Old Documentation which doesn't
include changing fonts, colors, or formatting anything other than
paragraphs, literal blocks of text, lists, and headings.  It is
very handy for what it does, but it doesn't do everything.

Writing a script that reads output from pod2html and inserts a
font and color selection is nearly trivial in Perl.  Perhaps
you could take a stab at this yourself.  Perhaps something like:

    perl -pi.old -e 's/<BODY>/<BODY><font...>/' *.html

I suggest you read perlpod.pod (in ...perl.../lib/pod) for
information on how to insert arbitrary HTML.  The only source I
know of for information on how links are determined is pod2html
itself, which isn't very reader-friendly (though I'm not reading
the most current version).
-- 
Tye McQueen    Nothing is obvious unless you are overlooking something
         http://www.metronet.com/~tye/ (scripts, links, nothing fancy)


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

Date: 9 Nov 1998 21:27:28 GMT
From: snowhare@devilbunnies.org (Snowhare)
Subject: Re: pod2html and <BR> and L<text> tags
Message-Id: <727mo0$qn6$1@nnrp4.snfc21.pbi.net>



Nothing above this line is part of the signed message.

In article <727div$hnf@fohnix.metronet.com>,
Tye McQueen <tye@fohnix.metronet.com> wrote:
>
>Realize that POD stands for Plain Old Documentation which doesn't
>include changing fonts, colors, or formatting anything other than
>paragraphs, literal blocks of text, lists, and headings.  It is
>very handy for what it does, but it doesn't do everything.

pod2html generates broken HTML, period. It is truely a pain for 
those of us who actually validate their work with an SGML validator.
I need to get around to writing a post-processor to fix its worst
sins quickly.....

#!/usr/bin/perl -w
use strict;

my $text = '';
my ($file);
while ($file = shift) {
	my ($text) = &read_file ($file);
	next if (not defined $text);
	my $fixed_text = &fix_screwups($text);
	&write_file($file,$fixed_text);
}

sub read_file {
	my ($file) = @_;

	if (not open (FILE,$file))  {
		warn ("Could not open '$file' for reading\n$!");
		return undef;
	}
	local $/ = undef;
	my $text = <FILE>;
	close (FILE);

	$text;
}

sub write_file {
	my ($file,$text) = @_;

	if (not open (FILE,">$file"))  {
		warn ("Could not open '$file' for writing\n$!");
		return undef;
	}
	my $old_select = select (FILE);
	$|++;
	print $text;
	$|--;
	select $old_select;
	close (FILE);

	1;
}

sub fix_screwups {
	my ($text) = @_;

	my $doctype = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'; 
	$_ = $text;

	# If I wanted my email address where a spam 
	# bot could snag it, I'd put it in myself  
	s/<LINK REV="made" HREF="mailto:[^"]+">//o;

	# =item C<$ui-E<gt>set_ui_mode($mode);>
	# WRONG WRONG WRONG!!!!! <STRONG> is illegal in <DT>. &gt; is the entity
	# for >. Failing to close <DT> screws up some HTML 'parsers'.
	# <DT><STRONG><A NAME="item__ui_gtset_ui_mode_mode_">$ui-gtset_ui_mode($mode);</A></STRONG><DD>
	# Better. Except for the false positives...... 
	# <dt><b><a name="item__ui_gtset_ui_mode_mode_">$ui-&gt;set_ui_mode($mode);</b></dt>\n<dd> 
	s/-gt/-\&gt;/go;
	s#<DT><STRONG>#<dt><b>#go;
	s#</STRONG><DD>#</b></dt><dd>#go;

	# Close the <DD> tags. Stylesheets don't work
	# right in the Big Two with implied block closures.
	s#</DL>#</dd></dl>#go;

	# <P><HR> is nonsense code.
	s#<P>([^<]*)<P>\s+<HR>#<p>$1</p>\n<hr>#go;

	# close the dangling <P>
	s#<P>([^<]*)</dd>#<p>$1</p>\n</dd>#go;

	# <P> IS NOT equivalent to '\n\n'. Grrr.....
	# Messy. Works.
	s#<P>([^<]*)<P>#<p>$1</p>#oig;
	s#<P>([^<]*)<P>#<p>$1</p>#oig;
	s#</p>([^<]*)<P>#</p><p>$1</p>#iog;
	s#</p>([^<]*)<P>#</p><p>$1</p>#iog;
	s#\n</p>([^<]*)</p>#</p><p>$1</p>#iog;

	# close dangling <li> 
	s#<LI><A HREF="([^"]*)">([^"]*)</A>(\s+)(?=<LI>)#<li><a href="$1">$2</a></li>$3#go;
	s#</A>(\s+)</UL>#</a></li>$1</ul>#go;
	s#</ul>(\s+)<li>#</ul></li>$1<li>#goi;

	# Gah.
	s#>\s+<P>\s+<HR>#>\n<hr>#go;
	s#<HR>\s+<P>\s+<H(\d)>#<hr>\n<h$1>#go;
	s#</H(\d)>\s+<P>\s+<HR>#</h$1>\n<hr>#go;

	# Patch up more P stuff
	s#([^\s>])+\s*</dd>#$1\n</p></dd>#goi;
	s#<P>\s*([^\s<]+)\s*</body>#<p>$1</p>\n</body>#oi;

	"$doctype\n$_";
}

Not anywhere near perfect, but at least a million times better....

Benjamin Franz


Version: 2.6.2

iQCVAwUBNkdfoujpikN3V52xAQF8oQP9GLrU65Mze4iUGoq2uaZs15iQGZLvu8QR
kdhyMy4gLI7ZMGD5nn/+5SHZRPzwRnbEvRjQYs2pr7ZIMvz/E7v7dizqqzpk6qT+
5FJw7BdVPeKfSgOJA+9wveRKicMiclvI/mETC9F1CrGkT7hhgGfL385I6T3gNC9X
dE7MLzX24+4=
=S4/7
-----END PGP SIGNATURE-----


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

Date: Mon, 09 Nov 1998 14:39:31 -0500
From: Wilson Snyder <wsnyder@ultranet.com>
Subject: Printing binary and loading binary numbers
Message-Id: <364744F3.ADBCA63C@ultranet.com>


With the printf now being built in (THANKS!), I'd like to suggest two
improvements
to the perl baseline:

1. printf  ("%[someletter]", ... Where the output is in binary.

2. reading literals 0b11111 == 15, Where the number is converted from
binary ala 0x.

As a EE, I'm always doing these functions, and have them part of a
package, but it would
make a lot more sense if they were intrinsic.

Thanks!

-Wilson



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

Date: Mon, 09 Nov 1998 22:44:35 +0100
From: Frank <debot@xs4all.nl>
Subject: Prof Help Needed
Message-Id: <36476242.C4346C41@xs4all.nl>

I need a script which can delete the first or last line of a data file.
If the 11th line is added that the first line is deleted. Or reversed.




--
Visit my pages:

http://www.xs4all.nl/~debot/
http://www.xs4all.nl/~debot/webdesign/
http://www.xs4all.nl/~debot/mp3planet/
http://www.xs4all.nl/~debot/frank/
http://www.geocities.com/SunStrip/Frontrow/4346/
http://www.geocities.com/Vienna/Choir/1516/
http://www.geocities.com/Heartland/4345/
http://members.tripod.com/~botje1/

Contact me:
email: debot@xs4all.nl
ICQ: 13307469




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

Date: Sun, 8 Nov 1998 22:55:58 -0500
From: nospam@wam.umd.edu (Vikram Pant)
Subject: Returning a WAV file to browser to play
Message-Id: <MPG.10b031de70bb069f9896a3@news.wam.umd.edu>

I'm writing a simple script that takes in some variables, makes a URL out 
of it and then returns a .wav file to the user.

Problem is that I want to sound returned to them.  Such as a Netscape 
pop-up window or something of that nature.

User click on a .wav file link (sounds.cgi?Heat+deniro.wav) and my 
program puts the two variables into a URL where the file is located 
(http://..../Heat/sounds/deniro.wav).

Problem is that I've tried numerous return types, but nothing seems to be 
working well.

print "Content-type: audio/x-wav\n\n";
$ReturnSound;

I'm doing as above.
$ReturnSound = 
http://vikrampant.com/alltimefavflics/Heat/sound/deniro.jpg

What do I do so that the sound plays when they click on the link?

Thanks,
Vikram Pant


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

Date: Mon, 9 Nov 1998 00:09:03 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Returning a WAV file to browser to play
Message-Id: <1di78p1.1agv3mb1tne4skN@bay1-8.quincy.ziplink.net>

Vikram Pant <nospam@wam.umd.edu> wrote:

> print "Content-type: audio/x-wav\n\n";
> $ReturnSound;
> 
> I'm doing as above.
> $ReturnSound = 
> http://vikrampant.com/alltimefavflics/Heat/sound/deniro.jpg

If you want to return a file of type audio/x-wav to the browser, then
you actually have to print out such a file.

The above program doesn't print out anything, other than a Content-type
header.

And even if you did print out the $ReturnSound variable, then you would
be giving the browser a URL, rather than a file of type audio/x-wav.

And the URL is for an image/jpeg file, at that.  (Okay, so the .jpg bit
was probably a typo.  :-)


$sound_file = '/alltimefavflics/Heat/sound/deniro.wav'

open(WAV, $sound_file) or
  die "Can't open $sound_file: $!\n";
binmode(WAV);

print "Content-type: audio/x-wav\n\n";
print <WAV>;

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: Mon, 09 Nov 1998 09:42:09 GMT
From: tore@forumnett.no (Tore Aursand)
Subject: Re: Split with Multiple
Message-Id: <3647b8aa.407427279@news.online.no>

On Sun, 08 Nov 1998 17:54:24 -0500, "Frank McCulley"
<mcculley@jersey.net> wrote:
> I am sending form data to a perl program.

Whatever your intentions are: Start using the CGI.pm module for
Perl.  It helps you do most of the "hard work" related to CGI
programming using Perl.

Take a look in the CGI section at http://www.perl.com/ for more
information.


-- 
Tore Aursand
ForumNett Online AS
http://www.forumnett.no/


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

Date: Mon, 09 Nov 1998 17:40:42 GMT
From: jweisgram@hotmail.com (Jim Weisgram)
Subject: Re: STANDARD PERL for WIN 95/NT EXECUTABLE
Message-Id: <36492804.50453519@news.teleport.com>

j.poehlmann@link-n.cl.sub.de (Johannes Poehlmann) wrote:

>	(Weekly posting to comp.lang.perl.misc and de.lang.perl)
>
>_Where to find the *STANDARD* windows 95/NT port of perl (binary) ?_
>
>(The "standard" has a number of advantages over Microsoft's "Activeware"  
>port. E.g. you can install perl modules  not contained in the binary  
>distribution. As long as these  Modules do not use C-code you do not need a C- 
>compiler )
[...snip...]

I believe the current ActiveState version is *NOW* considered to be the
"standard" version (i.e., the "standard" Win32 port and the ActiveState port
have been merged into one as of 5.005).

>
>You find the Files in alternative subdirectories:    /authors/ 
>Gurusamy_Sarathy/
>	    perl5.00402-bindist04-bc.zip

ActiveState has just announced on their web site that Gurusamy Sarathy has
joined their development team.
-- 
All opinions expressed are mine and not my employers (but they ought to be)
Jim Weisgram
Oregon Department of Transportation


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

Date: Mon, 09 Nov 1998 14:09:08 -0500
From: Bob Davis <Robert.Davis@jhuapl.edu>
Subject: sysread() Question
Message-Id: <36473DD4.5B24E0CB@jhuapl.edu>

I am using sysread() to read a series of binary bytes into a buffer.
What is the underlying data structure of buffer filled by sysread()?

My ultimate goal is to determine if the contents of this buffer is all
zeros.

Bob Davis

Rober.Davis@jhuapl.edu




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

Date: 09 Nov 1998 14:34:30 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: sysread() Question
Message-Id: <x7ww54bqyh.fsf@sysarch.com>

>>>>> "BD" == Bob Davis <Robert.Davis@jhuapl.edu> writes:

  BD> I am using sysread() to read a series of binary bytes into a buffer.
  BD> What is the underlying data structure of buffer filled by sysread()?

there is no structure. all perl buffers are just strings of bytes. you
can do a sysread and then do any string operation (or anything than
converts from a string) on the buffer.

  BD> My ultimate goal is to determine if the contents of this buffer is all
  BD> zeros.

this should work:

$buffer =~ /^\x00*$/

hth,

uri



-- 
Uri Guttman  -----------------  SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire  ----------------------  Perl, Internet, UNIX Consulting
uri@sysarch.com  ------------------------------------  http://www.sysarch.com
The Best Search Engine on the Net -------------  http://www.northernlight.com


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

Date: Mon, 9 Nov 1998 13:27:59 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: VARIABLES DE ENTORNO CGI
Message-Id: <MPG.10b0fe39413feaa7989866@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <364751C8.FF445964@kenan.com> on Mon, 09 Nov 1998 15:34:16 -
0500, Seth Gordon <sgordon@kenan.com> says...
> Larry Rosler:
> > + Actually, that's surprisingly comprehensible....
> 
> I R A Aggie:
> 
> > > I think you meant to say:
> > >
> > > Realmente, eso es asombrosamente comprensible....
> 
> Larry Rosler:
> 
> > No, I meant to say:
> >
> > Really, that is amazingly comprehensible...
> 
> "Realmente" does not mean "really".  It means "soon".
> 
> ObPerl: there has been some discussion on this group about "got-me"s in Perl.

Yes, I know.  I was the one who started it. :-)

> The above is a "got-me" in Spanish....

No hablo espaqol.  The one to blame is 
<URL:http://babelfish.altavista.com>, which is where these 
"translations" came from.  Their translation (two-way) of "really soon" 
is "realmente pronto".

> --
> perl -le'$m="r 0rJaa.u0cksthe";$c=967150;s/$/substr$m,($i\
> +=$c%2?4:1)%=16,1or$i-2?"no":"Perl h"/e while$c>>=1;print'
> == seth gordon == sgordon@kenan.com == standard disclaimer ==
> == documentation group, kenan systems corp., cambridge, ma ==

PS (published here not to embarrass you but to help others):

Many of us (myself included) appreciate receiving email copies of posts.  
We appreciate it even more when the copies are indicated as such (see 
above), so that we can distinguish them from private letters.  That way, 
we don't have to respond twice to the same message.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 9 Nov 1998 00:09:05 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: Why doesn't my perl compiler like this expression?
Message-Id: <1di7988.1f0ugpk1eqkslN@bay1-8.quincy.ziplink.net>

sara starre <nospam.gear4u@hotmail.com> wrote:

> why does the compiler not like:
> 
>    (iii)  $a=1+$b=$c=0;
> 
> ???

Well, why doesn't it?

Can't modify addition in scalar assignment at - line 1, near "0;"

Hmm, it looks like you're trying to assign to an addition expression...

(1+$b) is not a valid l-value.

Perhaps you meant:

$a=1+($b=$c=0);


Note that addition has higher precedence than assignment.  If it didn't,
then you'd almost always have to parenthesize the rhs of an assignment.

-- 
 _ / '  _      /         - aka -         rjk@coos.dartmouth.edu
( /)//)//)(//)/(     Ronald J Kimball      chipmunk@m-net.arbornet.org
    /                                  http://www.ziplink.net/~rjk/
        "It's funny 'cause it's true ... and vice versa."


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

Date: 12 Jul 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 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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