[12141] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5741 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 21 09:09:45 1999

Date: Fri, 21 May 99 06:00:23 -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           Fri, 21 May 1999     Volume: 8 Number: 5741

Today's topics:
    Re: best way to database stuff using Perl? <jhecker@iago.nac.net>
        CGI : transferring a whole file <parpaille@chez.com>
        check pop3 with perl? <hkasten@abm-soft.de>
    Re: check pop3 with perl? <gellyfish@gellyfish.com>
    Re: Converting from octal to decimal <droby@copyright.com>
        Creating Files with a Perl script <unspecified@gs.com>
    Re: Creating Files with a Perl script <hove@ido.phys.ntnu.no>
        date conversion and comparison routines <cooperagent@my-dejanews.com>
    Re: date conversion and comparison routines <rra@stanford.edu>
    Re: eliminating lines in extracted text <rbbdsb@erols.com>
    Re: Extracting form fields <gellyfish@gellyfish.com>
    Re: File::Copy <vvb@ibm.net>
    Re: Formatting dates <gellyfish@gellyfish.com>
        RE: Help me to install Perl5,please <bakulin@eximb.kiev.ua>
    Re: Hiding OLE Object in Perl <matt-news@sergeant.org>
        How can i create a file ? <barnauld@online.fr>
    Re: How can i create a file ? <andy@focus-consulting.co.uk>
    Re: How can i create a file ? (Bob Trieger)
    Re: How to move a directory? (Bob Trieger)
        MacPerl and QuarkXPress??? <mats.pettersson@falukuriren.se>
    Re: Perl "constructors" <rra@stanford.edu>
    Re: Perl and Databases (Bill Peel)
    Re: Perl Unicode/Multibyte Support <matt-news@sergeant.org>
        Q: Problem with readdir on AIX <mathiaso@xlink.net>
    Re: Refresh a document in frame (Bob Trieger)
        Reverse dns lookup within mailform script <hughf@drcauto.com>
        Setting the env. / oraperl question <jhecker@iago.nac.net>
    Re: What's wrong with this hit counter? <ebohlman@netcom.com>
    Re: What's wrong with this hit counter? (Bob Trieger)
        where from download Oraperl for Windows? <chetan_gautam@hotmail.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Fri, 21 May 1999 12:59:50 GMT
From: Jared Hecker <jhecker@iago.nac.net>
Subject: Re: best way to database stuff using Perl?
Message-Id: <aNc13.726$kn3.17717@nntp1>

Jonathan Stowe <gellyfish@gellyfish.com> wrote:
> [ comp.lang.perl is dead - removed from groups ]

> <http://www.tcx.se/Manual_chapter/manual_Licensing_and_Support.html>

> For personal (Development use) both Informix SE and Sybase are free
> for the Linux platform - I dont know about Oracle.

For personal development, Oracle for Linux is available as a d/l or $4.95
for the CD fro Oracle.  Right now the current posted release is 8.0.5; 8i
(8.1.5) is due this month, supposedly.  Their Web App Server is available,
too.  

Regards,
jh
 -- 
Jared Hecker	| HWA Inc. - Oracle architecture and Administration
jared@hwai.com	|  ** serving NYC and New Jersey **


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

Date: Fri, 21 May 1999 14:03:24 +0200
From: bernard menez <parpaille@chez.com>
Subject: CGI : transferring a whole file
Message-Id: <37454B8C.4A886FD6@chez.com>

Hi all, I want to write a CGI script that would send back a binary file.

My problem is that I want to send it as a whole ... I do not want
something
like this :
@lines=<file>;
foreach $line (@lines)
{ print "$line"; }
I'm using a windows environment. If I was using Unix, I guess I could do

something like :
$data='cat file';
print "$data";
Could anyone tell me how I can do something like this ?
Thanks in advance.

    Bernard



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

Date: Fri, 21 May 1999 11:36:18 +0200
From: "Holger Kasten" <hkasten@abm-soft.de>
Subject: check pop3 with perl?
Message-Id: <7i39er$7ql$1@black.news.nacamar.net>

