[7594] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1220 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Oct 23 15:17:26 1997

Date: Thu, 23 Oct 97 12:00:32 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 23 Oct 1997     Volume: 8 Number: 1220

Today's topics:
     Re: [Q] STARTPERL define not working? (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     Anyone have Perl5.004 on SCO Enterprise 5.004 <gary@newsinform.com>
     Re: Checking for the existence of subroutines (Andrew M. Langmead)
     Creating perl doc. in HTML format indhiraa@hotmail.com
     Re: Creating perl doc. in HTML format (Mike Stok)
     Deleting first line <yasuda@pacbell.net>
     Re: Deleting first line (Tad McClellan)
     Flowcharting perl code in Java (Shoel Perelman)
     help- Using Mat scripts <nathanc@bright.net>
     HTML::Parser:  Parsing HTML tables and Frames??? (Dragomir R. Radev)
     Re: Huge files, <>, and sysread() (M.J.T. Guy)
     Re: Huge files, <>, and sysread() (Tad McClellan)
     Re: Minimal match regular expression (Tad McClellan)
     Re: Most efficient way to parse large text files <mark@exodus.net>
     Re: Most efficient way to parse large text files (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     Novell port of perl = crippleware? x@apocalypse.org
     Re: Novell port of perl = crippleware? (Jonathan Stowe)
     Re: Open File Question (Craig A. Shortreed)
     Re: Open File Question (Tad McClellan)
     panic on "make test" - SunOS 5.5.1 (Sitaram Chamarty)
     Re: perl editor <mesjpo@di.uminho.pt>
     Re: Perl for Windows 95 (Jonathan Stowe)
     Re: persistent hash assignment problem (M.J.T. Guy)
     Re: Problem with Getopt::std (Mike Heins)
     Re: Problems locking a file (Tad McClellan)
     Q: Webserver for Win95? <cj-ryan@ai.uiuc.edu>
     Reading File Lines <ramsan00@mh.uk.sbphrd.com>
     Re: Reading File Lines (Tad McClellan)
     Re: Regexp optimizing (Ilya Zakharevich)
     Strange behavior of $? (Mike Manion)
     streaming to another process? paul@pkamf.demon.co.uk
     Time-Date string / epoch seconds conversion (James W. Durkin)
     Re: Use perl from Visual Basic (Jonathan Stowe)
     Re: What might go wrong here and how can I test that? <jstern@world.northgrum.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Thu, 23 Oct 97 10:57:45 -0400
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: [Q] STARTPERL define not working?
Message-Id: <344f6655$1$ofn$mr2ice@speaker>

In <62laab$rp4@miso.wwa.com>, on 10/22/97 at 11:40 AM,
   thalerj_NOSPAM@wwa._NOSPAM.com said:
+-----
|  In my configuration process, I allowed STARTPERL
| to be defined as the proper location.  However, when I create a script with
| that string on top, it doesn't actually execute perl.
+--->8

Depends.  Some systems insist on a space between #! and the filename; others
have a length limit (usually 32 characters).  Since you didn't mention which
system, there's no way for us to know if you're on such a system.

-- 
brandon s. allbery              [Team OS/2][Linux]          bsa@void.apk.net
cleveland, ohio              mr/2 ice's "rfc guru" :-)                 KF8NH
Warpstock '97:  OS/2 for the rest of us!  http://www.warpstock.org
Memo to MLS:  End The Burn Scam --- Doug Logan MUST GO!  FORZA CREW!



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

Date: Thu, 23 Oct 1997 13:11:17 -0400
From: Gary Pike <gary@newsinform.com>
Subject: Anyone have Perl5.004 on SCO Enterprise 5.004
Message-Id: <344F8535.8F22D6A2@newsinform.com>

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

I downloaded the GNU c compiler and Perl 5.004_01. Giving Up on
intalling it. Anyone have a binary already installed or how they did it?

Gary Pike

--------------E80A003DC2030B7EA2F8B7FA
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Gary Pike
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Gary Pike
n:              Pike;Gary
org:            News Express
adr:            1753 Connecticut Ave;;;Washington ;DC;20009;USA
email;internet: gary@newsinform.com
tel;work:       (202) 332-2890
tel;fax:        (202) 462-6657
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


--------------E80A003DC2030B7EA2F8B7FA--



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

Date: Thu, 23 Oct 1997 17:34:03 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Checking for the existence of subroutines
Message-Id: <EIIM4r.6rt@world.std.com>

Doug Seay <seay@absyss.fr> writes:

>[posted and mailed]

>Arvid Peterson wrote:
>> The reason for this is, I need to call subroutines for specific variable
>> values, and want to name the subroutine with the value. Let's say...
>> 
>> $var1= "grub";
>> <more perl code>
>> &$var1;

>I don't think that &$var is legal Perl4 syntax.  Soft references didn't
>exist yet.  If you want to be dynamic, you'll need to use either eval()
>or a TYPEGLOB.  Both are ugly, but I prefer the eval().

Symbolic references didn't exist as a general concept, but a few
specific parts of the perl4 language allowed a scalar that contained
the name of another symbol. In version 5, symbolic references
generalized these special cases.

$fh = 'STDOUT';
print $fh "Hi there\n";
print "$fh is file descriptor number ",fileno $fh;

$sub = 'foo';
do $sub; # the deprecated form of &$sub;

(and probably some more that I can't think of.)
-- 
Andrew Langmead


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

Date: Thu, 23 Oct 1997 13:01:52 -0600
From: indhiraa@hotmail.com
Subject: Creating perl doc. in HTML format
Message-Id: <877629359.4439@dejanews.com>

Hi All:

Is there any utility to create documentation of PERL source
code in HTML format from Perl pod format.

Thanks.

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 23 Oct 1997 18:43:35 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: Creating perl doc. in HTML format
Message-Id: <62o5sn$a2t@news-central.tiac.net>

In article <877629359.4439@dejanews.com>,  <indhiraa@hotmail.com> wrote:
>Hi All:
>
>Is there any utility to create documentation of PERL source
>code in HTML format from Perl pod format.

Recent versions of perl should intall pod2html

NAME
       pod2html - convert .pod files to .html files

SYNOPSIS
           pod2html --help --htmlroot=<name> --infile=<name> --outfile=<name>
                    --podpath=<name>:...:<name> --podroot=<name>
                    --libpods=<name>:...:<name> --recurse --norecurse --verbose
                    --index --noindex --title=<name>


DESCRIPTION
       Converts files from pod format (see the perlpod manpage)
       to HTML format.

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


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

Date: Thu, 23 Oct 1997 08:52:19 -0700
From: Gary Yasuda <yasuda@pacbell.net>
Subject: Deleting first line
Message-Id: <344F72B3.1F06@pacbell.net>

Through PERL, I am putting tables on the web, and the tables are 
contained in ASCII text files.  I am translating the tables through
Adobe Acrobat into PDF, so that they can be viewed on the web using
Adobe Acrobat Reader.  The database for some reason puts a page break
(^L) on the very first line of each text file I translate, so the
first page is always blank.  I always get calls that the translation
did not work when the first thing people see is a blank page, but
every page after that is fine.

Is there some way in PERL 5.004 of just stripping off the first 
entire line of each text file or just stripping the first ^L read in
prior to running them through Adobe Acrobat?  I experimented with
some of the pattern matching features of PERL to get rid of the first
^L character, but I ended up replacing all the ^L characters throughout
the entire text file.


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

Date: Thu, 23 Oct 1997 13:46:38 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Deleting first line
Message-Id: <e26o26.h7u.ln@localhost>

Gary Yasuda (yasuda@pacbell.net) wrote:
: Through PERL, I am putting tables on the web, and the tables are 
: contained in ASCII text files.  I am translating the tables through
: Adobe Acrobat into PDF, so that they can be viewed on the web using
: Adobe Acrobat Reader.  The database for some reason puts a page break
: (^L) on the very first line of each text file I translate, so the
: first page is always blank.  I always get calls that the translation
: did not work when the first thing people see is a blank page, but
: every page after that is fine.

: Is there some way in PERL 5.004 of just stripping off the first 
: entire line of each text file 


Yes.


1)
   while (<>) {
      print unless $. == 1;  # print all but the first line
   }


2)

   <>;  # discard the first line
   while (<>) {
      print;
   }


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 23 Oct 1997 15:07:53 GMT
From: perelman@geometry.cims.nyu.edu (Shoel Perelman)
Subject: Flowcharting perl code in Java
Message-Id: <62np89$5rl$1@news.nyu.edu>

I'm looking for a way to display the flow of a perl script in a graphical
manner using Java.  I seek Java code that can parse perl code and display
the branching, if/thens, loops, and references to other subroutines in
the form of a simple flowchart.

An added bonus would be the ability to *build* perl code from these flowcharts
if the flowchart package comes with a graphical builder.

Please cc any replies to shoel@shoel.com.

Thanks a lot in advance..

-Shoel Perelman 



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

Date: 23 Oct 1997 18:27:17 GMT
From: "Nathan & Angela Carnahan" <nathanc@bright.net>
Subject: help- Using Mat scripts
Message-Id: <01bcdfe0$20d91fe0$9a078fd1@ultra>

Hello I am using Matt Scripts free for all links and I want to change the
URL to accept and open up an email box. What kind of code do I need to
write to open up an email box in Perl??????


Angela
angelac@childrensmall.com


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

Date: 23 Oct 1997 11:38:51 -0400
From: radev@news.cs.columbia.edu (Dragomir R. Radev)
Subject: HTML::Parser:  Parsing HTML tables and Frames???
Message-Id: <62nr2b$92r@bluewhale.cs.columbia.edu>

Is there an extension to HTML::Parser* for tables and frames? I am
interested in extracting all ASCII text from the tables and frames. Output
formatting is not important.

D.
-- 
Dragomir R. Radev                           Graduate Research Assistant
Natural Language Processing Group     Columbia University CS Department
H: 212-749-9770  O: 212-939-7121      http://www.cs.columbia.edu/~radev


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

Date: 23 Oct 1997 17:42:41 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Huge files, <>, and sysread()
Message-Id: <62o2ah$8ol$1@lyra.csx.cam.ac.uk>

Mordechai T. Abzug <mabzug1@umbc.edu> wrote:
>The evaluation of <FILE> depends on context.  If it's in a scalar context,
>it returns the next line.  If it's in a list context, it slurps the whole
>file.  Guess which one you've got?  :)
>
>For a scalar context, say:
>
>while ($line = <FILE>)

No.   As -w would remind you, you should write

 while (defined($line = <FILE>))


Mike Guy


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

Date: Thu, 23 Oct 1997 07:58:38 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Huge files, <>, and sysread()
Message-Id: <ulhn26.m81.ln@localhost>

Mordechai T. Abzug (mabzug1@umbc.edu) wrote:
: In article <yf1hgac6usz.fsf@iniki.gsfc.nasa.gov>,
: "J-F Pitot de La Beaujardiere " <delabeau@iniki.gsfc.nasa.gov> spake thusly:
: > 
: > A colleague just came to me with a Perl problem.  He is attempting to read a
: > huge (20MB) text file.  Everything works if he attempts to process test
: > lines snipped from the file, but if he tries to process the entire file it
: > takes forever (forever = longer than patience permits).  Stepping through
: > with the debugger suggests that the line
: > 
: > 	foreach $line (<FILE>)

: The evaluation of <FILE> depends on context.  If it's in a scalar context,
: it returns the next line.  If it's in a list context, it slurps the whole
: file.  Guess which one you've got?  :)

: For a scalar context, say:

: while ($line = <FILE>)


make that:

   while (defined($line = <FILE>))


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Thu, 23 Oct 1997 08:08:15 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Minimal match regular expression
Message-Id: <v7in26.7a1.ln@localhost>

Martin Svanstrvm (erac.eramsva@memo.ericsson.se) wrote:

: I have a problem which I'm starting to get very annoyed with.
: Let's see if I can explain it:

: My variable $text contains a complete text file. It looks something like
: this:
: BLA BLA<title>BLA BLA text BLA BLA</title><title>BLA BLA BLA
: BLA</title><title>BLA BLA  BLA text</title>  and so on.

: I want to create a reg exp which searches for all <title>  </title>
: enclosures which contains the string  "text" and print everything inside
: the enclosure.
: I've tried, on $text, something like:

: while (s/<title>(.*?text.*?)<\/title>//) {
:    print "$1\n";
:     }

: This, however, will find everything from the first found <title> to
: "text", while I want it to find the <title> which is closest to "text"


I am surprised that none of the followups pointed out that you
need s///s if the title's start and end tag are on different lines.


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Thu, 23 Oct 1997 10:11:33 -0700
From: Mark Tripod <mark@exodus.net>
Subject: Re: Most efficient way to parse large text files
Message-Id: <344F8545.143C650C@exodus.net>

> Yowza!  Using a hash to associate month names with numbers would shorten
> the code considerably, but that's already been pointed out in a previous
> response, as has the year 2000 problem.  As far as pulling the number of
> bytes, this works:
> 
> my $ByteSent = 0;
> $_ = "Bytes Sent: 107968967 bytes";
> 
> if (/Bytes Sent: \b(\d+)\b/) {
>    $BytesSent += $1;
>    print "$BytesSent\n";
> }
> 
> The \b notation forces the match to begin and end on word boundaries.
> The (\d+) sucks up all digits and backreferences tehm for later use.
> The $1 is the remembered backref.

(\d+) implies that bytes count is always at two digits, correct?

Mark


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

Date: Thu, 23 Oct 97 14:05:44 -0400
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: Most efficient way to parse large text files
Message-Id: <344f922c$2$ofn$mr2ice@speaker>

In <344F8545.143C650C@exodus.net>, on 10/23/97 at 10:11 AM,
   Mark Tripod <mark@exodus.net> said:
+-----
| > The (\d+) sucks up all digits and backreferences tehm for later use.
| > The $1 is the remembered backref.
| (\d+) implies that bytes count is always at two digits, correct?
+--->8

No, at least one digit.  "+" means "1 or more of the preceding expression", in
this case being "\d" (a digit).

-- 
brandon s. allbery              [Team OS/2][Linux]          bsa@void.apk.net
cleveland, ohio              mr/2 ice's "rfc guru" :-)                 KF8NH
Warpstock '97:  OS/2 for the rest of us!  http://www.warpstock.org
Memo to MLS:  End The Burn Scam --- Doug Logan MUST GO!  FORZA CREW!



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

Date: Thu, 23 Oct 1997 10:40:34 -0600
From: x@apocalypse.org
Subject: Novell port of perl = crippleware?
Message-Id: <877620524.26794@dejanews.com>

I'm being forced to consider using Novell's IntranetWare Web Server and
am concerned about its support of perl. From what I understand, Novell
wrote their own perl interpreter (or is it ActiveWare's perhaps?). If
that's true, what good is that going to do me as a developer? I'm getting
more into modules, and have noticed that many modules require perl 5.003
or perl 5.004. Has anyone used the perl interpreter on IntranetWare? What
are its limitations?

I can't even find a review on IntranetWare web server.

Please help.

Thanks.

  - Xochi

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: 23 Oct 1997 16:44:24 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Novell port of perl = crippleware?
Message-Id: <62nut8$6uo@neon.btinternet.com>

In article <877620524.26794@dejanews.com>, x@apocalypse.org says...
>
>I'm being forced to consider using Novell's IntranetWare Web Server and
>am concerned about its support of perl. From what I understand, Novell
>wrote their own perl interpreter (or is it ActiveWare's perhaps?). If
>that's true, what good is that going to do me as a developer? I'm 
getting
>more into modules, and have noticed that many modules require perl 5.003
>or perl 5.004. Has anyone used the perl interpreter on IntranetWare? 
What
>are its limitations?
>
>I can't even find a review on IntranetWare web server.
>
>Please help.
>
>Thanks.
>
>  - Xochi
>
>-------------------==== Posted via Deja News ====-----------------------
>      http://www.dejanews.com/     Search, Read, Post to Usenet

The intranetware Perl is I think a four point something port ( well on my 
server it appears to be ).  So you can kiss your modules goodbye - but it 
is fast as it is loaded as an NLM all the time.  I have used it for a 
couple of things that had beeb originally on Linux and the only problem 
is getting the pathnames to any external files right which to be honest 
is a bit of guesswork as it is NOT WELL DOCUMENTED !

Given a choice of linux or Intranetware i'd go for Linux but the web 
server is fast and you get a nice red box.



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

Date: 23 Oct 1997 16:20:58 GMT
From: cshortreed@valnet.com (Craig A. Shortreed)
Subject: Re: Open File Question
Message-Id: <62ntha$3t0$1@news1.rmi.net>

You are not opening the $InFile, your open command says that what you open 
should be CALLED InFile, but it doesn't say that InFile=$InFile, for example:

>    open (InFile, "|sort >$OutFile") or die "Error: $InFile: $!\n";
$temp="|sort >";
$temp2=$InFile . $temp . $OutFile;
open (InFile,$temp2)

It looks like when you open the file you are actually trying to open a file 
named $OutFile instead of the value of $OutFile, and the line you specified 
does not say what InFile is supposed to be.

In article <62nne0$sus$1@Venus.mcs.net>, aya@MCS.COM says...
>
>I am novice in the Perl's world.
>
>I have a problem with the following program.  The program is a copy from the
>"Programming Perl" book. After program is run the output file is empty. What
>am I possible doing wrong?



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

Date: Thu, 23 Oct 1997 13:41:15 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Open File Question
Message-Id: <bo5o26.h7u.ln@localhost>

NATALIA ALTMAN (aya@MCS.COM) wrote:
: I am novice in the Perl's world.

: I have a problem with the following program.  The program is a copy from the
: "Programming Perl" book. 


Would you care to share the page number (and edition) with us?

I'm guessing you have not typed it in verbatim...


: After program is run the output file is empty. What
: am I possible doing wrong?

: Perl, version 5.003 with EMBED
:     built under hpux at Oct 16 1996 12:41:55
:     + suidperl security patch


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

:     $InFile="filename";

The '$InFile' variable is never again used in your program...

-w is warning you about this, isn't it?

You should provide any warnings that perl gives you when you ask for
help. That is what the warnings are *for*, to help debug.



:     $OutFile="/tmp/filename.$$";

: #
: # Using the FileHandle constructor...
:     use FileHandle;

I don't see any place where you are using FileHandle below,
so you don't need this statement...


: #
: # Sort $InFile file and redirect output to $OutFile...
:     open (InFile, "|sort >$OutFile") or die "Error: $InFile: $!\n";

1) you should use UPPER CASE for filehandles. This is a usual convention
   in perl programs.

2) you have opened the 'InFile' file handle for *writing* here


:     while($Line=<InFile>) {


Now you are *reading* from a file that you opened for writing...

That should also be wrapped in defined()


:         print "$Line";

This is writing to STDOUT. Do you see any stuff on STDOUT?

If so, why didn't you tell us?


:     }
:     close(InFile);
:     die "Error: $!\n" if $?;
: -----------------------------------

: Thanks,


1) taken from the Camel, without telling us where

