[13722] in Perl-Users-Digest
Perl-Users Digest, Issue: 1132 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 20 14:06:25 1999
Date: Wed, 20 Oct 1999 11:05:18 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <940442716-v9-i1132@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 20 Oct 1999 Volume: 9 Number: 1132
Today's topics:
Re: Attempt to free unreference scalar? <dan@tuatha.sidhe.org>
Re: Card shuffling <NukeEmUp@ThePentagon.com>
Re: creating variable question? <aqumsieh@matrox.com>
Examining Win32 processes mirak63@yahoo.com
Re: How to get file size? <lr@hpl.hp.com>
Re: How to get file size? <acacia@online.no>
Re: How to get file size? <acacia@online.no>
Re: How to get file size? <newsposter@cthulhu.demon.nl>
Re: How to get file size? <acacia@online.no>
How to send & recv via UDP ... with IO:: ?? <visstmbl@reading.ac.uk>
Re: I pass by reference, but my array is unchanged. <lr@hpl.hp.com>
Re: I pass by reference, but my array is unchanged. (Joe Petolino)
Re: I pass by reference, but my array is unchanged. <aqumsieh@matrox.com>
Re: Ignore the idiots (including Tad) (Matthew Bafford)
Re: Ignore the idiots (Greg Snow)
Re: Ignore the idiots <bvargas@cmh.edu>
Re: IP address <lr@hpl.hp.com>
Re: New Perl/TK Tutorial on perl.com (Ilya Zakharevich)
Re: problems with proxy protocol sceme <Karsten.Priegnitz@stud.fh-hannover.de>
stealing the news: how hard can it be? <michael@cermak.com>
Re: Substitution oliver.cookEWYBLB@ukonline.co.uk
this darn error <mikee@bnis.net>
Re: this darn error <newsposter@cthulhu.demon.nl>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 20 Oct 1999 18:58:22 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Attempt to free unreference scalar?
Message-Id: <ihoP3.1745$IZ5.26210@news.rdc1.ct.home.com>
Tom Phoenix <rootbeer@redcat.com> wrote:
> On Tue, 19 Oct 1999, Jeff Boes wrote:
>> Attempt to free unreferenced scalar during global destruction.
>>
>> It appears this is causing a core dump. Version is 5.004_04 built for
>> aix, modules in use include various Mail::*, DBI, Carp, and a home-
>> grown module that uses PLMQ from IBM. Anyone have any ideas how to
>> track this down? Where are messages like this documented?
> It's in perldiag. It generally means that a compiled module (or _maybe_
> perl) suffers from a bug or miscompilation. I'd suspect the home-grown
> module, if it uses any compiled C (or other non-Perl) code.
5.004_04 did spit this error out occasionally, but IIRC it was cleaned up
in 5.004_05. In this case I think he's tripped over a legit (but fixed)
perl bug. Install 5.004_05 and you'll probably be fine.
Dan
------------------------------
Date: Wed, 20 Oct 1999 18:17:29 +0100
From: David Cantrell <NukeEmUp@ThePentagon.com>
Subject: Re: Card shuffling
Message-Id: <jvgNOGVQOC0woW0zSi=5TNTZzjz0@4ax.com>
On 20 Oct 1999 17:04:39 +0100, Jonathan Stowe
<gellyfish@gellyfish.com> said:
>David Cantrell <NukeEmUp@ThePentagon.com> wrote:
>> On 20 Oct 1999 07:33:25 -0500, abigail@delanet.com (Abigail) said:
>>
>> [david@tempest david]$ telnet www.perl.com 80
>> Trying 208.201.239.50...
>> Connected to www.perl.com.
>> Escape character is '^]'.
>> GET /pub/v/faqs HTTP/1.0
>>
>> HTTP/1.1 404 Not Found
>
>Try sending a Host: header ;-}
>
><The HTTP/1.1 is a clue there>
A few minutes later it was working again, so I can only assume that
someone was doing some server tweakage.
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: Wed, 20 Oct 1999 11:58:22 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: creating variable question?
Message-Id: <x3yu2nmhvmp.fsf@tigre.matrox.com>
beta1_version@yahoo.com writes:
> I am trying to create three variable, but
> don't quite understand how to do it.
I take it that you want to use Perl.
Do you think you have read enough about Perl for you to proceed? Are
you comfortable with the syntax and the language in general?
> example
> # > ping caltech.edu
> caltech.edu is alive
>
> I want $one=caltech.edu , $two=is, $three=alive
Look at the qx() (aka backticks) and the split() functions. You might
also want to look at open().
> once I have those as variables,
> I want to do a
> system("cat $one $two $three);
hmmm... do you know what cat() does? I suppose you mean echo()
instead.
> but how???
Why don't you just:
system "ping caltech.edu"
??
--Ala
------------------------------
Date: Wed, 20 Oct 1999 20:32:33 GMT
From: mirak63@yahoo.com
Subject: Examining Win32 processes
Message-Id: <380e24a3.17138104@news.vnet.net>
I need to examine the System Idle process to see how long it has been
running. I've checked the Perl for win32 book by Dave Roth. It shows
clearly how to create and manipulate your own processes. However, I
can't seem to find any way to access the standard processes.
It has been suggested to me to use the GetProcessTimes() function that
is referenced in MSDN but I don't understand how to use PERL to access
that.
Sorry in advance for sounding like an idiot. I've only been
programming for a year.
Thanks,
Karim Wall
mirak63@yahoo.com
------------------------------
Date: Wed, 20 Oct 1999 09:59:21 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: How to get file size?
Message-Id: <MPG.127794c38999d72098a0d1@nntp.hpl.hp.com>
In article <380dd667_2@newsread3.dircon.co.uk> on 20 Oct 1999 15:49:11
+0100, Jonathan Stowe <gellyfish@gellyfish.com> says...
> Acacia <acacia@online.no> wrote:
> > I need a simple code for retrieving the file size (in bytes and kB,
> > prefferably put into 2 different variables, i.e. $bytes and $kb) of
> > a specified file.
> >
> > For instance, how to get the size of file.zip ...
> > ------------------
> >
> > $url = http://www.get.my/file.zip
>
> but $url isnt a file its a URL it doesnt have a size ...
>
> You will need to retrieve the file from the URL before you can determine
> its size - for that I would recommend that you use the LWP modules.
Second resort, I think. First resort is to do a HEAD request and see if
$response->headers->{'content-length'}
comes back defined.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 20 Oct 1999 19:20:39 +0100
From: "Acacia" <acacia@online.no>
Subject: Re: How to get file size?
Message-Id: <BPmP3.7473$7G2.40725@news1.online.no>
ok, i've done pretty much what you guys have told me, but now a new problem
has come up...
-----
#!/usr/bin/perl
# excerpt
$path = '/usr/home/site/';
$temp = 'bigfile.zip';
$temp =~ s#.*/(.*/.*/.*)$#$1#;
$abslink = "$path/$temp";
$filesize = (stat($abslink))[7];
print "$filesize";
-----
the output for $filesize is 'blank' (meaning the path was wrong)
the reason why is because $temp =~ s#.*/(.*/.*/.*)$#$1#; puts an extra
space behind bigfile.zip, so that it turns out 'bigfile.zip '
does anyone know how to eliminate the space?
Acacia
----- Original Message -----
From: Acacia <acacia@online.no>
Newsgroups: comp.lang.perl.misc
Sent: Wednesday, October 20, 1999 4:17 PM
Subject: How to get file size?
> I need a simple code for retrieving the file size (in bytes and kB,
> prefferably put into 2 different variables, i.e. $bytes and $kb) of
> a specified file.
>
> For instance, how to get the size of file.zip ...
> ------------------
>
> $url = http://www.get.my/file.zip
>
> ------------------
>
> Please help.
>
> Acacia
>
>
------------------------------
Date: Wed, 20 Oct 1999 19:27:53 +0100
From: "Acacia" <acacia@online.no>
Subject: Re: How to get file size?
Message-Id: <mWmP3.7480$7G2.40888@news1.online.no>
sorry about the repost, but i typed something wrong in the one im replying
to...
$temp = 'bigfile.zip';
is supposed to be...
$temp = 'http://www.domain.com/files/misc/strange/bigfile.zip';
anyway, u get my point...
------------------------------
Date: 20 Oct 1999 17:28:30 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: How to get file size?
Message-Id: <7uku3u$rba$1@internal-news.uu.net>
Acacia <acacia@online.no> wrote:
> ok, i've done pretty much what you guys have told me, but now a new problem
> has come up...
Hm, no one told you to search documentation instead of asking here?
> the reason why is because $temp =~ s#.*/(.*/.*/.*)$#$1#; puts an extra
> space behind bigfile.zip, so that it turns out 'bigfile.zip '
> does anyone know how to eliminate the space?
See perlfaq4:
How do I strip blank space from the beginning/end of a string?
Erik
------------------------------
Date: Wed, 20 Oct 1999 20:03:53 +0100
From: "Acacia" <acacia@online.no>
Subject: Re: How to get file size?
Message-Id: <7snP3.7504$7G2.41491@news1.online.no>
didn't work... in the html code the output looks like this...
<td width=95 height=20 bgcolor=DADADA><font face=Verdana size=1
color=007AB5>npskin_v2.ZIP
</font></td>
while i in the code typed...
print "<td width=95 height=20 bgcolor=DADADA><font face=Verdana size=1
color=007AB5>$url</font></td>\n";
it should turn out (without any separation):
<td width=95 height=20 bgcolor=DADADA><font face=Verdana size=1
color=007AB5>npskin_v2.ZIP</font></td>
it's as if i've pressed [enter] after npskin_v2.ZIP in the HTML code...
Erik van Roode <newsposter@cthulhu.demon.nl> wrote in message
news:7uku3u$rba$1@internal-news.uu.net...
> Acacia <acacia@online.no> wrote:
> > ok, i've done pretty much what you guys have told me, but now a new
problem
> > has come up...
>
> Hm, no one told you to search documentation instead of asking here?
>
> > the reason why is because $temp =~ s#.*/(.*/.*/.*)$#$1#; puts an extra
> > space behind bigfile.zip, so that it turns out 'bigfile.zip '
> > does anyone know how to eliminate the space?
>
> See perlfaq4:
> How do I strip blank space from the beginning/end of a string?
>
> Erik
>
------------------------------
Date: Wed, 20 Oct 1999 18:45:27 +0100
From: John Stumbles <visstmbl@reading.ac.uk>
Subject: How to send & recv via UDP ... with IO:: ??
Message-Id: <Pine.WNT.4.10.9910201813130.195-100000@supc16.rdg.ac.uk>
Hi,
I'm trying to get data from one unix (Solaris) host to another
using UDP. I've looked at the examples in the manual (pod/perlipc) and
Camel and can do this with TCP. I especially like the IO:: package
versions: Interactive Client with IO::Socket and TCP Servers with
IO::Socket (reproduced below - please excuse the bandwidth).
s/tcp/udp/ on the scripts don't work however ;-)
Actually on the client the script runs, though I'm far from sure
it would work if I had a corresponding server (and connecting to
chargen/19 or time/37 produces nothing).
On the server code using udp instead of tcp in the constructor:
$server = IO::Socket::INET->new( Proto => 'udp',
LocalPort => $PORT,
Listen => SOMAXCONN,
Reuse => 1);
gives the error:
IO::Socket::INET: Operation not supported on transport endpoint at
IO_UDP_serv.pl line 8
(but _what_ specific aspect of the Operation?)
I know this is a pretty simple-minded (OK, clueless :-) approach:
UDP is connectionless and so some of the abstractions in the OO model for
TCP have no equivalents for UDP. Can anybody show me how it should be
done?
tia
[btw email Cc: of newsgroupd replies would be appreciated - news can
expire here sometimes before it arrives!]
--
John Stumbles j.d.stumbles@reading.ac.uk
I.T. Services Centre, University of Reading http://www.rdg.ac.uk/~visstmbl
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*** client ***
#!/usr/bin/perl -w
use strict;
use IO::Socket;
my ($host, $port, $kidpid, $handle, $line);
unless (@ARGV == 2) { die "usage: $0 host port" }
($host, $port) = @ARGV;
# create a tcp connection to the specified host and port
$handle = IO::Socket::INET->new(Proto => "tcp",
PeerAddr => $host,
PeerPort => $port)
or die "can't connect to port $port on $host: $!";
$handle->autoflush(1); # so output gets there right away
print STDERR "[Connected to $host:$port]\n";
# split the program into two processes, identical twins
die "can't fork: $!" unless defined($kidpid = fork());
# the if{} block runs only in the parent process
if ($kidpid) {
# copy the socket to standard output
while (defined ($line = <$handle>)) {
print STDOUT $line;
}
kill("TERM", $kidpid); # send SIGTERM to child
}
# the else{} block runs only in the child process
else {
# copy standard input to the socket
while (defined ($line = <STDIN>)) {
print $handle $line;
}
}
*** server ***
#!/usr/bin/perl -w
use diagnostics;
use IO::Socket;
use Net::hostent; # for OO version of gethostbyaddr
$PORT = 9000; # pick something not in use
$server = IO::Socket::INET->new( Proto => 'tcp',
LocalPort => $PORT,
Listen => SOMAXCONN,
Reuse => 1);
die "can't setup server" unless $server;
print "[Server $0 accepting clients]\n";
while ($client = $server->accept()) {
$client->autoflush(1);
print $client "Welcome to $0; type help for command list.\n";
$hostinfo = gethostbyaddr($client->peeraddr);
printf "[Connect from %s]\n", $hostinfo->name || $client->peerhost;
print $client "Command? ";
while ( <$client>) {
next unless /\S/; # blank line
if (/quit|exit/i) { last; }
elsif (/date|time/i) { printf $client "%s\n", scalar localtime; }
elsif (/who/i ) { print $client `who 2>&1`; }
elsif (/cookie/i ) { print $client `/usr/games/fortune 2>&1`; }
elsif (/motd/i ) { print $client `cat /etc/motd 2>&1`; }
else {
print $client "Commands: quit date who cookie motd\n";
}
} continue {
print $client "Command? ";
}
close $client;
}
------------------------------
Date: Wed, 20 Oct 1999 10:15:08 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: I pass by reference, but my array is unchanged.
Message-Id: <MPG.12779874d49b45198a0d3@nntp.hpl.hp.com>
In article <380DEFC9.50A9@fc.hp.com> on Wed, 20 Oct 1999 10:37:29 -0600,
Arne Jamtgaard <arnej@fc.hp.com> says...
+ Tad McClellan wrote:
+ > Arne Jamtgaard (arnej@fc.hp.com) wrote:
+ > : > my $i;
+
+ > : This is actually unnecessary, as the default for a for-index is
+ > : to keep it local to the for-loop.
+ >
+ > : > for $i ( 0 .. $#arr ){
+ > : > print "$arr[$i]\n";
+ > : > $arr[$i] = $i;
+ > : > }
+
+ > But it _is_ necessary if you code under "use strict".
+ If that's so, why does this code run without comment?
+
+ -----
+ #! /usr/contrib/bin/perl -w
+ # cp.pl - test program
+
+ use strict;
+
+ my @args = @ARGV;
+
+ foreach $a (@args) {
+ print "ARG: $a\n";
+ }
Heh, heh! $a and $b are package global variables, predefined for use by
sort(). Try it with $z and see what happens.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 20 Oct 1999 17:19:37 GMT
From: petolino@joe.Eng.Sun.COM (Joe Petolino)
Subject: Re: I pass by reference, but my array is unchanged.
Message-Id: <7uktj9$jnf$1@engnews2.Eng.Sun.COM>
>> : > my $i;
>> : This is actually unnecessary, as the default for a for-index is
>> : to keep it local to the for-loop.
>> : > for $i ( 0 .. $#arr ){
>> : > print "$arr[$i]\n";
>> : > $arr[$i] = $i;
>> : > }
>> But it _is_ necessary if you code under "use strict".
>If that's so, why does this code run without comment?
> . . .
>use strict;
> . . .
>foreach $a (@args) {
> print "ARG: $a\n";
> }
I think you've stumbled upon one of Perl's special globals. For efficiency
reasons, Perl's 'sort' function uses the global variables $a and $b to pass
arguments to its comparison function. 'use strict' ignores undeclared uses
of those two variables, on the off chance that your code is part of a sort
comparison routine.
-Joe
------------------------------
Date: Wed, 20 Oct 1999 12:04:06 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: I pass by reference, but my array is unchanged.
Message-Id: <x3yso36hvd5.fsf@tigre.matrox.com>
Jeff Moser <agon@unm.edu> writes:
>
>
> # I want to pass an array reference to a gah() and have gah()
> # make changes to the array. Since the array is being passed
> # by reference, I expect that any changes made in gah() will
> # actually occur to @blorg in subroutine blah(). That's not
> # what is happening though.
You are right. If you pass a variable by reference to a subroutine,
then any changes made to that variable will be retained after the end
of the subroutine.
> # The output of this program is
> # a
> # b
> # c
> # a
> # b
> # c
>
> # I expected the output of this program to be:
> # a
> # b
> # c
> # 0
> # 1
> # 2
You must be doing something wrong. Let's see.
> #!/usr/bin/perl -w
>
> use strict;
>
> blah();
> exit 0;
>
> sub blah()
> {
> my @blorg = ("a","b","c");
> gah(\@blorg);
Here you pass @blorg by reference. Good.
> my $i;
> for $i (0 .. $#blorg){
> print "$blorg[$i]\n";
> }
> }
>
> sub gah()
> {
> my $foo = shift;
Here you capture the reference.
> my @arr = @$foo;
But here, you are dereferencing the reference, and creating a new
array @arr that contains the elements of @blorg. Note that now @arr is
a *COPY* of @blorg, and is *NOT* @blorg itself.
The above line can be read as: "Create a new lexical array @arr, and
assign to it the values in the array referenced by $foo."
> my $i;
>
> for $i ( 0 .. $#arr ){
> print "$arr[$i]\n";
> $arr[$i] = $i;
Here you are assigning to $arr[$i], not to $foo->[$i].
> }
>
> }
>
HTH,
--Ala
------------------------------
Date: Wed, 20 Oct 1999 17:41:57 GMT
From: *@dragons.duesouth.net (Matthew Bafford)
Subject: Re: Ignore the idiots (including Tad)
Message-Id: <slrn80ru8p.1e9.*@dragons.duesouth.net>
On Wed, 20 Oct 1999 11:38:58 -0500, "Benjamin Vargas" <bvargas@cmh.edu>
enriched us with:
: Tad McClellan <tadmc@metronet.com> wrote in message
: news:le5ku7.h2e.ln@magna.metronet.com...
: > emlyn_a@my-deja.com wrote:
: > : Just because Abigail is posting questions that engage YOU, it does not
: > : exclude anyone else from posting for legitimate questions they have.
: > ^^^^^^^^^^
: > FAQs are not legitimate questions in *any* Usenet newsgroup.
[snip signature quotage]
You know better than that.
: I would never consider hiring a consultant with an attitude such as yours.
Since when are newsgroups places to find consultants?
We ask questions on our own time, for YOUR benefit.
We don't get paid, other than the occasional thank you email.
Is it too much to ask that you put a little bit of work into it yourself?
If you were paying us to answer your questions, most of us wouldn't care
if you asked questions that had already been answered.
--Matthew
------------------------------
Date: 20 Oct 1999 16:52:09 GMT
From: snow@statsci.com (Greg Snow)
Subject: Re: Ignore the idiots
Message-Id: <7ukrvp$p4g$1@junior.statsci.com>
>This is comp.lang.perl.misc right? Maybe there should be a
>comp.lang.perl.peoplewhoknowitallalready so that us newbies don't feel
>like we're encroaching on the elitists' turf.
This has been suggested before, but think about it for a minute, if there
were a newbies group and an experts group and you had a question that you
thought was important, would you go to the newbies group where the only
people who would answer the question might know less than you, where you
might get an answer that works, but does not have the experiance behind it
to be the BEST answer, or would you go over to the experts group hoping to
get an expert to answer. The fear is that if we split it into 2 groups,
all the newbies would flood the experts group expecting help from experts
and it would be no different from what we have now (maybe we could set up
an experts group as a decoy and all the experts could hang out on the
newbie group where the newbies are afraid to ask questions :)
>
>You must remember that although some of the questions we have could be
>answered with a book, we're not always sure which is the BEST way to do
>something, and the only way to find that out is by asking people who
>use the language all the time.
So you would go to experts group rather than a newbies group?
>I've found that the online references
>and books on the subject are over-rated: they cram too much information
>into a single explanation (often including other stuff in an example
>that is unneccessary), so we never actually find out what the CORE of
>the function/expression/whatever is.
The experts here do not dislike newbies, they dislike people who don't do
their homework (but the intersection of the 2 groups is so large that it
is easy to mistake things aimed at the one group for things aimed at the
other). If you (or anybody) posts with questions like:
"I scanned through the docs but am a little overwhelmed, I tried doing a
search using these keywords, but apparently did not think of the right
ones to use, could someone please give me a pointer to the right
section(s) for my problem"
or
"I read this in the FAQ, but don't understand this part of it, could
someone please expand on this?"
or
"the Docs cover this situation, but mine is a little different, here is
what I tried, here is what I got, but I expected/wanted this, can someone
help me?"
or
"After consulting the docs I came up with this soulution, but it seems
like there might be something better out there, any ideas?"
Then you will probably get good responses without the flames (and look for
the good in the responses that may seem otherwise at first, while they may
not answer your imediate question, they may lead to greater understanding
of bigger issues).
Another option is clp.moderated, there is less flamage there, you just
have to convince the moderators that your question is not covered in the
FAQ and is on topic (but then if you can convince the clp.misc regulars of
the same things then you won't be flammed here either).
One thing to remember is that even though usenet does not cost money
(beyond what you may pay an ISP), it is still an exchange society. Rules
of basic economics still apply. In situations where there is more supply
than demand, the demanders can make the rules, but when demand far
outweighs supply, the suplier get to make the rules (some people like to
compare clpm to other newsgroups, but they don't take the supply/demand
ratio differences into account). You don't have to read this group for
long before you realise that demand far outweighs supply, esspecially now
that both Larry Wall and Tom C. have given up on posting here. That means
that the suppliers (gurus and experts) get to make the rules and the
responsibility for quality posts belongs to those wanting good answers.
Is that fair, probably not, but the fault lays more on the abusers of the
system than on those forced to make and enforce the rules. Here is a
basic rate card for answers on clpm (not official, just my observation):
Product Cost (beyond computer and usenet access)
------- ----
Lurking Free
Flames real cheap, just post FAQ or off-topic
RTFM cheap, just post something in the manual (free
flames included)
Pointers to specific prove willingness to read docs
docs
Code Critique Post code, ask for critique, include -w and
use strict; (why should we do the work the
computer can do for you)
Clarification of prove that you have read docs and explain
Docs what you do and don't understand
Useful answers Well phrased question, proof that you did your
homework, code snippet (short but shows problem)
and both actual and expected output.
Somebody to do Money, and lots of it (these transactions should
your work for you be taken to somewhere else though).
>
>Maybe I just speak for myself here, but I doubt it.
If you check deja.com (a good thing to know how to do), you'll find that
you were not the first to suggest some of these ideas (though you were
more polite than a lot of the others).
>
>Just because Abigail is posting questions that engage YOU, it does not
>exclude anyone else from posting for legitimate questions they have.
Legitimate questions are welcome, just realize that proof of
legitimateness is the responsability of the questioner.
Hope this helps some,
--
-------------------------------------------------------------------------------
Gregory L. Snow | Inertia makes the world go round,
(Greg) | Love makes the trip worth taking.
snow@statsci.com |
------------------------------
Date: Wed, 20 Oct 1999 12:05:59 -0500
From: "Benjamin Vargas" <bvargas@cmh.edu>
Subject: Re: Ignore the idiots
Message-Id: <7uksjk$b76$1@iami.cmh.edu>
I think the simple and most polite way to cope with this situation is to
ignore the posts you don't wish to read or respond to. I don't understand
why someone would take the time to respond to a question that was posted,
but choose to try to intimidate or belittle the person asking the question
instead of providing useful advice. How does this help to promote the use
and development of the Perl language?
I think some might choose not to use or learn the language if they were to
read some of the posts in this newsgroup. I feel some of the messages
posted do not attract Perl newbies. They don't say, "Come and try your hand
at this wonderful language". Instead, they seem to say, "Don't you dare try
learning Perl unless you are an experienced programmer who does not ask
stupid questions."
I believe people ask questions in order to find solutions to problems, not
to invite others to insult or ridicule them.
bV
Brett W. McCoy <bmccoy@foiservices.com> wrote in message
news:slrn80riao.gep.bmccoy@moebius.foiservices.com...
> Also Sprach emlyn_a@my-deja.com <emlyn_a@my-deja.com>:
>
> >You must remember that although some of the questions we have could be
> >answered with a book, we're not always sure which is the BEST way to do
> >something, and the only way to find that out is by asking people who
> >use the language all the time. I've found that the online references
> >and books on the subject are over-rated: they cram too much information
> >into a single explanation (often including other stuff in an example
> >that is unneccessary), so we never actually find out what the CORE of
> >the function/expression/whatever is.
>
> That's what 'perldoc' is for. I understand the sentiment when you are
> really stuck on something, but it seems the same questions (ones that are
> answered in one of several FAQs that are distributed with Perl) keep
> getting asked over and over. I've only been in this newsgroup for a week
> or so, and it's as if the summer reruns are showing. I'm by no means an
> expert (I've only been doing Perl for less than a year), but whenever I
> open up slrn, I've got the Camel Book in my lap and terminal window open
> ready to have 'perldoc' typed into it.
>
> --
> Brett W. McCoy bmccoy@foiservices.com
> Computer Operations Manager (Alpha Geek) http://www.foiservices.com
> FOI Services, Inc./DIOGENES 301-975-0110
> --------------------------------------------------------------------------
-
------------------------------
Date: Wed, 20 Oct 1999 10:09:08 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: IP address
Message-Id: <MPG.12779713af3d6ad998a0d2@nntp.hpl.hp.com>
In article <7ukoid$bgs$1@nnrp1.deja.com> on Wed, 20 Oct 1999 15:53:55
GMT, hakanogren@my-deja.com <hakanogren@my-deja.com> says...
> I would like to know how I can get the IP number from the machine where
> the script is running.
I assume you mean that the program is being run by a server.
Dump the list of environment variables. Some servers set
$ENV{LOCAL_ADDR} as an IP address. Most servers set $ENV{SERVER_NAME}
as a domain name, which you can resolve using gethostbyname().
As a last resort, many systems have a `hostname` command, whose results
you can resolve also.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 20 Oct 1999 17:46:12 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: New Perl/TK Tutorial on perl.com
Message-Id: <7ukv54$bd9$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Stephen O. Lidie
<lusol@Pandora.CC.Lehigh.EDU>],
who wrote in article <7ukibs$1jis@fidoii.cc.Lehigh.EDU>:
> > All I see is
>
> > Essential Perl/TK
> Programming
>
> > [first.gif] [prev.gif] [1]Next [2]Last [space.gif] [3]Index [4]Home
> > [5][USEMAP:img001.gif]
>
> > Slide 1 of 31
>
> > Does not look very educative...
>
> Yup. Mannually link to the *next* page, then the slide show starts.
The only difference is that it says
Slide 2 of 31
Look as they suppose people will read docs from *GIFs*! My Lord!
Ilya
------------------------------
Date: Wed, 20 Oct 1999 19:52:36 +0200
From: "Karsten Priegnitz" <Karsten.Priegnitz@stud.fh-hannover.de>
Subject: Re: problems with proxy protocol sceme
Message-Id: <7ukva5$rl1$1@linux.rz.fh-hannover.de>
that was it!
thanks, köm
------------------------------
Date: Wed, 20 Oct 1999 13:44:16 -0400
From: "TechGuy" <michael@cermak.com>
Subject: stealing the news: how hard can it be?
Message-Id: <PbnP3.1888$l05.51357@typ11a.deja.bcandid.com>
I'd like to find/modify a script to seek out current headlines (such as
Yahoo! news, CNET, CNN, or anything like that) and create a small list
(maybe half a dozen) links on a page to those articles. I suppose this
would be somewhat similar to the services offered by isyndicate.com. Any
suggestions, comments, ideas, urls, etc are greatly appreciated.
--
TechGuy
------------------------------
Date: 20 Oct 1999 17:29:26 GMT
From: oliver.cookEWYBLB@ukonline.co.uk
Subject: Re: Substitution
Message-Id: <7uku5m$nif$1@apple.news.easynet.net>
Thanks for those answers. I can't remove the YTTFIT by the way. It's
imposed on me by my ISP.
Ollie
>oliver.cookYTTFIT@ukonline.co.uk wrote:
>
>: I wrote this script, but it bombs with the error "Can't modify
array
>: deref in substitution at /usr/local/apache/cgi-bin/plan.pl line 6,
>: near "s/\n/\<p\>/;""
>
>: The script is:
>
>: #!/usr/bin/perl
>
>
> You are missing a "-w" there.
>
> You are missing a "use strict;" too.
>
>
>: print "content-type:text/html\n\n";
>
> You are missing a space there, I think.
>
>
>: open (PLAN, "/home/ollie/.plan") || die "could not open plan
file";
>:
>: @plan = <PLAN>;
>: close(PLAN)||die "could not close plan file";
>: @plan =~ s/\n/\<p\>/;
> ^ ^
> ^ ^ unnecessary and misleading
>
>
> The binding operator (=~) binds the pattern match to a string
> (a scalar).
>
> It doesn't work on an array.
>
>
>: Any help on this one would be very gratefully received.
>
>
> foreach my $plan (@plan) {
> $plan =~ s/\n/<p>/;
> }
>
>
>: Please remove the YTTFIT before replying by email.
>
>
> Please remove the YTTFIT if you desire replies by email.
>
>
>--
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
Please remove the EWYBLB before replying by email.
***** Posted via the UK Online online newsreader *****
Go to http://www.ukonline.co.uk to find out
about other online services we offer our subscribers.
------------------------------
Date: Wed, 20 Oct 1999 17:45:43 GMT
From: Mikee <mikee@bnis.net>
Subject: this darn error
Message-Id: <s0rvu7o5r0189@corp.supernews.com>
every time i try to run a .pl file i get this error
<offline mode> : entername=value pairs on standard input
do you know why i get this?
i dont check the board alot so email me your suggestions thanx in advance
my email addy is mikee@bnis.net
--
Posted via CNET Help.com
http://www.help.com/
------------------------------
Date: 20 Oct 1999 17:49:52 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: this darn error
Message-Id: <7ukvc0$s2t$1@internal-news.uu.net>
Mikee <mikee@bnis.net> wrote:
> every time i try to run a .pl file i get this error
> <offline mode> : entername=value pairs on standard input
> do you know why i get this?
You use the CGI module?
> i dont check the board alot so email me your suggestions thanx in advance
> my email addy is mikee@bnis.net
And mine is ask_here_get_your_answer_here@cthulhu.demon.nl
Erik
------------------------------
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 1132
**************************************