is there any known way, to check a pop3
account using a perl-script?




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

Date: 21 May 1999 12:52:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: check pop3 with perl?
Message-Id: <3745490e@newsread3.dircon.co.uk>

Holger Kasten <hkasten@abm-soft.de> wrote:
> is there any known way, to check a pop3
> account using a perl-script?
> 

There is a Net::POP3 module part of the libnet bundle available from CPAN


/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: Fri, 21 May 1999 12:28:38 GMT
From: Don Roby <droby@copyright.com>
To: Uri Guttman <uri@sysarch.com>
Subject: Re: Converting from octal to decimal
Message-Id: <7i3jhk$n10$1@nnrp1.deja.com>

[Posted and mailed]

In article <x7hfp77xsy.fsf@home.sysarch.com>,
  Uri Guttman <uri@sysarch.com> wrote:
>
> it must have been tricky to name a macro-11 function dec2bin since it
> had a 6 char limit on labels!
>

Indeed.  Guess the 2 must have been added by a faulty memory cell in my
aging brain.

> BTW, its macros could do things m4 and cpp still can't do!
>
> fondly remembering macro-11 (i wrote an rtos in it, among other
projects)
>

I didn't do anything that big.  Mainly at that time, I was maintaining
some awful inherited code for a few RSTS/E system utilities written in
a mix of NBS Pascal and Macro-11.  I'm not sure if those conversions
were things I actually used or something I just did for fun while
learning Macro-11.

I do remember making versions of those routines and some computation
routines with support for large numbers along the lines of Math::BigInt,
and that was definitely just for fun.

They're long gone now, along with the PDP-11/45 they rode in on.

--
Don Roby


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

Date: Fri, 21 May 1999 12:15:58 +0100
From: Nicholas Tettenborn <unspecified@gs.com>
Subject: Creating Files with a Perl script
Message-Id: <3745406E.64C4E1A8@gs.com>

I am sure this is some thing that i have completely overlooked but I
can't find out how to:

Create a new file with a script. I have no difficulty appending to files
and reading from them. I also have no problem changing permissions with
the scripts but this does stump me. Any help would be appreciated and if
poss could you mail to nicholas.tettenborn@gs.com as I don't get much
chance to read this group. although I should.

Thanks

Nicholas



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

Date: 21 May 1999 14:08:31 +0200
From: Joakim Hove <hove@ido.phys.ntnu.no>
Subject: Re: Creating Files with a Perl script
Message-Id: <k0nyaii62ww.fsf@ido.phys.ntnu.no>

Nicholas Tettenborn <unspecified@gs.com> writes:

[....]
> Create a new file with a script. I have no difficulty appending to files
> and reading from them. I also have no problem changing permissions with
> the scripts but this does stump me. 
[....]

Well, (1) at least when I read your post this was answered approx ten
messages above. (2) It already seems you know how to do it,

open(FILE ,">filename") || 
	die("Could not open filename for writing $!\n");

Will open the file for writing, creating a new one if it does not
exist.

But even though I have given you the answer now (misunderstood
kindness ??) check out :

perldoc -f open

Getting aquinted with the documentation which is already on your
system will make you a more efficient Perl-programmer,

HTH jh

-- 
=== Joakim Hove     www.phys.ntnu.no/~hove/    ======================
# Institutt for fysikk	(735) 93637 / 352 GF  |  Skoyensgate 10D    #
# N - 7034 Trondheim	hove@phys.ntnu.no     |	 N - 7030 Trondheim #
=====================================================================


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

Date: Fri, 21 May 1999 10:13:25 +0100
From: "David Phillips" <cooperagent@my-dejanews.com>
Subject: date conversion and comparison routines
Message-Id: <7i382u$8ep$1@newsreader3.core.theplanet.net>

folks,

Before I start reinventing wheels here, is there a set of routines
available, or can anyone point me at some sample code, for doing date
comparisons and conversions in perl on dates formatted as DD-MMM-YYYY and
DD-MMM-YY ?

