[10915] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4516 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 30 03:07:13 1998

Date: Wed, 30 Dec 98 00:00:43 -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, 30 Dec 1998     Volume: 8 Number: 4516

Today's topics:
    Re: a nicer way? (Michael Rubenstein)
        CGI.pm abnormal end <farber@admin.f-tech.net>
    Re: Deleting files in Win32 with PERL CGI <bratch@home.com>
    Re: EXPERIENCED IN PERL ? <carvdawg@patriot.net>
    Re: EXPERIENCED IN PERL ? ptimmins@netserv.unmc.edu
    Re: EXPERIENCED IN PERL ? <mlabor@sprintmail.com>
    Re: Help on HTML::LinkExtor <ebohlman@netcom.com>
    Re: how to debug perl programs? <ebohlman@netcom.com>
        invoking a C function in a perl program (beginner) <ovdlc@ldlc.com>
        Logging out rsarcomo@my-dejanews.com
    Re: Logging out (Sam Holden)
        Need help with printing date on web page (Loans2001)
        Need Shopping Cart for web...Newbie (Jennifer Driller)
    Re: Perl 5 on HP dennis_marti@yahoo.com
    Re: Perl Cookbook ptimmins@netserv.unmc.edu
        Perl equivalent to unix's uniq command <bpike@netspace.net.au>
    Re: Perl equivalent to unix's uniq command (Sam Holden)
    Re: Retrospective on comp.lang.perl.moderated? (Ronald J Kimball)
    Re: Scale/Mode calculator <mmcmanus@frontiernet.net>
    Re: Scale/Mode calculator <neal413@javanetspam.com>
    Re: Script for inserting HTML abbrevations <ebohlman@netcom.com>
    Re: Searching for Text (Tad McClellan)
    Re: Searching for Text <ebohlman@netcom.com>
        Solaris 2.6 Perl5.005_02 and h2ph problems for the aub  (Lyle Merdan)
        use diagnostics <nospam@nospam.com>
        win32 install woes.   ( win98 ) <cs2400@hotmail.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Wed, 30 Dec 1998 03:03:14 GMT
From: miker3@ix.netcom.com (Michael Rubenstein)
Subject: Re: a nicer way?
Message-Id: <368d95dd.153072386@nntp.ix.netcom.com>

On Tue, 29 Dec 1998 17:59:21 GMT, Scratchie <upsetter@ziplink.net>
wrote:

>
>Jason Costomiris <jcostom@madcow.jasons.org> wrote:
>
>: I did not "correct" Tom.  I simply asked if there was something particularly
>: better about his approach than mine.  Seems that since it was Tom's fingers
>: that did the typing, that's enough for it to be better. :-)
>
>Plus it's faster.

Have you tested this?  Just looking at the code for cgi.pm, it seems
to me that the procedural approach will be slower, though I'd bet that
you'd be hard pressed to detect the difference.  I certainly don't
believe that the difference in speed would be important.
--
Michael M Rubenstein


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

Date: Wed, 30 Dec 1998 00:33:46 -0500
From: Paul Farber <farber@admin.f-tech.net>
Subject: CGI.pm abnormal end
Message-Id: <Pine.LNX.3.96.981230003015.2125A-100000@admin.f-tech.net>

Hello all...

trying to get a form/cgi program to accespt some input and write it to a
file.  Alls going well except that the perl script that uses CGI.pm always
end abnormally.

The values are written to the disk, and the file is closed, but the server
always send me to an error page about the script ending abnormally.  The
script seems to close the files/end properly.... and perl -c ran clean, I
have use strict and use diagnostics... the thing runs clean but end
normally...

It this a script or form problem??



Paul D. Farber II
Farber Technology
717-628-5303
farber@admin.f-tech.net



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

Date: Wed, 30 Dec 1998 07:00:04 GMT
From: Tim Bratcher <bratch@home.com>
Subject: Re: Deleting files in Win32 with PERL CGI
Message-Id: <3689D00F.3F489A85@home.com>

