[17778] in Perl-Users-Digest
Perl-Users Digest, Issue: 5198 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 26 00:10:26 2000
Date: Mon, 25 Dec 2000 21:10:11 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <977807411-v9-i5198@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 25 Dec 2000 Volume: 9 Number: 5198
Today's topics:
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi (J.B. Moreno)
Re: Syntax for "eq" and "||" (Jon Bell)
Thank you <studdstr@qwest.net>
Re: Thank you (Tad McClellan)
Re: Using Rational Rose with Perl for UML microgold@pipeline.com
what the hell is wrong with this ?????? <ultimategamer@home.com>
Re: what the hell is wrong with this ?????? <jbuff1856@my-deja.com>
Re: what the hell is wrong with this ?????? (Martien Verbruggen)
Re: what the hell is wrong with this ?????? (David Efflandt)
Re: what the hell is wrong with this ?????? <jbuff1856@my-deja.com>
You guys are great! <emerald-arcana@home.com>
Re: You guys are great! <uri@sysarch.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 25 Dec 2000 23:42:48 -0500
From: planb@newsreaders.com (J.B. Moreno)
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <1em7ylf.44iv7b1u2t47gN%planb@newsreaders.com>
John Stanley <stanley@skyking.OCE.ORST.EDU> wrote:
> In article <3a381054@cs.colorado.edu>,
> Tom Christiansen <tchrist@perl.com> wrote:
> >In article <slrn93flr4.r5.tadmc@maxim.metronet.com>,
> >>It will not be posted in POD. It will be posted in plain text.
> >
> >Perhaps, but you should not _f_o_r_b_i_d people from posting in pod.
>
> Nice formatting. Rather illegible, but I suppose it means something.
Coming into this a bit late, and primarily because coincidentally I just
asked about this very issue on the USEFOR mailing list.
What he did was use the "underline backspace character" method of
underlining, instead of the more _underline_ method.
In USEFOR it is mentioned in section 4.3.1. as:
Posters SHOULD avoid using control characters in US-ASCII (or other
CCSs) except for tab (ASCII 9), formfeed (ASCII 12), and backspace
(ASCII 8). [...] Backspace SHOULD be used only for underlining, done
by a sequence of underscores (ASCII 95) followed by an equal number
of backspaces, signifying that the same number of text characters
following are to be underlined. Posters are warned that underlining
is not available on all output devices and is best not relied on for
essential meaning. Reading agents SHOULD recognize underlining and
translate it to the appropriate commands for devices that support it.
Which is taken from son-of-1036 which says the same thing.
Apparently rn and descendants, as well as Gnus recognize it, I'm not
sure about anyone else (except in a negative way, MacSOUP and Thoth
don't recognize it [in fact Thoth strip's it out when quoting], Thoth
does recognize _underline_).
--
JBM
"Moebius strippers only show you their back side." -- Unknown
------------------------------
Date: Tue, 26 Dec 2000 02:41:59 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Syntax for "eq" and "||"
Message-Id: <G65M60.E3L@presby.edu>
Paul Wasilkoff <paul_wasilkoff@ucg.org> wrote:
>
>if ($in{'Contact_Country'} eq "Austalia" || "Canada" || "UK")
Allow me to save myself a bit of typing by using an intermediate variable:
$incc = $in{'Contact_Country'};
if ($incc eq "Australia" || $incc eq "Canada" || $incc eq "UK")
{
# do something
}
As in most programming languages the comparision operators like 'eq' are
all "binary" operators that require two operands. Evaluating them gives
Boolean (logical) results that you can in turn combine with the Boolean
operators such as '&&' and '||'.
--
Jon Bell <jtbell@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
[ Help try to keep the Deja.com archive alive! Sign the petition at ]
[ http://www2.PetitionOnline.com/dejanews/petition.html ]
------------------------------
Date: Mon, 25 Dec 2000 15:50:57 -0800
From: Jimmy <studdstr@qwest.net>
Subject: Thank you
Message-Id: <3A47DD61.215355D5@qwest.net>
for some reason I don't have the "-q" option on my webhost...?
And I am getting better at using the PerlFaqs, I did find exactly what I
needed. "How do I shuffle an array randomly?"
had the exact routine I was looking for.
Thanx Again
Jimmy
Tad McClellan wrote:
> Jimmy <studdstr@qwest.net> wrote:
>
> >I am looking to display the lines from a file, in a random order. I have
> >not found anything on how I should do this.
> ^^^^^^^^^
>
> Most of us are going to find it awfully hard to believe you...
>
> perldoc -q random
>
> "How do I shuffle an array randomly?"
>
> "How do I select a random element from an array?"
>
> "How do I select a random line from a file?"
>
> >Could someone point me in the right direction?
>
> The right direction would be to check the Perl FAQ *before*
> posting to the Perl newsgroup.
>
> --
> Tad McClellan SGML consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
------------------------------
Date: Mon, 25 Dec 2000 18:31:22 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Thank you
Message-Id: <slrn94fm6a.asr.tadmc@magna.metronet.com>
[ for some reason you have put your reply before the quoted text
that you are commenting on. Please don't do that.
It is much easier to read when the "first thing" is first
and the "second thing" is second.
Please don't quote an entire article.
Please don't quote .signatures.
Please see http://www.geocities.com/nnqweb/nquote.html
Thank you.
]
Jimmy <studdstr@qwest.net> wrote:
>for some reason I don't have the "-q" option on my webhost...?
You are expected to check the Perl FAQ *before* posting to the
Perl newsgroup.
If you cannot access the Perl FAQ in order to do that, then
you cannot post!
(There is no exception for "not having" the FAQ. It comes with
the perl distribution itself. We assume you have perl installed
when you post to the Perl newsgroup.
)
Complain to your "host" if they have a misconfigured perl.
Or, better yet, Perl is free. Go get it and install it on
whatever computer you have.
Having easy access to the FAQs will save you boatloads of time.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 26 Dec 2000 02:54:42 GMT
From: microgold@pipeline.com
Subject: Re: Using Rational Rose with Perl for UML
Message-Id: <92919h$if4$1@nnrp1.deja.com>
Hi,
Microgold has an add-in for perl for its WithClass tool that allows you
to reverse engineer perl files into a class diagram. The source for
the add-in is included (in VBA) so you can change it. There is also a
script for generating classes for perl. You can download a trial
version of the product at http://www.microgold.com
-Mike Diamond
TEch Support
Microgold Software Inc.
http://www.microgold.com
In article <ivh16.442$B9.189123072@news.frii.net>,
cfedde@fedde.littleton.co.us (Chris Fedde) wrote:
> In article <91snbd$rrg$1@nnrp1.deja.com>,
> Steve Button <steve_button@my-deja.com> wrote:
> >Hi,
> >
> >We've recently started using Rational Rose to model our systems and
> >will ultimately be building the systems in Perl.
> >
> >Does anyone have any experiences of using UML with Perl ?
> >
>
> Rational will probably bark at you when you say you are using their
> tools for a typeless language. Most of what Rational Rose excels
> at is building all those function templates for the interfaces that
> make it so hard to make any progress using C++.
>
> In Perl all that stuff disappears in a puff of AUTOLOAD. If you
> are really in the market for a design methodology that applies
> itself well to design and development using Perl or other typeless
> languages take a look at XP.
>
> Good Luck
> chris
> --
> This space intentionally left blank
>
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 26 Dec 2000 02:04:02 GMT
From: "Ryan" <ultimategamer@home.com>
Subject: what the hell is wrong with this ??????
Message-Id: <m0T16.152754$_5.33924202@news4.rdc1.on.home.com>
#!/usr/bin/perl
print "Content-type: text/html\n\n";
($seconds, $minutes, $hours, $dayOfMonth, $Month, $year, $dayOfWeek,
$dayOfYear, $daylSavingTime) = localtime(time);
print "<html><head>";
print "<title> Punk Radio Cast</title>";
print "</head><body>";
print $hours, "Hours\n";
print $minutes, "Minutes\n";
if (($hours >=7) $$ ($hours <=10) $$ ($dayOfWeek = 1) && ($dayOfWeek = 5))
{
print "<p>The show is online</p><br>";
}
else
{
print"<p>Sorry, the shows not on yet</p>";
}
print "</body></head>";
ive tried this on both a unix/apache, and win98/apache server (changing the
location of perl each time)
and it doesnt work, y not?
someone please help me
thanks,
Ryan
------------------------------
Date: Tue, 26 Dec 2000 02:38:29 GMT
From: jbuff <jbuff1856@my-deja.com>
Subject: Re: what the hell is wrong with this ??????
Message-Id: <9290b5$hom$1@nnrp1.deja.com>
In article <m0T16.152754$_5.33924202@news4.rdc1.on.home.com>,
"Ryan" <ultimategamer@home.com> wrote:
> if (($hours >=7) $$ ($hours <=10) $$ ($dayOfWeek = 1) && ($dayOfWeek
= 5))
>
Should be:
if (($hours >=7) && ($hours <=10) && ($dayOfWeek = 1) && ($dayOfWeek =
5))
"It doesn't work" is not an adequate desription of your problem, but I
spotted this obvious flaw in your code.
-- jbuff
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 26 Dec 2000 13:59:32 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: what the hell is wrong with this ??????
Message-Id: <slrn94g2ck.8i7.mgjv@martien.heliotrope.home>
On Tue, 26 Dec 2000 02:04:02 GMT,
Ryan <ultimategamer@home.com> wrote:
> #!/usr/bin/perl
no -w or warnings pragma
no strict pragma
no -T, and this is a CGI program.
You're not using the CGI module, and this is a CGI program. You'll make
mistakes that ypou could have prevented by using a module.
> print "Content-type: text/html\n\n";
>
> ($seconds, $minutes, $hours, $dayOfMonth, $Month, $year, $dayOfWeek,
> $dayOfYear, $daylSavingTime) = localtime(time);
Ugly variable names.
> print "<html><head>";
> print "<title> Punk Radio Cast</title>";
> print "</head><body>";
>
> print $hours, "Hours\n";
> print $minutes, "Minutes\n";
learn about here-docs from the perldata documentation.
print <<EOHTML;
<html><head>
<title> Punk Radio Cast</title>
</head><body>
$hours Hours
$minutes Minutes
EOHTML
Of course, since you're outputting HTML, those newlines might as well
just be a space.
> if (($hours >=7) $$ ($hours <=10) $$ ($dayOfWeek = 1) && ($dayOfWeek = 5))
^^ ^^
what's that? and that?
Have you seen perl FAQ, part 9? It talks about what you should do to
debug CGI programs. If you had done so, you would have known about this
in seconds, rather than the longish time it takes for Usenet to
propagate. Let Perl tell you what's wrong with your programs. Learn how
to debug. Don't run anything as a CGI program until it runs fromt he
command line. Your stuff won't even compile.
> ive tried this on both a unix/apache, and win98/apache server (changing the
> location of perl each time)
But you never thought of running it from the command line? Or using
CGI::Carp? Or inspecting your server logs? Even though the perl FAQ
explains how to?
> and it doesnt work, y not?
Because it is syntactically incorrect. And next time, when you have a
problem, please report something more useful than "doesn't work".
That's meaningless. It is up to _you_ to come up with a decent
description of what goes wrong. You're the one wo wants help. We can't
second-guess everything.
Be specific. And read the perl FAQ, part 9. Oh, and also look at Part 3.
> someone please help me
Please, learn to help yourself. You'll be much happier, and successful
as a programmer.
Martien
--
Martien Verbruggen |
Interactive Media Division | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd. | cynical. It's perfectly easy to be
NSW, Australia | cynical.
------------------------------
Date: Tue, 26 Dec 2000 03:51:04 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: what the hell is wrong with this ??????
Message-Id: <slrn94g5e0.nmd.efflandt@efflandt.xnet.com>
On Tue, 26 Dec 2000 02:38:29 GMT, jbuff <jbuff1856@my-deja.com> wrote:
>In article <m0T16.152754$_5.33924202@news4.rdc1.on.home.com>,
> "Ryan" <ultimategamer@home.com> wrote:
>> if (($hours >=7) $$ ($hours <=10) $$ ($dayOfWeek = 1) && ($dayOfWeek
>= 5))
>>
>
>Should be:
>
>if (($hours >=7) && ($hours <=10) && ($dayOfWeek = 1) && ($dayOfWeek =
>5))
That will not quite work either. The above statement would be true
between 7 AM and 10 AM any day of the week, because he is reassigning
$dayOfWeek to 1 and then to 5 regardless of which day of the week it
really is.
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: Tue, 26 Dec 2000 04:16:38 GMT
From: jbuff <jbuff1856@my-deja.com>
Subject: Re: what the hell is wrong with this ??????
Message-Id: <929634$ljg$1@nnrp1.deja.com>
In article <slrn94g5e0.nmd.efflandt@efflandt.xnet.com>,
efflandt@xnet.com wrote:
> On Tue, 26 Dec 2000 02:38:29 GMT, jbuff <jbuff1856@my-deja.com> wrote:
> >In article <m0T16.152754$_5.33924202@news4.rdc1.on.home.com>,
> > "Ryan" <ultimategamer@home.com> wrote:
> >> if (($hours >=7) $$ ($hours <=10) $$ ($dayOfWeek = 1) &&
($dayOfWeek
> >= 5))
> >>
> >
> >Should be:
> >
> >if (($hours >=7) && ($hours <=10) && ($dayOfWeek = 1) && ($dayOfWeek
=
> >5))
>
> That will not quite work either. The above statement would be true
> between 7 AM and 10 AM any day of the week, because he is reassigning
> $dayOfWeek to 1 and then to 5 regardless of which day of the week it
> really is.
>
D'oh. Perhaps I should have just said "perldoc perlop" and waited for
the light to come on.
-- jbuff
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 26 Dec 2000 01:53:06 GMT
From: Arcana <emerald-arcana@home.com>
Subject: You guys are great!
Message-Id: <6SS16.18739$59.5856757@news3.rdc1.on.home.com>
Dear Perl User Group,
I'd like to thank you guys very much for posting regularly and answering
everyone's questions, no matter how basic and stupid they may seem! I've
never posted here before but even by reading I learned an immense deal. I
was going to post up a question dealing with matching the value of a
variable in Regular Expressions, but by reading this group I figured a way
around it that I would have never dreamed of.
Thanks guys! You make my life a lot easier. Keep up the good worl!
--
-- Arcana
------------------------------
Date: Tue, 26 Dec 2000 04:28:12 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: You guys are great!
Message-Id: <x7snnbbyci.fsf@home.sysarch.com>
>>>>> "A" == Arcana <emerald-arcana@home.com> writes:
A> learned an immense deal. I was going to post up a question dealing
A> with matching the value of a variable in Regular Expressions, but
A> by reading this group I figured a way around it that I would have
A> never dreamed of.
i wish we could put acknowledgements like this into the regular post tad
is writing. we constantly tell newbies to read this group for a while
before posting (lurking) and to search deja for their question as it
most always has been asked and answered before.
so my praises go to you, a newbie who did the right thing to get
an answer here and who figured that out himself.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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.
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 5198
**************************************