I thank you

dave p.





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

Date: 21 May 1999 02:29:01 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: date conversion and comparison routines
Message-Id: <ylg14qdb4y.fsf@windlord.stanford.edu>

David Phillips <cooperagent@my-dejanews.com> writes:

> Before I start reinventing wheels here, is there a set of routines
> available, or can anyone point me at some sample code, for doing date
> comparisons and conversions in perl on dates formatted as DD-MMM-YYYY
> and DD-MMM-YY ?

I usually use Date::Format to convert them to Unix timestamps and do my
comparisons on that.  Alternatively you can use the much larger
Date::Manip module.  Both are found on CPAN (Date::Format being part of
the TimeDate package).

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Fri, 21 May 1999 08:21:40 -0400
From: "rbbdsb" <rbbdsb@erols.com>
Subject: Re: eliminating lines in extracted text
Message-Id: <7i3jef$9kv$1@autumn.news.rcn.net>

Thanks for the response.  I was just using the print as a sampe of some
code.  The code looks more like:

while (<InputFile>) {
# extents
    if (/Owner/ .. /System/) {
        next if(/Owner/);
        next if(/--/);
        next if(/System/);
        tr/,//d;
        ($ignore, $owner, $object, $type, $tablespace, $sizekb, $blocks,
        $extents, $maxextent, $nextextentsize) = split(/\s*\|\s*/);
        }

# DB backup
    if (/Backup function/ .. /^$/) {
        next if(/Backup/);
        next if(/--/);
        next if(/^$/);
        ($ignore, $backupfunction, $startbackup, $endbackup,
        $returncode, $detaillog) = split(/\s*\|\s*/);
        }
}

$inserth = $dbh->prepare("INSERT INTO extents(owner, object, type,
 tablespace, sizekb, blocks, extents, maxextent, nextextentsize)
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)");
$inserth->execute($owner, $object, $type, $tablespace, $sizekb,
 $blocks, $extents, $maxextent, $nextextentsize);