2) warnings from -w not included in article

3) stuff written on STDOUT not included in article


Try giving enough information for someone to help you, and someone
will likely try to help you.

Most of us are not psychic...



The more you tell us about what you see, what you tried, etc.,
the more likely you are to get help that actually helps        ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 23 Oct 1997 15:41:43 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: panic on "make test" - SunOS 5.5.1
Message-Id: <slrn64usmv.no.sitaram@ltusitaram.diac.com>

I'm trying to install Perl 5.004_01 on SunOS 5.5.1.  (An earlier attempt
failed because I overrode some defaults, not realising that SunOS 5.5.1 is
Solaris 2.5.1!)

I chose all the defaults in Configure, except the install directory itself
(installing it without root).  Make also went fine (or at least didnt crap out
visibly).

"make test" failed a few tests.  Here's a sample:

---------- sample ----------
    op/misc...........PROG:
    %@x=0;
    EXPECTED:
    Can't modify hash deref in repeat at - line 1, near "0;"
    Execution of - aborted due to compilation errors.
    GOT:
    Can't modify hash deref in repeat at - line 1, near "0;"
    Execution of - aborted due to compilation errors.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    panic: corrupt saved stack index.
    Segmentation Fault - core dumped
    FAILED on test 15       
---------- end sample ------

As you can see, the "GOT:" and "EXPECTED:" are the same, except that we get
the panic also...