I got a newer Perl and the unlink() works, but still only for
short file names or long file names without spaces.  Anytime
I try to delete a long file name with spaces using exec "del 
$filename", or system "del $filename", or exec "move $filename
C:\\Recycle", I get the same "No such file or directory" error.
This is what I pass to exec "del $filename", or to unlink ($filename)
Actually, this is the contents of $filname:

C:\DELFILES\"Copy (2) of Resistance.htm"

It works from the command line, and it works from the CGI program if
there are no spaces.  I did chomp the filename, and I did tr /+/ /
the spaces in the file name.

This is the first time perl has kicked my butt, and most of it
is because I am using it on a win32 platform.
Any other ideas?

Thanks, 
tim
bratch@home.com

Ethan H. Poole wrote:
> 
> [Posted and Emailed]  In article <3688657E.7BAF4F85@home.com>,
> bratch@home.com says...
> >
> >I am writing Perl scripts for Win32.  The script needs
> >to allow a user (from a protected directory) to delete
> >files in that directory.  The unlink command wasn't
> >working, so I am using this:
> >
> >exec "del $ThisFile";
> >
> >Anyone know how to delete long file names with spaces via a WIN32
> >CGI script?
> 
> Update your Perl to a version that has a working unlink().  There have been a
> few Win32 ports with broken unlink() functionality.
> 
> --
> Ethan H. Poole              | Website Design and Hosting,
>                             | CGI Programming (Perl & C)..
> ========Personal=========== | ============================
> * ehpoole @ ingress . com * | --Interact2Day--
>                             | http://www.interact2day.com/


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

Date: Tue, 29 Dec 1998 21:13:38 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: EXPERIENCED IN PERL ?
Message-Id: <36894602.58F632C4@patriot.net>

Yeah, I got a response back from this guy, too.  And the response was evenmore
vague than the original posting!!  He made references to a business,
a product, markets...but nothing was specific.  And he asked a lot of personal
questions that could have also been used for demographics.

I also checked out the web site for Token Systems...if anyone else has seen it,
have you noticed that none of the quotes on the pages specifically say "Token
Systems"?  They all are vague quotes that could have easily been taken out of
context.  And there is no contact information...no listing of who the president or

CEO is...

Hhhhhmmmm...



> Now now everyone. I've emailed this guy/person, and he/she has assured
> me that this is *not* usenet SPAM, and they just *really* need someone
> (to do anything apparently) :
>
> "This is not "SPAM" .. it is a completely legit opportunity for some one
> who has talent and skill with PERL and the like.  We have a need for a
> qualified person due to the fact we have grown so much, we require
> additional assistance on product production.
> If this is a concern, we can stop including the news groups in general
> for our search.
> Thank you for your time."
>





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

Date: Wed, 30 Dec 1998 02:56:38 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: EXPERIENCED IN PERL ?
Message-Id: <76c4p6$qov$1@nnrp1.dejanews.com>

In article <368931C2.20681CEE@usa.net>,
  GSX <gsx97@usa.net> wrote:

> I'm presently writing a Perl Coffee Maker. I've got the code to brew a
> great cup of Hazelnut...but I'm having a problem with the code for
> decaf.

if ($decaf == 1) {
    pour(MeCl2_decaf($cup));
} else {
    pour($cup);
}

sub MeCl2_decaf {
   $cup =~ s/caffeine//gi;
}

sub pour {
    print $cup;
}


Patrick Timmins
$monger{Omaha}[0]

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


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

Date: Tue, 29 Dec 1998 22:37:39 -0500
From: "Manual Labor" <mlabor@sprintmail.com>
Subject: Re: EXPERIENCED IN PERL ?
Message-Id: <76c75a$7s4$1@oak.prod.itd.earthlink.net>

You can't make a coffee maker using PERL, you should use java.


Erik wrote in message <76bcia$m90$1@news.cyberhighway.net>...
>In article <368931C2.20681CEE@usa.net>,
> GSX <gsx97@usa.net> writes:
>> I'm presently writing a Perl Coffee Maker. I've got the code to brew a
>> great cup of Hazelnut...but I'm having a problem with the code for
>> decaf.
>>
>> Will this make me ineligible for the job?
>
>No, but you better get that code for the cappucino extension working
>properly...these people are obviously high class.
>
>--
>Erik Nielsen, Cyberhighway Internet Services NOC
>I think it's a new feature.  Don't tell anyone it was an accident.  :-)
>         -- Larry Wall on s/foo/bar/eieio in
<10911@jpl-devvax.JPL.NASA.GOV>





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

