[12648] in Perl-Users-Digest
Perl-Users Digest, Issue: 57 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 7 13:07:24 1999
Date: Wed, 7 Jul 1999 10:06:05 -0700 (PDT)
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, 7 Jul 1999 Volume: 9 Number: 57
Today's topics:
Binary file corruption nerilius@my-deja.com
Re: Binary file corruption (Larry Rosler)
Re: Binary file corruption (Abigail)
Re: Binary file corruption (Ronald J Kimball)
Re: Bloated code <gellyfish@gellyfish.com>
Re: Bloated code <maddoc@en.com>
Books <amr@iname.com>
Re: Books <vinger@mail.ford.com>
cgi question, can you help me? <geofox@softhome.net>
Re: CGI Script Problems. <Ryan@lmp.co.uk>
cgi.pm question (John Hurley)
Checking if a url is valid <ysgan@hotmail.com>
Re: Checking if a url is valid <gellyfish@gellyfish.com>
Re: Checking if a url is valid <martin@adoma.se>
commandline arguments... <yogeshd@pacbell.net>
Re: commandline arguments... (elephant)
Re: commandline arguments... <rgz@soft-mountain.com>
Re: commandline arguments... <lbenfie1@avwb001.aveley.ford.com>
Re: commenting code in perl (Andrew Allen)
Re: commenting code in perl (Abigail)
Re: commenting code in perl <uri@sysarch.com>
Re: commenting code in perl (Abigail)
Re: commenting code in perl <gellyfish@gellyfish.com>
Re: commenting code in perl <gbartels@xli.com>
Re: commenting code in perl <tchrist@mox.perl.com>
Re: commenting code in perl (Philip 'Yes, that's my address' Newton)
Re: Date::Manip can't handle Arizona Time zone? kgentes@gentek.net
Re: Date::Manip can't handle Arizona Time zone? (I R A Aggie)
Re: Employment Opportunity - Transportation (Ronald J Kimball)
Expired CGI-script (Needs help quick) <artsoft@danbbs.dk>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 06 Jul 1999 22:26:30 GMT
From: nerilius@my-deja.com
Subject: Binary file corruption
Message-Id: <7ltvqa$r4i$1@nnrp1.deja.com>
'passme'
I'm trying to write a CGI program that can open a binary file, read it
into an array, and print that array to the client via a web browser.
The file must be read into an array for later alterations not affecting
the original file. The size of the binary PRBMP.exe executable is
50176, while the size of the printed array is 50333. Is there any way
to read a binary file into an array and print it, without the
information stored in the array being corrupted? In other words, I need
the information read into the array to be exactly the same as the
information contained in the PRBMP.exe file.
sub download
{
open(PROGRAM, "<Prbmp.exe");
binmode PROGRAM;
@file=<PROGRAM>;
print "Content-type:application/octet-stream\r\n\r\n"; print "@file";
}
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 6 Jul 1999 17:17:00 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Binary file corruption
Message-Id: <MPG.11ec3c54b00ca4bc989c68@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7ltvqa$r4i$1@nnrp1.deja.com> on Tue, 06 Jul 1999 22:26:30
GMT, nerilius@my-deja.com <nerilius@my-deja.com> says...
> I'm trying to write a CGI program that can open a binary file, read it
> into an array, and print that array to the client via a web browser.
> The file must be read into an array for later alterations not affecting
> the original file. The size of the binary PRBMP.exe executable is
> 50176, while the size of the printed array is 50333. Is there any way
> to read a binary file into an array and print it, without the
> information stored in the array being corrupted? In other words, I need
> the information read into the array to be exactly the same as the
> information contained in the PRBMP.exe file.
>
>
> sub download
> {
> open(PROGRAM, "<Prbmp.exe");
> binmode PROGRAM;
> @file=<PROGRAM>;
Why do you create an array consisting of the 'lines' of the file, when
binary files do not have lines?
Don't forget to do this also:
binmode STDOUT;
before printing anything.
> print "Content-type:application/octet-stream\r\n\r\n"; print "@file";
^ Put a space there. ^^^^^^^^ Just use "\n\n".
Why do you want to add a space character between each pair of 'lines' in
the array @file? Leave off the double-quotes.
> }
If the file isn't really huge, you could do this far better by slurping
it. Otherwise loop on read and print. None of this 'lines' nonsense.
print do { local $/; <PROGRAM> };
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 6 Jul 1999 19:42:03 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Binary file corruption
Message-Id: <slrn7o58i5.tch.abigail@alexandra.delanet.com>
nerilius@my-deja.com (nerilius@my-deja.com) wrote on MMCXXXV September
MCMXCIII in <URL:news:7ltvqa$r4i$1@nnrp1.deja.com>:
**
** I'm trying to write a CGI program that can open a binary file, read it
** into an array, and print that array to the client via a web browser.
** The file must be read into an array for later alterations not affecting
** the original file. The size of the binary PRBMP.exe executable is
** 50176, while the size of the printed array is 50333. Is there any way
** to read a binary file into an array and print it, without the
** information stored in the array being corrupted? In other words, I need
** the information read into the array to be exactly the same as the
** information contained in the PRBMP.exe file.
Interestingly enough, there was a person named 'nerilius@my-deja.com'
who asked the same question only yesterday. He even had a file name
named 'Prbmp.exe', just like you! Isn't that a coincidence?
Anyway, I answered his question. Perhaps you can email him, and he will
forward you the answer. Alternatively, you might have heard of this
"deja.com" services, that allows you to browse through old Usenet
articles. You'll find my answer there!
Abigail
--
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 6 Jul 1999 21:57:15 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Binary file corruption
Message-Id: <1duji88.1df6wtxla6xwvN@p158.block1.tc4.state.ma.tiac.com>
<nerilius@my-deja.com> wrote:
> sub download
> {
> open(PROGRAM, "<Prbmp.exe");
> binmode PROGRAM;
> @file=<PROGRAM>;
> print "Content-type:application/octet-stream\r\n\r\n"; print "@file";
> }
RTFM. "@file" interpolates the array with the value of $" between each
element. No quotes needed or wanted there.
Why are you reading binary data into an array anyway? Localize $/ and
read the whole file into a scalar.
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: 6 Jul 1999 20:47:03 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Bloated code
Message-Id: <7ltq07$ih$1@gellyfish.btinternet.com>
On 6 Jul 1999 16:25:09 GMT Mike Kozlowski wrote:
> In article <7lj62n$fka$2@fcnews.fc.hp.com>, Andrew Allen <ada@fc.hp.com> wrote:
>
>>Just as a matter of style, I use "foreach" when iterating over a list,
>>and "for" only when using the for(initializer;condition;increment)
>>form.
>>
>>Do most other people do this also?
>
> I actually base my usage off of the plurality of the variable name, so I'd
> use:
>
Funnily enough I tend to do that as well - completely irrational really
but there you go.
/J\
--
Jonathan Stowe <jns@gellyfish.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Tue, 06 Jul 1999 19:16:58 -0400
From: Mike <maddoc@en.com>
Subject: Re: Bloated code
Message-Id: <37828E6A.4A29CC26@en.com>
jfk120@my-deja.com wrote:
> In article <378098C1.DACEA8E5@gmx.net>,
> "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.net>
> wrote:
> > Abigail wrote:
> > >
> > > that's my address' Newton (nospam.newton@gmx.net) wrote on MMCXXXIV
> > > September MCMXCIII in <URL:news:3780580B.C4774C7D@gmx.net>:
> > > ?? garthwebb@my-deja.com wrote:
> > > ?? >
> > > ?? > > In about one second I chopped it down to:
> > > ?? > > for (@array) {&doStuffWith($_)}
> > > ?? > >
> > > ?? >
> > > ?? > Man, what's with all that typing? In about one second I
> chopped that
> > > ?? > down to:
> > > ?? >
> > > ?? > for(@a){d($_)}
> > > ??
> > > ?? How about:
> > > ??
> > > ?? d$_ for@a;
> > >
> > > map{d}@a; # Assuming d takes $_ as a default argument.
> > >
> > > One char shorter!
> >
> > If I could have assumed that, I'd have written
> >
> > d for@a;
> >
> > which is one char shorter than your solution. *And* it wouldn't have
> > used map in void context :).
> >
> > Cheers,
> > Philip
> >
>
> How about
>
> d;
>
> Yes, it will return an error but it's extremely tight code.
>
<DELURK> ...lol...</DELURK>
------------------------------
Date: Wed, 07 Jul 1999 13:26:37 GMT
From: amr <amr@iname.com>
Subject: Books
Message-Id: <7lvki0$ch1$1@nnrp1.deja.com>
Can anyone recommend, to me, a good book on the Perl language, i.e. how
to use the language, functions available, how to use it in terms of
web-site building.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 07 Jul 1999 10:18:58 -0400
From: Slav Inger <vinger@mail.ford.com>
Subject: Re: Books
Message-Id: <378361D2.94D31724@mail.ford.com>
amr wrote:
>
> Can anyone recommend, to me, a good book on the Perl language, i.e. how
> to use the language, functions available, how to use it in terms of
> web-site building.
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
O'Reilly titles: Learning Perl, Programming Perl, Perl Cookbook with CGI
and LWP examples, and I think there's also a book on Perl CGI
programming, also by O'Reilly.
- Slav Inger.
- vinger@mail.ford.com
------------------------------
Date: Thu, 8 Jul 1999 00:39:10 +0800
From: "geofox" <geofox@softhome.net>
Subject: cgi question, can you help me?
Message-Id: <7lvvko$m6b$1@newso.ctimail.com>
This is a multi-part message in MIME format.
------=_NextPart_000_000D_01BEC8DA.4B777BE0
Content-Type: text/plain;
charset="big5"
Content-Transfer-Encoding: quoted-printable
Hi,
I have written a cgi script to get
some information about the statistics of=20
the web site....
However, it takes some time to output=20
the result.
My Question is:
can I write something such "pls wait" or "the result is coming" etc.
to indicate the request is processing before the result comes out
in the page?
Thanks,
geofox
------=_NextPart_000_000D_01BEC8DA.4B777BE0
Content-Type: text/html;
charset="big5"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dbig5" http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2014.210" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I have written a cgi script to =
get</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>some information about =
the statistics of=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>the web site....</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>However, it takes some time to output =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>the result.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>My Question is:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>can I write something such "pls wait" =
or "the=20
result is coming" etc.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>to indicate the request is processing =
before the=20
result comes out</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>in the page?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>geofox</FONT></DIV>
<DIV> </DIV></BODY></HTML>
------=_NextPart_000_000D_01BEC8DA.4B777BE0--
------------------------------
Date: Wed, 07 Jul 1999 08:57:53 +0100
From: Ryan Critchley <Ryan@lmp.co.uk>
Subject: Re: CGI Script Problems.
Message-Id: <37830881.A8299D53@lmp.co.uk>
Hi Philip,
Thanks for the reply I will be using the Perl 5 option from Demon
but at the moment I am testing the script on our in house Linux machine
also running Perl 5 and can not get the error condition to execute using
both the || and the 'or' methods.
Ryan
Philip Baker wrote:
>
> In article <377C9B2F.E5F294F5@lmp.co.uk>, Ryan Critchley
> <Ryan@lmp.co.uk> writes
> >Hi all. I am having the following problem with a CGI script (in perl)
> >that I am trying to write. This script is your normal take the form and
> >e-mail it to someone and this works ok with one exception. I have a line
> >which reads:
> >
> >
> > open (MAIL, "|$mailprog -t") or &dienice("Can't access $mailprog!\n");
> >
> > ....
> >
> > sub dienice{
> > ($msg) = @_;
> > .. {Print HTML CODE}
> > exit;
> > }
> >
> >now according to the tutorial that I am following if the mailprog can
> >not be found or run properly then the sub function dienice should be
> >called. So to test this I changed /usr/sbin/sendmail to /usr/mymail but
> >the dienice function does not get called I just keep seeing the Thank
> >you message which is returned on a successful send.
> >
> >Can anyone suggest what's wrong or point me in the direction of a good
> >perl resource so I can understand better what is going on with these
> >commands.
> >
>
> What version of Perl are you using? Demon commercial web space still
> defaults, I believe, to Perl 4, in which case use '||' not 'or'.
>
> [Follow-up set to comp.lang.perl.misc]
> --
> Philip Baker
> http://www.thalasson.com
> http://www.pjbsware.demon.co.uk
------------------------------
Date: Wed, 07 Jul 1999 17:03:04 GMT
From: jhurleyremove@njsba.org (John Hurley)
Subject: cgi.pm question
Message-Id: <378386ff.11237876@news.erols.com>
hi all,
I have been having a problem with using cgi mail forms on my web site
for quite some time. And I THINK I found the problem and want to know
if it is possible.......
My site is running on a BSD server and every time i try to run a Perl
program on it with the use CGI line, i get a 500 error. Can it be
that the Perl interpreter on the server may be an old version that
does not contain cgi.pm on it? I have been trying to get a hold of my
isp for a while now to find out about this and have not been replied
to yet. So I just thought I would ask you Perl pros.
Thanks,
John M Hurley
------------------------------
Date: Wed, 7 Jul 1999 15:27:30 +0800
From: "Victor Gan" <ysgan@hotmail.com>
Subject: Checking if a url is valid
Message-Id: <3783016d.0@news.cyberway.com.sg>
I'm trying to check if a given url such as http://www.hotmail.com
is valid using a Perl CGI script.
Is there a way to do this?
Thanks.
------------------------------
Date: 7 Jul 1999 09:49:49 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Checking if a url is valid
Message-Id: <378314ad@newsread3.dircon.co.uk>
Victor Gan <ysgan@hotmail.com> wrote:
> I'm trying to check if a given url such as http://www.hotmail.com
> is valid using a Perl CGI script.
>
The module LWP::UserAgent allows you to request the document with a
HEAD method.
/J\
--
"I suggest you apply some lubrication before any bending begins" -
Antoine de Caunes, Eurotrash
------------------------------
Date: Wed, 07 Jul 1999 14:04:45 +0100
From: Martin Quensel <martin@adoma.se>
Subject: Re: Checking if a url is valid
Message-Id: <3783506D.707F133B@adoma.se>
Victor Gan wrote:
>
> I'm trying to check if a given url such as http://www.hotmail.com
> is valid using a Perl CGI script.
>
> Is there a way to do this?
Yes.
Take a look at LWP::Simple.
Best regards
Martin Quensel
------------------------------
Date: Wed, 7 Jul 1999 05:59:40 -0700
From: "news.pacbell.net" <yogeshd@pacbell.net>
Subject: commandline arguments...
Message-Id: <ObIg3.9$a7.13823@typhoon-sf.snfc21.pbi.net>
hi!
I'm trying to write a perl script which can except command line arguments
like say ( -p -q -x etc ), do perform different action based on the input
switch.
does anyone know what system variable i can use to read these arguments?
thanks in advance
-yogesh damle
california
------------------------------
Date: Wed, 7 Jul 1999 23:07:09 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: commandline arguments...
Message-Id: <MPG.11edfc0aa97d4754989b14@news-server>
news.pacbell.net writes ..
>does anyone know what system variable i can use to read these arguments?
yes .. everyone does .. look at the perlvar section of the manual
--
jason - remove all hyphens for email reply -
------------------------------
Date: Wed, 07 Jul 1999 15:24:55 +0200
From: Rafael Garcia-Suarez <rgz@soft-mountain.com>
Subject: Re: commandline arguments...
Message-Id: <37835527.5BDAC7A0@soft-mountain.com>
"news.pacbell.net" wrote:
> I'm trying to write a perl script which can except command line arguments
> like say ( -p -q -x etc ), do perform different action based on the input
> switch.
you might want to use the standard module Getopt::Std...
------------------------------
Date: Wed, 07 Jul 1999 14:02:45 +0000
From: Lee Benfield <lbenfie1@avwb001.aveley.ford.com>
Subject: Re: commandline arguments...
Message-Id: <37835E05.292F2852@avwb001.aveley.ford.com>
"news.pacbell.net" wrote:
>
> hi!
>
> I'm trying to write a perl script which can except command line arguments
> like say ( -p -q -x etc ), do perform different action based on the input
> switch.
>
> does anyone know what system variable i can use to read these arguments?
>
> thanks in advance
>
> -yogesh damle
> california
use the @ARGV array.
perlfunc manpage has copious examples.
--
------------------------------------------------------------------------
Lee Benfield -- Tel: 737-2859 [+44 (0)1708 858859] | Web Centre Of
GB-20/660 Fax: 737-2510 [+44 (0)1708 858510] | Excellence, Europe
lee@recoil.org Mail: lbenfie1@avwb001.aveley.ford.com
------------------------------
Date: 6 Jul 1999 21:44:04 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: commenting code in perl
Message-Id: <7lttb4$9a$1@fcnews.fc.hp.com>
Viral Sheth (Viral.Sheth@ny.email.gs.com) wrote:
: does anyone know how to comment chunks of code in perl without having to
: go through every single line..
: i know # is used to comment one line..
: here is what i need..
Use the pod, Luke!
=head1
commented out stuff
=cut
Andrew
------------------------------
Date: 6 Jul 1999 18:19:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: commenting code in perl
Message-Id: <slrn7o53mu.tch.abigail@alexandra.delanet.com>
Viral Sheth (Viral.Sheth@ny.email.gs.com) wrote on MMCXXXV September
MCMXCIII in <URL:news:37822850.FA097CEC@ny.email.gs.com>:
<> does anyone know how to comment chunks of code in perl without having to
<> go through every single line..
<> i know # is used to comment one line..
<> here is what i need..
You need vi.
" Comment a block.
ma}k:'a,.s/^/#/<RET>
" Uncomment a block.
ma}k:'a,.s/^#//<RET>
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 06 Jul 1999 23:07:26 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: commenting code in perl
Message-Id: <x7iu7xupht.fsf@home.sysarch.com>
>>>>> "A" == Abigail <abigail@delanet.com> writes:
A> Viral Sheth (Viral.Sheth@ny.email.gs.com) wrote on MMCXXXV September
A> MCMXCIII in <URL:news:37822850.FA097CEC@ny.email.gs.com>:
A> <> does anyone know how to comment chunks of code in perl without having to
A> <> go through every single line..
A> <> i know # is used to comment one line..
A> <> here is what i need..
A> You need vi.
A> " Comment a block.
A> ma}k:'a,.s/^/#/<RET>
A> " Uncomment a block.
A> ma}k:'a,.s/^#//<RET>
nahh, emacs has it easier. i have a comment block keystroke ^C# and with
a prefix arg ^U it uncomments a block.
less filling! tastes great!!
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
"F**king Windows 98", said the general in South Park before shooting Bill.
------------------------------
Date: 6 Jul 1999 23:00:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: commenting code in perl
Message-Id: <slrn7o5k72.tch.abigail@alexandra.delanet.com>
Uri Guttman (uri@sysarch.com) wrote on MMCXXXVI September MCMXCIII in
<URL:news:x7iu7xupht.fsf@home.sysarch.com>:
\\ >>>>> "A" == Abigail <abigail@delanet.com> writes:
\\
\\ A> " Comment a block.
\\ A> ma}k:'a,.s/^/#/<RET>
\\
\\ A> " Uncomment a block.
\\ A> ma}k:'a,.s/^#//<RET>
\\
\\
\\ nahh, emacs has it easier. i have a comment block keystroke ^C# and with
\\ a prefix arg ^U it uncomments a block.
:map ^C ma}k:'a,.s/^/#/<RET>
:map ^U ma}k:'a,.s/^#//<RET>
There. Now you have ^C and ^U in vi too.
Abigail
--
perl -weprint\<\<EOT\; -eJust -eanother -ePerl -eHacker -eEOT
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 7 Jul 1999 09:20:46 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: commenting code in perl
Message-Id: <37830dde@newsread3.dircon.co.uk>
Andrew Allen <ada@fc.hp.com> wrote:
> Viral Sheth (Viral.Sheth@ny.email.gs.com) wrote:
> : does anyone know how to comment chunks of code in perl without having to
> : go through every single line..
> : i know # is used to comment one line..
> : here is what i need..
>
> Use the pod, Luke!
>
> =head1
>
> commented out stuff
>
> =cut
>
If your code already contains POD sections then you probably would
want to do:
=for comment
blah blah
=cut
So your commented out stuff doesnt come out in any documentation.
/J\
--
"People say money brings its own problems. Rubbish, rubbish - I'm loaded -
it's fantastic" -
------------------------------
Date: Wed, 07 Jul 1999 07:41:20 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: commenting code in perl
Message-Id: <37833CE0.F5FE652E@xli.com>
Abigail wrote:
>
> Viral Sheth (Viral.Sheth@ny.email.gs.com) wrote on MMCXXXV September
> MCMXCIII in <URL:news:37822850.FA097CEC@ny.email.gs.com>:
> <> does anyone know how to comment chunks of code in perl without having to
> <> go through every single line..
> <> i know # is used to comment one line..
> <> here is what i need..
>
> You need vi.
>
> " Comment a block.
> ma}k:'a,.s/^/#/<RET>
>
> " Uncomment a block.
> ma}k:'a,.s/^#//<RET>
he needs vi as much as a hole in the head.
------------------------------
Date: 7 Jul 1999 08:48:29 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: commenting code in perl
Message-Id: <378368bd@cs.colorado.edu>
In comp.lang.perl.misc, Greg Bartels <gbartels@xli.com> writes:
:he needs vi as much as a hole in the head.
Unfamiliarity leads to misunderstanding.
Misunderstanding leads to fear.
Fear leads to hate.
Hate leads to your comment.
--tom
--
"You need to go and find someone to teach you the rudiments of irrational
discourse." --Larry Wall
------------------------------
Date: Wed, 07 Jul 1999 16:26:04 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: commenting code in perl
Message-Id: <3782ce59.253632112@news.nikoma.de>
On 6 Jul 1999 21:44:04 GMT, ada@fc.hp.com (Andrew Allen) wrote:
>Viral Sheth (Viral.Sheth@ny.email.gs.com) wrote:
>: does anyone know how to comment chunks of code in perl without having to
>: go through every single line..
>: i know # is used to comment one line..
>: here is what i need..
>
>Use the pod, Luke!
>
> =head1
>
> commented out stuff
>
> =cut
This will mess your program's embedded documentation up.
And besides, it's a FAQ. `perldoc -q comment` would have pointed you
to an item in perlfaq7: "How can I comment out a large block of perl
code?". It uses POD, too, but not =head1. Read it to find out.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.net>
------------------------------
Date: Tue, 06 Jul 1999 23:31:54 GMT
From: kgentes@gentek.net
Subject: Re: Date::Manip can't handle Arizona Time zone?
Message-Id: <7lu3la$sfc$1@nnrp1.deja.com>
alright, I give.. .what is a TZ file and how
I get one set up? is this really needed for
Perl to run Date::Manip?
In article <slrn7nsc1e.aff.fl_aggie@thepentagon.com>,
fl_aggie@thepentagon.com wrote:
> On 3 Jul 1999 04:43:45 -0500, Abigail <abigail@delanet.com>, in
> <slrn7nrmpv.31h.abigail@alexandra.delanet.com> wrote:
>
> + Does that mean people in the US actually have to change their
timezone
> + (file)s twice a year?
>
> Umm, no...usually a TZ file looks like 'EST5EDT', so it has both sides
> covered. But you knew that?
>
> + (Or at least those not from Arizona or certain parts of Illinios).
>
> Indiana, actually. Both Children of the Corn, tho...so the confusion
is
> a given...
>
> James
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 7 Jul 1999 02:06:05 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Date::Manip can't handle Arizona Time zone?
Message-Id: <slrn7o5dkp.5c9.fl_aggie@thepentagon.com>
On Tue, 06 Jul 1999 23:31:54 GMT, kgentes@gentek.net <kgentes@gentek.net>, in
<7lu3la$sfc$1@nnrp1.deja.com> wrote:
+ alright, I give.. .what is a TZ file
In unix, either /etc/TIMEZONE (Solaris & SGI) or /etc/timezone (Debian linux).
+ and how I get one set up?
% cat >> /etc/timezone
US/Eastern
^D
That's the linux file, Solaris & SGI files are 'EST5EDT', for instance.
+ is this really needed for Perl to run Date::Manip?
Nah. You can "cheat" and set the TZ variable yourself:
$ENV{'TZ'}='MST7'; # set the timezone variable
Which looks strange to me, but as is readily documented, Arizona does not
observe daylight savings. But that information should be gotten out of
the Windows registry, I would think.
James
------------------------------
Date: Tue, 6 Jul 1999 21:57:17 -0400
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Employment Opportunity - Transportation
Message-Id: <1dujic1.1b7txpw1swfwzhN@p158.block1.tc4.state.ma.tiac.com>
<www@OpsResearch.com> wrote:
> For more information see:
> http://OpsResearch.com
Where do we go for less information?
--
_ / ' _ / - aka -
( /)//)//)(//)/( Ronald J Kimball rjk@linguist.dartmouth.edu
/ http://www.tiac.net/users/chipmunk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Wed, 7 Jul 1999 17:58:28 +0200
From: "Anders Thorsby" <artsoft@danbbs.dk>
Subject: Expired CGI-script (Needs help quick)
Message-Id: <NNKg3.263$HY5.508@news.get2net.dk>
Hi
I have a CGI-script which much expire, so the script has to be executed
again if the user follows a link and using the browsers back-button. The
output of the script may not be cached!
Any hint, help or quick solution is usable!!!
Anders Thorsby
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 57
************************************