$inserth = $dbh->prepare("INSERT INTO dbbackup(backupfunction, startbackup,
endbackup, returncode, detaillog VALUES (?, ?, ?, ?, ?)");
$inserth->execute($backupfunction, $startbackup, $endbackup, $returncode,
$detaillog);

Sample data is:

 05/20/1998  11:25:28      Missing indices

----------------------------------------------------------------------------
--------------------------------------------------------------------------
----------------------------------------------------------------------------
--------------------------------------------------------------------------
| Missing database indices             | Indices not defined in DDIC
|
----------------------------------------------------------------------------
--------------------------------------------------------------------------


----------------------------------------------------------------------------
--------------------------------------------------------------------------
 05/20/1998  11:25:28      Database tables without unique indices

----------------------------------------------------------------------------
--------------------------------------------------------------------------
|Database tables without unique indices
|
----------------------------------------------------------------------------
--------------------------------------------------------------------------
Objects found:           0
----------------------------------------------------------------------------
--------------------------------------------------------------------------
 05/20/1998  11:25:28      Extents of Tables and Indices

----------------------------------------------------------------------------
--------------------------------------------------------------------------
| Owner      | Object         | Type       | Tablespace | KBytes          |
Blocks   | Extents  | MaxExtents  | Next   (K)  |
----------------------------------------------------------------------------
--------------------------------------------------------------------------
| USER1      | ANEK           | TABLE      | USERDATA  |            696  |
87  |      18  |        300  |         40  |
| USER1      | ANEP______0    | INDEX      | USERINDEX  |          1,456  |
182  |      10  |        300  |        160  |
| USER1      | ANKB           | TABLE      | USERDATA  |          1,440  |
180  |      22  |        300  |         40  |
| SYS        | SOURCE$        | TABLE      | SYSTEM     |          2,336  |
292  |      11  |        505  |      1,120  |
| SYS        | VIEW$          | TABLE      | SYSTEM     |          1,576  |
197  |      10  |        505  |        744  |
----------------------------------------------------------------------------
--------------------------------------------------------------------------
----------------------------------------------------------------------------
------------------
System               ORCL
Database, DB Server  ORACLE       hostname            Database Backup Logs
Available
Day, Time            05/20/1998   11:25:28
----------------------------------------------------------------------------
------------------

----------------------------------------------------------------------------
-------------
| Backup function  | Start of backup      | End of backup        | RC   | OS
log name   |
----------------------------------------------------------------------------
-------------
| full,offline,util| 04/28/1998 21:05:35  |                      | 9999 |
bcxfydad.aff  |
| full,online,util | 04/27/1998 22:00:03  | 04/27/1998 23:06:36  | 0000 |
bcxftkat.anf  |
| full,online,util | 04/26/1998 22:00:02  | 04/26/1998 22:41:33  | 0000 |
bcxfomfq.anf  |
----------------------------------------------------------------------------
-------------

David Cassell wrote in message <3743012B.E5B22F61@mail.cor.epa.gov>...
>rbbdsb wrote:
>>
>> Using the range operator, it is easy to extract lines that occur between
two
>> patterns, for example
>>
>> if (/foo/ .. /bar/) { print; }
>
>Right.  You can write this in current Perls as:
>
>    print if (/foo/ .. /bar/);
>
>And you can get everything except those pieces like this:
>
>    print unless (/foo/ .. /bar/);
>
>> It is also possible to exclude specific absolute lines by doing something
>> like:
>>
>> next line if (1 .. /^$/);   # skip header lines
>
>or:
>
>    print unless (1 .. /^$/);
>
>> What I need to do is eliminate a couple of header and trailer lines at
from
>> the extracted lines, but the absolute line numbers aren't known in
advance.
>> What is the most efficient way to do this?  Is pattern matching the only
>> option?
>
>That depends on how one knows where the header ends and the text
>begins (and similarly for the trailer).  If there is no way of
>describing the break, then there is no way of setting it up in
>code.  Do any of my suggestions above help?  If not, then
>perhaps you could post more info on your problem, along with
>a short program you've written that makes a first stab at it.
>
>HTH,
>David
>--
>David Cassell, OAO                     cassell@mail.cor.epa.gov
>Senior computing specialist
>mathematical statistician




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

Date: 21 May 1999 10:38:59 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Extracting form fields
Message-Id: <374529b3@newsread3.dircon.co.uk>

Jen <jenmei@my-dejanews.com> wrote:
> No, I want to use Perl for Web automation. Basically, we have a server
> that goes down ever once in a while, and I want to write a script that
> connects to it, logins, and does a simple look up -- just to check
> that the Web server, the app. server, and the database server are all
> working.
> 
> Just a simple get for the first page, change some form fields, then a
> post, change some form fields, then another post. Real easy stuff.
> 

You will want to use the LWP::UserAgent module that is part of the 
libwww-perl module available from CPAN - it comes with fine documentation
so I wont bore everyone else here with an example ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: Fri, 21 May 1999 14:10:54 +0200
From: "Vincent Vanbiervliet" <vvb@ibm.net>
Subject: Re: File::Copy
Message-Id: <37453dfc@news.uk.ibm.net>


RG <roland@oco.net> wrote in message news:3744A3C6.4E7FDFCD@oco.net...
> I've been away from Perl programming for a little while, and I need to
> refresh my knowledge on the modules used. Do I need to install a
> file::copy module in the perl files in my perl/bin directory for
> file::copy to work properly.
>
> Thanks in advance
> Roland
> Executive Producer
> Radiowave Internet
> roland@oco.net
>
If you have the latest Perl version, you should have the module in your
perl/lib directory.

Vincent




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

Date: 21 May 1999 11:12:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Formatting dates
Message-Id: <37453176@newsread3.dircon.co.uk>

Jen <jenmei@my-dejanews.com> wrote:
> Is there an easy way to do this? I've read about the existence of a
> Date::Format module, but have not been able to find it anywhere. I can
> write my own, but it just sounds like this is something someone has
> already done.

You can use the Date::Format module (it is vailable from CPAN) however
if all you want you want to do is produce the occasional 'dd/mm/yyyy' type
date from a time value you could be just as well off making your own.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>



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

Date: Fri, 21 May 1999 13:28:34 +0300
From: "Boris Bakulin" <bakulin@eximb.kiev.ua>
Subject: RE: Help me to install Perl5,please
Message-Id: <2.07b3.OIIR.FC2VRM@eximb.kiev.ua>

I try to install Perl5 second day and I'm tierd.

1 SCO UNIX
2 very new in perl
3 version of perl is P500503
4 inside directory  /P500503 start 'sh configur'
5 answer
Sorry, I can't seem to locate the source dir for perl5.  Please start
Configure with an explicit path -- i.e. /some/path/Configure.


Please      Boris




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

Date: Fri, 21 May 1999 12:33:41 +0100
From: Matt Sergeant <matt-news@sergeant.org>
Subject: Re: Hiding OLE Object in Perl
Message-Id: <37454495.EC6B39FD@sergeant.org>

kgentes@gentek.net wrote:
> 
>  why I am not instantiating
>      the OLE Excel object on my work PC?

I don't know - what error do you get when you run it with -w ?


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

Date: Fri, 21 May 1999 09:54:02 GMT
From: XX <barnauld@online.fr>
Subject: How can i create a file ?
Message-Id: <374549B1.331E1424@online.fr>

I want to create a file with my perl sript and enter some data into this
file.
How can i do that ?
Thank you.



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

Date: Fri, 21 May 1999 11:40:15 +0100
From: Andy Mendelsohn <andy@focus-consulting.co.uk>
Subject: Re: How can i create a file ?
Message-Id: <3745380F.9C4E12A9@focus-consulting.co.uk>

XX wrote:
> 
> I want to create a file with my perl sript and enter some data into this
> file.
> How can i do that ?
> Thank you.

TIMTOWTDI


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

Date: Fri, 21 May 1999 11:21:42 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: How can i create a file ?
Message-Id: <7i3e67$d8r$2@oak.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
XX <barnauld@online.fr> wrote:
>I want to create a file with my perl sript and enter some data into this
>file.
>How can i do that ?

you open a filehandle to it.
you print to the filehandle.
you close the filehandle.

check out the documentation for the specifics.

perldoc -f open
perldoc -f print
perldoc -f close



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

Date: Fri, 21 May 1999 10:27:54 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: How to move a directory?
Message-Id: <7i3b1f$8vh$1@oak.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
lee.lindley@viasystems.com wrote:
>Hans-Georg Rist <hans-georg@rist.net> wrote:
>:>"Jalil Feghhi" <jalil@corp.home.net> wrote:
>
>:>>I also noticed that rename does not work accross file system boundaries or
>:>>network, which is what I want
>:>>
>:>>Is there any perl function or module that can help me with that? Or, should
>:>>I write my own function and move all the files one by one?
>
>:>use File::Copy;
>
>Doesn't preserve file ownership or permissions.  That wasn't part
>of the requirements of the original post, but..
>
>From a shell I do something like this
>
>cd FROM_DIR
>tar cf - . | (cd TO_DIR; tar xpf -)
>
>You can do that with a system command in a perl program, but checking
>for success or failure is kind of hard.  

I use this on Solaris:
system "cp -rpf $old_dir $new_dir";

I am still looking for a way to do it in perl without the system 
command and am growing less optimistic about it.

I'd really love to be able to preserve the read-only flag from Solaris 
to Win32.




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

Date: Fri, 21 May 1999 14:40:59 +0200
From: Mats Pettersson <mats.pettersson@falukuriren.se>
Subject: MacPerl and QuarkXPress???
Message-Id: <3745545B.95698573@falukuriren.se>

Hi!

I'm currently trying to do a apple-script for QuarkXPress. However
expressions isn't apple-scripts greatest strength, so i thought i should
try MacPerl.

I couldn't find any info how to intergrate apple-script with perl or if
it is possible in any way.

Anybody tried scripting Quark with perl, or if somone could point me to
any similar information.

Thank's

Mats


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

Date: 21 May 1999 02:27:49 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Perl "constructors"
Message-Id: <yliu9mdb6y.fsf@windlord.stanford.edu>

armchair <armchair@my-dejanews.com> writes:

> my $scalar = myObject->ReturnSomething();

> what does $scalar hold at this moment zenin, number, string or
> reference?

If you already know what *specifically* that method returns (someone's
name, tomorrow's date, an open connection to a server), then you already
have more and better information than that and don't need to care.

If you don't even know what type of information myObject->ReturnSomething
is supposed to return, you have much larger problems and need to read the
documentation of myObject, wherever that may be found.  Knowing whether
it's a number, string, or reference won't be enough information to write
code anyway.

So in other words, knowing *only* whether something is a number, a string,
or a reference is worthless information by itself.  There's therefore no
reason to force it to be derivable from the semantics of the language.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Fri, 21 May 1999 10:08:49 GMT
From: W.Peel@mmu.ac.uk (Bill Peel)
Subject: Re: Perl and Databases
Message-Id: <37452ff8.6763695@news.mmu.ac.uk>

Get Dave Roth's Win32::ODBC module and then look at the tutorial at
the URL:

http://www.netaxs.com/~joc/perl/article/Article.html

Using this I was pulling data from an Access database using Perl
within 5 minutes.

Bill Peel


On Wed, 19 May 1999 22:07:38 GMT, "Jalil Feghhi" <jalil@corp.home.net>
wrote:

>Is there any database module in Perl (other that dbm)? For example, any way
>to interface with an Access (or any other) database on Windows?
>
>Thanks,
>
>-Jalil
>
>
>



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

Date: Fri, 21 May 1999 10:07:20 +0100
From: Matt Sergeant <matt-news@sergeant.org>
Subject: Re: Perl Unicode/Multibyte Support
Message-Id: <37452248.272384F9@sergeant.org>

Ilya Zakharevich wrote:
> 
[snip "use utf8"]

> Keep in mind that apparently *nobody* did ever tried to use it
> (judging by the obvious bugs I see in the implementation, and a
> complete absense of bug reports).

Probably due to the fact that it's not in the perl people use yet. For
example, judging by the TPI survey, almost 40% of perl users are on NT,
for which there is no Beta-perl binary build available. I'm sure in
reality very few people are using 5.005_[5..9]\d

Once it becomes the standard perl, expect lots of bug reports from the
XML people... :)

Matt.


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

Date: Fri, 21 May 1999 11:55:07 +0200
From: Mathias Ochsendorf <mathiaso@xlink.net>
Subject: Q: Problem with readdir on AIX
Message-Id: <Pine.GSO.3.95.990521112740.12220E-100000@xlink105.xlink.net>

Hi,

I have problems with directory related perl functions on AIX 4.2:
When I use readdir to find a given file, there are sometimes very 
strange outputs:

 >o44config905o0 
instead of >config

I tried to install the latest version of Perl perl5.005_03, 
but it failed:
>op/readdir..........FAILED test 3
>lib/dirhand.........FAILED tests 2-4
>lib/dosglob.........FAILED tests 2-3
>lib/filefind.t ......FAILED tests 1-2

Can anyone give me a hint ??

Thanks,
Mathias Ochsendorf
-------------------------------------------------------------
FH-Furtwangen: Computer Networking  
eMail:         mathias@ochsendorf.de  



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

Date: Fri, 21 May 1999 10:35:31 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Refresh a document in frame
Message-Id: <7i3bfk$8vh$2@oak.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
karpat@eeh.ee.ethz.ch wrote:
>Could somebody help me with such small problem:
>I have two frames, the user fills a form in the first frame, on the base
>of his input I add something to the document, which is seen in the
>second frame. Can I make browser to refresh the second frame?

Perl doesn't do frames, perhaps you are seeking:

rec.wood-working or comp.infosystems.www.authoring.cgi



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

Date: Fri, 21 May 1999 22:20:53 +1000
From: "Hugh Fox" <hughf@drcauto.com>
Subject: Reverse dns lookup within mailform script
Message-Id: <Acc13.5116$vM1.5211@ozemail.com.au>

I'm a REAL newbie at this, and I may (probably) not be in the right
newsgroup.

My new webhost uses FormMail from Matts Script Archive, which does
everything very well. My problem is that by default the webhost does not get
the REMOTE_HOST variable. I want to get it so I know more about who is
mailing me.

Is there a snippet of code I can put into MailForm which would use
REMOTE_ADDR (which is reported) to lookup REMOTE_HOST?

I've found a snippet whch uses gethostbyaddr

if (($ENV{'REMOTE_HOST'} eq $ENV{'REMOTE_ADDR'}) && ($ENV{'REMOTE_ADDR'} =~
/(\d+)\.(\d+)\.(\d+)\.(\d+)/))
        {
        $Address = pack('C4', $1, $2, $3, $4);
        $DNS_Address = (gethostbyaddr($Address, 2))[0];
        $ENV{'REMOTE_HOST'} = $DNS_Address if $DNS_Address;
        }
$ENV{'REMOTE_HOST'} =~ tr/[A-Z]/[a-z]/;

unfortunately the webhost doesn't have this command. They do have nslookup
if that helps.

Can anybody help me, or point me in the right direction?




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

Date: Fri, 21 May 1999 12:56:28 GMT
From: Jared Hecker <jhecker@iago.nac.net>
Subject: Setting the env. / oraperl question
Message-Id: <0Kc13.725$kn3.17717@nntp1>

Hi -

I am planning a script that will have to:

1. select info from an oracle database (via oraperl - I know how to do
this), then

2. change an environmental variable and do some work (loop iteration 1,
ENV=xxx, run scripts; loop iteration 2, ENV=yyy, run scripts; etc.).

My question is, when I set an environmental variable from perl and then
use a system call to run another app (in this case SQL*Plus), does the
environmental variable setting hold for the called app's environment?

(If it's convenient, e-mail will reach me faster.)

TIA -

Regards,
jh
-- 
Jared Hecker	| HWA Inc. - Oracle architecture and Administration
jared@hwai.com	|  ** serving NYC and New Jersey **


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

Date: Fri, 21 May 1999 09:43:06 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: What's wrong with this hit counter?
Message-Id: <ebohlmanFC2tnv.1D7@netcom.com>

Felix <felixtse@crosswinds.net> wrote:
: This is a hit counter.
: I have 10 pics called count0-9.gif, and a log file called counter.log
: contain "0".

The answer to the question in your subject: line is "just about everything."

: Code:
: #!usr/bin/perl

Missing -w
Missing "use strict;"

: open(LOG,"counter.log");

Missing check of open status.

In CGI code, you should specify the *full* path to any files you're 
using; remember that the Web server is the user running the script, and 
its idea of the current directory often won't be what you're expecting.

: while(<LOG>){
: chomp;
: $count=$_;
: }

Use of a loop to read a single line

<block>
: if $count>=10000{}
: elseif $count>=1000{
: $digits[0]=0;
: }
: elseif $count>=100{
: $digits[0,1]=(0,0);
: }
: elseif $count>=10{
: $digits[0,1,2]=(0,0,0);
: }
: else{
: $digits[0,1,2,3]=(0,0,0,0);
: }
: i=4;
: while($count>0){
: $digits[i]=substr($count,1-,1);

This is syntactically illegal.  Either your code won't even compile, or 
you've retyped the whole thing rather than cutting and pasting.

 : $count=($count-digit[i])/10;
: i--;
: }
</block>

Everything in between <block></block> is an overly complex way of doing:

@digits=split(//,sprintf("%05d",$count));

This will leave @digits with the *characters* '0,',...,'9' rather than 
the *numbers* 0,...,9, but that won't be a problem; read on.

: print "Content-type:text/html\n\n";
: print "<Html>";
: print "<Head>";
: print "<Title>Hit counter</Title>";
: print "</Head>";
: print "<Body>";
: print "<p>";

Use a here-document instead of all these print statements.

<block>
: for(j=0;j<5;j++){
: print "<Img Src=\"count$digit[j].gif\" Alt=\"Hit Counter\" Width=\"20\"
: Height=\"30\">";
: }
</block>

replace with:
  foreach my $digit (@digits) {
    print qq(<img src="count$digit.gif" alt="" width="20" height="30">);
  }

1) Using the qq quote operator, as described in perlop, eliminates the 
need to backwhack every single quote.

2) Things like graphical hit counters should have empty alt values since 
they're non-essential and the information can't be conveyed textually; 
someone using Lynx, for example, really doesn't need to see:

[Hit Counter][Hit Counter][Hit Counter][Hit Counter][Hit Counter]

: print "</p>;
: print "</Body>";
: print "</Html>";

Your code merely displays the value stored in the counter file, but 
doesn't increment it.  I'd suggest reading perlfaq5 before trying to 
implement the increment, since you're going to have to do some 
concurrency control using file locking unless you want your counter to 
get randomly reset.



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

Date: Fri, 21 May 1999 11:18:23 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: What's wrong with this hit counter?
Message-Id: <7i3e01$d8r$1@oak.prod.itd.earthlink.net>

[ courtesy cc sent by mail if address not munged ]
     
Felix <felixtse@crosswinds.net> wrote:
>This is a hit counter.
>I have 10 pics called count0-9.gif, and a log file called counter.log
>contain "0".
>
>Code:
>#!usr/bin/perl

No -w switch in shbang line!

>open(LOG,"counter.log");

Not checking for status of the open.

open LOG,'counter.log' or die "Gosh darn it: $!";

>while(<LOG>){

No need for while, this should be no more than 1 line!

chomp($count = <LOG>)

>chomp;
>$count=$_;
>}
>if $count>=10000{}
>elseif $count>=1000{
>$digits[0]=0;
>}
>elseif $count>=100{
>$digits[0,1]=(0,0);
>}
>elseif $count>=10{
>$digits[0,1,2]=(0,0,0);
>}
>else{
>$digits[0,1,2,3]=(0,0,0,0);
>}
>i=4;
>while($count>0){
>$digits[i]=substr($count,1-,1);
>$count=($count-digit[i])/10;
>i--;
>}

All of these if/esle statements are a waste of time and space. If you 
just want to pad a number with zeroes, use the sprintf function.

$count = sprintf "%05d",$count;
@count = split '',$count;

>print "Content-type:text/html\n\n";
>print "<Html>";
>print "<Head>";
>print "<Title>Hit counter</Title>";
>print "</Head>";
>print "<Body>";
>print "<p>";
>for(j=0;j<5;j++){

foreach (@count) {

>print "<Img Src=\"count$digit[j].gif\" Alt=\"Hit Counter\" Width=\"20\"
>Height=\"30\">";

get those ugly backwhacks out of there. use the qq quote operator and 
you won't need the little whackers.

        print qq(<Img Src="count$digit[$_].gif" Alt="Hit Counter" 
Width="20" Height="30">)

>}
>print "</p>;
>print "</Body>";
>print "</Html>";

HTH



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

Date: Fri, 21 May 1999 11:09:04 GMT
From: CHETAN <chetan_gautam@hotmail.com>
Subject: where from download Oraperl for Windows?
Message-Id: <7i3esg$jui$1@nnrp1.deja.com>



hello,

where from can I download Oraperl for Windows 95/NT ?

all the informations are appreciated.
Thanks
regards
cg


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---


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

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

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