Date: Wed, 30 Dec 1998 04:09:24 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Help on HTML::LinkExtor
Message-Id: <ebohlmanF4rFJo.yz@netcom.com>

Frank de Bot <debot@xs4all.nl> wrote:
: Can someone give me a simple example how to use: HTML::LinkExtor  ?

There are two simple examples in the documentation for it, which is 
generated from the internal POD in the module.




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

Date: Wed, 30 Dec 1998 03:52:25 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: how to debug perl programs?
Message-Id: <ebohlmanF4rErD.MAA@netcom.com>

vivekvp@hotmail.com wrote:
: i have a site hosted on a server.  i upload the scripts from my home computer
: and then try to execute them from my server - through my web pages.  of
: course i always get the old "internal server error" screen.

: 1.  can i debug the program fromt he server - it gives very limited error
: messages - premature end of script

Not really.  There's nothing you can do if your script fails because it 
won't compile due to syntax errors.  If the script compiles but doesn't 
run properly, you can insert lots of temporary output statements to get 
an idea of what's going on, but that will be slow and tedious.

: 2.  can i run the perl program from machine at home - and catch errors before
: i upload it?  if so, how?

: i would like to install perl (however i do that) on my home machine, write
: then debug it with a perl debugger, then upload it to my server.  does this
: sound right?

Yep.  If you use CGI.pm, which you almost certainly should, you can use 
its test mode where it prompts you for your parameters.  You can also 
install a lightweight HTTP server on your local machine and access your 
script results through it.


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

Date: Mon, 28 Dec 1998 11:02:08 +0100
From: "olivier" <ovdlc@ldlc.com>
Subject: invoking a C function in a perl program (beginner)
Message-Id: <768vfo$5hm$1@front5.grolier.fr>

hello,

I must use a C function in a perl (CGI) script, the function is part of a
library
what syntax should i use ?

the fact that the script call a function in a library, is it a problem (i
have the Lib.h file).

thanks
olivier




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

Date: Wed, 30 Dec 1998 04:11:06 GMT
From: rsarcomo@my-dejanews.com
Subject: Logging out
Message-Id: <76c94q$u3n$1@nnrp1.dejanews.com>

Is there a way to logout from a perl script?  I've tried
system("logout"),system("exit"),exec("logout"), and exec("exit") to no avail.
 I want the script to log out after it's done running.	Thanks.

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


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

Date: 30 Dec 1998 04:38:33 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Logging out
Message-Id: <slrn78jbi9.gn5.sholden@pgrad.cs.usyd.edu.au>

On Wed, 30 Dec 1998 04:11:06 GMT, rsarcomo@my-dejanews.com
	<rsarcomo@my-dejanews.com> wrote:
>Is there a way to logout from a perl script?  I've tried
>system("logout"),system("exit"),exec("logout"), and exec("exit") to no avail.
> I want the script to log out after it's done running.	Thanks.

Just exec the script from the shell...
use 'exec script.pl' instead of 'script.pl' to run it...


-- 
Sam

There's no such thing as a simple cache bug.
	--Rob Pike


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

Date: 30 Dec 1998 06:30:09 GMT
From: loans2001@aol.com (Loans2001)
Subject: Need help with printing date on web page
Message-Id: <19981230013009.09071.00004198@ng05.aol.com>

I wrote this code...

#<-- Begin Code -->

$mod_time = (stat("../../coastal/rates/rates.htm"))[9];
print $mod_time;
# Last modified time is index 9 of array returned by stat, so we
# grab that only.  We then go on to get the time in a usable
# format by supplying this number (remember it is in epoch
# seconds) to the localtime function, and return only the
# info we are interested in.

($min,$hour,$day,$mon,$yr) = (localtime($mod_time))[1..5];

# We now need to do some modifications, because of the format
# of the numbers returned by localtime, i.e., year is the
# number of years since 1900, month numbers run from 0 to
# 11, and also remember the time is returned in 24 hour
# (military) format.  For printing, we force the hours and
# minutes to print with two numbers for cases like 00:05,
# which would normally print as 0:5.

