[17896] in Perl-Users-Digest
Perl-Users Digest, Issue: 56 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jan 13 11:05:32 2001
Date: Sat, 13 Jan 2001 08: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: <979401910-v10-i56@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sat, 13 Jan 2001 Volume: 10 Number: 56
Today's topics:
Re: [OT] Re: Getting files off remote servers <iltzu@sci.invalid>
Re: Ada feature borrowed for Perl?? <iltzu@sci.invalid>
Adding Feild Comments in Excel using Win32::OLE <arlandw@toughguy.net>
Code breaking <jbou@bunker79.fsnet.co.uk>
Re: Code breaking <artd@artd3.com>
Re: Code breaking (Colin Watson)
Re: Code breaking <iltzu@sci.invalid>
converting a form value sandywadkins123@my-deja.com
Re: converting a form value <tony_curtis32@yahoo.com>
Re: converting a form value <iltzu@sci.invalid>
Re: HTTP::Request encoding query iain_hogg@my-deja.com
Re: HTTP::Request encoding query iain_hogg@my-deja.com
Re: HTTP::Request encoding query iain_hogg@my-deja.com
Re: HTTP::Request encoding query <iltzu@sci.invalid>
Re: Jobs: Senior Software Engineer (Tad McClellan)
Komodo (Paul Delahunta)
Re: Komodo <bowman@montana.com>
Re: Michelle, this is great! <arinagour@yahoo.co.uk>
Net::Telnet with W2K NTLM <davidkirk@mediaone.net>
Perl and AOL. How is this possible? (G.A.D.Miles)
perlscript: can't figure out what's wrong <franky.claeys@vt4.net>
Re: perlscript: can't figure out what's wrong (Tad McClellan)
Re: References (Colin Watson)
Re: RegExp substitution w/Array Dereference (Tad McClellan)
Re: Returning a filename from FILEHANDLE (Martien Verbruggen)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Jan 2001 12:18:50 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: [OT] Re: Getting files off remote servers
Message-Id: <979388129.24723@itz.pp.sci.fi>
In article <m37l402ude.fsf_-_@mumonkan.sunstarsys.com>, Joe Schaefer wrote:
>Ilmari Karonen <iltzu@sci.invalid> writes:
>
>> I just recently had a piece of spam evade my filters for the first
>> time in a long while. It was addressed to "perl@itz.pp.sci.fi". I
>> still haven't heard back from the maintainers of the relay they used
>> -- I guess I ought to see if it's still open, and nominate them for
>> the RBL if it is.
>
>Don't bother - someone already did that for you :) MAPS and ORBS
>are liberating in that way (the diligence of a few benefits us all).
Actually, they closed the relay after I wrote that. But the same
spammer is still out there, and sent me another copy over another
relay. Oh well, that one's been forwarded to the postmasters along
the chain as well. He ought to be LARTed soon enough.
--
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: 13 Jan 2001 12:14:49 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Ada feature borrowed for Perl??
Message-Id: <979385947.18000@itz.pp.sci.fi>
In article <3a5f97c8.5813$2ff@news.op.net>, Mark Jason Dominus wrote:
>In article <979339185.16527@itz.pp.sci.fi>,
>Ilmari Karonen <usenet11334@itz.pp.sci.fi> wrote:
>
>>A keyword like "then" as a low-precedence scalar comma would be nice.
>
>Or even better, it could do nothing at all!
> $title = $_, then next LINE if !$title and /\S/;
> push(@bad_urls, $url), then next URL unless $resp->is_success;
But then you lose the precedence effects. It'd be nice to write:
carp "Bleurgh!\n" then return if /bleurgh/;
push @bad_urls, $url then next URL unless $resp->is_success;
You could still have that extra comma to improve readability, since
Perl allows trailing commas anyway:
carp "Bleurgh!\n", then return if /bleurgh/;
I think it'd be best if "then" were the lowest-precedence operator in
Perl, below "or" and "xor".
\begin{daydreaming}
This would tie in with another item on my wish list, stacked statement
modifiers:
print if /foo/ while <>;
Or maybe we could generalize statement modifiers to expression
modifiers (I'd let if / unless return () or undef if false, and while
/ for could return their last value, or () / undef for cases of zero
iterations) and then dispense with the concept of statements entirely.
That would make ";" and my proposed "then" essentially equivalent,
except for their precedence relative to statement -- oops, expression
-- modifiers. We'd need to rethink the concept of blocks, though.
Maybe they could be just a variation of parentheses that creates a new
scope.. That'd push TIMTOWTDI to a whole new level.
\end{daydreaming}
>A meaningless 'then' would also have the benefit that
> if (EXPR) then BLOCK
>would no longer be a syntax error.
You have a point there. But maybe we could achieve this by having
"then" as I suggested and allowing any kind of commas between the
(EXPR) and the BLOCK. Although that'd almost certainly mean some
twisted person would write "if (EXPR) => BLOCK"..
--
Ilmari Karonen - http://www.sci.fi/~iltzu/
"The aliens don't look much like the Dutch, but . . ."
-- John Kensmark in rec.arts.sf.composition
------------------------------
Date: Sat, 13 Jan 2001 16:16:39 +0100
From: "Arland" <arlandw@toughguy.net>
Subject: Adding Feild Comments in Excel using Win32::OLE
Message-Id: <93priq$naf$1@bw107zhb.bluewin.ch>
Greetings, I'm trying to write to an Excel spreadsheet using Perl and
Win32::OLE.
Everything was pretty straightforward until I tried to create a comment in a
field.
Here is the VBA code (generated from a macro) that I'm trying to convert:
Range("C23").Select
Range("C23").AddComment
Range("C23").Comment.Text Text:="asdf"
The first 2 lines are easy:
my $Excel = Win32::OLE->GetActiveObject('Excel.Application') ||
Win32::OLE->new('Excel.Application', 'Quit');
my $Book = $Excel->Workbooks->Open("jada.xls");
my $Sheet = $Book->Worksheets(1);
$Sheet->Range("C23")->Select;
$Sheet->Range("C23")->Addcomment;
but what the actual adding of the comment is what stumped me. I looked into
the Win32::OLE man pages, and did a deja search but I couldn't find
anything.
Any insight would be much apreciated
________Arland_________
------------------------------
Date: Sat, 13 Jan 2001 13:04:58 -0000
From: "James Boulter" <jbou@bunker79.fsnet.co.uk>
Subject: Code breaking
Message-Id: <93pjqp$7e6$1@newsg1.svr.pol.co.uk>
Dear all,
I am writting a perl program to translate normal words into code. In order
to do this I need to be able to put each letter in a variable through the
same process. Is there a way of saying:
foreach (letter in the $data variable) {
translate the letter
}
If you see what I mean
Also, each letter could be put into an array, if so, how?
James
------------------------------
Date: Sat, 13 Jan 2001 08:31:09 -0500
From: "Art" <artd@artd3.com>
Subject: Re: Code breaking
Message-Id: <t60m511moorhe4@corp.supernews.com>
Not an expert, but this may work:
#!/usr/bin/perl -w
$data = 'This is a string';
#Reverses the order so when you do chop, it adds them to the array in order
$data = reverse $data;
# Gets the chopped value and pushes it (adds it) to the array
while ($data) {
push @letters, chop($data);
};
foreach $letter (@letters) {
print "$letter\n";
# do whatever you want with the individual letter now.
};
I'm sure this scriptlet will be criticize by our cordial list members for
not using use strict, I am recomending use strict, I just want to write the
damned thing and get this post over with :).
-Art
"James Boulter" <jbou@bunker79.fsnet.co.uk> wrote in message
news:93pjqp$7e6$1@newsg1.svr.pol.co.uk...
> Dear all,
>
> I am writting a perl program to translate normal words into code. In
order
> to do this I need to be able to put each letter in a variable through the
> same process. Is there a way of saying:
>
> foreach (letter in the $data variable) {
> translate the letter
> }
>
> If you see what I mean
> Also, each letter could be put into an array, if so, how?
>
> James
>
>
>
------------------------------
Date: 13 Jan 2001 14:17:48 GMT
From: cjw44@flatline.org.uk (Colin Watson)
Subject: Re: Code breaking
Message-Id: <93po2c$rdc$1@riva.ucam.org>
Art <artd@artd3.com> wrote:
>#Reverses the order so when you do chop, it adds them to the array in order
>$data = reverse $data;
>
># Gets the chopped value and pushes it (adds it) to the array
>while ($data) {
> push @letters, chop($data);
>};
This would be much more readable, and wouldn't modify $data in the
process:
my @letters = split //, $data;
>foreach $letter (@letters) {
> print "$letter\n";
> # do whatever you want with the individual letter now.
>};
>
>I'm sure this scriptlet will be criticize by our cordial list members for
>not using use strict, I am recomending use strict, I just want to write the
>damned thing and get this post over with :).
Er, you need precisely three extra my()s, you know. :) ($data, $letter,
and a separate 'my @letters' declaration.) It's not that hard.
--
Colin Watson [cjw44@flatline.org.uk]
"I guess we'll have to use something other than TCP to talk to
the University of Mars." - /usr/src/linux/net/ipv4/tcp_timer.c
------------------------------
Date: 13 Jan 2001 15:48:29 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Code breaking
Message-Id: <979399696.4497@itz.pp.sci.fi>
In article <93pjqp$7e6$1@newsg1.svr.pol.co.uk>, James Boulter wrote:
>
>I am writting a perl program to translate normal words into code. In order
>to do this I need to be able to put each letter in a variable through the
>same process. Is there a way of saying:
TIMTOWTDI. One way that avoids splitting the string is:
$string =~ s/(.)/process($1)/seg;
If you only want to substitute _letters_, instead of any characters,
replace the "." with something like "[^\W\d_]".
>Also, each letter could be put into an array, if so, how?
Again, several ways work:
my @chars = split //, $string;
my @chars = $string =~ /(.)/sg;
my @chars = unpack 'a' x length($string), $string;
The last approach appears to be fastest, but the first is by far the
most popular one because of its simplicity.
--
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: Sat, 13 Jan 2001 14:18:09 GMT
From: sandywadkins123@my-deja.com
Subject: converting a form value
Message-Id: <93po2u$giq$1@nnrp1.deja.com>
problem: when getting a form value that = Black/white it comes out
Black%2FWhite and is written to file that way.
I can't seem to convert it?? What am I doing wrong
here's what I'm doing.
$color=~ s/%([a-fA-F0-9] [a-fA-F0-9])/pack("C", hex($1))/eg;
thanks
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 13 Jan 2001 10:00:46 -0600
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: converting a form value
Message-Id: <87r927v3v5.fsf@limey.hpcc.uh.edu>
>> On Sat, 13 Jan 2001 14:18:09 GMT,
>> sandywadkins123@my-deja.com said:
> problem: when getting a form value that = Black/white it
> comes out Black%2FWhite and is written to file that way.
> I can't seem to convert it?? What am I doing wrong
> $color=~ s/%([a-fA-F0-9] [a-fA-F0-9])/pack("C",
> hex($1))/eg;
You're not using the CGI.pm module: this does all the
decoding (and much more) for you.
perldoc CGI
hth
t
--
Eih bennek, eih blavek.
------------------------------
Date: 13 Jan 2001 16:01:56 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: converting a form value
Message-Id: <979401325.16228@itz.pp.sci.fi>
In article <93po2u$giq$1@nnrp1.deja.com>, sandywadkins123@my-deja.com wrote:
>
>I can't seem to convert it?? What am I doing wrong
>
>here's what I'm doing.
>$color=~ s/%([a-fA-F0-9] [a-fA-F0-9])/pack("C", hex($1))/eg;
1. You should either remove the space in the regex, or add an "x"
modifier.
2. You should really use CGI.pm or any other module that does this
for you. Query string decoding has been solved countless times in
the past, often very badly. A few of the best solutions have been
included in modules. CGI.pm is even part of the standard perl
distribution. There's no need to try reinventing the wheel.
--
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: Sat, 13 Jan 2001 11:47:13 GMT
From: iain_hogg@my-deja.com
Subject: Re: HTTP::Request encoding query
Message-Id: <93pf81$at4$1@nnrp1.deja.com>
In article <u9g0ioir08.fsf@wcl-l.bham.ac.uk>,
nobull@mail.com wrote:
> iain_hogg@my-deja.com writes:
>
> > Take the following HTTP::Request :
> >
> > $tgt = 'http://www.acme.com/cgi/test.cgi?val=bar|';
> > $req = new HTTP::Request('GET' => $tgt);
> >
> > Now, when this request is made at some point it is encoded (in iso latin 1 I
> > think) into a HTTP request that looks like
> >
> > GET http://www.acme.com/cgi/test.cgi?val=bar%7C
> >
> > where '|' has become '%7C'
> >
> > So what I'd like to know is if there is any way to prevent this encoding
> > taking place?
>
> Wouldn't it make more sense to fix the bug in test.cgi?
>
> > I don't mind changing perl source and recompiling if someone
> > can point me in the right direction, though obviously I'd prefer not to :)
>
> ISTR that the URI::Escape module actually keeps the characters to be
> substuted in a package variable so you can tweak that varaible
> directly after loading URI::Escape. For details see source.
>
> BTW: Why do you want to make your LWP not conform to RFC2396?
>
The cgi-bin script I'm working with is out of my control, so I've no choice
but to modify the client instead. And thanks for this pointer, I'll have a
dig through the source and try this out.
--
Iain
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Sat, 13 Jan 2001 12:20:40 GMT
From: iain_hogg@my-deja.com
Subject: Re: HTTP::Request encoding query
Message-Id: <93ph6n$c1r$1@nnrp1.deja.com>
In article <m33deo2tgz.fsf@mumonkan.sunstarsys.com>,
Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
[cut]
>
> 2.4.3. Excluded US-ASCII Characters
> ...
> Other characters are excluded because gateways and other
> transport agents are known to sometimes modify such characters,
> or they are used as delimiters.
>
> unwise = "{" | "}" | "|" | "\" | "^" | "[" | "]" | "`"
>
> Data corresponding to excluded characters must be escaped
> in order to be properly represented within a URI.
> ...
>
> I'd say that's a pretty direct statement that "|" is forbidden
> in a URI.
>
No arguments there. Having a brief look over RFC 2396 did seem to suggest
though that a URI only identifies the resource and not the context i.e a URI
would be 'www.foo.com/cgi-bin/test.cgi' and would exclude any arguments to
the script i.e. 'www.foo.com/cgi-bin/test.cgi?attr=val', hence the arguments
would be considered outside the URI? This is only my take on it though.
As a side note, both Opera 4.0 and IE 5.0 ignore this RFC, they send a '|'
unescaped.
--
Iain
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Sat, 13 Jan 2001 12:22:52 GMT
From: iain_hogg@my-deja.com
Subject: Re: HTTP::Request encoding query
Message-Id: <93phar$c29$1@nnrp1.deja.com>
In article <979342462.21913@itz.pp.sci.fi>,
Ilmari Karonen <usenet11334@itz.pp.sci.fi> wrote:
> In article <Pine.LNX.4.30.0101121932210.13422-100000@lxplus003.cern.ch>, Alan J. Flavell wrote:
> >On Fri, 12 Jan 2001 iain_hogg@my-deja.com wrote:
> >
> >> The cgi-bin script I'm trying to work with (which I can't change) does not
> >> unencode its input i.e. change '%7C' back to '|',
> >
> >Then that's your real problem, but it has nothing to do with
> >programming in Perl. It would be more on-topic for a group with CGI
> >in its name.
>
> Hardly, IMHO, unless the OP is planning to write his own script
> instead of accessing an existing one.
>
> >You seem blithely unaware that there is a published interworking
> >specification, and that you are using a script that doesn't follow
> >that specification. On that basis, there could well be a lot of other
> >things wrong with the script, including security exposures.
>
> I considered a similar reply, but reading the post more carefully
> suggested the the OP was trying to access an existing, broken, service
> that he has no control over.
>
This is indeed the case. I have no control over the service, so I am forced
to adapt the client. Rather than stating 'I couldn't change' the cgi script
I should have perhaps made it clearer it was outside my control.
--
Iain
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 13 Jan 2001 12:31:14 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: HTTP::Request encoding query
Message-Id: <979388438.25236@itz.pp.sci.fi>
In article <m33deo2tgz.fsf@mumonkan.sunstarsys.com>, Joe Schaefer wrote:
>Ilmari Karonen <iltzu@sci.invalid> writes:
>> But it does point out that any encoding done after the URI has
>> been composed should be pointless, and any cases where it isn't
>> should be considered broken.
>
>Which is why the RFC makes no effort to define an "escaped" URI.
>URI's are *always* in escaped form.
I snipped the rest of your points because this is the one I wanted to
originally address. In essence, RFC2396, in defining how an URI is to
be constructed, also defines the set of strings that this construction
process can yield.
Faced with a string outside this set, HTTP::Request, which _only_ sees
the finished product of the construction process, has three options:
a) Complain and refuse to treat the string as an URI.
b) GIGO: accept the string as is, possibly emitting a warning.
c) Try to fix the string by coercing it to the set.
Of those, c is the current behaviour. I would claim that it is in
fact the worst one: it hides bugs instead of fixing or reporting them,
and it also loses to b in its ability to accommodate broken decoders.
Perhaps it would be ideal if the default behavior were a, with some
option to switch it to b for this specific purpose.
--
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: Sat, 13 Jan 2001 06:28:29 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Jobs: Senior Software Engineer
Message-Id: <slrn960eut.1g9.tadmc@tadmc26.august.net>
Jon Bell <jtbell@presby.edu> wrote:
>They can't do that any more (grep through misc.jobs.offered). That group
>has been voted out of existence, 170 to 14, as announced in
>news.announce.newgroups on 28 November 2000. For the RFD and CFV, see
>
><ftp://ftp.isc.org/pub.usenet/news.announce.newgroups/misc/misc.jobs.offered>
^
^
s#pub\.#pub/#;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 13 Jan 2001 15:10:32 GMT
From: mustbe@pdelahunta.cjb.com (Paul Delahunta)
Subject: Komodo
Message-Id: <3a606de6.762008@news.planet.nl>
Hello,
I heard about the release of ActiveState's Komodo (beta 1.0)
Does anybody have any experience using it?
And if so, what do you think of it? Is it worth the trouble? (of
downloading it, getting to know it etc; I understand you need to
download ActivePython first to get Komodo to work).
I'd like to hear any opinion.
Thanks,
Best regards,
Paul Delahunta
------------------------------
Date: Sat, 13 Jan 2001 09:00:45 -0700
From: "bowman" <bowman@montana.com>
Subject: Re: Komodo
Message-Id: <5Y_76.576$d25.2453@newsfeed.slurp.net>
Paul Delahunta <mustbe@pdelahunta.cjb.com> wrote in message
news:3a606de6.762008@news.planet.nl...
>
> And if so, what do you think of it? Is it worth the trouble? (of
> downloading it, getting to know it etc; I understand you need to
> download ActivePython first to get Komodo to work).
second hand info: some posters on c.l.python said it was quite impressive,
but like many large lizards, quite slow and not too far evolved.
------------------------------
Date: Sat, 13 Jan 2001 13:52:30 -0000
From: "chris lamb" <arinagour@yahoo.co.uk>
Subject: Re: Michelle, this is great!
Message-Id: <d4Z76.1435$ni.22881@NewsReader>
Maybe I am naive, but is this a spam or some attempt to make a security
point. All I got was a lot of html/text (I cannot stand html based email!)
which basically pointed to the page attached at the end?
What am I missing??
Please enlighten me!
Chris
----------------------------------------------------------------------------
--------------
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="refresh"
content="60;URL=http://www.bulkclicks.com/txt.php3?l=madmaxyou",'','scrollba
rs=yes'>
</head>
<body bgcolor="#FFFFFF">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>
<SCRIPT language=JavaScript>
var message=""; // Message for the alert box
// Don\'t edit below!
function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->
</SCRIPT>
</p><!-- Counter code version 1.0. Do NOT alter this code!
http://counter.mycomputer.com -->
<SCRIPT language=JavaScript
src="http://counter.mycomputer.com/get_counter.html?u=madmaxyou&c=1">
</SCRIPT>
<NOSCRIPT> <a href="http://counter.mycomputer.com/"><img alt="Counter"
src="counter.gif" border=0 width="63" height="26"></a> </NOSCRIPT> <!-- End
of Counter Code -->
<p> <a href="http://www.bulkclicks.com/txt.php3?l=madmaxyou"
target="_blank">Find
Everything!</a> <a
href="http://click.linksynergy.com/fs-bin/stat?id=b1em/08JU8Y&offerid=24136&
type=1&subid=0" >Comedy
World, Inc.</a><IMG border=0 width=1 height=1
src="http://ad.linksynergy.com/fs-bin/show?id=b1em/08JU8Y&bids=24136&type=1&
subid=0" >
<a
href="http://www.commission-junction.com/track/track.dll?AID=1201629&PID=626
939&URL=http%3A%2F%2Fwww%2Eamericas%2Donlinecasino%2Ecom%2Findex%2Easp%3Ffro
m%3D36" target="_top">
<img
src="http://www.commission-junction.com/banners/tracker.exe?PID=626939&AID=1
201629&banner=1201629%2Egif" width="120" height="60" alt="" border="0"></a>
<A
HREF="http://www.blackjackballroom.com/affiliate/referral.asp?aff_id=aff2198
"><IMG SRC="banner468_60_2.gif" width="468" height="60"></A>
<a
href="http://click.linksynergy.com/fs-bin/stat?id=b1em/08JU8Y&offerid=12761.
10000003&type=4&subid=0"><IMG alt="Banner 10000003" border=0
src="http://216.34.209.9/Banners/1156325.GIF"></a><IMG border=0 width=1
height=1
src="http://ad.linksynergy.com/fs-bin/show?id=b1em/08JU8Y&bids=12761.1000000
3&type=4&subid=0">
<!--BEGIN BE FREE TAG (c) COPYRIGHT 1997-2000 Be Free, Inc All right
reserved. -->
<script language="JavaScript"
src="http://service.bfast.com/bfast/script?bfmid=29150500&siteid=36848575&bf
page=smholiday">
</script>
<!-- END BE FREE TAG -->
</body>
</html>
------------------------------
Date: Sat, 13 Jan 2001 13:30:57 GMT
From: David Kirkpatrick <davidkirk@mediaone.net>
Subject: Net::Telnet with W2K NTLM
Message-Id: <3A6058DD.FB01FA28@mediaone.net>
Hi,
I'm sending commands to another unix machine via Net::Telnet login
etc. It works fine. When I try to access an NT 2000 machine it does
not work. I get an EOF and the session closes. The NT side seems to
use some form of login dialogue which I not sure Net::Telnet is capable
of handling. That is NTLM. NTLM has three settings for login -
0 no encryption, 1, try NTLM then try no encryption and 2 NTLM only.
I've tried all three and cannot get logged into a W2K machine. What do
I need to do to get logged into the NT 2000 Machine (advanced server).
Thanks Davidk
------------------------------
Date: Sat, 13 Jan 2001 13:15:32 GMT
From: usad1@gadnet.com (G.A.D.Miles)
Subject: Perl and AOL. How is this possible?
Message-Id: <3a605397.7747790@news.newsguy.com>
I have written some perl scripts for running your own banner exchange.
When you click on a banner it takes you to the appropriate site. This
works fine in all browsers. However, if you right click on a banner
and opt to open the page in a new browser window, it works fine in IE
and Netscape, but in AOL the script cannot find the site and returns
the default URL location.
How can this be possible since it is the server, not the browser that
is running the code?
Regards,
Drummond Miles
BannerPlus
http://www.gadnet.com/bplus
------------------------------
Date: Sat, 13 Jan 2001 16:02:52 +0100
From: "Franky Claeys" <franky.claeys@vt4.net>
Subject: perlscript: can't figure out what's wrong
Message-Id: <93pqlk$ess$1@mykenos.hogent.be>
Hi there,
For my graduationproject (I'm stuying last year commercial sciences option
management & IT) I'm working on a website that allows visitors to check the
course of stockquotes and ratio's.
For this I'm using perl and a mysql database. The graph are made with the
libs GD, GifGraph etc.
At this moment I'm having some problems with a perlscript I cannot debug
since my knowlegde of programming is not that super.
I'm receiving the following message on my commandline:
Script started on Fri Jan 12 16:59:55 2001
[root@franky cgi-bin]# perl test28dec.pl
Scalar found where operator expected at test28dec.pl line 28, at end of line
(Missing operator before ?)
syntax error at test28dec.pl line 28, near "@($row"
Execution of test28dec.pl aborted due to compilation errors.
[root@franky cgi-bin]# exit
Script done on Fri Jan 12 17:00:20 2001
Can anyone try to help debugging the script? As I see it it has to be a
minor mistake in syntax.
perl script --> look below.
Thanks a million times in advance !!!
greetz from Belgium
Frank
www.franksite.net
#!/usr/bin/perl -w
use CGI;
use GIFgraph::lines;
use DBI;
# Create an instance of CGI
$query = new CGI;
# connectie naar de DB
$dbh = DBI->connect('dbi:mysql:test', 'root', 'localhost');
# Arrays voor de data uit de table
my @day;
my @stock;
# sql query naar de DB
$sql = "SELECT day,stock FROM lh";
# voorbereiding
$sth = $dbh->prepare($sql);
# voer de query uit
$sth->execute;
# Syntaxerror should be arround here
while ($row = $sth->fetch_arrayref)
{
($day, $stock) = @($row);
push @day, $day;
push @stock, $stock;
}
# gedaan
$sth->finish;
# data array maken
@data = (\@day, \@stock);
# MIME header voor de browser
print $query->header(-type => "image/gif");
# het graph object aanmaken
$graph = new GIFgraph::lines;
# de grafiek tekenen
print $graph->plot(\@data);
# afkoppelen van DB
$dbh->disconnect;
------------------------------
Date: Sat, 13 Jan 2001 09:04:11 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: perlscript: can't figure out what's wrong
Message-Id: <slrn960o2r.22f.tadmc@tadmc26.august.net>
Franky Claeys <franky.claeys@vt4.net> wrote:
>Scalar found where operator expected at test28dec.pl line 28, at end of line
> (Missing operator before ?)
>syntax error at test28dec.pl line 28, near "@($row"
>Execution of test28dec.pl aborted due to compilation errors.
>#!/usr/bin/perl -w
This isn't related to your problem, but I've noticed another
bug in your program. There should be a:
use strict;
somewhere around here.
># Syntaxerror should be arround here
>while ($row = $sth->fetch_arrayref)
>{
> ($day, $stock) = @($row);
^ ^
^ ^
($day, $stock) = @{$row};
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Jan 2001 14:25:26 GMT
From: cjw44@flatline.org.uk (Colin Watson)
Subject: Re: References
Message-Id: <93pogm$ror$1@riva.ucam.org>
John Boy Walton <johngros.NOSPAM@bigpond.net.au> wrote:
>"Joe Schaefer" <joe+usenet@sunstarsys.com> wrote in message
>news:m3u2740yyq.fsf@mumonkan.sunstarsys.com...
>> btw - are "xaxis" and "yaxis" scalars or arrays?
>
>xaxis and yaxis are both arrays and scalars.
>I was trying to access them as arrays if an indice was passed to the sub and
>as scalars if no indice was passed.
I don't think you really understand Perl's data types, then ('perldoc
perldata'). Nothing can be both an array and a scalar. On the other
hand, a given variable might be a *reference* to either an array or a
scalar, and you can find out which by using ref().
>The problem was not using the ref correctly.
>But my previous subs used the same syntax and worked.
>I thought I figured out the diff (the ref being passed to the sub instead of
>created by the sub) but I was using $_[0][$xaxis][$yaxis] which is the same
>as $array[$xaxis][$yaxis] so I dunno.
No, it's not the same, I'm afraid. Have a look at section 3 of "Using
References" in 'perldoc perlref', particularly the sentence which
describes when the arrow is optional.
--
Colin Watson [cjw44@flatline.org.uk]
"Ye GODS! NT crashed the microwave!" "Hmmm. Am thinkink we should put
Elder Sign seal on microwave now. Leave alone." - User Friendly
------------------------------
Date: Sat, 13 Jan 2001 07:12:46 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: RegExp substitution w/Array Dereference
Message-Id: <slrn960hhu.1g9.tadmc@tadmc26.august.net>
Bald Headed John <baldheadedjohn@SpamAnyone?newsguy.com> wrote:
>
>
>I've got a little regexp problem, maybe you could give me a hand...
>
>please forgive any typos,
Typos in prose are fine. There is no forgiveness for typos in code!
So don't type code. Use copy/paste or "import" or something.
No sense in having hundreds (thousands?) of people troubleshooting
code that does not even exist.
>the regex works other than this problem;
>
>here's a scalar:
>
>$SuperString = "+Reply-To:tzf@here.to\n CC:tzf@there.tv,tzf@where.tv\n
>BCC:tzf@elsewhere.fr\n\n Subject:'the subject' body:'thebody'\n "
No, that is some code that does not even compile!
Why do you want a space in front of the CC header?
>here's an array:
>
>@Change = @_ # incoming change data
>and $Change[0] holds "tzf@farfaraway.cz" or whatever.
How @Change is populated is a possible cause of your problem,
so we need to know _exactly_ what is in there.
Saying it in natural language is cumbersome, time consuming and
ambiguous. Saying it in Perl is none of those. You can say
the above in Perl this way:
$Change[0] = 'tzf@farfaraway.cz';
>here's the substitution regex expression:
>
>THE PROBLEM EXPRESSION:
>$SuperString = (s/Reply-To:.*?\\n/Reply-To:$Change[0]\\n/)
^^ ^^ ^^ you want 1 backslash?
^^ I think you want =~ there instead
>THE PROBLEMATIC RESULT:
It does not compile. There *is no* result!
Post a short and complete program *that we can run* and we will
help you fix it.
>...more than a fix, I'd REALLY like an explanation of what the
>interpreter is thinking.
It is thinking you have syntax errors, so it refuses to execute.
>Is it taking [0] as a character class?
No.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 14 Jan 2001 00:26:30 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Returning a filename from FILEHANDLE
Message-Id: <slrn960ls6.50v.mgjv@martien.heliotrope.home>
On Sat, 13 Jan 2001 07:00:09 -0000,
Chris Stith <mischief@velma.motion.net> wrote:
> Julian Cook/Sherab Gyatso <president@webticker.com> wrote:
>
>> Is there a function is PERL that will return what a filehandle is
>> associated with?
[snip of clever solution for Unix-like systems. However, see further
comments]
> Basically I choose the directory I think the file is in, then
> compare the inode reported by stat() for the filehandle to the
> inode reported by stat() for the file names returned by readdir().
>
> If a file name and file handle both use the same inode, they are
> the same file (unless something really funky is going on). If you
Or, unless you suddenly are on a different file system then you thought
you were because you followed a symbolic link. Or unless that same file
you think you are reading actually is a hard link to the file you are
actually reading (although that might not matter to you).
Symbolic and hard links make it hard to be confident in applying
solutions like this. If you open /foo/bar/banana which really is a
symlink to /bar/foo/banana, then you can search for the appropriate
inode in the directory you think it should be in as much as you want,
you won't find it. Especially is /bar is a different file system, you
can even scan the whole of the /foo file system, and still not find the
right inode. Even worse, you might find one that matches, but that's a
totally different file.
If you're on other OS's where the relationships between files and
directories can be even more odd, you might run into other problems.
> are more paranoid, stat() returns a bunch of stuff. I'd say if
> fields 0 through 7 don't satisfy you, then you're pretty much
> out of luck, although if you just have to, you could compare the
> whole thing.
That is a solution to prevent accidentally thinking that a file with the
same inode number, but on another file system is the one you have open,
but what do you do after that? Scan all file systems? Give up [1]?
If /foo/bar/banana is a hard link to /bar/foo/banana (they're on the
same file system now), then how do you determine which name you used to
open the file? All of the stat() values will be the same.
of course, you could check the 4th return value of stat(), and try to be
clever, but the question pops up about how useful all this is getting.
> Another operator (set of them, actually) that work(s) on both
> filehandles and file names (?:is|are) the -x operators(s).
> Two files with the same values returned by -s, -M, -A, and -C
> are probably the same file. If you're paranoid, you could
Probably might be good enough for many people, but as far as I am
concerned, it isn't. if you can't determine with certainty,
retrospectively, what the original file name was you opened, then you
should keep that name around.
> run the gamut of all the -x ops until they all match up or don't.
Interestingly, as you mentione, all of those operators do take a file
handle. So do many others. I have mentioned in another post that what I
believe should be done, is to keep the original name together with the
file handle.
However, the question does come up: Why do you _need_ that name anyway?
Is it to reopen the file after closing it? Almost any other requirement
will happily take the filehandle as an argument. The OP didn't mention
_why_ they thought they needed this information after the fact, but in
most other cases I;ve ever heard this question asked, there was no
actual need, just a wish.
> If something might be a special file, you could test for that with
> the -x ops first.
>
> Hopefully this helps (or at least entertains) someone, if not the
> OP.
It probably does help some people. I do hope, however, that those people
will document that their software will probably not deal very well with
symlinks or being spread over multiple file systems. otherwise they may
get some angry admin call them up and complain :)
Of course, to fix the problem, the easiest thing is to not make
assumptions, and to keep the original file name around, if it's needed.
> Product shown enlarged to make you think you're getting more.
Heh :)
Martien
[1] I've had the dubious pleasure of having to administer software
packages that couldn't comfortably deal with symbolic links, which meant
I couldn't split their logs from their binaries. Believe me, a system
admin will be pissed off if software misbehaves in ways like that.
--
Martien Verbruggen |
Interactive Media Division | The world is complex; sendmail.cf
Commercial Dynamics Pty. Ltd. | reflects this.
NSW, Australia |
------------------------------
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 V10 Issue 56
*************************************