[13863] in Perl-Users-Digest
Perl-Users Digest, Issue: 1273 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 3 21:10:32 1999
Date: Wed, 3 Nov 1999 18:10:22 -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: <941681421-v9-i1273@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 3 Nov 1999 Volume: 9 Number: 1273
Today's topics:
Keeping %blah in a uri string crackbaby1@my-deja.com
Re: Need nifty code for displaying Web Graphics (Martien Verbruggen)
Re: Need nifty code for displaying Web Graphics <flavell@a5.ph.gla.ac.uk>
Re: Need to remove url and keep file <cassell@mail.cor.epa.gov>
Re: Newbie confusion about syntax <rootbeer@redcat.com>
Newbie Help (Neo Sevon)
Re: Perl and commonsense part 2 (Martien Verbruggen)
Re: Perl and commonsense part 2 (Craig Berry)
perl on windows NT <yuri@intertrust.com>
PerlApp <samay1NOsaSPAM@hotmail.com.invalid>
Re: perldoc and the string "PI::" <cassell@mail.cor.epa.gov>
Re: perldoc and the string "PI::" <uri@sysarch.com>
Re: perldoc and the string "PI::" (Alan Curry)
Re: Running perl on NT (Mjd440)
Selective require <tonyboy@earthling.net>
Re: Selective require <rootbeer@redcat.com>
The Answer!! (Was: Need nifty code for displaying Web G (Antopia Herpes Network)
well, then how DOES it work? <reembar@hotmail.com>
Re: well, then how DOES it work? (Michael Budash)
Re: Why am I getting an undefined subroutine error? <cassell@mail.cor.epa.gov>
Re: Why am I getting an undefined subroutine error? <aqumsieh@matrox.com>
Re: Why doesn't this work? <010101@technologist.com>
Re: Why doesn't this work? <cassell@mail.cor.epa.gov>
Re: Year 2000 date problem (Craig Berry)
Re: Year 2000 date problem <lr@hpl.hp.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 04 Nov 1999 00:40:19 GMT
From: crackbaby1@my-deja.com
Subject: Keeping %blah in a uri string
Message-Id: <7vqklj$o8u$1@nnrp1.deja.com>
I send data to a cgi script and need to capture the data in a variable.
Netscape can't handle this but IE can.
I have been trying use URI::Escape
The $describe variable collects a description:
ie. THIS IMAGE IS MINE...
use URI::Escape;
$describe = $cgi->param('describe');
$describe = uri_escape($describe);
Need help...
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 04 Nov 1999 00:16:36 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Need nifty code for displaying Web Graphics
Message-Id: <Ef4U3.101$KN4.4767@nsw.nnrp.telstra.net>
On Thu, 04 Nov 1999 09:16:14 +1030,
Henry Penninkilampi <spamfree@metropolis.net.au> wrote:
> In article <m3puxrgs82.fsf@projdirc.literacy.upenn.edu>, Steve Linberg
> <linberg@literacy.upenn.edu> wrote:
> > No. HTML doesn't support in-line image data.
>
> Hmmm...
>
> var fred = 'GIF89a\1\0\1\0\200[...]\1\0;'
> ...
> <IMG SRC="javascript:fred">
That is not HTML.
> comp.lang.javascript
Indeed
Martien
--
Martien Verbruggen |
Interactive Media Division | The gene pool could use a little
Commercial Dynamics Pty. Ltd. | chlorine.
NSW, Australia |
------------------------------
Date: Thu, 4 Nov 1999 00:15:32 +0000
From: "Alan J. Flavell" <flavell@a5.ph.gla.ac.uk>
Subject: Re: Need nifty code for displaying Web Graphics
Message-Id: <Pine.OSF.4.20.9911040003020.2389-100000@a5.ph.gla.ac.uk>
On 3 Nov 1999, Steve Linberg wrote:
> NOSPAMajm@antopia.com writes:
>
> > Is there then a way in perl to incorporate variable $fred into an HTML
> > statement such that it actually shows up as a .jpg picture?
> No. HTML doesn't support in-line image data.
Right enough: "HTML" doesn't _support_ any kind of image data: it only
supplies hooks for the URL of image data. Since one kind of URL
consists of inline data, then HTML's support for inline data is just
as strong as HTML's support for out-of-line data: it's exactly the
same hook in each case.
Of course, browser support is a different matter. They're too busy
inventing new gizmos to bother supporting the stuff described in the
open specifications.
> A more precise question might be: can I use Perl to write a CGI script to
> return a JPEG image built from image data stored outside my web server's
> document root? And the answer is: "Sure." And it's a great topic for
> comp.infosystems.www.authoring.cgi. :)
No argument with any of that ;-)
I think what the questioner really wants, I mean that actually works
in the available mass-market browser-like things, is covered in FAQs.
Generate the URL of the script itself into the HTML (into the IMG SRC
or whatever), with arguments that'll be recognized when it comes back
again, and then when the browser calls the script again with those
arguments, have the script generate the image data.
------------------------------
Date: Wed, 03 Nov 1999 16:07:15 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Need to remove url and keep file
Message-Id: <3820CE33.89A44045@mail.cor.epa.gov>
crackbaby1@my-deja.com wrote:
>
> This worked, I got the code from another post.
>
> if ($image_file =~ /.*\//)
> {
> $imagefile = "$'\n";
> }
>
> Thanks for the code...
Uggghh. Didn't you notice that this was the *worst* bit of
code in that thread? Also, using $' makes you take a
performance penalty. Extra badness. Please look at the
other snippets in that thread and find a better one.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 3 Nov 1999 16:18:36 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Newbie confusion about syntax
Message-Id: <Pine.GSO.4.10.9911031615580.29670-100000@user2.teleport.com>
On Wed, 3 Nov 1999, it was written:
> Subject: Newbie confusion about syntax
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> & $returnedAttribues is interpreted as if it were
> &$returnedAttributes.
Yes; that's a code reference.
> $problem = ARCHIVE & $returnedAttributes;
You should define ARCHIVE with the 'use constant' pragma (or equivalent
code). If you've done that, this confusion shouldn't happen.
Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 04 Nov 1999 01:13:23 GMT
From: neosevon@aol.comnospam (Neo Sevon)
Subject: Newbie Help
Message-Id: <19991103201323.10872.00000647@ng-cq1.aol.com>
Hello. I am a total newbie to programming, but I am really interested in
learning Perl. Is there anywhere online (Free, preferably) where I could learn
it or at least get some tutorials or something? Please email NeoSevon@aol.com
if you can help.
---
Neo Sevon
New and IMPROVED!
I'm not crazy. It's the voices, THEY'RE the crazy ones...
Can't sleep clown will eat me
Can't sleep clown will eat me
Can't sleep clown will eat me
Can't sleep clown will eat me
Can't sleep clown will eat me
------------------------------
Date: Wed, 03 Nov 1999 23:08:24 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl and commonsense part 2
Message-Id: <If3U3.86$KN4.1769@nsw.nnrp.telstra.net>
On Wed, 03 Nov 1999 14:42:31 GMT,
ajmayo@my-deja.com <ajmayo@my-deja.com> wrote:
> Incidentally in Javascript arrays are indexed by either a numeric
> subscript *or* a key, making them both hashes and arrays. This, on the
> surface, strikes me as a somewhat more orthogonal approach.
Apart from all the other answers you got:
Comparinf JavaScript to Perl is of course nonsensical, but that's
another issue. If you want hashes that you can use as arrays, perl
5.005 and up offer you the pseudo-hash.
# man perlref
Pseudo-hashes: Using an array as a hash
WARNING: This section describes an experimental feature.
Details may change without notice in future versions.
Martien
--
Martien Verbruggen |
Interactive Media Division | Failure is not an option. It comes
Commercial Dynamics Pty. Ltd. | bundled with your Microsoft product.
NSW, Australia |
------------------------------
Date: Thu, 04 Nov 1999 01:13:38 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Perl and commonsense part 2
Message-Id: <s21ne2bq24261@corp.supernews.com>
ajmayo@my-deja.com wrote:
: Further to my previous post. My colleague asked me how you would
: combine two hashes to create a single hash.
:
: Well, this is simple with two arrays. Just use push..
:
: $a[0]=1;
: $a[1]=2;
: @b=@a;
What's the point of that last line?
: $b[0]=3;
: $b[1]=4;
: push @a,@b;
: print $a[2],"\n";
:
: So, let's use commonsense. To do the same with two hashes, you'd do
: this, right?
Why is this common sense? One of the reasons for the name change from
'associative arrays' is that hashes are *not* arrays.
: $a{'1'}=1;
: $a{'2'}=2;
: %b=%a;
: $b{'3'}=3;
: $b{'4'}=4;
: push %a,%b;
: print $a{'4'},"\n";
:
: Don't be silly. This doesn't work. Hashes are not arrays. Perl:1,
: commonsense:nil.
Truly don't see this.
: Incidentally in Javascript arrays are indexed by either a numeric
: subscript *or* a key, making them both hashes and arrays. This, on the
: surface, strikes me as a somewhat more orthogonal approach.
If Perl's hashes retained order of entries, this might make sense. But
they don't, which allows them to be more efficent than they would be with
this constraint. Thus it's good that there are two different data
structures available.
Beyond that, how do you reconcile positional vs. named references? If I
make it so arrays can be keyed by numbers or strings, and then do the
following:
$a[0] = 0;
$a[1] = 1;
$b[0] = 2;
$b[1] = 3;
$b[2] = 4;
push @a, @b;
What is the value of $a[2]? Arguning from array-like behavior, the answer
is 2; from hash-like behavior, it's 4.
: PS: how *do* you combine two hashes, then, without explicitly iterating
: over one of them?
One of the reason this is slightly awkward is that there's no good way to
deal with which of duplicate-key values to throw out. But to do it
"randomly",
%c = ( %a, %b );
works just fine.
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: Wed, 03 Nov 1999 17:18:01 -0800
From: Yuri Shtil <yuri@intertrust.com>
Subject: perl on windows NT
Message-Id: <3820DEC9.1DBDD911@intertrust.com>
Hi, folks
I want to be able to find out from a perl code if a process with gived
pid exists on the local Windows NT machine.
I looked through several modules but did not find any clues.
Any help will be greatly appreciated.
Please reply via e-mail to yuri@intertrust.com
------------------------------
Date: Wed, 03 Nov 1999 15:02:47 -0800
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: PerlApp
Message-Id: <000b8d9b.ca9a83b9@usw-ex0101-006.remarq.com>
Hi, I got the PDK from ActivePerl
When I use PerlApp.pl and get *.exe I am facing some problem.
1. I added some modules, which were called by modules (included in my
program.pl file) in my program.pl file.
Which solve some of my problem..
Now I am using the standard LWP/HTTP Modules to get the data..
$Address =$ie->LocationURL; ( which is like "http://www.perl.com")
my $ua = new LWP::UserAgent;
$ua->proxy('http', $ProxyServerAddress);
my $request = new HTTP::Request('GET', $Address);
my $response = $ua->request($request); ###
if ($response->is_success) {
$html = $response->content;
} else {
$html = $response->error_as_HTML;
} my $ua = new LWP::UserAgent;
} else {
$html = $response->error_as_HTML;
}
All, I am getting is..
An Error Occurred, 501, Protocol scheme 'http' is not supported at evel
(58) line 186.
Note that the same program runs fine when I am calling from program.pl
file..But when I make program.exe using Perlapp -f (standalone version)
it gives me this error..
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Wed, 03 Nov 1999 16:33:01 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: perldoc and the string "PI::"
Message-Id: <3820D43D.BEA54FB7@mail.cor.epa.gov>
Tom Phoenix wrote:
>
> On Wed, 3 Nov 1999, Alan Curry wrote:
>
> > pod2man is converting the word "PI" to the greek letter.
>
> The fact that PI happens to be the name of a Greek letter shouldn't make
> one iota of difference. Does this also affect alpha test versions of
> software to monitor the effects of gamma ray bombardment on beta-format
> videos starring Catherine Zeta-Jones?
More importantly, does it affect Catherine Zeta-Jones?
And can we monitor *that* ?
Actually, I think Alan is right. Note this text from the POD
of pod2man:
Besides the obvious pod conversions, B<pod2man> also takes care of
func(), func(n), and simple variable references like $foo or @bar so
you don't have to use code escapes for them; complex expressions like
C<$fred{'stuff'}> will still need to be escaped, though. Other nagging
little roffish things that it catches include translating the minus in
something like foo-bar, making a long dash--like this--into a real em
dash, fixing up "paired quotes", putting a little space after the
parens in something like func(), making C++ and PI look right, making
double underbars have a little tiny space between them, making ALLCAPS
a teeny bit smaller in troff(1), and escaping backslashes so you don't
have to.
And, deep in the innards of pod2man, we find this tidbit:
.ds PI pi
and
.ds PI \\(*p
'br\\}
So it plays with PI, but with no other Greek letter. At least,
none that I found.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 03 Nov 1999 20:04:42 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: perldoc and the string "PI::"
Message-Id: <x766zj83th.fsf@home.sysarch.com>
>>>>> "DC" == David Cassell <cassell@mail.cor.epa.gov> writes:
DC> And, deep in the innards of pod2man, we find this tidbit:
DC> .ds PI pi
DC> and
DC> .ds PI \\(*p
DC> 'br\\}
DC> So it plays with PI, but with no other Greek letter. At least,
DC> none that I found.
it ain't greek to me. thems nroff doohickies. larry (the wall one) wrote
wacky support for nroff documentation in code in pre-pod days. if you
look in your /eg (going away in 5.6 i am told) dir you will find some
moldy examples of it. so probably nroff/groff is converting the PI to pi
and not pod. try looking at the output of pod2man before piping to
nroff.
if it is doing the lower casing it is to support some use of pi in nroff.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Thu, 04 Nov 1999 01:20:28 GMT
From: pacman@defiant.cqc.com (Alan Curry)
Subject: Re: perldoc and the string "PI::"
Message-Id: <wb5U3.26119$23.1362324@typ11.nn.bcandid.com>
In article <x766zj83th.fsf@home.sysarch.com>,
Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "DC" == David Cassell <cassell@mail.cor.epa.gov> writes:
>
> DC> .ds PI pi
>
> DC> and
>
> DC> .ds PI \\(*p
> DC> 'br\\}
>
>it ain't greek to me. thems nroff doohickies. larry (the wall one) wrote
Them doohickies is in a heredoc in pod2man. It is to be blamed for generating
them. Did anyone try pod2man Foo.pm | groff -Tps | lpr like I suggested? (You
may use a temp file and ghostview instead of lpr if you like)
--
Alan Curry |Declaration of | _../\. ./\.._ ____. ____.
pacman@cqc.com|bigotries (should| [ | | ] / _> / _>
--------------+save some time): | \__/ \__/ \___: \___:
Linux,vim,trn,GPL,zsh,qmail,^H | "Screw you guys, I'm going home" -- Cartman
------------------------------
Date: 03 Nov 1999 23:53:36 GMT
From: mjd440@aol.com (Mjd440)
Subject: Re: Running perl on NT
Message-Id: <19991103185336.09661.00000553@ng-fp1.aol.com>
Hi Tim,
Here's what I found in the ActiveState help screen. This should do the trick
for you....
From the View menu in the My Computer window, choose Options. The
Options dialog box appears.
In the Options dialog box, select the File Types tab.
Click the New Type button. The Add New File Type dialog box appears.
In the ``Description of type'' box, type ``Perl Script''.
In the ``Associated extension'' box, type ``.pl''.
Leave the Content Type (MIME) box blank.
Click the New button beneath the Actions list. The New Action
dialog box will appear.
In the Action box, type ``Open'' (it's important to use this name for the
action!).
In the ``Application used to perform action'' box, type [full path to
perl]\perl.exe %1 %*, where [full path to perl] is the full path to perl.exe on
your machine. If perl is in your path, you can put just perl.exe, but for
esoteric reasons it's better to put the full path. Also, if the path to your
interpreter includes spaces (like C:\Program Files\perl5) put in the DOS path
instead (C:\progra~1\perl5).
Click OK to close the New Action dialog box.
Click OK to close the Add New File Type dialog box.
Click OK to close the Options dialog box.
------------------------------
Date: Wed, 03 Nov 1999 18:46:50 -0500
From: Anthony Lalande <tonyboy@earthling.net>
Subject: Selective require
Message-Id: <B446339A.672%tonyboy@earthling.net>
Greetings,
I have many Perl scripts that call a main support library. This support
library, in turn, calls other libraries for use. Depending on where the
originating script is located, it may or may not require a certain library.
I would like to make it so that all scripts in the foobar directory trigger
the calling of a foobar.lib.pl file. I've tried something like:
@caller = caller;
require "foobar-lib.pl" if ($caller[1] =~ /\/foobar\//i);
...and...
require "foobar-lib.pl" if ($0 =~ /\/foobar\//i);
But these two only return the script name, and not the directory path. Any
ideas?
Regards,
- Anthony Lalande
------------------------------
Date: Wed, 3 Nov 1999 17:50:43 -0800
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Selective require
Message-Id: <Pine.GSO.4.10.9911031744190.29670-100000@user2.teleport.com>
On Wed, 3 Nov 1999, Anthony Lalande wrote:
> I have many Perl scripts that call a main support library. This support
> library, in turn, calls other libraries for use. Depending on where the
> originating script is located, it may or may not require a certain library.
Why not have the originating script load the library if it's needed?
Having code which works differently depending upon where the source is
stored is, well, somewhat odd. To me, it seems as sensible as having a
program which spellchecks its own source. :-) But maybe I'm missing
something....
In any case, it may not always be possible to identify the location of the
calling program.
If you don't want the originating script to load the library, you could
use some other way to signal whether the other library is needed. For
example, you could make your library into a module, then give it an
additional parameter:
use MyModule qw/ use_foobar_lib /;
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 04 Nov 1999 01:57:11 GMT
From: nospam.ajm@antopia.com (Antopia Herpes Network)
Subject: The Answer!! (Was: Need nifty code for displaying Web Graphics)
Message-Id: <3820e747.1186639@news.compuserve.com>
On Wed, 03 Nov 1999 21:31:44 GMT, NOSPAMajm@antopia.com wrote:
>Hi:
>
>I have an interesting question.
>
>I have a web site that has lots of user pictures on it. The pics are
>all in an online graphics directory and in my perl script that calls up
>the pictures on demand there is a simple
>
>print "<IMG SRC=\"graphics/fred.jpg\">\n";
>
>type of call. Obviously, anyone can see the picture directly by going
>to http://www.mydomain.com/graphics/fred.jpg .
>
>Now, I want to hide the pictures from anyone so they can NOT be called
>viewed directly, just via the page generated by the script. I do NOT
>want to password protect the graphics directory for other reasons. What
>I want to do is to have the picture files in some offline directory,
>such as /home/mydomain/graphics/.
>
>I can suck a picture into my script by calling:
>
>open (PIC, "< /home/mydomain/graphics/fred.jpg");
>$fred = <PIC>;
>
>Is there then a way in perl to incorporate variable $fred into an HTML
>statement such that it actually shows up as a .jpg picture? The name of
>the picture does NOT need to be preserved. I just want to display the
>JPG file that's now in variable $fred.
>
>A new car and vacation in Hawaii to anyone who can answer this!! Better
>yet, a lifetime membership to my website, although I hope you don't need
>it!
>
>AJ
>Webmaster
>Antopia Herpes Network
The answer, of course, is to write a script that, having nothing in it
but the correct Header code and then the file dump, will show nothing
but the picture, and then write that into the HTML in the form:
<IMG SRC="yourcgi.cgi">
Too obvious. I got this from the authoring newsgroup. Thanks for the
suggestion.
Anthony
------------------------------
Date: Thu, 04 Nov 1999 01:00:09 +0200
From: Re'em Bar <reembar@hotmail.com>
To: Bill Moseley <moseley@best.com>
Subject: well, then how DOES it work?
Message-Id: <3820BE79.9E81635F@hotmail.com>
I am afraid I didn't find this reply very helpful, Bill.
--
Re'em
http://snark.co.il
Bill Moseley wrote:
>
> Re'em Bar (reembar@hotmail.com) seems to say...
> > open(FILE,"http://www.snark.co.il/index.shtml");
> > @html=<FILE>;
> > close(FILE);
>
> chmod 0755, 'http://www.snark.co.il/index.shtml';
>
> doesn't work either!
>
> maybe opendir(DIR, 'http://www.snark.co.il/') or die $!;
>
> Nope?!?!
>
> That would be nice if that worked that way. But it doesn't.
>
> perldoc LWP
> perldoc LWPCook
>
> --
> Bill Moseley mailto:moseley@best.com
> pls note the one line sig, not counting this one.
------------------------------
Date: Wed, 03 Nov 1999 16:12:45 -0800
From: mbudash@wcws.com (Michael Budash)
Subject: Re: well, then how DOES it work?
Message-Id: <mbudash-0311991612450001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>
> In article <3820BE79.9E81635F@hotmail.com>, Re'em Bar
> <reembar@hotmail.com> wrote:
>
> Bill Moseley wrote:
> >
> > Re'em Bar (reembar@hotmail.com) seems to say...
> > > open(FILE,"http://www.snark.co.il/index.shtml");
> > > @html=<FILE>;
> > > close(FILE);
> >
> > chmod 0755, 'http://www.snark.co.il/index.shtml';
> >
> > doesn't work either!
> >
> > maybe opendir(DIR, 'http://www.snark.co.il/') or die $!;
> >
> > Nope?!?!
> >
> > That would be nice if that worked that way. But it doesn't.
> >
> > perldoc LWP
> > perldoc LWPCook
> >
> > --
> > Bill Moseley mailto:moseley@best.com
> > pls note the one line sig, not counting this one.
>
> I am afraid I didn't find this reply very helpful, Bill.
> --
he was trying to tell you that you use a filename, not a url, on 'open'
(as well as 'chmod' and 'opendir')... if you find yourself wanting to use
urls, it's time to investigate the marvels of LWP...
htvh-
--
Michael Budash ~~~~~~~~~~ mbudash@wcws.com
------------------------------
Date: Wed, 03 Nov 1999 16:08:41 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Why am I getting an undefined subroutine error?
Message-Id: <3820CE89.BB9EE689@mail.cor.epa.gov>
Peter Steele wrote:
>
> I have Perl installed on my Windows NT system and am trying to make use of
> some of packages that are part of the distribution. I tried a very simple
> script:
>
> use Net::ping;
> print "alive" if pingecho('localhost', 10);
>
> but when I run this I get the error
>
> Undefined subroutine &main::pingecho called at - line 2
>
> Can anyone explain what is causing this error?
Yes. Even on win32 systems, Perl is case-sensitive. The module
is named Net::Ping , not Net::ping . Perl couldn't find the
module because of the case error.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 3 Nov 1999 18:53:18 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Why am I getting an undefined subroutine error?
Message-Id: <x3yvh7jrv2q.fsf@tigre.matrox.com>
"Peter Steele" <psteele@opticalnetworks.com> writes:
> I have Perl installed on my Windows NT system and am trying to make use of
> some of packages that are part of the distribution. I tried a very simple
> script:
>
> use Net::ping;
> print "alive" if pingecho('localhost', 10);
>
> but when I run this I get the error
>
> Undefined subroutine &main::pingecho called at - line 2
>
> Can anyone explain what is causing this error?
You either have a typo in your little snippet above, or you're lying
to us.
The use() statements get executed in compile time. The correct module
name in Net::Ping. Perl is case-sensitive, even on winblows.
Unless you have a module called Net::ping hidden somewhere in your
@INC directories, your program should have never compiled, and you
would've never gotten the error, which happens at run time.
HTH,
--Ala
------------------------------
Date: Wed, 03 Nov 1999 18:35:42 +0000
From: Tony <010101@technologist.com>
Subject: Re: Why doesn't this work?
Message-Id: <38208078.F4FC3D5A@technologist.com>
Michael Budash wrote:
> In article <381F380A.19372B56@technologist.com>, 010101@technologist.com wrote:
>
> [snip ridiculouly long code post]
>
> > Can anyone explain to me why this is isn't working?
>
> define "isn't working"
> --
> Michael Budash ~~~~~~~~~~ mbudash@wcws.com
Well I've finally been able to translate it into a (HTML4) formatted page, but the
variables don't seem to carry over. Neither does the SENDMAIL. I tried using
#!/usr/bin/perl -w
use
diagnostics;
use
strict;
in response to the automatic mailer of this newsgroup. But the results, upon using
"tail -20
/var/www/logs/error_log" tells me "Preamature end of
script headers not found." I also noticed it said "exec of
/ilab/u1/iti/iti0010/public_html/cgi-bin/cntc.cgi failed, reason: No such file
or directory (errno = 2)." But every time that I try using the help command, it
says that it doesn't recognize any of those codes.
--
Anthony Stephenson
artist & designer
http://home.att.net/~a.spec
010101@technologist.com
------------------------------
Date: Wed, 03 Nov 1999 16:47:13 -0800
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Why doesn't this work?
Message-Id: <3820D791.C2EC5F89@mail.cor.epa.gov>
Tony wrote:
>
> Michael Budash wrote:
>
> > In article <381F380A.19372B56@technologist.com>, 010101@technologist.com wrote:
> >
> > [snip ridiculouly long code post]
> >
> > > Can anyone explain to me why this is isn't working?
> >
> > define "isn't working"
> > --
> > Michael Budash ~~~~~~~~~~ mbudash@wcws.com
>
> Well I've finally been able to translate it into a (HTML4) formatted page, but the
> variables don't seem to carry over. Neither does the SENDMAIL. I tried using
Okay, let me just mention that 'carry over' is not specific enough
to really help you. And the PSI::ESP module is needed to
guess that when you say "Neither does the SENDMAIL" you mean
than you couldn't get your variables interpolated into a string
passed to sendmail through a filehandle. We're trying, Tony.
But it's really hard without a detailed, precise description
of the problem.
> #!/usr/bin/perl -w
> use
> diagnostics;
> use
> strict;
These are good. Your line wrap did weird things here, but
these are a good start. Now you may also want to learn about
the module CGI::Carp and the statements:
use CGI::Carp qw(fatalsToBrowser);
die "Fatal error messages are now sent to browser";
This may help you with debugging.
> in response to the automatic mailer of this newsgroup. But the results, upon using
Excellent! I sometimes wonder if anyone reads that. Thank you.
> "tail -20
> /var/www/logs/error_log" tells me "Preamature end of
> script headers not found."
Okay. That is not a Perl error message. That is a message
from your web server. You failed to do something needed
by the server to include the HTML headers, to write them
correctly, or to terminate them properly. There are a lot
of reasons why that might happen, and even with the PSI::ESP
module I can't seem to divine what is wrong without a tiny
snippet of code which illustrates the problem.
> I also noticed it said "exec of
> /ilab/u1/iti/iti0010/public_html/cgi-bin/cntc.cgi failed, reason: No such file
> or directory (errno = 2)."
I presume somewhere you're trying to use a file called cntc.cgi .
It may not be in the directory you think it is in. Are you
using a relative path to access it? If so, try with an
absolute path instead. Webservers like to lie to you about
the 'current' directory.
> But every time that I try using the help command, it
> says that it doesn't recognize any of those codes.
The 'help' command? I'm sorry, I don't know which command that
is. But these are not Perl errors or DOS errors, so your
help command is probably telling you the exact truth.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 03 Nov 1999 23:22:00 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Year 2000 date problem
Message-Id: <s21gsos224246@corp.supernews.com>
Frederic TYNDIUK (tyndiuk@ftls.org) wrote:
: The year in perl was "modulo" 100,
No no no no no no *no*! The year field in localtime is *offset* 1900,
that is, the value returned is the year - 1900.
Year modulo 100 returns 0 in 2000. Year - 1900 returns 100 in 2000. Huge
difference.
The original poster clearly *thought* it was modulo rather than offset,
hence the bug.
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: Wed, 3 Nov 1999 16:17:03 -0800
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Year 2000 date problem
Message-Id: <MPG.128a705e5961dccd98a19c@nntp.hpl.hp.com>
In article <s21bfjog24218@corp.supernews.com> on Wed, 03 Nov 1999
21:49:39 GMT, Craig Berry <cberry@cinenet.net> says...
...
> ... using a subrange to do the list slice, we derive the more concise
>
> ($sec, $min, $hour, $mday, $mon, $year, $wday) = (localtime)[0..6];
Using the assignment to do the list slice, we derive the more concise
($sec, $min, $hour, $mday, $mon, $year, $wday) = localtime;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1273
**************************************