$yr += 1900;
$mon++;
$outstr = "$mon/$day/$yr at ".sprintf("%.2d",
$hour).':'.sprintf("%.2d", $min);
print "$outstr";

#<-- End Code -->

All I'm trying to do is print the last day the file was updated on the web
page.
What's so hard about this? I wish Perl would just have a function for this. But
I have to get the number in seconds? Is there an easier way/

If you can see my web page at http://www.mortgage-pros.com/cgi-bin/rates.cgi

the program puts something strange there.  Like 112/31/1969  

Any suggestons? 

Thanks,

Scot King




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

Date: Wed, 30 Dec 1998 06:08:08 GMT
From: jdriller@usit.net (Jennifer Driller)
Subject: Need Shopping Cart for web...Newbie
Message-Id: <3689c1f9.21520417@news.usit.net>

I know practically nothing about Perl. (MIS background) I need a
shopping cart program. Have heard of PerlShop and Mini Vend, but I
need help. Anyone used these? How do I get started? What do I need?
Any help greatly appreciated!!!!

Jen @ www.bellboytech.com


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

Date: Wed, 30 Dec 1998 06:56:30 GMT
From: dennis_marti@yahoo.com
Subject: Re: Perl 5 on HP
Message-Id: <76ciqu$4ve$1@nnrp1.dejanews.com>

In article <36895E31.E3257F73@ccn.net>,
  Arndt Baerschneider <ab@ccn.net> wrote:
> who can help me finding a binary distribution of perl 5.00x  for HP-UX
> 10.20?

try http://hpux.cs.utah.edu/ the Software Porting And Archive Centre
for HP-UX.

Dennis

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


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

Date: Wed, 30 Dec 1998 03:53:40 GMT
From: ptimmins@netserv.unmc.edu
Subject: Re: Perl Cookbook
Message-Id: <76c843$t87$1@nnrp1.dejanews.com>

In article <76b8ad$p83$1@gail.ripco.com>,
  mikebvc@ripco.com (Mike Stillman) wrote:

>  Kevin W. Reed wrote in message <366bfbcf.0@news.redrose.net>...
>  >The Perl Cookbook from O'Reilly is pretty good.  Just got it for a
>  >B-Day... Lots of solutions in it....
>
> Lots of errors, too. Check the O'Reilly website for a list of errata that
> runs 25+ pages.
[snip]

Don't be a nutt.

Go buy a book from a publisher that doesn't print an errata. Then you'll
have a book with no typos.

Patrick Timmins
$monger{Omaha}[0]

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


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

Date: Sun, 27 Dec 1998 11:11:45 +1100
From: "bpike" <bpike@netspace.net.au>
Subject: Perl equivalent to unix's uniq command
Message-Id: <763u5k$jpf$1@otis.netspace.net.au>

Does anyone no of away to simulate the unix command uniq in perl on an array

Thanks
Brad.




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

Date: 30 Dec 1998 01:39:34 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Perl equivalent to unix's uniq command
Message-Id: <slrn78j12m.d8r.sholden@pgrad.cs.usyd.edu.au>

On Sun, 27 Dec 1998 11:11:45 +1100, bpike <bpike@netspace.net.au> wrote:
>Does anyone no of away to simulate the unix command uniq in perl on an array

'perldoc -q uniq' would be a pretty obvious start and would lead to this
first hit... 

=head1 Found in /usr/lib/perl5/5.00554/pod/perlfaq4.pod

=head2 How can I extract just the unique elements of an array?
 
-- 
Sam

 "... the whole documentation is not unreasonably transportable in a
 student's briefcase." - John Lions describing UNIX 6th Edition
 "This has since been fixed in recent versions." - Kernighan & Pike


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

Date: Tue, 29 Dec 1998 20:50:49 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <1dktfwl.1jx9aol1mzemdkN@bos-ip-1-101.ziplink.net>

Leslie Mikesell <les@MCS.COM> wrote:

