[17688] in Perl-Users-Digest
Perl-Users Digest, Issue: 5108 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 14 06:05:31 2000
Date: Thu, 14 Dec 2000 03:05:10 -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: <976791909-v9-i5108@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 14 Dec 2000 Volume: 9 Number: 5108
Today's topics:
"is JScript enabled" via perl <schneider@xtewa.de>
Re: "is JScript enabled" via perl <mbudash@sonic.net>
Re: "is JScript enabled" via perl <schneider@xtewa.de>
Re: "is JScript enabled" via perl <ubl@schaffhausen.de>
Re: ??newbie: s/// and \r <bart.lateur@skynet.be>
Re: A valuable resource! Thanks <xzrgpnys@yvtugubhfrovm.pbz>
Re: CGI Question (Niklas Frykholm)
Command line to sum up fields <johnlin@chttl.com.tw>
Re: Date::Manip. how to calc "days ago"? upuautiii@my-deja.com
Re: Faster than LWP (Helgi Briem)
ftp - which funcion for changing local site directory (J. K.)
Re: General Tool(s) for browsing/editing DB tables? <ron@savage.net.au>
Re: How to make LWP::UserAgent "frame enabled" <webmaster@BalkanEnergyReview.com>
Re: How to put each line of a text area into a field nobull@mail.com
Re: http_referer Problem!? <iltzu@sci.invalid>
I want to let people remove their e-mail addresses from <fabian@markisspecialisten.com>
Re: Newbie problem reg. activeperl <rajeshpm@emirates.net.ae>
perlcrt gheiss@my-deja.com
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <nospam.newton@gmx.li>
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <nospam.newton@gmx.li>
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <bart.lateur@skynet.be>
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <bart.lateur@skynet.be>
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <bart.lateur@skynet.be>
Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <bart.lateur@skynet.be>
Re: quick way to search array members <bart.lateur@skynet.be>
Sending ; though a form. <basskiwi@my-deja.com>
Re: TMTOWTDI - which way is better? (Philip Lees)
Re: What is Perl anyway? (Abigail)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 14 Dec 2000 08:53:36 GMT
From: SimBean <schneider@xtewa.de>
Subject: "is JScript enabled" via perl
Message-Id: <91a1qf$ais$1@nnrp1.deja.com>
Hi all,
I need a little help with the following:
Is there a way to determin _via perl_ whether or not a user has JScript
enabled in his or her browser??
Maybe this information can be found in one of the environment-variables
or is there a special module for it ... ?!?!
Thanks.
--
Ciao,
SimBean.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 14 Dec 2000 01:13:28 -0800
From: Michael Budash <mbudash@sonic.net>
Subject: Re: "is JScript enabled" via perl
Message-Id: <mbudash-681BDC.01132814122000@news.pacbell.net>
In article <91a1qf$ais$1@nnrp1.deja.com>, SimBean <schneider@xtewa.de>
wrote:
> Hi all,
>
> I need a little help with the following:
>
> Is there a way to determine _via perl_ whether or not a user has JScript
> enabled in his or her browser??
no, but you can put jscript on a web page that will cause a perl cgi
script to be *told* that it (jscript) is enabled...
> Maybe this information can be found in one of the environment-variables
> or is there a special module for it ... ?!?!
nope
> Thanks.
y/w
--
Michael Budash ~~~~~~~~~~ mbudash@sonic.net
------------------------------
Date: Thu, 14 Dec 2000 10:19:41 GMT
From: SimBean <schneider@xtewa.de>
Subject: Re: "is JScript enabled" via perl
Message-Id: <91a6rr$drb$1@nnrp1.deja.com>
> > Is there a way to determine _via perl_ whether or not a user has
JScript
> > enabled in his or her browser??
>
> no, but you can put jscript on a web page that will cause a perl cgi
> script to be *told* that it (jscript) is enabled...
Thanks alot, I think this will be perfect for the job.
Thanks again.
--
Ciao,
SimBean.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 14 Dec 2000 11:26:35 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: "is JScript enabled" via perl
Message-Id: <3A38A05B.3F3F61E0@schaffhausen.de>
Michael Budash schrieb:
>
> In article <91a1qf$ais$1@nnrp1.deja.com>, SimBean <schneider@xtewa.de>
> wrote:
>
> > Hi all,
> >
> > I need a little help with the following:
> >
> > Is there a way to determine _via perl_ whether or not a user has JScript
> > enabled in his or her browser??
>
> no, but you can put jscript on a web page that will cause a perl cgi
> script to be *told* that it (jscript) is enabled...
>
> > Maybe this information can be found in one of the environment-variables
> > or is there a special module for it ... ?!?!
Well, if you really mean _J_Script, you can at least increase the probability
that the user has it by reading out the user agent environment variable
to check
whether you are dealing with IE.
->malte
------------------------------
Date: Thu, 14 Dec 2000 10:09:19 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: ??newbie: s/// and \r
Message-Id: <gt6h3tkm8aqo271os7k98gt5p9emgutkc7@4ax.com>
Caveman Og wrote:
>Therefore:
>
>under Windows \n is \13\10
Nope. Under Windows, reading from a text file turns "\015\012" into
"\010", and the reverse when printing to a text file. So "\n" is still
"\012" here. ONE character. (and "\r" is "\015".)
binmode() prevents that conversion.
Note that aberations like "\015\015\012" (for example, in some
downloaded HTML pages) get turned into "\015\012".
>under MacOS \n is \13
Yup. And "\r" is "\012" (= "the other one"). The meaning of "\r" and
"\n" have been switched.
--
Bart.
------------------------------
Date: 14 Dec 2000 08:15:28 GMT
From: kevin metcalf <xzrgpnys@yvtugubhfrovm.pbz>
Subject: Re: A valuable resource! Thanks
Message-Id: <3A38822F.58C24798@yvtugubhfrovm.pbz>
Chris wrote:
[SNIPPED]
> my scripts. Perhaps someday I'll have a question for which I will be unable
> to find the answer but Perl is so damn well documented it doesn't seem
> likely. Thanks Again for providing such a valuable resource to the Perl
> programming community.
Considering how many posts that should be 'damn well documented' that
end up here, I can only assume that you are deleriously mistaken in your
conclusion here. :)
--
Kevin Metcalf
(Carbon Ocelot)
email: xzrgpnys@yvtugubhfrovm.pbz
Huh? http://www.flactem.com/utils/rot13.html
------------------------------
Date: 14 Dec 2000 07:53:37 GMT
From: r2d2@montezuma.acc.umu.se (Niklas Frykholm)
Subject: Re: CGI Question
Message-Id: <slrn93gv41.epv.r2d2@montezuma.acc.umu.se>
In article <3A373933.B82054A9@home.com>, Mike Lin wrote:
>Hi, I need to create a script that takes someone's email address (the
>input) and creates a random number or code. This means that every time
>that I enter in this same email address I will get the same "random"
>code.
>Also, on the other side. How do I create a web page that will only let
>you download a file if you enter the right code?
If you can avoid it I would suggest not using a system where the same
email address always generates the same code. If the codes are used
to protect anything worth protecting, someone will find out the mapping
you are using between email addresses and codes, and the codes will
no longer be secret.
Instead --- generate random codes and store the mapping between
emails and codes in a database. Use a good RNG, such as Crypt::Random.
// Niklas
------------------------------
Date: Thu, 14 Dec 2000 11:59:34 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Command line to sum up fields
Message-Id: <919gni$mi5@netnews.hinet.net>
Dear all,
Today my boss asked me "Has Perl any command line option
to sum up fields?" Actually he meant:
<input.txt>
45 19 23
32 33 54
34 21 15
45 72 26
<output result>
45 19 23
32 33 54
34 21 15
45 72 26
-----------
156 145 118
Well, I gave him this answer:
perl -ape 'for $i (0..$#F) { $sum[$i]+=$F[$i] }
END { print "-----------\n@sum\n" }' input.txt
He didn't seem to be satisfied.
Because I used to show him some Perl magic like
@sorted = @original[@indexes];
I think he expected to get something more terse.
@sum += @F; # Of course not, but something like that
How can I improve the command line?
Thank you.
John Lin
------------------------------
Date: Thu, 14 Dec 2000 08:29:13 GMT
From: upuautiii@my-deja.com
Subject: Re: Date::Manip. how to calc "days ago"?
Message-Id: <91a0cl$9fk$1@nnrp1.deja.com>
thanks a bunch. exactly what I was looking for.
upuautiii
In article <mbudash-225CFC.17395012122000@news.pacbell.net>,
Michael Budash <mbudash@sonic.net> wrote:
> In article <916f9a$d25$1@nnrp1.deja.com>, upuautiii@my-deja.com wrote:
>
> > I read Date::Manip's doc, and could not find how to do what I need
to
> > do.
> >
> > I want to be able to calculate the diffrence between two days, and
have
> > the result in the format: X days ago, or, Y days ahead.
> > I know it's possible, but I can't figure it out.
> >
> > thanks
> >
> >
> > Sent via Deja.com
> > http://www.deja.com/
>
> Manip.pod shows:
>
> 4. The amount of time between two dates.
>
> $date1=&ParseDate($string1);
> $date2=&ParseDate($string2);
> $delta=&DateCalc($date1,$date2,\$err);
> => 0:0:WK:DD:HH:MM:SS the weeks, days, hours, minutes, and seconds
> between the two
> $delta=&DateCalc($date1,$date2,\$err,1);
> => YY:MM:WK:DD:HH:MM:SS the years, months, etc. between the two
>
> so, as an example (beware word wrap):
>
> use Date::Manip;
> $date1=&ParseDate("20001201");
> $date2=&ParseDate("20001209");
> $delta=&DateCalc($date1,$date2,\$err);
> ($dummy1, $dummy2, $weeks, $days, $hours, $minutes, $seconds) =
> split(/:/,$delta);
> $totaldays = ((7 * $weeks) + $days);
> $totaldays .= " days ";
> $delta =~ /^(.)/;
> $totaldays .= ($1 eq "+") ? "ago" : "ahead";
> print "$totaldays\n";
>
> that code yields:
>
> 8 days ago
>
> that oughta get you started...
> --
> Michael Budash ~~~~~~~~~~ mbudash@sonic.net
>
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 14 Dec 2000 10:25:20 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: Faster than LWP
Message-Id: <3a389ed7.601942787@news.itn.is>
On Wed, 13 Dec 2000 14:45:25 -0600 (CST),
dennis100@webtv.net (BUCK NAKED1) wrote:
>Hi Helgi,
>
>I finally got your script to work with another URL; but don't know why
>it wouldn't take that tar.gz URL???
>
Because the URI::Heuristic module is translating
blabla.tar.gz to a web url, probably by adding
index.html or something to the end.
Just remove the URI part and stuff in your
own, correctly formatted url.
I get paid for this stuff and shouldn't really
be spending time programming for a complete
stranger, but it might come in handy, so here
is a new version.
BTW, I didn't write this. I jsut pasted it
directly from the Perl Cookbook. All the
code is available online at perl.com.
Regards,
Helgi Briem
< CODE BELOW>
#!/usr/local/bin/perl -w
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
# Get URL from command line or CGI or whatever
if you like. Doing this through CGI and browser
is stupid anyway. Why doesn't the user just go
straight to CPAN if he wants to use a browser.
my $url =
"http://cpan.org/modules/by-module/Alias/Alias-2.32.tar.gz";
$| = 1;
printf "%s =>\n\t", $url;
my $ua = LWP::UserAgent->new();
$ua->proxy(['http', 'ftp'] => 'http://PROXYSERVER:PORTNUM');
my $req = HTTP::Request->new(GET => $url);
my $response = $ua->request($req);
if ($response->is_error()) {
printf " %s\n", $response->status_line;
}
else
{
$outfile = 'Alias-2.32.tar.gz';
open OUT, ">$outfile" or die "Cannot open $outfile:$!\n";
binmode OUT;
print OUT $response->content;
close OUT or die "Cannot close $outfile:$!\n";
}
------------------------------
Date: 14 Dec 2000 10:24:25 GMT
From: cljlk@hotmail.com (J. K.)
Subject: ftp - which funcion for changing local site directory
Message-Id: <91a74p$s4j$1@bob.news.rcn.net>
Hi,
Which funcion I can use for changing local site directory.
Your help will be appreciated.
------------------------------
Date: Thu, 14 Dec 2000 20:55:09 +1100
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: General Tool(s) for browsing/editing DB tables?
Message-Id: <tW%Z5.1313$%v1.39744@ozemail.com.au>
You can go here http://savage.net.au/Perl.html and take your chances with
myadin.pl, for MySQL.
--
Cheers
Ron Savage
ron@savage.net.au
http://savage.net.au/index.html
John Stumbles <visstmbl@reading.ac.uk> wrote in message
news:Pine.WNT.4.30.0012122248580.113-100000@supc16.rdg.ac.uk...
------------------------------
Date: Thu, 14 Dec 2000 10:35:03 +0100
From: i-Kan Solutions <webmaster@BalkanEnergyReview.com>
Subject: Re: How to make LWP::UserAgent "frame enabled"
Message-Id: <3A389444.4FEF1B5C@BalkanEnergyReview.com>
Hi Carl,
I had the same problem but the problem seems to have been something else.
Instead of displaying the page that LWP::Useragent got, I emaile it to myself
and when I opened it in my browser, it displayed correctly. For me, it was a
browser problem. It worked in the end.
Regards,
Flora
Carl Wu wrote:
> Hi Tony,
>
> Yes the document I got back has been processed by the server locally, it
> return a page tell me how to upgrade my browser with links to Microsfot and
> Netscape.
> I did try to call $ua->agent("Mozilla 5.0") and various agent ID(s) but it
> didn't help.
> Is it possible that the server didn't rely on the UserAgent Id but because
> it detects the client is not capable of understanding frames during the
> conversation between the server and the client?
>
> Many thanks,
> Carl Wu
>
> Tony Curtis wrote in message <878zpjzv36.fsf@limey.hpcc.uh.edu>...
> >>> On Thu, 14 Dec 2000 00:43:25 GMT,
> >>> mjd@plover.com (Mark-Jason Dominus) said:
> >
> >> In article <3a38123d$0$19441$7f31c96c@news01.syd.optusnet.com.au>,
> >> Carl Wu <carlywu@yahoo.com> wrote:
> >>> When I use a LWP::UserAgent to send a request for a web page, I got
> >>> a response that I need a frame enabled browser, how can I get
> >>> around with that?
> >
> >> The result will also have <frame> tag swith the URLs for the
> >> individual frames. Extract the URLs for the frames and request them
> >> separately.
> >
> >...unless the document you get back from the server has been handled
> >locally by something that purports to check the browsers's ID and
> >refuses to serve anything it regards as non-frame-capable. If that's
> >the case, you probably just want to tell the UserAgent instance to
> >pretend it is Mozilla or IE. That's a silly check for the server to
> >make IMHO, it smacks of an ironically Byzantine attempt at laziness
> >(providing no <noframes> alternative).
> >
> >hth
> >t
> >--
> >Eih bennek, eih blavek.
------------------------------
Date: 13 Dec 2000 21:11:37 +0000
From: nobull@mail.com
Subject: Re: How to put each line of a text area into a field
Message-Id: <u9y9xjpblr.fsf@wcl-l.bham.ac.uk>
"Perry Smit" <perry@in4me.tv> writes:
> But can't get it working. I have created the following script.
What script? I see no script. I see a random collection of Perl
statements. "A script" would imply that there was some logical
relationship between them.
> get server errors, what goes wrong over here?
Server errors! This source doesn't even pass syntax check! WTF are
you doing trying it on the server?
> #!/usr/bin/perl
Missing -w, missing "use strict".
> if ($ENV{'REQUEST_METHOD'} eq 'POST')
Syntactically inavalid a serves no purpose.
> my @lines = split (/\cM\cJ|\cM|\cJ/, $sting);
What is this? This looks like random transcription from an example of
how to do something. Stop the cargo-cult programming. If we show you
how to do something we may include examples that are supposed to help
you understand how to do something in Perl. We don't expect you to
unthinkingly transcribe these lines into your code and expect them to
produce working code. This isn't magic, it is programming.
> my %fields;
> @fields{split (/\cM\cJ|\cM|\cJ/, $q->param('fieldnames'))}=
> split (/\cM\cJ|\cM|\cJ/, $q->param('fieldvalues'));
Where are you setting $q? You need to set variables before you can use
them.
use CGI;
my $q=CGI->new;
> ($mon,$day,$year) = split(m|/|,`/bin/date +%B/%e/%Y`);
> $date = "$mon $day, $year";
Hmmm.... take a look at POSIX::strftime()
> &mailto;
As a general rule you should use the func() syntax to call subroutines
rather than &func unless you specificially want the semantics of the
latter.
> foreach $name (sort keys %fields) {
> next if $fields{$fieldnames} eq "";
> print MAIL "$fieldnames = $fields{$name}\n";
> }
You clearly changed your mind at some point as to whether you would
call the variable $name or $fieldnames and didn't change all
occourances.
If you'd used strict then Perl would have picked this up for you.
Posting to Usenet and expecting people help without bothering to allow
Perl to help you is exteemly rude. I'll say that again in case you
missed it. Your behaviour here is offensive.
> <nobull@mail.com> wrote in message news:u93dfsr7ek.fsf@wcl-l.bham.ac.uk...
[snip my whole post]
This is extreemly rude. Do not do it unless you actually _want_ to
offend people.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 14 Dec 2000 10:40:20 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: http_referer Problem!?
Message-Id: <976789935.5631@itz.pp.sci.fi>
In article <m1snnrwwcz.fsf@halfdome.holdit.com>, Randal L. Schwartz wrote:
>>>>>> "Jeffrey" == Jeffrey M Vinocur <jmv16@cornell.edu> writes:
>
>Jeffrey> You can check it to prevent outside websites from guiding
>Jeffrey> users into the midst of your website without their knowledge.
>Jeffrey> For example, if you have a clipart collection online, and
>Jeffrey> want to force people to copy the images to their own servers
>Jeffrey> and not just link to yours, you could check Referrer.
>
>I've got a solution to that which works better and doesn't count on
>the referer. See
><http://www.stonehenge.com/merlyn/WebTechniques/col18.html>. Make
>them come in through the front door via time-limited URLs.
Does that prevent bookmarking? I'd rather assume it'd have to, if
it's going to prevent linking from the outside too. That might be
what you want in some cases, but not always.
Referer does have some uses. Logging is one, this is another. No,
the word "security" shouldn't be used, but showing a simple note to
visitors with a wrong referer header saying "You know, whoever made
the link you just followed wasn't being polite at all" can be useful.
Yes, used as an authentication mechanism, referer is easily faked.
It's not as if Usenet didn't have its share of those, too..
[Note followups.]
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post
something, we discuss its implications. If the discussion happens to
answer a question you've asked, that's incidental." -- nobull in clpm
------------------------------
Date: Thu, 14 Dec 2000 10:56:46 GMT
From: "Fabian Thorbjörnsson" <fabian@markisspecialisten.com>
Subject: I want to let people remove their e-mail addresses from my list.
Message-Id: <OH1_5.3892$Kd1.450603@newsb.telia.net>
When people sign in, they submit their e-mail addresses to a list that i use
to inform them about useful information about their pruducts.
I want to give them the possibility to remover their address from our list
using a form.
Can anyone help me with that. Fabian
The script which register the addresses looks like this.
# Whrite e-mail to file.
open (FILE,"$guestmail") || die "Can't Open $guestmail: $!\n";
@LINES=<FILE>;
close(FILE);
$SIZE=@LINES;
# Open Link File to Output
open (GUEST,">$guestmail") || die "Can't Open $guestmail: $!\n";
for ($i=0;$i<=$SIZE;$i++) {
$_=$LINES[$i];
if (/<!--begin-->/) {
{
print GUEST "<!--begin-->\n" ;
}
if ( $FORM{'epost'}){
print GUEST " $FORM{'epost'}<br>" ;
}
if ($entry_order eq '0') {
print GUEST "<!--begin-->\n";
}
}
else {
print GUEST $_;
}
}
close (GUEST);
------------------------------
Date: Tue, 12 Dec 2000 13:19:01 +0400
From: "rajeshpm" <rajeshpm@emirates.net.ae>
Subject: Re: Newbie problem reg. activeperl
Message-Id: <91a79r$kot1@news.emirates.net.ae>
thanks a lot.
i figured out that i had downloaded something wrong.
i downloaded the version that was compiled for Windows NT ie Apa522e.exe
i should have downloaded for Intel machines ie api522e.exe.
now it is working.
regards,
Arek P <Arek@nospam._pietruszewski_.com> wrote in message
news:9132dv$2chv$1@earth.superlink.net...
> On Sun, 10 Dec 2000 21:14:17 GMT, Bob Walton
> <bwalton@rochester.rr.com> wrote:
> >rajeshpm wrote:
> >>
> >> I have installed ActivePerl 5.6 on my computer.
> My wild guess here is that You *had downloaded* maybe ???
>
> >>I have windows98.
> >> When i double click it on windows explorer it gives a message saying
that
> >> the version of windows i am using is not compatible.
>
>
> Is it possible that You need to get the updgarde for Windows
> installer? I know that I may be reaching here, but from Your
> description of the problem.... You never know...
>
> >>
> >> So what do i do ? is there a solution to this.?
> I am pretty sure that there is...but You need to denfine *this* a
> little bit better...
>
> >> Can somebody help.
> >...
> >> vidya
> >Maybe if you told us *exactly* what the error message says and *exactly*
> >what you double-clicked on to get it, then someone might be able to
> >help.
> >--
> >Bob Walton
>
------------------------------
Date: Thu, 14 Dec 2000 10:27:38 GMT
From: gheiss@my-deja.com
Subject: perlcrt
Message-Id: <91a7an$e7k$1@nnrp1.deja.com>
How can i get perlcrt.dll for nt4
or perlcrt.lib source ?
If you are on a Win32 system, and the build process fails with linker
errors for functions in the C library, check if your Perl is configured
to use PerlCRT (running perl -V:libc should show you if this is the
case). If Perl is configured to use PerlCRT, you have to make sure
PerlCRT.lib is copied to the same location that msvcrt.lib lives in, so
that the compiler can find it on its own. msvcrt.lib is usually found
in the Visual C compiler's lib directory (e.g. C:/DevStudio/VC/lib).
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 14 Dec 2000 09:49:24 +0100
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.li>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <m1rg3to0jlu0e0m8sr1e5afjkcmvitk3ti@4ax.com>
On Tue, 12 Dec 2000 06:43:40 -0600, tadmc@metronet.com (Tad McClellan) wrote:
> You can look up any of the messages that perl might issue to
> find out what the message means and how to resolve the
> potential mistake (perldoc perldiag).
, or use 'splain' on the error output of your script (perldoc splain).
Does anyone use splain at all? Maybe you can leave it out; 'use diagnostics' may
be the more appropriate tool.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Thu, 14 Dec 2000 09:49:25 +0100
From: "Philip 'Yes, that's my address' Newton" <nospam.newton@gmx.li>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <67rg3t4sjfavvgmtjnv0afubd3o14l9e1j@4ax.com>
On 13 Dec 2000 05:39:12 GMT, stanley@skyking.OCE.ORST.EDU (John Stanley) wrote:
> >On Tue, 12 Dec 2000, tadmc@metronet.com wrote:
> >> It is standard 'netiquette to monitor (lurk) a newsgroup for a few
>
> What is the ' for?
My guess: (Internet => 'net) + etiquette.
I'd leave off the apostrophe, though (and I'd also write "on the net" rather
than "on the 'net").
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
If you're not part of the solution, you're part of the precipitate.
------------------------------
Date: Thu, 14 Dec 2000 09:09:57 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <4j3h3toa17j89nn36cqgvfd2cd6trvm3e5@4ax.com>
John Stanley wrote:
>> Do we want a "flag" in the Subject for filtering purposes?
>
>Yes. As opposed to Abigail, I want to see neither the FAQ nor any
>responses to it, as all such articles will be off-topic.
Doesn't your newsreader allow you to ignore threads containing articles
of certain authors?
--
Bart.
------------------------------
Date: Thu, 14 Dec 2000 09:12:00 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <123h3ts3uf0gn2sp02g28b2sb45sdokjmt@4ax.com>
Tom Christiansen wrote:
>>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.
Now here's an example of something that should be considered "verboten".
--
Bart.
------------------------------
Date: Thu, 14 Dec 2000 09:12:13 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <qm3h3tsh3rnkrerq3qgk6ltd0219q162bp@4ax.com>
John Stanley wrote:
>I'm asking why you think that they will follow your
>suggestions when they don't follow any others.
But now these will be published guidelines. People ignoring these
guidelines deserve all the flames they get.
--
Bart.
------------------------------
Date: Thu, 14 Dec 2000 09:15:37 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 0.1 $)
Message-Id: <fr3h3t407s0891356u9ts8dufd7liqs4q6@4ax.com>
Chris Fedde wrote:
>Here is one that Nathan Torkington used to post frequently.
>It attempts to answer the question "How can I help my self to good
>information about perl?" It is in the rotation with the faq postings.
It looks remarkably much like the mail I got when I first posted to
comp.lang.perl.misc with a new e-mail address. It got sent to every new
poster (with an unmunged e-mail address -- duh!). Doesn't this happen
any more?
--
Bart.
------------------------------
Date: Thu, 14 Dec 2000 09:18:54 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: quick way to search array members
Message-Id: <o04h3tg13qqmb39h5nmguaubtbpbefqhfd@4ax.com>
Chris Stith wrote:
>A 50% time savings on average is signifigant.
But will you always get that much savings? If every pass through your
loop takes twice as long, there won't be any saving at all. So it all
depends on how much code -- in high level Perl -- your loop body has to
execute. A simple "last if condition" could increase the execution time
per loop step by quite a few percents.
--
Bart.
------------------------------
Date: Thu, 14 Dec 2000 09:19:21 GMT
From: Basskiwi <basskiwi@my-deja.com>
Subject: Sending ; though a form.
Message-Id: <91a3am$bfr$1@nnrp1.deja.com>
I am trying to send a ; though a form, but when it comes to printing out
the string containing the ; it gets truncated (abc;def prints as abc).
The script only seems to do this when the print $variable is included in
a sub and not when it is in the main body.
Anyone any ideas?
Cheers.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Thu, 14 Dec 2000 08:27:39 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: TMTOWTDI - which way is better?
Message-Id: <3a387ac8.56856545@news.grnet.gr>
On Wed, 13 Dec 2000 09:25:25 -0500, Jeff Pinyan <jeffp@crusoe.net>
wrote:
>>my $done;
>>foreach( @old_html ){
>> $done = $done || s/\*$link_fields[0]\*(?!<\/p>$)/$include_string/i;
>> unless ( $done ){ print FH "$include_string\n" if /^<\/body>\n$/i };
>> print FH;
>>}
>
>Hmm, you're only substituting once, you know. $done = $done || ... will
>only execute the ... when $done is false, and $done will be true after the
>first successful s///.
Yes - that's the idea. To avoid evaluating the regex again after the
match has been found.
>I'd probably use
>
> my $found;
> for (@old_html) {
> # /o modifier because $link_fields[0] doesn't change, right?
> $found ||= s/pattern/$include_string/io;
> print FH $include_string, "\n" if m!^</body>$!i and not $found;
> print FH;
> }
Two good points here: using o and using different delimiters for the
match to avoid backwhacking. I always forget that one. Thanks.
Is there any advantage/disadvantage to checking the $done/$found
variable at the start of the line with unless, as I did, rather than
putting it after the pattern match, as you do?
Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer
------------------------------
Date: 14 Dec 2000 10:28:27 GMT
From: abigail@foad.org (Abigail)
Subject: Re: What is Perl anyway?
Message-Id: <slrn93h86b.elk.abigail@tsathoggua.rlyeh.net>
On Wed, 13 Dec 2000 22:47:39 +0100, Da Rula (g.klijzing@zap.a2000.nl) wrote in comp.lang.perl.misc <URL: news:<918qu2$hur$1@darwin.a2000.nl>>:
++ Which machines use perl,and why should I use it?Is it for websites too?
Three questions.
Many machines use perl. Perl has been ported to a wide range of platforms,
including, but not limited to, most versions of Windows and Unix. It also
runs on big irons and the Macintosh. Many vendors now ship Perl with their
OS.
I don't think "why should I use it" is an appropriate question. The question
should be "should I use it". And the answer is, it depends. Perl can be used
for a wide range of tasks, but so can many other languages. It has a short
development cycle, but again, other languages have that too. Perl requires
a specific mindset; many people don't want to use Perl (for various reasons),
and many people using Perl would be better off using another language.
Perl is for websites too. But that's only one application domain Perl is
being used for. And Perl isn't the only language for websites.
Abigail
------------------------------
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 5108
**************************************