[9703] in Perl-Users-Digest
Resend: Perl-Users Digest, Issue: 3297 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 1 18:47:26 1998
Date: Sat, 1 Aug 98 15:39:05 -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 Sat, 1 Aug 1998 Volume: 8 Number: 3297
Today's topics:
Re: Digital UNIX arithmetic problem ? (Stephen McCamant)
Re: Digital UNIX arithmetic problem ? (M.J.T. Guy)
Re: Dup STDERR to STDOUT under NT? (Tye McQueen)
Editing large ASCII DB <support@ichat.com>
Emacs and CPerl <nguyend7@cse.msu.edu>
Re: Emacs and CPerl (Jan Dubois)
Re: Emacs and CPerl (Ilya Zakharevich)
Re: emacs environment nospam@nospam.nl
END { close(STDOUT) || die "can't close stdout: $!" } <mgregory@asc.sps.mot.com>
Re: END { close(STDOUT) || die "can't close stdout: $!" (Ilya Zakharevich)
Re: END { close(STDOUT) || die "can't close stdout: $!" (M.J.T. Guy)
Re: END { close(STDOUT) || die "can't close stdout: $!" <walter@wbriscoe.demon.co.uk>
Re: Error message -- Newbie question <support@ichat.com>
Re: Error message -- Newbie question (Tad McClellan)
Re: file system operations on open files <marcelo.meira@waii.ERASETHIS.com>
Re: filehandles behaviour <quednauf@nortel.co.uk>
gethostbyname <akarandi@pcocd2.intel.com>
Re: gethostbyname (Nem W Schlecht)
Re: Good Book? <tchrist@mox.perl.com>
Re: Good Book? (Steve Linberg)
Gzip on non *nix platform <jerryp.usenet@connected.demon.co.uk>
Re: Gzip on non *nix platform <bowlin@sirius.com>
Help NEEDED!!!! <dragotom@mail.datanet.hu>
Re: Help with environment variables (Mark-Jason Dominus)
Re: Help with environment variables <guillaume@nospam.com>
Re: HELP: Convert files using OLE in Perl (Jan Dubois)
hex char vano0023@tc.umn.edu
Re: hex char (Craig Berry)
Re: hex char (Gabor)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 1 Aug 1998 04:32:25 GMT
From: stephen@alias-2.pr.mcs.net (Stephen McCamant)
Subject: Re: Digital UNIX arithmetic problem ?
Message-Id: <slrn6s56h7.do.stephen@alias-2.pr.mcs.net>
On 30 Jul 1998 19:45:19 GMT, Martin Pensak, Martin.J.Pensak@usa.dupont.com
<pensakmj@esalp1.es.dupont.com> wrote:
>I have a wierd problem:
>attempting to install Perl (any version) on my workstation fails,
>and I have narrowed down the failure to the following test program:
>
>cat test2
>$foo = int(7.5);
>print "$foo\n"
>
>./miniperl test2
>6.9990234375
>
>Clearly, the answer should be "7", and most systems produce that.
>I'm on a Digital (Compaq?) AlphaStation 255/233,
>running Digital Unix 4.0D, with the latest consolidated patch kit installed
>(duv40das00001-19980312.tar).
>
>I've tried several other systems, including DUnix 4.0D without the patch kit,
>and it works fine everywhere else.
>
>Did the patch kit break it ? Or do I have a subtle hardware failure
>in my workstation ? Trying to narrow this down, I'd appreciate hearing
>about anyone else's experience with Perl on recent versions of Digital Unix.
>
>Think about this carefully -- this is not just the usual problems
>of rounding float point numbers -- Perl clearly still believes
>that the variable contains a floating point number, not an integer,
>or it would print it out with NO decimal point, no digits below the decimal.
>(Other systems print "7", not "7.0000")
>
>So what I think I have is an error in data TYPE, not the data Value.
>I haven't figured out how to duplicate this test in another language -
>such as C, because it is strongly data-typed.
>
>Color me baffled. Any ideas appreciated. Thanks.
I don't think your conclusion that it's a type error follows, since perl
never adds trailing zeroes to a number when you print it that way. Also,
perl's type logic is unlikely to break in a close-but-not-quite way.
The following C program duplicates the way perl implements the int()
function; I would guess it will show the same problem perl does.
#include <math.h>
main() {
double d = 7.5;
modf(d, &d);
printf("%g\n", d);
}
Note that 6.9990234375 = 7 - 2**10.
--
____________________________________________________________
Stephen McCamant ======== alias@mcs.com (finger for PGP key)
------------------------------
Date: 1 Aug 1998 12:29:07 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Digital UNIX arithmetic problem ?
Message-Id: <6pv1mj$3d5$1@pegasus.csx.cam.ac.uk>
Martin.J.Pensak@usa.dupont.com <pensakmj@esalp1.es.dupont.com> wrote:
>Think about this carefully -- this is not just the usual problems
>of rounding float point numbers -- Perl clearly still believes
>that the variable contains a floating point number, not an integer,
>or it would print it out with NO decimal point, no digits below the decimal.
>(Other systems print "7", not "7.0000")
Perl doesn't work like that. It just has "numbers", and stores them
internally as integers or floats (or both) according to convenience.
For example, try
perl -wle '$_=7.00000; print'
which will print `7'.
>So what I think I have is an error in data TYPE, not the data Value.
>I haven't figured out how to duplicate this test in another language -
>such as C, because it is strongly data-typed.
Perl simply uses the underlying C arithmetic operations. So you have
a broken underlying C. (Note that the incorrect value differs from
the correct one by a 1 bit value.)
Mike Guy
------------------------------
Date: 29 Jul 1998 01:26:30 -0500
From: tye@fumnix.metronet.com (Tye McQueen)
Subject: Re: Dup STDERR to STDOUT under NT?
Message-Id: <6pmfam$ree@fumnix.metronet.com>
) Jeremy Mortimer <mortimer@ifrc.org> wrote:
) : open(STDERR, ">&STDOUT");
)
) : My Perl is the Activeware port on Windows NT, and it just writes to a
) : file called STDOUT. Am I doing something really dumb, or is this a
) : problem with NT? Either way, what can I do about it?
Dan Nguyen <nguyend7@egr.msu.edu> writes:
)
) Unfortunately you are doing something dumb. Perl thinks your trying
) to open a file called STDOUT.
Go read your perl documentation. The "&" in ">&STDOUT"
means that "STDOUT" is a file handle and _not_ a file name.
A better response might be "Unfortunately you are doing something
dump. You are using an old ActiveState port of Perl". Whether
using a new ActiveState build (not "port") of Perl is a good idea
or not is still open for debate.
) *STDERR = *STDOUT;
Yuck!
) Any time you refer to STDERR it'll go to STDOUT. However for some
) reason, which I'm not sure of 'warn' will still print to STDERR.
Yes, because you didn't dup {see "man dup" on a Unix system]
STDERR. You have left stderr open and just clobbered the
perl variable used to refer to it within the script. Not
really a good idea.
The original code was correct.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: Fri, 31 Jul 1998 12:20:03 -0500
From: John Warner <support@ichat.com>
Subject: Editing large ASCII DB
Message-Id: <35C1FCC3.501FB955@ichat.com>
I am currently working on editing a large ASCII file that
contains the contents of a Ctree database. I have seen
posts in this group where the entire file was read into
memory, edited, then written to disk. Unfortunately, this
will not work in my case as I am dealing with several
hundred thousand records.
Each user record looks something like the following in the
ASCII file:
begin username
attribute1: some-value
attribute2: some-value
...
attributen: some-value1,some-value2,....,some-valuen
...other attributes...
end
What I am trying to accomplish is to delete the values
listed in csv for attributen. I know I can use
$string =~ s/^attributen: (.*)//
to remove the values from attributen. (In actuality, I need
to delete only certain values from attributen but that's
another story.) My questions are: How do I index a plain
ASCII file to have Perl write to the exact place I need to
update? Is there a better way to do this?
John Warner
Acuity Technical Support
http://www.acuity.com
------------------------------
Date: 31 Jul 1998 15:59:47 GMT
From: Dan Nguyen <nguyend7@cse.msu.edu>
Subject: Emacs and CPerl
Message-Id: <6psplj$e29$1@msunews.cl.msu.edu>
Hi,
I like using CPerl-mode with Emacs. However the tabs are set to 2. I
know if I can change to PerlStyle with M-x cperl-set-style. But how
can I get my .emacs file to do it everytime.
-dan
--
Dan Nguyen | There is only one happiness in
nguyend7@msu.edu | life, to love and be loved.
http://www.cse.msu.edu/~nguyend7 | -George Sand
------------------------------
Date: Fri, 31 Jul 1998 20:53:56 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: Emacs and CPerl
Message-Id: <35c810ee.132983660@news2.ibm.net>
[Mailed & Posted]
Dan Nguyen <nguyend7@cse.msu.edu> wrote:
>I like using CPerl-mode with Emacs. However the tabs are set to 2. I
>know if I can change to PerlStyle with M-x cperl-set-style. But how
>can I get my .emacs file to do it everytime.
(setq cperl-indent-level 4)
-Jan
------------------------------
Date: 31 Jul 1998 20:53:05 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Emacs and CPerl
Message-Id: <6ptarh$sjp$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Jan Dubois
<jan.dubois@ibm.net>],
who wrote in article <35c810ee.132983660@news2.ibm.net>:
> [Mailed & Posted]
>
> Dan Nguyen <nguyend7@cse.msu.edu> wrote:
>
> >I like using CPerl-mode with Emacs. However the tabs are set to 2. I
> >know if I can change to PerlStyle with M-x cperl-set-style. But how
> >can I get my .emacs file to do it everytime.
>
> (setq cperl-indent-level 4)
No, this would not set other differences of styles. Unless somebody
finds a way to do it without hooks, I see a need for a new variable,
as in (setq cperl-use-style "PerlStyle").
The drawback is that all the customization to separate variables will
be lost... Any idea?
Ilya
------------------------------
Date: Fri, 31 Jul 1998 22:09:48 GMT
From: nospam@nospam.nl
Subject: Re: emacs environment
Message-Id: <35c2400c.18816198@news.xs4all.nl>
On Thu, 23 Jul 1998 13:39:51 +0200, Luc Derrendinger
<derrendinger@ito.umnw.ethz.ch> wrote:
>Hi,
> I tried to run perl under emacs, with a script containing the
><STDIN> input, but
>I can not make it work. Does anybody have an idea how to?
>Thanks for any info,
> Luc
>
What I do is use a small emacs Lips function, which feeds the region
or in this example the entire buffer into a perl script, and replaces
the current buffer with stdout:
(defun jj-make-readable ()
"Converts buffer to readable format."
(interactive)
(message "Making readable; please wait...")
(call-process-region (point-min) (point-max)
"c:/bat/makereadable.bat" t t)
(goto-char (point-min))
(message nil)
)
excuse the OS (Win32), but you can replace the batch file with a
direct perl script (my bath fil \e calls several perls scripts).
Hope this helps.
Hermen Lesscher
Hermenlesscher@yahoo.com
------------------------------
Date: 31 Jul 1998 10:52:32 +0930
From: Martin Gregory <mgregory@asc.sps.mot.com>
Subject: END { close(STDOUT) || die "can't close stdout: $!" }
Message-Id: <r8yatalspz.fsf@asc.sps.mot.com>
Some time ago someone posted the above as a tip for robustly ending a
filter that writes to STDOUT, implying that this would somehow give
you a better warning if a disk filled.
Now that I think about it I wonder to myself: why doesn't perl do that
anyhow?
(And, by implication, under what circumstances would I _not_ want the
above in my programs?)
Martin.
------------------------------
Date: 31 Jul 1998 19:47:13 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: END { close(STDOUT) || die "can't close stdout: $!" }
Message-Id: <6pt701$kd3$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Martin Gregory
<mgregory@asc.sps.mot.com>],
who wrote in article <r8yatalspz.fsf@asc.sps.mot.com>:
>
> Some time ago someone posted the above as a tip for robustly ending a
> filter that writes to STDOUT, implying that this would somehow give
> you a better warning if a disk filled.
>
> Now that I think about it I wonder to myself: why doesn't perl do that
> anyhow?
>
> (And, by implication, under what circumstances would I _not_ want the
> above in my programs?)
If you have several Perl interpreters running, or are embedded?
STDOUT is a shared resource.
Ilya
------------------------------
Date: 31 Jul 1998 23:09:46 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: END { close(STDOUT) || die "can't close stdout: $!" }
Message-Id: <6ptirq$iod$1@pegasus.csx.cam.ac.uk>
Martin Gregory <mgregory@asc.sps.mot.com> wrote:
>
>Some time ago someone posted the above as a tip for robustly ending a
>filter that writes to STDOUT, implying that this would somehow give
>you a better warning if a disk filled.
>
>Now that I think about it I wonder to myself: why doesn't perl do that
>anyhow?
>
>(And, by implication, under what circumstances would I _not_ want the
>above in my programs?)
If you're thinking that way, you probably want warning messages on
*all* implicit closes. Some time back, I rather half-heartedly
suggested that on perl5-porters. I don't remember it attracting
much interest.
Mike Guy
------------------------------
Date: Fri, 31 Jul 1998 22:02:47 +0100
From: Walter Briscoe <walter@wbriscoe.demon.co.uk>
Subject: Re: END { close(STDOUT) || die "can't close stdout: $!" }
Message-Id: <NhNWQbA3Djw1Ew$X@wbriscoe.demon.co.uk>
I can't produce chapter and verse on this but seem to recall reporting
perl's behaviour in this matter as a bug. Unfortunately, it is typical
of much UNIX software. Shells handle inputs wonderfully. Failure
handling on accessing file descriptors leaves a lot to be desired. After
a few embarrassing failures, I am more cautious than I used to be. A
command line flag could hit the spot. (The one which flags use of
uninitialised data seem an obvious candidate. Sorry I am sending this
from a box where I don't have Perl.)
In article <r8yatalspz.fsf@asc.sps.mot.com>, Martin Gregory
<mgregory@asc.sps.mot.com> writes
>
>Some time ago someone posted the above as a tip for robustly ending a
>filter that writes to STDOUT, implying that this would somehow give
>you a better warning if a disk filled.
>
>Now that I think about it I wonder to myself: why doesn't perl do that
>anyhow?
>
>(And, by implication, under what circumstances would I _not_ want the
>above in my programs?)
>
>Martin.
--
Walter Briscoe
------------------------------
Date: Fri, 31 Jul 1998 12:31:24 -0500
From: John Warner <support@ichat.com>
Subject: Re: Error message -- Newbie question
Message-Id: <35C1FF6B.A2ACDC50@ichat.com>
Try using something like the following
print "Content-type: text/html\n\n";
print <<END;
<html>
<head>
...other HTML...
</html>
END
You should also make sure that your Perl lib directory is in your path
to ensure that IIS will be able to locate your PerlIS.dll. This may not
apply to IIS 3 since it uses only Registry entries but it is necessary
for IIS 4.
John Warner
Acuity Technical Support
http://www.acuity.com
T. Carrier wrote:
> Hello,
>
> I am trying to get Perl do some form processing for me. But I keep
> receiving the the following error message when I click on the submit
> button on the form:
>
> 'C:\Inetpub\wwwroot\test.pl' script produced no output
>
>
> [...stuff omitted...]
>
> Thanks for any help.
> Tom Carrier
> carriert@bit-net.com
------------------------------
Date: Fri, 31 Jul 1998 15:52:29 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Error message -- Newbie question
Message-Id: <dqatp6.sse.ln@localhost>
John Warner (support@ichat.com) wrote:
: Try using something like the following
: print "Content-type: text/html\n\n";
: print <<END;
: <html>
: <head>
: ....other HTML...
: </html>
: END
Or if you don't like a lot of typing:
print <<END;
Content-type: text/html
<html>
<head>
....other HTML...
</html>
END
;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 30 Jul 1998 08:47:00 -0500
From: "Marcelo L. Meira" <marcelo.meira@waii.ERASETHIS.com>
Subject: Re: file system operations on open files
Message-Id: <35C07954.A90BD6F0@waii.ERASETHIS.com>
Larry Rosler wrote:
>
> [Posted to comp.lang.perl.misc and copy mailed.]
>
> In article <6pnnim$gra$1@monet.op.net> on 29 Jul 1998 13:53:26 -0400,
> Mark-Jason Dominus <mjd@op.net> says...
> > In article <35BF558B.2BAE83D5@waii.ERASETHIS.com>,
> > Marcelo L. Meira <marcelo.meira@waii.ERASETHIS.com> wrote:
> > >Sorry, my fault for not reading the cross-post info. I read the article
> > >from comp.unix.programmer, and also I saw the mention to /etc/passwd, so
> > >I assumed Unix was the (only) OS in question here.
> >
> > It is. Ilya was making a joke. Larry is just confused.
>
> Each of those three statements is wrong.
>
> A false statement was made here, that it is 'portable' to unlink or
> rename a file while it is open. Both Ilya and I attempted to correct it.
> The fact that the example happened to refer to /etc/passwd is irrelevant
> to the misstatement on portability.
>
No, I think YOU do not grasp the context of the situation. Or simply
refuse to do so.
I read this post from comp.unix.programmer - I do not follow
comp.lang.perl.* since I don't give a damn about that language; I failed
to notice the cross-post info (as I have apologized before); There was a
mention to the /etc/passwd file, which reenforce the Unix nature of the
question. Then I made a *CORRECT* statement that unlink() etc opened
files IS portable - across UNIX environments - since I was assuming that
this was the case.
Usually, portability in c.u.p refers to POSIX portability.
----------------
Marcelo L. Meira, Programmer
spam bait: postmaster@localhost
e-mail: marcelo.meira at waii dot com
Western Geophysical - (713) 689-2679
"UNIX _IS_ user friendly; it's just picky about who its friends are."
------------------------------
Date: Thu, 30 Jul 1998 14:29:32 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: filehandles behaviour
Message-Id: <35C0753C.A6EC97A@nortel.co.uk>
Gil Brown wrote:
>
>
> my $line = <$fh>;
> My question is in the first example , after I say my $line=<$fh> if I don't
> follow with print "$line" I don't get the first line of the file but I get
> everything else. Why??
Because you defined $line with the first line of the file.
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: Fri, 31 Jul 1998 10:02:56 -0700
From: "Arvind K. Karandikar" <akarandi@pcocd2.intel.com>
Subject: gethostbyname
Message-Id: <35C1F8C0.4F5C@pcocd2.intel.com>
Hi,
i'm trying to obtain the full name of the machine that i'm running on.
'hostname' and hostname() only return the name - eg what i'd like
to have is "craft.camp.clarkson.edu", but what i get is simply "craft"
(i'm trying to connect to this machine via a socket). i've tried using
gethostbyname, but get all undef values:
>>code snippet
$localHost = `hostname` ;
print "current host is $localHost\n" ;
($name, $aliases, $addrtype, $length, @addrs) = gethostbyname $localHost
;
print "name is $name\n" ;
print "aliases are $aliases\n" ;
print "addrtype is $addrtype\n" ;
print "length is $length\n" ;
print "addrs are @addrs\n" ;
$name = gethostbyname $localHost ;
print "in scaler context, name is $name\n" ;
>> end code
>>output is
%getName.pl
current host is craft
Use of uninitialized value at getName.pl line 8.
name is
Use of uninitialized value at getName.pl line 9.
aliases are
Use of uninitialized value at getName.pl line 10.
addrtype is
Use of uninitialized value at getName.pl line 11.
length is
addrs are
Use of uninitialized value at getName.pl line 17.
in scaler context, name is
>> end output
the camel book and perldoc don't give any more info. any suggestion?
thanks,
Arvind
akarandi@pcocd2.intel.com.nospam
my opinions. mine! mine!! mine!!
------------------------------
Date: 31 Jul 1998 16:27:45 -0500
From: nem@abattoir.cc.ndsu.nodak.edu (Nem W Schlecht)
Subject: Re: gethostbyname
Message-Id: <6ptcsh$hjq@abattoir.cc.ndsu.nodak.edu>
[courtesy copy e-mailed to author(s)]
In comp.lang.perl.misc, Arvind K. Karandikar <akarandi@pcocd2.intel.com> wrote:
>
>$localHost = `hostname` ;
First off, you are going to get a newline by using the backticks. Use
something like this instead, to get rid of the extra junk:
chomp($localHost = `hostname`);
>($name, $aliases, $addrtype, $length, @addrs) = gethostbyname $localHost ;
This works fine, however, the problem again is in how you achieved the
hostname. Without the above chomp() call, you are passing the name of the
machine with a newline ('\n') tacked onto the end (your print statement
should have shown this, since you were also printing a newline, you should
be seeing a blank line when you run the script).
>$name = gethostbyname $localHost ;
>print "in scaler context, name is $name\n" ;
Nope. In scalar context, gethostbyname() returns the host's address. This
would work, though:
$name = scalar gethostbyaddr(@addrs,$addrtype);
--
Nem W Schlecht nem@plains.nodak.edu
NDUS UNIX SysAdmin http://www.nodak.edu/~nem/
"Perl did the magic. I just waved the wand."
------------------------------
Date: 1 Aug 1998 14:08:13 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Good Book?
Message-Id: <6pv7gd$d6i$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
jdporter@min.net writes:
:The Camel Critiques page is indispensible for deciding
:what books to use.
:
:But it is of little help it determining whether a book
:is useful, which does not appear in its list.
Just keep at 4 and 5 camels and be fine?
--tom
--
pos += screamnext[pos] /* does this goof up anywhere? */
--Larry Wall, from util.c in the v5.0 perl distribution
------------------------------
Date: Thu, 30 Jul 1998 16:48:57 -0400
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: Good Book?
Message-Id: <linberg-3007981648570001@projdirc.literacy.upenn.edu>
In article <35C0DC21.FB200D4E@istar.ca>, Dave Mckeown <dmckeown@istar.ca> wrote:
> I just bought "Perl 5 Complete" by Edward S. Peschko & Michele DeWolfe I
> was told by someone to buy "programming perl" by Larry wall, Randal
> Swartz or "Cgi programming for the www" Is the book I bought any good
> any one read it I sat down and read it for about 30 minutes in the store
> and it looked good any opinions??
Programming Perl is the bible.
_____________________________________________________________________
Steve Linberg National Center on Adult Literacy
Systems Programmer &c. University of Pennsylvania
linberg@literacy.upenn.edu http://www.literacyonline.org
------------------------------
Date: Sat, 1 Aug 1998 10:09:29 +0100
From: Jerry Pank <jerryp.usenet@connected.demon.co.uk>
Subject: Gzip on non *nix platform
Message-Id: <vr6wOCAJttw1Ewap@connected.demon.co.uk>
Is there a simple way of decoding a *.gz file (on a non *nix platform),
from within perl ?
--
Jerry Pank mailto:jerryp.usenet@connected.demon.co.uk
There's something to be said for returning the whole syntax tree.
-- Larry Wall in <199710221833.LAA24741@wall.org>
------------------------------
Date: Sat, 01 Aug 1998 08:23:21 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: Jerry Pank <jerryp.usenet@connected.demon.co.uk>
Subject: Re: Gzip on non *nix platform
Message-Id: <35C332E9.669243E8@sirius.com>
Jerry Pank wrote:
>
> Is there a simple way of decoding a *.gz file (on a non *nix platform),
> from within perl ?
> --
There are many sources for the "standard" Unix tools ports.
On NT/Windoze the following works for me:
my $content = `gzip -c $filename`;
HTH -- Jim Bowlin
------------------------------
Date: Thu, 30 Jul 1998 22:20:42 +0200
From: Thomas Malindovszky <dragotom@mail.datanet.hu>
Subject: Help NEEDED!!!!
Message-Id: <35C0D59A.C3EB184E@mail.datanet.hu>
Hi!
I am a newbie in Perl programming and I have some problems.
How can I generate a HTML page with a script and decode the datas with
the SAME script...
If anybody can, please help.
Thank you,
Dragotom
*----------------------------------------*
Dragotom
dragotom@mail.datanet.hu
------------------------------
Date: 31 Jul 1998 12:04:02 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Help with environment variables
Message-Id: <6pspti$8ej$1@monet.op.net>
In article <35C1C5D2.41C67EA6@kbss.bt.co.uk>, lina <lina@kbss.bt.co.uk> wrote:
>use Env;
>print(PWD);
>
>What's wrong with the above 2 lines of code?
You want
print $PWD;
Variables in Perl always have a $ on the front.
But you don't need `use Env'; you can always write
print $ENV{PWD} ;
instead. This is more flexible, because you can also use
if (exists $ENV{PWD}) {
# do something
}
to find out if the variable exists at all.
------------------------------
Date: Fri, 31 Jul 1998 14:31:19 +0100
From: "Planet News" <guillaume@nospam.com>
Subject: Re: Help with environment variables
Message-Id: <6psh1o$qm$1@svr-c-01.core.theplanet.net>
try this bit of code in a browser and you will see how you can use it:
print "Content-type: text/html\n\n";
print "<html>";
print "<b>Environment variable</b><br><br>";
foreach $key (keys %ENV){
print "\n<br>$key: $ENV{$key}";
}#end foreach
print "</html>";
hope this helps,
Guillaume.
------------------------------
Date: Fri, 31 Jul 1998 20:54:03 +0200
From: jan.dubois@ibm.net (Jan Dubois)
Subject: Re: HELP: Convert files using OLE in Perl
Message-Id: <35cb124e.133335736@news2.ibm.net>
[Mailed & Posted]
kornelii@my-dejanews.com wrote:
>I try to convert some Window Word97 files from Word97 format to Word95 format.
>
[snip]
>
>I used also &Word->Documents(1)->SaveAs ( ... )
>
>---------------
>But it doesn't save files no matter what format I use It just doesn't save.
Do you have Office 97 Service Release 1 installed? Without it you won't be
able to make the SaveAs method work through OLE automation because the
type library entry is botched.
-Jan
------------------------------
Date: Sat, 01 Aug 1998 00:29:03 -0500
From: vano0023@tc.umn.edu
Subject: hex char
Message-Id: <35C2A79E.FDE4C05B@tc.umn.edu>
if I have $hex=0x43, how do I get it to print 'C' with hex value 43
using variable $hex?
------------------------------
Date: 1 Aug 1998 06:13:25 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: hex char
Message-Id: <6pubm5$kr0$1@marina.cinenet.net>
vano0023@tc.umn.edu wrote:
: if I have $hex=0x43, how do I get it to print 'C' with hex value 43
: using variable $hex?
print chr($hex);
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| Member of The HTML Writers Guild: http://www.hwg.org/
"Every man and every woman is a star."
------------------------------
Date: 1 Aug 1998 11:49:41 GMT
From: gabor@vmunix.com (Gabor)
Subject: Re: hex char
Message-Id: <slrn6s60b2.917.gabor@guava.vmunix.com>
In comp.lang.perl.misc, vano0023@tc.umn.edu <vano0023@tc.umn.edu> wrote :
# if I have $hex=0x43, how do I get it to print 'C' with hex value 43
# using variable $hex?
#
If you looked at the docs you would've found you need to use chr.
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 3297
**************************************