> >Well, I guess that's your problem.  Registering for
> >comp.lang.perl.moderated is no more difficult than signing up for an
> >electronic mailing list.
> 
> I know who I am.  Why should I attempt to prove it to someone else
> using an unreliable medium just so I could answer someone else's
> question?

So that every poster will read the about the many resources available
(documentation/FAQ, other appropriate newsgroups, etc.) *before* having
a message posted to the newsgroup.  This should mean much less work for
the moderators, with a trivial, one-time inconvenience for all posters.

By the way, you can still answer someone else's question just by
emailing them directly.  If that's not too much of a "bother" for you.

Sadly, the perl debugger will not help you find the bug up your ass.

-- 
 _ / '  _      /         - aka -          rjk@linguist.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: Tue, 29 Dec 1998 22:34:58 -0500
From: Mike McManus <mmcmanus@frontiernet.net>
Subject: Re: Scale/Mode calculator
Message-Id: <36899F62.B750C109@frontiernet.net>

Samuel Hogarth wrote:
> 
> At 22:01:48 on Mon, 28 Dec 1998, our lives were enlightened by the words
> of Bill Huston, as follows:
> >  "periodic table" of scales (from 12 sharps to 12 flats),
> 
> What will the periodic table look like? Wouldn't you be better off
> with a cycle of fifths?

I tried this with key signatures recently. At six sharps/six flats
the cycle of fifths "wraps around" (six sharps and six flats are
enharmonic keys, and seven sharps and five flats are also enharmonic
and vice versa).

Are key signatures beyond seven sharps/flats used at all (in which
case double sharps or double flats would need to be used) or are
they simply avoided by spelling the key signature in an enharmonic
key? I would suspect the latter as I have never seen key signatures
using double sharps or flats.

-- 
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
_/  Mike McManus    _/ home: mmcmanus@frontiernet.net             _/
_/  Rochester, NY   _/ work: mcmanus@kodak.com                    _/
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/


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

Date: Wed, 30 Dec 1998 01:25:33 -0500
From: "Neal" <neal413@javanetspam.com>
Subject: Re: Scale/Mode calculator
Message-Id: <76ch30$sgk$1@winter.news.rcn.net>

One can write in "super-7" keys (like my new term?) but is avoided. If you
are in Db (5 b's) and go into the minor, you'll have, either in the sig or
due to accidentals, a Bbb. If you're in B and you go to the relative minor
(g#), the accidental on the leading tone is Fx. If a modulation to major
occurred, I would sneakily make it Ab minor instead.

Mike McManus wrote in message <36899F62.B750C109@frontiernet.net>...
>Samuel Hogarth wrote:
>>
>> At 22:01:48 on Mon, 28 Dec 1998, our lives were enlightened by the words
>> of Bill Huston, as follows:
>> >  "periodic table" of scales (from 12 sharps to 12 flats),
>>
>> What will the periodic table look like? Wouldn't you be better off
>> with a cycle of fifths?
>
>I tried this with key signatures recently. At six sharps/six flats
>the cycle of fifths "wraps around" (six sharps and six flats are
>enharmonic keys, and seven sharps and five flats are also enharmonic
>and vice versa).
>
>Are key signatures beyond seven sharps/flats used at all (in which
>case double sharps or double flats would need to be used) or are
>they simply avoided by spelling the key signature in an enharmonic
>key? I would suspect the latter as I have never seen key signatures
>using double sharps or flats.
>
>--
>_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
>_/  Mike McManus    _/ home: mmcmanus@frontiernet.net             _/
>_/  Rochester, NY   _/ work: mcmanus@kodak.com                    _/
>_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/




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

Date: Wed, 30 Dec 1998 03:47:38 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Script for inserting HTML abbrevations
Message-Id: <ebohlmanF4rEJE.LyH@netcom.com>

Kjetil Kjernsmo <kjetikj@ulrik.uio.no> wrote:
: I thought about start writing a script to insert HTML ABBRs and
: ACRONYMs in existing HTML files, by having the program look up a list
: of common abbrevations and acronyms (as well as my own) and their
: expansions, but first I figured I'll ask if someone already wrote such
: a script. So?

: Since I'm quite new to Perl (that I will use), it'll probably take me
: some time. If somebody wants to give a hand, it seems like my greatest
: difficulty now is to make sure I'm not inserting ABBRs inside HTML
: tags. I can't just remove them of course, which seems easy. If anybody
: knows a fast way (without having to go all the way through a parser),
: that would be great.

You *do* want to use HTML::Parser or one of its subclasses (possibly 
HTML::Filter) so you can be sure you're doing your substitutions on 
content rather than markup.  It's not really that difficult, and trying 
to "hack parse" HTML is just asking for trouble, especially if the HTML 
isn't all written by you (there are plenty of perfectly legal, but 
non-obvious, HTML constructs that can throw you off).



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

Date: Tue, 29 Dec 1998 20:34:31 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Searching for Text
Message-Id: <nf3c67.q12.ln@magna.metronet.com>

Robert Bruno (rbruno@mindspring.com) wrote:
: This is a multi-part message in MIME format.
                                  ^^^^^^^^^^^
                                  ^^^^^^^^^^^

   Please don't do that anymore.

   Usenet is a plain text medium.

   Your "newsreader" is mis-configured, please fix it.

   [ do you know that many folks have MIME articles automatically
     deleted before they ever see them? There is no benefit to
     having your questions ignored...
   ]


: Unfortunately it only writes the line of today's date.


   OK, then my previous followup pointed out the problem.

   Just fix it  ;-)



