[9339] in Perl-Users-Digest
Perl-Users Digest, Issue: 2933 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 22 12:26:47 1998
Date: Mon, 22 Jun 98 09:00:35 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 22 Jun 1998 Volume: 8 Number: 2933
Today's topics:
"Code-checker" for Perl. <j.bessels@telegraafnet.nl>
Re: add a record into file DBF with perl (Honza Pazdziora)
Appending to File1 from File2 <Mark_Rogers@UManitoba.CA>
Re: Appending to File1 from File2 <rootbeer@teleport.com>
Re: Appending to File1 from File2 (Bob Trieger)
Re: CGI.pm without warnings? <rootbeer@teleport.com>
Couldn't get perl scripts to run on web browsers in Win <kenho@nortel.ca>
Re: Couldn't get perl scripts to run on web browsers in (Bob Trieger)
Re: first language (Clinton Pierce)
Re: Flames.... dgris@rand.dimensional.com
Re: Flames.... <bowlin@sirius.com>
Re: Flames.... (Larry Rosler)
Re: Flames.... <tchrist@mox.perl.com>
Re: Flames.... <tchrist@mox.perl.com>
Re: Flames.... <rootbeer@teleport.com>
Re: ftp->get( ) in variable (Bob Trieger)
How can I get the IP-Number & the Remote_Host Name <at@pixelfilm.com>
Re: How can I get the IP-Number & the Remote_Host Name <rootbeer@teleport.com>
Re: How can I get the IP-Number & the Remote_Host Name <psdspss@execpc.com>
Re: How to find last modified date of a file? (Bob Trieger)
Re: How to find last modified date of a file? <richard@see.my.sig>
Re: Key exists (Larry Rosler)
Perl extension problem anranga@blr.vsnl.net.in
problem: passing an array of references <tmil@lle.rochester.edu>
Re: Question(s) about lexically scoped variables under (Larry Rosler)
Re: Script to get all IP addesses in Router-Network (Joseph A. DiVerdi, Ph.D.)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 22 Jun 1998 16:43:15 +0200
From: Jan Bessels <j.bessels@telegraafnet.nl>
Subject: "Code-checker" for Perl.
Message-Id: <358E6D83.F357B14C@telegraafnet.nl>
Hi Guys/Galls
The department I work is looking for a tool to standardize the look and
Feel of the Perls scripts. They want to standardize indentation of
constructs, naming conventions etc etc. I believe "Code-checker" for C
(windows system) is such a tool. I'm looking for alternatives for the
Perl languages for use under Unix. Anyone with a hint please respond
and/or sent an Email to j.bessels@telegraafnet.nl. Although freeware
would be nice a commercial tool isn't a problem either...
With kind regards,
Jan Bessels
===========
------------------------------
Date: Fri, 19 Jun 1998 14:03:51 GMT
From: adelton@fi.muni.cz (Honza Pazdziora)
Subject: Re: add a record into file DBF with perl
Message-Id: <adelton.898265031@nemesis>
peacemakers@my-dejanews.com writes:
> How to add a record into file DBF with Perl.
> To read I'm acctualy using module Xbase.pm
> and I dont know how to write...
You probably want to upgrade to XBase.pm, the supported XBase handling
module, which has writing capabilities. Note that the interface is not
compatible with Xbase 1.07, but is hopefully easier, and you can also
use SQL via DBD::XBase. Check CPAN.
Hope this helps,
--
------------------------------------------------------------------------
Honza Pazdziora | adelton@fi.muni.cz | http://www.fi.muni.cz/~adelton/
I can take or leave it if I please
------------------------------------------------------------------------
------------------------------
Date: Mon, 22 Jun 1998 09:56:29 -0500
From: "Mark Rogers" <Mark_Rogers@UManitoba.CA>
Subject: Appending to File1 from File2
Message-Id: <6mlr6v$dfq$1@canopus.cc.umanitoba.ca>
Hi,
Could I get a few suggestions as to how one
might append a results file to an archive file?
Here is what I am really doing.
I get a file and weed out the bad data.
I format each record for input into a database.
I want to take each of these formatted records
and place them in an archive file of all records
that have gone through the system.
There are lots of ways to do this, but it would
be nice if I could do it programmatically.
Thanks.
Mark
------------------------------
Date: Mon, 22 Jun 1998 15:07:49 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Appending to File1 from File2
Message-Id: <Pine.GSO.3.96.980622080724.6310a-100000@user2.teleport.com>
On Mon, 22 Jun 1998, Mark Rogers wrote:
> Could I get a few suggestions as to how one
> might append a results file to an archive file?
The perlfunc manpage explains how to open a file for appending. Hope this
helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 22 Jun 1998 15:09:46 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Appending to File1 from File2
Message-Id: <6mls7c$rvd$1@ligarius.ultra.net>
[ posted and mailed ]
"Mark Rogers" <Mark_Rogers@UManitoba.CA> wrote:
-> Could I get a few suggestions as to how one
-> might append a results file to an archive file?
perldoc -f open
specifically `>>'
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
and let the jerk that answers know that his
toll free number was sent as spam. "
------------------------------
Date: Mon, 22 Jun 1998 13:59:25 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: CGI.pm without warnings?
Message-Id: <Pine.GSO.3.96.980622065729.6310R-100000@user2.teleport.com>
On Mon, 22 Jun 1998, Jay Flaherty wrote:
> > If Submit Button 1 or 2 is pressed, the opposite conditional
> > complains about "Use of uninitialized value at line #"
> Pre-declare your variables using use vars qw($var1,$var2); or
> my($var1,$var2);
While that's good advice, that'll never prevent the "uninitialized value"
warning. Thanks for trying!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 22 Jun 1998 10:53:36 -0400
From: Kenneth Ho <kenho@nortel.ca>
Subject: Couldn't get perl scripts to run on web browsers in Windows95
Message-Id: <358E6FF0.67617FC7@nortel.ca>
Anyone,
I've the Personal Web Server running on a Windows 95 machine. I made
the association of the .pl extension to the perl application for the
File Types as well as the Script Mapping in the Registry. I've no
problem running the perl scripts in both DOS and Windows, but I couldn't
get them to run on the browser. When a script was called from a form, I
could see the perl.exe was running in Task manager on the server. On
the browser, it's just waiting for reply and nothing happened until
either I terminated the perl.exe or server time-out. (I'd even tried
with a script that contain only print statements for a simple html
page.) The same scripts run fine on a Power Mac running Personal Web
Server.
Any information would be appreciated and thank you in advance for your
help.
Kenneth
------------------------------
Date: Mon, 22 Jun 1998 15:23:24 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: Couldn't get perl scripts to run on web browsers in Windows95
Message-Id: <6mlt0t$rvd$2@ligarius.ultra.net>
[ posted and mailed ]
Kenneth Ho <kenho@nortel.ca> wrote:
-> I've the Personal Web Server running on a Windows 95 machine. I made
-> the association of the .pl extension to the perl application for the
-> File Types as well as the Script Mapping in the Registry. I've no
-> problem running the perl scripts in both DOS and Windows........
'nuff said. You don't have a problem with perl and there is nobody in c.l.p.m
that can help.
You will have much better luck looking for help in the documentation for your
server, then if you still can't find a resolution, try posting to an
appropriate newsgroup:
news:comp.infosystems.www.servers.ms-windows
news:comp.infosystems.www.authoring.cgi
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
and let the jerk that answers know that his
toll free number was sent as spam. "
------------------------------
Date: 22 Jun 1998 15:23:42 GMT
From: cpierce1@cp500.fsic.ford.com (Clinton Pierce)
Subject: Re: first language
Message-Id: <6mlstu$klk1@eccws1.dearborn.ford.com>
In article <6mhfcc$k4q$1@news01.li.net>,
"T Jurik" <tjurik_NoSpam_@li.net> writes:
>Deva Seetharam wrote in message <358AA28C.1882F4F9@execpc.com>...
>>
>>Programming is undoubtedly an art.
>
>I do not think Programming or programming is an "art." It does not require
>a brilliant mind to do any of what you described. Also, good programming
>and design can be learned. Very good programmers do not have higher
>intelligence than other people in professional positions. One must be
>rigorous in one's thinking, yes, but this is not an art, nor is it
>brilliance.
I disagree. Any number of non-brilliant people are currently employed as
adaquate programmers. (Carefully sidestepping the loaded word "good" and
I won't step into the intelligence == good programmer bear trap either...)
I think adaquate programming can be taught to anyone willing to learn.
But original and creative programming is something you have to be born
with, or at least predisposed to.
I can be taught to draw. Learn the concepts of perspective, shading, and
contours. I'm no good at it, I have no "knack" for it. If pressed, I
can render a usable image. Certainly not beautiful or "art" by any stretch.
I know many people who can draw beautifully. I think the same principle
applies to programming, or writing novels, or playing voilin.
--
+------------------------------------------------------------------------+
| Clinton A. Pierce | "If you rush a Miracle Man, | http://www. |
| cpierce1@ford.com | you get rotten miracles" | dcicorp.com/ |
| fubar@ameritech.net |--Miracle Max, The Princess Bride| ~clintp |
+------------------------------------------------------------------------+
GCSd-s+:+a-C++UALIS++++P+++L++E---t++X+b+++DI++++G++e+>++h----r+++y+++>y*
------------------------------
Date: Mon, 22 Jun 1998 14:35:36 GMT
From: dgris@rand.dimensional.com
Subject: Re: Flames....
Message-Id: <6mlpfl$bf2$1@rand.dimensional.com>
[posted and mailed to the cited author]
In article <6mjt6d$4ov$1@nnrp1.dejanews.com>, <birgitt@my-dejanews.com> wrote:
<snip _two_ complete articles :-(>
>1. The assumption that anybody who posts his first question here
> knows how to use a computer, has read the FAQs and some of
> the Perl documentation and has read c.l.p.m for at least a
> week is quite unrealistic.
>
What is `unrealistic' is the expectation among some that they can
enter a professional gathering and expect expert training for free.
Come on, would you ever show up at a convention of auto mechanics screaming
at people that you promised to fix this car, but can't figure out how to
start it, and expect them to do it for you? Would you accost an attorney
and demand he write a legal brief for your client because you don't know
how?
I consider it perfectly reasonable to expect people who are asking questions
about programming to know how to use their computer, to have read the
relevant documentation, and to have read a newsgroup for at least a week
before they begin posting (actually, I expect them to have read the group
for at least six months, more if they have no experience on Usenet). If
a person hasn't done these things then that person shouldn't post. If
they do post, they deserve what they get. I'd never enter into an
unfamiliar culture without taking the time to learn its values and
customs, why should I put up with those with less respect for other
people's time and energy.
<snip>
> FAQ! ANSWERS TO YOUR QUESTIONS ! READ FIRST!
> *daily* even *twice daily*. And I would include as many
> detailed pointers as you can.
>
The mini-faq never falls out of my news spool. It's there for any who want
to read it, anytime they want to read it. Posting it more frequently
wouldn't make it more visible.
> 2. Post another one saying:
> WHY YOU DON'T GET AN ANSWER TO YOUR POST !
>
I agree with this.
<snip>
> how about a pre-canned flame like this:
> WE EXPECT YOU TO HELP YOURSELF !
>
This should go into the mini-faq.
>This may sound silly, but I think it's better than to
>resort in sarcastic or emotional flames and mile-long threads.
>
If the flames convince others to _not_ post, then they are worth it.
If the programmers are perceived as a bunch of unhelpful people who
scream at newbies, well, at least the newbies will go away (perhaps
back to lurker land until they know how to program).
>Especially as very often the assumed 'sinfulness' of the newbie
>can't fairly be known. You might hurt a lot of feelings for nothing.
>And you say yourself that this approach is also not very successful.
>
No, it seems extraordinarily successful to me. The non-programmers go
away after a couple of flames, leaving the rest of us to discuss things
productively. If the feelings of someone who hasn't bothered to learn
how to properly conduct himself are hurt, so be it.
>One cannot *help* someone to read something and one cannot *help*
>someone to *help himself*.
>
No, but one has no responsibility to coddle these so called _programmers_
and to perform their jobs for them.
<snip>
>Regards,
>Birgitt Funk
>
Daniel
--
Daniel Grisinger dgris@perrin.dimensional.com
"No kings, no presidents, just a rough consensus and
running code."
Dave Clark
------------------------------
Date: Mon, 22 Jun 1998 08:24:00 -0700
From: Jim Bowlin <bowlin@sirius.com>
Subject: Re: Flames....
Message-Id: <358E7710.867F268A@sirius.com>
Chris Nandor wrote:
>
> # That's the whole point. Your talking about people who are trying to
> # learn what "grep" is -- but you are assuming (as many posters do) that
> # a novice should already know something before they even ask. Why would
> # they ask if they knew how to get the answer already?
>
> Where does it end? When someone asks how to turn the computer on? Where
> the Any key is? You have to know how to use a computer before you can
> program it, period. There are degrees of usage, and degrees of
> programming, but if you cannot search a text file, at LEAST go to an
> appropriate place to learn it, which is NOT a programming newsgroup.
[not to Chris in particular]
Comment:
These Flame threads seem circular. IMHO the pro-flamers are giving
moral arguments for flaming newbies, while (at least some of) the
anti-flamers are giving practical arguments of why polite responses may
actually be more effective at achiving the desired result which I think
many will agree is a higher signal to noise ratio in c.l.p.m.
Suggestion:
In addition to a daily posting of the FAQ, perhaps instructions on
how to answer newbie questions could also be posted. Granted it might
be difficult to achieve consensus on what these instructions should be.
Posting these instructions could have at least three positive benefits:
1) warn newbies of what kind of responses to expect
2) defuse some flames i.e. "S/he was only following instructions"
3) cut down on the honey that is attracting unwanted posts
-- Jim Bowlin
------------------------------
Date: Mon, 22 Jun 1998 08:29:11 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Flames....
Message-Id: <MPG.ff818231143d69e9896dd@nntp.hpl.hp.com>
In article <pudge-2206980902060001@dynamic52.ply.adelphia.net>, Chris
Nandor <pudge@pobox.com> says...
> In article <358d9bd3.351150@news.tc.umn.edu>, ames0009@tc.umn.edu wrote:
>
> # On Sun, 21 Jun 1998 17:00:00 GMT, chip@mail.atlantic.net (Chip
> # Salzenberg) wrote:
> #
> # >Why should it be too much to expect that a person wanting to learn
> # >about a *programming*language* know how to grep?!
> #
> # That's the whole point. Your talking about people who are trying to
> # learn what "grep" is -- but you are assuming (as many posters do) that
> # a novice should already know something before they even ask. Why would
> # they ask if they knew how to get the answer already?
>
> Where does it end? When someone asks how to turn the computer on? Where
> the Any key is? You have to know how to use a computer before you can
> program it, period. There are degrees of usage, and degrees of
> programming, but if you cannot search a text file, at LEAST go to an
> appropriate place to learn it, which is NOT a programming newsgroup.
The search tool *is* available, even on Windows systems (which is where
most of the flaming is aimed), but is hard to find. The problems are:
1. Unlike Unix systems, the tool is not available by default from the
command-line interface (which is where most Perl programming is done).
The user must know about, obtain, and install grep -- a nontrivial task.
2. The GUI tool to search files by content is hidden as an 'advanced'
capability under the fundamental 'Start:Find:Files or Folders...'
interface that even beginners use to find files by name. (Conceive of
'grep' as an option under 'ls'!)
Maybe those who respond here 'Use grep, dammit!' will consider that they
are adding yet another level of jargon to burden those struggling with
Perl. Imagine if you had never heard of 'grep' (let alone knowing what
the letters stand for). "Please search the wonderful Perl documentation
on your system for the text 'xxx'." would be a thoughtful and
compassionate way of dealing with this problem for the Unix-deprived.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 22 Jun 1998 15:26:02 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Flames....
Message-Id: <6mlt2a$4iu$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, bowlin@sirius.com writes:
:In addition to a daily posting of the FAQ
You've got to be kidding.
--tom
--
"Since nobody ever compared Hitler to Hitler, being compared with Hitler
immediately disqualifies you for Hitlerhood."
--Larry Wall
------------------------------
Date: 22 Jun 1998 15:47:27 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Flames....
Message-Id: <6mluaf$8cn$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, lr@hpl.hp.com (Larry Rosler) writes:
:Maybe those who respond here 'Use grep, dammit!' will consider that they
:are adding yet another level of jargon to burden those struggling with
:Perl.
You could just consider it a threshhold test, like the bar at amusement
park rides. Maybe that way we won't get questions about the Any key.:-)
The line between polite helpfulness and obsequious handouts to the
underfirepowered is not always clear.
--tom
--
Windows was invented to keep the stupid people away from Unix.
------------------------------
Date: Mon, 22 Jun 1998 15:53:20 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Flames....
Message-Id: <Pine.GSO.3.96.980622083750.6310f-100000@user2.teleport.com>
On Mon, 22 Jun 1998, Jim Bowlin wrote:
> In addition to a daily posting of the FAQ,
I autopost a pointer to finding the FAQ every week. If someone isn't
reading that, why would he or she read the (entire?) FAQ posted every day?
> perhaps instructions on how to answer newbie questions
> could also be posted.
There's no reason to restrict this to the perl newsgroups - perhaps we
should tell people in _every_ newsgroup how to answer questions. And
not just in newsgroups - we should mail this to everyone in the world! :-)
Seriously, if you have some guidelines on how to answer "newbie
questions", I encourage you to conserve bandwidth by placing that document
on the web, then arranging to have the URL included in the existing FAQs
and whatnot.
> Posting these instructions could have at least three positive benefits:
>
> 1) warn newbies of what kind of responses to expect
Again, if they're not reading the existing postings, what makes you think
they'll read the new ones?
> 2) defuse some flames i.e. "S/he was only following instructions"
That's no excuse. If an action is wrong, following instructions to do that
is still wrong.
> 3) cut down on the honey that is attracting unwanted posts
I don't see how posting additional information cuts down on anything.
I'm not trying to stomp on your ideas, but (to me) the people who read
aren't the problem; it's the ones who don't. And you won't get them to
read by giving them _more_ to read!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 22 Jun 1998 14:07:37 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: ftp->get( ) in variable
Message-Id: <6mloj3$pie$2@ligarius.ultra.net>
[ posted and mailed ]
Juergen Weiss <root@hpux01.hrz.uni-oldenburg.de> wrote:
-> Is there any chance to redirect the output from ftp->get( <file>, <file>
-> )
-> fro, Net::FTP into an list, array, hash.
->
You could always just save it to a temp file. Do what ever you want with that
file and then delete the file.
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
and let the jerk that answers know that his
toll free number was sent as spam. "
------------------------------
Date: Mon, 22 Jun 1998 16:30:03 +0200
From: Alex T <at@pixelfilm.com>
Subject: How can I get the IP-Number & the Remote_Host Name
Message-Id: <358E6A6A.FFEBF213@pixelfilm.com>
Hello...
How can I get the IP-Number & the Remote_Host Name from a user who is
running my
CGI-Application?
------------------------------
Date: Mon, 22 Jun 1998 14:43:23 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: How can I get the IP-Number & the Remote_Host Name
Message-Id: <Pine.GSO.3.96.980622074231.6310W-100000@user2.teleport.com>
On Mon, 22 Jun 1998, Alex T wrote:
> How can I get the IP-Number & the Remote_Host Name from a user who is
> running my CGI-Application?
The docs, FAQs, and newsgroups about CGI programming should be of
assistance to you. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 22 Jun 1998 09:40:33 -0500
From: Deva Seetharam <psdspss@execpc.com>
Subject: Re: How can I get the IP-Number & the Remote_Host Name
Message-Id: <358E6CE1.7BD0313C@execpc.com>
Alex T wrote:
> Hello...
> How can I get the IP-Number & the Remote_Host Name from a user who is
> running my
> CGI-Application?
In perl, access to cgi env is done thru %ENV associative array.
IP address of the browser = $ENV{'REMOTE_ADDR'}
Host name of the browser = $ENV{'REMOTE_HOST'}
This variable is *often not* set.
Hope that helps.
Deva
------------------------------
Date: Mon, 22 Jun 1998 14:15:36 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: How to find last modified date of a file?
Message-Id: <6mlp1o$pie$3@ligarius.ultra.net>
"Richard G. Coleman" <richard@see.my.sig> wrote:
-> In article <6mlfv5$vnq$1@strato.ultra.net>, Bob Trieger
-> <sowmaster@juicepigs.com> writes
-> >"Richard G. Coleman" <richard@see.my.sig> wrote:
-> >> How do I extract the last modified date / time of a file eg a data file
-> >-> and print it on an html page.
-> >
-> >perldoc -f stat
-> >perldoc -f print
-> >
-> >HTH
->
-> I need to put these in a perl script eg
->
-> print "That file was modified on ";
-> print {code to get date of file};
->
->
-> I don't know how to include this in the script.
I think you misunderstood.
perldoc is a program that will print the text for perl functions and modules
for you if you have perl installed correctly. for more info and how to use it,
enter `perldoc perldoc' at the prompt.
The 2 functions your are looking for are `stat' and `print'. I was merely
trying to show you how to find the documentation on them.
HTH
Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
and let the jerk that answers know that his
toll free number was sent as spam. "
------------------------------
Date: Mon, 22 Jun 1998 16:55:05 +0100
From: "Richard G. Coleman" <richard@see.my.sig>
Subject: Re: How to find last modified date of a file?
Message-Id: <hKd1SAAZ5nj1Ewgr@alchemedia.co.uk>
In article <Pine.GSO.3.96.980622065435.6310Q-100000@user2.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> writes
>On Mon, 22 Jun 1998, Richard G. Coleman wrote:
>
>> >perldoc -f stat
>> >perldoc -f print
>
>> I need to put these in a perl script eg
>>
>> print "That file was modified on ";
>> print {code to get date of file};
>>
>>
>> I don't know how to include this in the script.
>
>The person you quoted above was trying to tell you to write some code that
>uses the functions 'stat' and 'print', whose documentation you can read
>with the perldoc program. Hope this helps!
>
My apologies for the misunderstanding.
As it happens, my provider (Demon Internet UK) does not support perldoc
from the terminal screen.
Regards
Richard
--
Richard G. Coleman | richard@alchemedia.co.uk
Alchemedia Interactive Ltd | http://www.alchem.demon.co.uk/
-------------------------------------------------------------
------------------------------
Date: Mon, 22 Jun 1998 08:38:03 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Key exists
Message-Id: <MPG.ff81a3890a9f3a09896df@nntp.hpl.hp.com>
In article <358D2EF3.D99E60A8@matrox.com>, Ala Qumsieh
<aqumsieh@matrox.com> says...
> lhiller@compupartner-edm.com wrote:
...
> > How can I check if a has has a particular key defined?
>
> if (exists $hash{$key}) {
> # whatever
> }
'exists' ne 'defined'. A bit more discussion is required.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 22 Jun 1998 14:12:39 GMT
From: anranga@blr.vsnl.net.in
Subject: Perl extension problem
Message-Id: <6mloon$av0$1@nnrp1.dejanews.com>
Hi,
I am trying to write a perl extention to a C library. I have to invoke
a C function that returns a char**. This char ** should be returned
to perl an an array. I have found some example .xs files
that do this but they seem to return a reference to an array not the array
itself. Can somebody tell me how I can do this. Thanks
regards
ranga
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Mon, 22 Jun 1998 11:17:31 -0400
From: Todd Milligan <tmil@lle.rochester.edu>
Subject: problem: passing an array of references
Message-Id: <358E758B.8B0B4765@lle.rochester.edu>
Hello,
I've got an interesting problem I was hoping someone will have an
elegent solution.
I'm using DBI to convert some database reports to Perl. I have roughly
70 reports to
convert, so I thought I would make a library that will contain all
database related fuctions.
Thus taking all of the DBI functionallity out of the hands of the person
creating the report.
There is a very useful function in DBI called 'bind_columns' that
accepts scalar references. This is the functions prototype:
$rv = $sth->bind_columns(\%attr,
@refs_to_vars_to_bind);
This is an example of how I us it:
$rv = $sth->bind_columns( undef, /($FirstCol,
$SecCol) );
Here's the rub: I want to pass these refernces to a function that will
then use them
in a call to 'bind_columns'. The number of references(columns to bind)
will
never be the the same. It could be one reference or twenty. So I
thought I would
create an array of references and pass that into the library function.
The
problem is that I can't think af an elegent( read 'easy' ) way to break
the array
into the individual scalar references and use them in the call to
'bind_columns'.
Do any of you Perl gurus out there have a good solution to this
problem? I don't
have a lot of experience with references, but I have looked through the
O'Reilly books
and can't find a good solution.
I can provide additional info if anyone needs it.
Thanks in advance,
Todd
------------------------------
Date: Mon, 22 Jun 1998 08:35:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Question(s) about lexically scoped variables under 'use strict'
Message-Id: <MPG.ff819a9f80cdab49896de@nntp.hpl.hp.com>
In article <358D3210.58AC8F23@matrox.com>, Ala Qumsieh
<aqumsieh@matrox.com> says...
> Stephan Carydakis wrote:
...
> > Every variable in this sub(and the whole script!) produces an error,
> > "global symbol '%s' requires explicit package name" which I have read up
> > on. It seems that I have to either qualify every variable with an
> > explicit package name, or declare every variable with 'my'.
> >
> > Is there something I'm missing here?. Can I gather that under strict
> > that all variables need to be either predeclared with my, or qualified
> > with a package name? This seems a bit 'odd'(for want of a better word)
> > to me?
...
> Well, you could read the documentation on "use strict". This
> documentation comes with every standard version of Perl, and is probably
> residing somewhere on your harddrive.
> If you "use strict", you are actually using all three currently
> available restrictions,
>
> "vars", "subs" and "refs".
>
> Straight from perldoc strict:
>
> strict vars
...
This quote doesn't answer the question (actually, it answers it wrong --
yes, all variables must be predecalrd with 'my' or qualified...).
use vars qw( ... );
does.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Mon, 22 Jun 1998 09:46:54 -0600
From: diverdi@XTRsystems.com (Joseph A. DiVerdi, Ph.D.)
Subject: Re: Script to get all IP addesses in Router-Network
Message-Id: <diverdi-2206980946540001@tulip12.verinet.com>
In article <358E2CB8.3BB6@okay.net>, Michael Beckers
<michael.beckers@okay.net> wrote:
>Hi all,
>
>1. I am an absolut beginner in Perl.
>2. I am looking for a script which can tell me which IP-Addresses are
>avaiable in a small Router-Network.
>
>Thank you for your help and please be patiant with me ;)
>
>Best Regards, Michael Beckers
Dear Michael,
It's not clear exactly what you are lookign for... I am guessing here but
this might help. Here is script that I used to use a long time ago to
periodically check a small local network where we had a Class C domain to
see which machines were "alive". Please note that it's a shell script not
a Perl script. (Of course, if I were to write it today it would be in
Perl.)
Here's the script:
---------------------------------------------------------------------------
if [ -z "$1" ]
then
echo -n "Enter Base IP Address (e.g., 192.9.200): "
read ipadd
else
ipadd="$1"
fi
$I=1
until [ $I -eq 254 ]
do
if [ -n "`ping $ipadd.$I 3 | grep '[0-9a-z. ]*alive'`" ]
then
echo "$ipadd.$I" OK
else
echo "$ipadd.$I" not found
fi
I="`expr $I + 1`"
done
---------------------------------------------------------------------------
Here's how it would be invoked:
pingall 205.168.235
---------------------------------------------------------------------------
Here's some sample output:
205.168.235.1 OK
205.168.235.2 OK
205.168.235.3 OK
205.168.235.4 OK
205.168.235.5 OK
205.168.235.6 OK
205.168.235.7 OK
205.168.235.8 not found
205.168.235.9 OK
205.168.235.10 OK
205.168.235.11 not found
205.168.235.12 OK
205.168.235.13 not found
205.168.235.14 not found
...and so on up to 205.168.235.254...
---------------------------------------------------------------------------
Hope that this helps.
passme
--
Joseph A. DiVerdi, Ph.D. 970.221.3982 (voice)
diverdi@XTRrsystems.com (email) 970.224.3723 (fax)
http://www.XTRsystems.com
%PGPKey=('BB1469AB',[1024,'24DA 2D00 ABB0 D26F 4E14 56C9 0CEF 1053 BB14 69AB'])
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 2933
**************************************