Here's the tail end of the "./perl harness" run, which was suggested by the
"make test".

    Failed Test  Status Wstat Total Fail  Failed  List of failed
    ----------------------------------------------------------------------------
    lib/db-btree.t    0   139    ??   ??       %  ??
    lib/db-hash.t     0   139    ??   ??       %  ??
    lib/db-recno.t    0   139    ??   ??       %  ??
    lib/gdbm.t        0   139    ??   ??       %  ??
    op/misc.t                    45    4   8.89%  15, 26-28
    pragma/strict.t              76   25  32.89%  9-10, 21, 33-34, 36-39, 43, 47
    pragma/subs.t                 6    2  33.33%  1-2
    Failed 7/152 test scripts, 95.39% okay. 31/4160 subtests failed, 99.25% okay

All the details you want will be made available - could someone please help?

Thank you.

Sitaram


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

Date: Wed, 22 Oct 1997 17:20:52 +0100
From: Jose Pedro Oliveira <mesjpo@di.uminho.pt>
To: Vladimir Afanasiev <afan@elnet.msk.ru>
Subject: Re: perl editor
Message-Id: <344E27E4.DF85D355@di.uminho.pt>

Vladimir Afanasiev wrote:

> Where I can download freeware or shareware editor for PERL program
> (Win'95)?

Try the Lemmy editor. This is a VI like editor for WIN32 with
syntax highlighting for various languages including C, Java, HTML, Perl,
TclTk,...

The URL is http://www.accessone.com/~jai/

--
Jose Pedro Garcia de Oliveira
mesjpo@di.uminho.pt




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

Date: 23 Oct 1997 16:35:48 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl for Windows 95
Message-Id: <62nud4$6uo@neon.btinternet.com>

In article <344eb33d.67520527@news.flash.net>, cheerio@flash.net says...
>
>I am a newbie to Perl and i have been attempting to create small
>programs that may be useful on a shell account, i use windows 95
>as my os and i was wondering if there was a type of perl for win95.
>One that can run commands .etc and i dont mean cgi. Well if there
>is can someone tell me where to get it .etc and if it is different
>from the linux version? well thanks for your time
>                                -Cheerio

Activeware have a good Win32 release. It works well on both NT and 95.  
Everything I have tried works equally as under Linux.

get it from 


ftp://ftp.ActiveState.com/Perl-Win32/Release/

or if you prefer http://www.activeware.com/download.html

enjoy



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

Date: 23 Oct 1997 17:38:46 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: persistent hash assignment problem
Message-Id: <62o236$8j6$1@lyra.csx.cam.ac.uk>

In article <344F587E.7CCD54AD@sni.de>, Jochen Luig  <eggbert.pad@sni.de> wrote:
>Hi!
>
>I have a problem using persistent hashes. When I run the following
>program segment:
>
>dbmopen(%parray,"test",0777);

Always check the return from system calls.   Something like

 dbmopen(%parray,"test",0777) or die "Failed to open 'test': $!\n";

>%parray = ( "key1" => "value1",
>                   "key2" => "value2");
>dbmclose(%parray);
>
>I keep gettin the error message:
>
>sdbm store returned -1, errno2, key "key1" at  <filename>

In this message, the errno is a value for $!, so you can get an associated
message.   The numbers are system dependent, but on my system I get

       $ perl -lwe '$!=2; print $!'
       No such file or directory

which suggests that the open failed.   But since you've concealed the
result of the open, it's impossible to tell.


Mike Guy


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

Date: 23 Oct 1997 18:34:11 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: Problem with Getopt::std
Message-Id: <62o5b3$gou$1@vixen.cso.uiuc.edu>

Dave Barnett (barnett@houston.Geco-Prakla.slb.com) wrote:
: I believe I am using Getopt::std correctly, but am getting what I
: believe are incorrect results.
: 
: I am unable to get a single character option to work properly.
: 
: For example:
: 
: #!/usr/local/bin/perl -w
: #
: use strict;
: use diagnostics;
: use Getopt::std;

You would get a "module not found" error for the above on most
UNIx systesms, as it should be Getopt::Std.

: getopt('h');

I always use getopts('h'), which allows you to specify arguments
to flags when appropriate. And you should check your return
status for errors to catch illegal flags.

getopts('h') or die "Illegal program option. ($0 -h for list) \n";

I also suggest dropping the $:: with a 'use vars qw($opt_h);',
becasue if you were to emply the code in another package it
would break.

: if (defined($::opt_h) {

I am not sure checking for "defined" status is the eay to
do this. That depends on the module. I know that just plain
if( $opt_h) will work, and it won't give a warning on later
Perls. if (defined $opt_h and $opt_h) will prevent warnings
on older Perls.

: 	$::opt_h = "";
: 	USAGE();
: }
: sub USAGE {
: 	print STDOUT ("usage: $0: [-h] [other options]\n");
: 	print STDOUT ("         -h     Print this help message.");
: 	exit 1;

Exit code 1 is standard for a program error -- most UNIX programs
use 2 for initialization things like this.

: }
: 
: __END__
: 
: When I run the script as 'script.perl -h', the opt_h variable does not
: get set.  I am attempting to set up a help message for my script that
: will print out any time 'script.perl -h' is input. 
: 
: If I enter 'script.perl -h --', opt_h is assigned "--" as a value, and
: so the subroutine that prints the usage information is then called.
: 
: What am I missing here?  I want to have a unix style usage line, without
: having to enter 'script.perl -h --', assuming that the users will not
: know to do this.  Can it be done using Getopt, or must I manually check
: for the '-h' option before this will work?

I would use the module, but if all you will ever have is a single
flag, then this will work fine:

if($ARGV[0] eq '-h' or $ARGV[0] eq '--help') {
	$help_needed = shift;
}

if($help_needed) {
	USAGE();
	exit 2;
}

My programs never have but a single flag, at least not after I 
finish with them. 8-)

Regards,
Mike Heins


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

Date: Thu, 23 Oct 1997 08:06:10 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Problems locking a file
Message-Id: <24in26.7a1.ln@localhost>

Xavier Tarafa Mercader (xavi@teclata.es) wrote:
: I posted a similar question 15 days ago, but I didn't get the answer I
: was looking for.

: I've a  script which open a file (with exclusive lock) wait for ten
: seconds and then close the file. The script also return to me the value
: returned by flock function.


: What I do is running the script twince in less than 10 seconds. So it
: was suposed to the second time I run it to get an error value as a
      ^^^^^^^^^^                             ^^^^^^^^^^^^^^^^^^


No it isn't.

It is supposed to wait (ie. "block") until it _can_ get the lock.


: return of flock function, but it doesn't  happen.


You want 'non-blocking' locking to get the behavior you describe.


See LOCK_NB in the description for flock() in the perlfunc man page.



--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Thu, 23 Oct 1997 11:41:22 -0500
From: CaSey Ryan <cj-ryan@ai.uiuc.edu>
Subject: Q: Webserver for Win95?
Message-Id: <344F7E32.DCAF21D4@ai.uiuc.edu>



I'm looking for a way to test my CGI scripts on a win95 machine.  Its
doesn't have a constant network conection, only dialup, so there isn't a
static IP.  I compiled and installed Apache. While the service is
running, when I try to access the webserver with a browser it can't find
the computer because it's doing a DNS lookup on it.  I went all throught
the files looking for something that might tell it to look locally, but
couldn't find anything.
Is there a way I can get around this and still use Apache, or is there
any other program that I could use to test the scripts?

Casey



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

Date: Thu, 23 Oct 1997 16:53:10 +0100
From: "Naseem . Ramsahye" <ramsan00@mh.uk.sbphrd.com>
Subject: Reading File Lines
Message-Id: <344F72E6.41C6@mh.uk.sbphrd.com>

Hi all

I've written a PERL script which involves reading the data from a plain
ASCII file, of the format :

int, int, char, float, float, float

However the script never seems to read the very first line.  If I add a
blank line at the beginning, it doesn't ignore it (the blank line)
though.

Any ideas why this is, and how I can solve it?

Thanking you in advance

Naseem
-- 
=====================================================================
Naseem A. Ramsahye                                
SmithKline Beecham Pharmaceuticals  
Email:ramsan00@mh.uk.sbphrd.com      
=====================================================================


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

Date: Thu, 23 Oct 1997 13:48:17 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Reading File Lines
Message-Id: <h56o26.h7u.ln@localhost>

Naseem . Ramsahye (ramsan00@mh.uk.sbphrd.com) wrote:

: I've written a PERL script which involves reading the data from a plain
: ASCII file, of the format :

: int, int, char, float, float, float

: However the script never seems to read the very first line.  If I add a
: blank line at the beginning, it doesn't ignore it (the blank line)
: though.

: Any ideas why this is, and how I can solve it?
  ^^^^^^^^^


One idea might be to post the broken code...


--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: 23 Oct 1997 17:37:25 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Regexp optimizing
Message-Id: <62o20l$ior$1@agate.berkeley.edu>

In article <62n42b$jmc$1@vixen.cso.uiuc.edu>,
Mike Heins <mheins@prairienet.org> wrote:
> Roar Andre Lauritzsen (roarl@metaphor.no) wrote:
> : I made a small program for searching through our 6MB of C source code
> : for the definition of a specific identifier. When I expanded the regexp
> : to search for macro definitions as well, the program got very slow. Then
> : I found out that by splitting the regexp the program became efficient
> : again.
> : 
> : Question: Why is
> :   /^([(\w][()*\w\s]*[)*\s])?$id\s*([(;=]|$)/o || /^#define\s*$id\b/o
> : 10 times faster than
> :   /^(([(\w][()*\w\s]*[)*\s])?$id\s*([(;=]|$))|(#define\s*$id\b)/o
> : ???
> 
> Less copying during the pattern match (2 less paren sets) and
> the efficient anchoring of the opening strings ^[\w(] and ^#define.

Either there is copying, or there is not.  Amount of parens is not
relevant.

And change "strings" to "atoms" or somesuch.

Otherwise very relevant.  This flaw is not fixed in the jumbo RE
patch.  But first-char optimization is one of the closest goals.

Ilya


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

Date: 23 Oct 1997 15:51:02 GMT
From: manion@defiant.cv.lexington.ibm.com.torolab.ibm.com (Mike Manion)
Subject: Strange behavior of $?
Message-Id: <62nrp6$d6m$1@news.lexington.ibm.com>


I am running Perl version 5.004_01.  When I execute the following 4-line
script:

#!/usr/local/bin/perl -w
print "Content-type: text/html\n\n";
`echo aaa`;     #those are backticks
print "$?";

from the command line, I get the output "0", as I should.  But when I
point my web browser at the script (it is in my cgi-bin directory), I
get a "-1" in my browser.

No matter what command I put in backticks, I always get a -1 as the return
status.  If I remove the third line (backtick command), I see a "0" printed
whether I run from the command line or over the web.  It's only when I
try and execute a command that $? gets set to -1, and it's only when I
am running the script via the web.

By the way, the httpd server I'm using is a local one spawned by my own
userid, so anything I run from the web should act exactly the same as if
I had run it from the command line.

Please help!  I can't find any mention of this in any FAQ's or the Blue
Camel book.  I have a web page that has to call some other programs with
backticks, so I can capture their output, but I also want to look at
their return codes.  All I am getting is -1's every time!  Very
frustrating.

Mike Manion
mmanion@us.ibm.com


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

Date: Fri, 24 Oct 1997 02:32:39 GMT
From: paul@pkamf.demon.co.uk
Subject: streaming to another process?
Message-Id: <877631562.13462.0.nnrp-06.9e98ada2@news.demon.co.uk>

Hi Gurus!

I am writing some perl that takes code piped from gunzip:

gunzip - c | ../myprog.pl

Now,  I filter that data then I want to pass the differently filtered
streams to another application.  As the data comes into my perl prog I
split it and then I want to send it to its relevant stream.

I know how to open files etc!!!

How do I open a stream, kick off a process, keep it open then shut it
down.  I tried the following without success:

$stream = "startmyapp +setupfile > output.html"; # Declare execution

         $filename = $stream;
         if (!open ($entry, "|$filename")) {
                 die "Can't open stream $entry";
         } 

Any ideas as to how I can do this dynamically many times for my
filtered streams?

Please email replies to:

paul@pkamf.demon.co.uk

TIA

Paul



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

Date: 23 Oct 1997 14:20:15 -0400
From: jwd@graphics.cornell.edu (James W. Durkin)
Subject: Time-Date string / epoch seconds conversion
Message-Id: <reyb3k734w.fsf@eyrie.graphics.cornell.edu>

I have time/date strings (in Unix 'date' format) stored in a file that
I need to read in, convert to epoch seconds for some manipulation
(can't get away from that part), and write back out as new time/date
strings.  A quick look through CPAN shows a handful of modules that
would help somewhat, but none with methods that quite to the trick.
Any suggestions?



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

Date: 23 Oct 1997 16:48:34 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Use perl from Visual Basic
Message-Id: <62nv52$6uo@neon.btinternet.com>

In article <344f3d56.25072933@news.compuserve.com>, 
ivkovic@compuserve.com says...
>
>May sound like a heresy, but:
>I would like to benefit from some perl advantages in MS apps where I
>have to use VBA code.
>So, I would like to be able to include perl code into VBA code. I
>don't know if/how I can call the PerlIIS.dll from VB and get the
>return values.
>Or, if I shell to perl.exe executing a script, how do I send things
>from VB to <STDIN> of the perl script, and how do I get back in VB
>what perl prints to <STDOUT>?
>
>Thank you for any help...
>
>Milivoj

You probably wont be able to call the perl dll as the isapi dlls are 
slightly different from normal ones ( just as vb controls are ) but a 
brave programmer (not me ) could make a perl control for VB.



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

Date: Thu, 23 Oct 1997 17:38:01 GMT
From: Jim Stern <jstern@world.northgrum.com>
Subject: Re: What might go wrong here and how can I test that?
Message-Id: <344F8B79.7D44@world.northgrum.com>

Gerben_Wierda@RnA.nl wrote:
> 
> I was trying to speed up a program by using the // empty pattern trick
> 
> ========================================================
> warn "Trying to match header on: $matchline\n" if $opt_verbose;
> /$matchline/;   # Force pattern compile
> foreach my $headerline (@header) {
>     if ($headerline =~ //) { # Speed: use last compiled pattern
>     warn "Match on: $headerline\n" if $opt_verbose;
> ========================================================
> 
> [...] 
> In fact, it matches on any pattern, as if it is a real empty pattern which
> always matches. [...]

Are you sure the `/$matchline/' succeeded?  From perlop:

   If the PATTERN evaluates to a null string, the last
   successfully executed regular expression is used instead.
   ^^^^^^^^^^^^^^^^^^^^^

$_ has to contain something that `/$matchline/' will match at
the time `/$matchline/' is executed.

-- 
Jim Stern -- Views here are my own, not Northrop Grumman's.   (El
Segundo, CA)


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

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

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