: Tad McClellan <tadmc@metronet.com> wrote in message
: news:90db67.oev.ln@magna.metronet.com...
: >Robert Bruno (rbruno@blue-pumpkin.com) wrote:


: >: I want to open a file (rpt1204.txt) and have it look for
: >: certain information to pull out (Date and time interval) and then print
: the
: >: output of the search to another document (rpt1204.out). If someone could
: >
: >
: >   I don't see anywhere in your code where you
: >   "print the output of the search".
: >
: >   Might that be the problem?
: >
: >


: >[ snip while() loop code that never writes to the OUTPUT filehandle. ]


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


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

Date: Wed, 30 Dec 1998 03:43:18 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Searching for Text
Message-Id: <ebohlmanF4rEC7.Ln2@netcom.com>

Robert Bruno <rbruno@blue-pumpkin.com> wrote:
: Here is the code I'm using currently.

: $theInputFile = 'C:\rpt1204.txt';
: open( INPUT, "<$theInputFile" ) or die "couldn't find file for writing\n";

: $theOutputFile = 'C:\rpt1204.out';
: open( OUTPUT, ">$theOutputFile" );

See Tad's corrections to the above.

: ($TodayDay, $TodayMonth, $TodayYear) = (localtime)[3, 4, 5];
: printf OUTPUT "Report Date: %02d/%02d/%02d\n", (($TodayMonth + 1),
: $TodayDay, $TodayYear);

Not planning on using this script for more than a year and two days, eh?  Or
is a line like "Report Date: 01/03/100" acceptable to you?  Go back and 
look at the documentation for localtime().  "Years since 1900" means 
exactly what it says.

: print OUTPUT "\n";

: while ( $theCurrentLine = <INPUT> )

If there's any possibility this script will be run on a version of Perl 
older than 5.005, change the loop condition to 
'defined($theCurrentLine=<INPUT>)'.

: {
:  if ( $theCurrentLine =~ /^\s+SUMMARY REPORT/ )
:  {
:   last;
:  }
:  elsif ( $theCurrentLine =~ /^\s+FROM \d\d:\d\d .. (...) (\d|\d\d),
: \d\d(\d\d)/ )
: {
:  $theCurrentDate = sprintf "%s/%02d/%s", $theMonths{$1}, $2, $3;
:  }
: .....

You've omitted too much code to diagnose the problem.  Where did 
%theMonths get set?  What are you doing in the rest of your loop?  Is 
that regex above literal, or did you omit part of it?

: }

: close( INPUT );
: close( OUTPUT );

: exit $returnCode;

You've omitted any of the code that does printing, so how do you expect 
us to help you figure out why it isn't printing right.



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

Date: Wed, 30 Dec 1998 02:37:03 GMT
From: lyle@visi.com (Lyle Merdan)
Subject: Solaris 2.6 Perl5.005_02 and h2ph problems for the aub script
Message-Id: <jlgi2.439$TO5.12317@ptah.visi.com>
Keywords: h2ph solaris 2.6 perl5.005_02 aub

I'm having trouble with the aub script. It says that it cannot find the 
sys/socket.ph.

Now to answer some anticipated questions:

Here is the output of perl -V:
# perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration:
  Platform:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    uname='sunos solaris 5.6 generic_105181-10 sun4m sparc sunw,sparcstation-5 '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='gcc', optimize='-O2', gccversion=2.8.1
    cppflags='-I/usr/local/include'
    ccflags ='-I/usr/local/include'
    stdchar='unsigned char', d_stdstdio=define, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries:
    ld='gcc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
    libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
    libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under solaris
  Compiled at Dec 29 1998 19:46:04
  @INC:
    /usr/local/lib/perl5/5.00502/sun4-solaris
    /usr/local/lib/perl5/5.00502
    /usr/local/lib/perl5/site_perl/5.005/sun4-solaris
    /usr/local/lib/perl5/site_perl/5.005
    .


I've also done the recommended command after install:
cd /usr/include
h2ph *.h sys/*.h

# find / -name socket.ph -print
/usr/local/lib/perl5/site_perl/5.005/sun4-solaris/sys/socket.ph

When I run aub I get the message about not being able to find sys/socket.ph.

Can anyone offer any help?

Lyle Merdan

lyle@visi.com


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

Date: Tue, 29 Dec 1998 22:35:23 -0800
From: "David Christensen" <nospam@nospam.com>
Subject: use diagnostics
Message-Id: <76chui$ano$1@pollux.dnai.com>

Hello, World!

I am running Perl 5.0 patchlevel 4 subversion 2 from "GNU Software
for MS-Windows and MS-DOS" on an NT4/SP4 box.  When I try to put
the statement "use diagnostics" into my Perl  program (ex10_1), I
get the following message:

couldn't find diagnostic data in
c:/djgpp/lib/perl5/pod/perldiag.pod d:/fsf/lib/perl5
d:/fsf/lib/perl5/site d:/fsf/lib/perl5/site . ex10_1 at
d:/fsf/lib/perl5/diagnostics.pm line 227, <POD_DIAG> chunk 531.
BEGIN failed--compilation aborted at ex10_1 line 3, <POD_DIAG>
chunk 531.

Any ideas?

David

--
PS  The above from/reply address is bogus to avoid spam.
    My username is dchrist, and my domain is dnai.com.





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

Date: Tue, 29 Dec 1998 23:04:00 -0500
From: "c.s." <cs2400@hotmail.com>
Subject: win32 install woes.   ( win98 )
Message-Id: <76c8uc$390$1@remarQ.com>

hello,

I am haveing trouble getting Perl to work on my machine.  I can run scipts
from the command line just fine, but i can't invoke them via a web server.

I have checked the FAQs, but I am somewhat new to this, so I may have missed
something.

My system:

Win98
Microsoft PWS.


The problem:

While installing perl (build 507 and 508), the installer complains several
times
that it "Cannot Access The IIS MetaBase.... continue installation ? y/n ".
I clicked "yes" to continue all of the times. (It also suggested that I
restart
the machine and try again, but this did not help.)

Perl was installed to c:\perl\bin. I am able to run scripts from
command line just fine, however the webserver did not seem to configured to
recognize perl yet.

At this point, I added the .pl(x) => "c:\perl\bin\perl.exe(perlIS.dll) %s
%s" keys to: HKLM\System\CurrentControlSet\Services\W3SVC\Parameters\Script
Map

Now, the server seems to call Perl, but one of two things will happen when I
try to request a script via the web server.

When requesting a ".pl" file:
The server seems to stall, returning no information to the browser. Hitting
"Ctrl-Alt-Delete" reveals that there is a process by the name of  "Perl"
running at the moment. Eventually, forcing this process to quit will cause
the server to send a generic CGI error to the browser.

When requesting a ".plx" file":    (perlIS.dll)
The server will return a page that says "One of the library files needed to
run this application cannot be found. "



Thank you for your time,
cs2400@hotmail.com







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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

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

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

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

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

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

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


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

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