[17732] in Perl-Users-Digest
Perl-Users Digest, Issue: 5152 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Dec 19 18:08:09 2000
Date: Tue, 19 Dec 2000 15:05:17 -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: <977267117-v9-i5152@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 19 Dec 2000 Volume: 9 Number: 5152
Today's topics:
Re: (Beginner) Simple stuff not working (Mark-Jason Dominus)
.h enums in perl <randy.fox@openwave.com>
Re: .h enums in perl (Tad McClellan)
Apache <lars_lars@home.se>
Re: Apache <latsharj@my-deja.com>
Re: Apache <lars_lars@home.se>
Re: Apache <mothra@nowhereatall.com>
Re: Apache <latsharj@my-deja.com>
Re: beginner question (David H. Adler)
Re: beginner question <garryknight@bigfoot.com>
Re: CGI name=value with spaces in it, Sendmail/NT <mwatkins@lexmark.com>
Re: changing array contents as you iterate over it bdesany@my-deja.com
Re: changing array contents as you iterate over it <ddunham@redwood.taos.com>
Re: deskcode.com hot new perl resource read more <camerond@mail.uca.edu>
Re: Executing perl on linux (David Efflandt)
RE: Free servers with Perl support? <qbertREMOVE@THISusuarios.retecal.es>
How can I do this with perl? Tar Tricks <mwatkins@lexmark.com>
how do I reboot NT from within perl <geoff.lart@workplane.com>
Re: how do I reboot NT from within perl (Logan Shaw)
Re: how do I reboot NT from within perl <carvdawg@patriot.net>
How to check if a class include a particular method? <eidheim@hivolda.no>
Re: How to check if a class include a particular method (Tom Christiansen)
Re: installing perl on win98 <pyuson@yahoo.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 19 Dec 2000 19:55:52 GMT
From: mjd@plover.com (Mark-Jason Dominus)
Subject: Re: (Beginner) Simple stuff not working
Message-Id: <3a3fbd47.b94$7e@news.op.net>
Keywords: Eleazar, cognitive, promulgate, will
In article <slrn93v3m8.og7.fuzzybear@Odin.Thor>,
Ben Okopnik <fuzzybear@pocketmail.com> wrote:
>>> !#c:/perl/bin/perl.exe
>>>
>>> $phrase = "Its about time";
>>> print phrase;
>>>
>>> Still the same error message.
>
>
>Shouldn't 'print phrase' be 'print $phrase'?
Yes.
>I would think that this is where the error comes from.
Nope. This is subtle enough that it might be worth explaining. Look
at the comment on the first line. Everything from the # sign onward
is ignored, so Perl sees:
!
$phrase = "Its about time";
print phrase;
Since the whitespace is irrelevant, this is the same as:
!$phrase = "Its about time";
And the error was:
>>> "Can't modify not in scalar assignment at line .... " error.
"Can't modify not." The 'not' that couldn't be modified was the
(!$phrase) expression--- '!' is the 'not' operator.
Also worth noticing is the way the original poster deleted the line
number from the original message, presumably because he didn't think
it was important.
I vote for this as one of the top three errors committed by beginners:
Ignoring the line number in the error message.
A common beginner pattern is to write the program, run it, get an
error message, and then start changing things at random in hopes that
it will go away.
Experienced programmers start by (a) understanding what the error
message means and (b) looking at the line that is faulted by the
message. Even when they can't understand the message, they look at
the line anyway, and then at the lines just before it, hoping that
something will appear that makes the error message easier to
understand.
--
@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2)+=$f=!fork;map{$P=$P[$f|ord
($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[P.]/&&
close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print
------------------------------
Date: Tue, 19 Dec 2000 12:09:32 -0800
From: "Randy Fox" <randy.fox@openwave.com>
Subject: .h enums in perl
Message-Id: <91ofaa$fqq$1@news.phone.com>
I have a .h file with some enums I want to access in a perl program.
ie:
enum {
START,
STOP,
NEXT,
MAX
};
So in my perl script I'd like to do something like:
for (my $i = START; $i < MAX;++$i)
And thus if I change my .h and add something my perl program supports it
after I recompile.
I tried x2xs but didn't see it in there.
I am fairly new to Perl, and have to dive into some more complex
functionality quickly.
Thanks in advance,
Randy
------------------------------
Date: Tue, 19 Dec 2000 16:31:02 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: .h enums in perl
Message-Id: <slrn93vksm.afd.tadmc@magna.metronet.com>
Randy Fox <randy.fox@openwave.com> wrote:
>I have a .h file with some enums I want to access in a perl program.
>
>ie:
>enum {
>START,
>STOP,
>NEXT,
>MAX
>};
>
>So in my perl script I'd like to do something like:
^^^^^^^^^^^
>for (my $i = START; $i < MAX;++$i)
You are writing C in Perl. Consider a more Perlish approach:
foreach ( qw/START STOP NEXT MAX/ ) {
If you really must have them in the form of a .h file, then
write a routine to read them into an array first, and
foreach across the array.
>And thus if I change my .h and add something my perl program supports it
>after I recompile.
You mean when you run it? perl recompiles every time you run
the program.
>I tried x2xs but didn't see it in there.
>
>I am fairly new to Perl,
Gak!
Don't near XS when new to Perl. Down that path lies insanity.
>and have to dive into some more complex
>functionality quickly.
If you can tell us what you really need to accomplish, maybe we can
come up with a way to do it in native Perl.
That is, why do you need the enumerated type?
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 19 Dec 2000 19:22:57 GMT
From: "Lars Svensson" <lars_lars@home.se>
Subject: Apache
Message-Id: <lAO%5.917$wz.47804@nntp1.chello.se>
Hi.
I got this error-message from an Apache-server:
[Tue Dec 19 20:16:15 2000] [error] [client 127.0.0.1] couldn't spawn child
process: c:/program/apache group/apache/cgi-bin/htmlsearch.cgi
In english (or swedish), what does it mean?
regards Lars
------------------------------
Date: Tue, 19 Dec 2000 20:10:48 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: Apache
Message-Id: <91ofc1$ejm$1@nnrp1.deja.com>
In article <lAO%5.917$wz.47804@nntp1.chello.se>,
"Lars Svensson" <lars_lars@home.se> wrote:
> I got this error-message from an Apache-server:
>
> [Tue Dec 19 20:16:15 2000] [error] [client 127.0.0.1] couldn't spawn
> child process: c:/program/apache group/apache/cgi-bin/htmlsearch.cgi
>
> In english (or swedish), what does it mean?
One possibility is that the path to perl.exe on the shebang line of
your cgi program is incorrect.
It should be something like: #!c:/perl/bin/perl -Tw
--
Regards,
Dick
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 19 Dec 2000 20:31:47 GMT
From: "Lars Svensson" <lars_lars@home.se>
Subject: Re: Apache
Message-Id: <TAP%5.925$wz.48049@nntp1.chello.se>
Well, it was a stupid mistake by me.
I wrote #!/c:\Perl\bin\perl.exe instead of #!c:\Perl\bin\perl.exe.
Once I´ve got that fixed the next problem comes along.
OK, I have an .html that contains a form.
The form calles for http://localhost/cgi-bin/htmlsearch.cgi with a dir and a
file. But when I press the submitbutton the stupid browser wants to download
the cgi-file instead of executing the script I called for.
Why??
regards Lars
"Dick Latshaw" <latsharj@my-deja.com> skrev i meddelandet
news:91ofc1$ejm$1@nnrp1.deja.com...
> In article <lAO%5.917$wz.47804@nntp1.chello.se>,
> "Lars Svensson" <lars_lars@home.se> wrote:
> > I got this error-message from an Apache-server:
> >
> > [Tue Dec 19 20:16:15 2000] [error] [client 127.0.0.1] couldn't spawn
> > child process: c:/program/apache group/apache/cgi-bin/htmlsearch.cgi
> >
> > In english (or swedish), what does it mean?
>
> One possibility is that the path to perl.exe on the shebang line of
> your cgi program is incorrect.
> It should be something like: #!c:/perl/bin/perl -Tw
> --
> Regards,
> Dick
>
>
> Sent via Deja.com
> http://www.deja.com/
------------------------------
Date: Tue, 19 Dec 2000 12:51:05 -0800
From: mothra <mothra@nowhereatall.com>
Subject: Re: Apache
Message-Id: <3A3FCA39.E538EAD7@nowhereatall.com>
Lars Svensson wrote:
> Well, it was a stupid mistake by me.
> I wrote #!/c:\Perl\bin\perl.exe instead of #!c:\Perl\bin\perl.exe.
> Once I´ve got that fixed the next problem comes along.
>
> OK, I have an .html that contains a form.
> The form calles for http://localhost/cgi-bin/htmlsearch.cgi with a dir and a
> file. But when I press the submitbutton the stupid browser wants to download
> the cgi-file instead of executing the script I called for.
>
> Why??
>
> regards Lars
You need to check your apache configuration. Also you might want to post your
apache questions
to the appropriate newsgroup.
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the
client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
[snipped]
------------------------------
Date: Tue, 19 Dec 2000 21:00:09 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: Apache
Message-Id: <91oi8l$h8s$1@nnrp1.deja.com>
In article <TAP%5.925$wz.48049@nntp1.chello.se>,
"Lars Svensson" <lars_lars@home.se> wrote:
> OK, I have an .html that contains a form.
> The form calles for http://localhost/cgi-bin/htmlsearch.cgi with a
> dir and a file. But when I press the submitbutton the stupid browser
> wants to download the cgi-file instead of executing the script I
>called for.
>
> Why??
The server is not recognizing your cgi program as an executable. This
is a server configuration issue and off topic for this news group. Try
the FAQ's at www.apache.org.
--
Regards,
Dick
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 19 Dec 2000 21:36:23 GMT
From: dha@panix2.panix.com (David H. Adler)
Subject: Re: beginner question
Message-Id: <slrn93vl6n.gs4.dha@panix2.panix.com>
On Tue, 19 Dec 2000 11:23:01 -0500, Jeff Boes <jboes@eoexchange.com> wrote:
>
>The short answer is that "you don't want to do this". Probably better is
>to set up an array of references to the arrays:
>
>my @array1 = ();
>my @array2 = ();
>my @array3 = ();
>my @arrayrefs = (\@array1, \@array2, \@array3);
># or
># my @arrayrefs = \( @array1, @array2, @array3 );
Or, if you don't need the sub-arrays to be named, you could just use
anonymous arrays and just do it in one step:
my @arrayrefs = ([], [], []);
then, to set the first element of the first sub-array:
$arrayrefs[0][0] = 'stuff';
Go wild. :-)
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
All the study in the world doesn't make it science - Paul Weller
------------------------------
Date: Tue, 19 Dec 2000 22:34:05 +0000
From: "Garry Knight" <garryknight@bigfoot.com>
Subject: Re: beginner question
Message-Id: <91onot$eq7$1@taliesin.netcom.net.uk>
In article <3A3F776D.1F271D37@pitt.edu> "Martin Schmidt" <mcs2@pitt.edu>
wrote:
> Hi, I'm writing a perl program that uses a few array variables named
> something like
> @array1, @array2, @array3
>
> I want to access them using a variable to represent the number.
> $num = 1;
>
> @array$num These don't work.
> @array{$num}
> @array${num}
>
>
> Any idea how to access an array using a scalar as part of the name?
Have other people misunderstood, or have I? I would have thought the
simple answer to this question is:
$array[$num]
since you want a scalar value returned.
--
Garry Knight
garryknight@bigfoot.com
------------------------------
Date: Tue, 19 Dec 2000 20:52:13 GMT
From: Mark Watkins <mwatkins@lexmark.com>
Subject: Re: CGI name=value with spaces in it, Sendmail/NT
Message-Id: <91ohpq$gp3$1@nnrp1.deja.com>
In article <91nuj6$u9r$1@nnrp1.deja.com>,
invinfo@my-deja.com wrote:
>
>
> I'm designing a form based email system and I'm looking for
suggestions.
> I'm using NT and ActiveState v5.6.0
>
> Currently, I am just using perl to call java ( and use javamail ).
>
> Testing in command mode, however, my script does not work properly
when
> the values are multiple words with spaces in between.
> ( I am enclosing them in double-quotes when entering on the command
> line. )
>
> Is sendmail available for NT ?
>
> TIA - Robert
>
> Sent via Deja.com
> http://www.deja.com/
>
The problem is most likely the way java mail accepts command line
info. This is always a nast way to handle mail on NT. (temp files,
cleanup, etc. YUK)
I have a system that uses Apache and Perl on NT with automated mailings
quite a bit. I use the MIME::Lite module with the smtp option to mail
not only text but also images.
Have your CGI perl script format the message and open a MIME document
and send it that way. Here is a snipit of code assuming you are using
CGI.pm.
use MIME::Lite;
my $subject = "Request INFO Form";
my $from = param('email'); #CGI.pm param...
my $to = "mainguy@myshop.com";
my $txt = param('request_text');
my @cc_list = ('joe','john','peter','paul'); #others to email
#format the From: field
$from = "The Big Shop";
my $mailmsg = new MIME::Lite;
$mailmsg = build MIME::Lite
From => $from,
Subject => $subject,
Type => 'TEXT',
Data => $txt;
#Add to field
$mailmsg->add(To => $to);
#ADD CC's
foreach (@cc_List) {
$f_cc .= "$_@somewhere.com,";
}
chop $f_cc;
$mailmsg->add(Cc => $f_cc);
MIME::Lite->send('smtp',"smtp.server.com",Timeout=>60);
$mailmsg->send;
This get all the mail handling in perl and out of a secondary program.
You can do quite a bit with this little module. There are other perl
MIME type modules around. Find one that fits the bill.
Mark Watkins
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 19 Dec 2000 21:58:36 GMT
From: bdesany@my-deja.com
Subject: Re: changing array contents as you iterate over it
Message-Id: <91olm7$k83$1@nnrp1.deja.com>
> But this loops multiple times. If you can do all your work in one
> loop, it's wasteful to do two.>
> You could consider a for loop with an index, and modify the index
> inside of the routine:
>
> for (my $i = 0; $i < @a; $i++)
> {
> # based on $a[$i], splice the array if needed,
> # modify $i if necessary
> }
>
> But I'd probably reconsider the storage you have here. Why do you need
> to adapt the array length based on its contents? Is the array really
> large? Maybe instead of modifying it in place you should just create a
> copy? maybe instead of a flat array an array of array references would
> be a better storage solution?
The array has around 25000 elements (and will grow much larger in the
future as more data can be incorporated into it), and it is made on-the-
fly by calling the "vertices" method on a Graph::Undirected object. The
test whereby the array splicing is determined is a depth first search
using whatever vertex (array element) foreach happens to pick at the
start of the loop. All the vertices returned during the dfs need to
then be removed from the array so that another dfs is not done on them
(which would be multiply redundant and extremely time consuming).
Eventually, the array gets reduced to zero elements as each dfs set is
discovered its members are removed from the array.
At first glance, modifying $i seems like a lot of work, especially
since by doing a dfs on one array element does not give me the array
indices of the other array elements it returns.
I'm still mulling this one over - maybe the ugly two-loop solution is
actually the most convenient one for this problem?
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 19 Dec 2000 22:40:01 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: changing array contents as you iterate over it
Message-Id: <5tR%5.54757$Wq1.21573666@nnrp5-w.sbc.net>
bdesany@my-deja.com wrote:
> for (@array) {
> # do some checks with the "first" $_
> # based on the results, splice out various elements of @array
> }
A common idiom is to reverse the array, and then loop backward through
it. Removing rearward items will not affect later items...
@array = qw (a b c d e f g h i j);
@array = reverse @array;
foreach $index (reverse (0 .. $#array))
{
# deal with $array[$index]
# maybe remove it..
if ($array[$index] =~ /[aeiou]/) # Down with vowels!
{ print "nuking $index - $array[$index]\n"; splice @array, $index, 1; }
}
@array = reverse @array;
print "@array\n";
% perl -w /tmp/perl
nuking 9 - a
nuking 5 - e
nuking 1 - i
b c d f g h j
If you have a huge array and you think the cost of two reverses (3 if
you count the indexing I did and don't use a for() style loop) is too
much, instead of doing the splices in-loop, just keep an array of
indexes to delete and unshift the indexes onto the array.
Once outside the loop, just run a foreach loop on your array of
deletetions (which will be in descending order) and splice remove the
items.
This too may not be possible based on what you're doing with the array,
but it's another idea.
--
Darren Dunham ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< Please move on, ...nothing to see here, please disperse >
------------------------------
Date: Tue, 19 Dec 2000 14:40:39 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: deskcode.com hot new perl resource read more
Message-Id: <3A3FC7C7.2D26668D@mail.uca.edu>
Steven Smolinski wrote:
>
> Tad McClellan <tadmc@metronet.com> wrote:
> > deskcode@my-deja.com <deskcode@my-deja.com> wrote:
> > >Please come and visit us,
> >
> > This poster is a spammer. Don't go there.
>
> I stumbled across this site. It's nearly bare.
>
> > I guess there isn't _anything_ there yet. Why go?
>
> Oh, Tad, how wrong you are! There were two webpage hit counter
> programs, both broken.
What a waste of time and resources! Not only is the above the sum total
Perl content, but the page loads slow as molasses in December, holds
everything else up while doing so, and spreads to twice the screen width
of my monitor (1024 x 768). Four strikes in my book. Next batter.
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
Date: Tue, 19 Dec 2000 22:51:05 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Executing perl on linux
Message-Id: <slrn93vpik.hbh.efflandt@efflandt.xnet.com>
On Tue, 19 Dec 2000 09:42:22 +0000, Jimmy Mc Namara <jmcnamara@iel.ie> wrote:
>
>Not sure if this is the correct newsgroup for this but here goes. I am
>writing perl scripts that are transported from a test environment to a
>production environment on site after every build. I found that perl
>lived in /usr/bin in one of the machines and in /usr/local/bin in the
>other so I used the usual script to search the path as follows:
>
>#!/bin/sh -- # -*- perl -*-
>eval 'exec perl -wS $0 ${1+"$@"}'
> if 0;
>
>Now one of the servers has been switched to an intel box using
>linux(output of uname -a is "Linux rufus 2.2.16-SMP #1 SMP Wed Aug 2
>20:01:21 GMT 2000 i686 unknown" and the script above doesn't work it
>throws an error as follows:
>
>
>sh: -- # -*- perl -*-: unrecognized option
Wouldn't it be simpler to do this on the Linux box, so you could use the
longer path you can't control on either (or get your admin to do it if not
your Linux box):
ln -s /usr/bin/perl /usr/local/bin/perl
--
David Efflandt efflandt@xnet.com http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
------------------------------
Date: Tue, 19 Dec 2000 20:25:27 +0100
From: "Navcomp" <qbertREMOVE@THISusuarios.retecal.es>
Subject: RE: Free servers with Perl support?
Message-Id: <91oci9$29u$1@titan.bt.es>
Yes, I know it but I only have access to one computer presently, and I can't
install Linux on it.
Navcomp.
------------------------------
Date: Tue, 19 Dec 2000 20:31:45 GMT
From: Mark Watkins <mwatkins@lexmark.com>
Subject: How can I do this with perl? Tar Tricks
Message-Id: <91ogji$fnf$1@nnrp1.deja.com>
I have a little crontab script which backs up a directory from a server
to a backup, it looks like this:
#!/bin/ksh
echo $(hostname) backup_Mickey_2_Donald STARTED...$(date) > /tmp/$$
tar cf - /home | (rsh Donald -l root "cd /; rm -rf /home > /dev/NULL
2>&1; mkdir /home > /dev/NULL 2>&1; cd /home; tar xf -")
echo $(hostname) backup_Mickey_2_Donald ENDED...$(date) >> /tmp/$$
mail -s 'Backup Mickey 2 Donald' me@myserver < /tmp/$$
This works just fine, however I would like to re-write it using perl
and maybe put in some checks to see if it all got there and there were
no errors.
Things I have considered:
1. Use Archive::Tar to create a tar file and Net::FTP it to the backup
machine and un-tar it there. Not sure I like having a deamon looking
for the tar file resident to the backup machine to do the untarring.
2. Use Archive::Tar and a socket to create a bit stream and have a
deamon untar on the fly. Still don't like having a program running on
backup machine.
3. NFS mount the backup system to the main server and run everything
like it is local. Not a horrible solution.
Just wondering if there was any great ideas out there that I might be
overlooking.
Thanks in advance!
Mark Watkins
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Tue, 19 Dec 2000 22:25:38 +0000
From: Geoff Lart <geoff.lart@workplane.com>
Subject: how do I reboot NT from within perl
Message-Id: <3A3FE062.DFA19C92@workplane.com>
Folks,
How do I reboot my NT4 box from within a perl script ?
Also how do I run a perl script as soon as the box
comes back up, without any user logging in ?
Cheers.
Geoff Lart.
------------------------------
Date: 19 Dec 2000 16:36:57 -0600
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: how do I reboot NT from within perl
Message-Id: <91onu9$821$1@ahab.cs.utexas.edu>
In article <3A3FE062.DFA19C92@workplane.com>,
Geoff Lart <geoff.lart@workplane.com> wrote:
>How do I reboot my NT4 box from within a perl script ?
Probably you run
system("some unknown NT command here");
>Also how do I run a perl script as soon as the box
>comes back up, without any user logging in ?
I don't know. That's an NT question. This is a Perl newsgroup.
- Logan
------------------------------
Date: Tue, 19 Dec 2000 17:58:35 -0500
From: H C <carvdawg@patriot.net>
Subject: Re: how do I reboot NT from within perl
Message-Id: <3A3FE81B.88BDAF4D@patriot.net>
> How do I reboot my NT4 box from within a perl script ?
Use Win32::InitiateSystemShutdown (you'll need to check the API for the
exact
format for arguments)
> Also how do I run a perl script as soon as the box
> comes back up, without any user logging in ?
Check Registry keys. Some (the exact ones escape me at the moment)
might be
useful...
------------------------------
Date: Tue, 19 Dec 2000 20:30:19 +0100
From: Ole Christian Eidheim <eidheim@hivolda.no>
Subject: How to check if a class include a particular method?
Message-Id: <3A3FB74B.FA16927@hivolda.no>
Hi, I'm stuck again:)
How do I figure out if a class include method A or not?
I wish "defined($class->A)" worked, but it doesn't.
Thanks again,
Ole Christian Eidheim
------------------------------
Date: 19 Dec 2000 12:43:35 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: How to check if a class include a particular method?
Message-Id: <3a3fba67$1@cs.colorado.edu>
In epistola sua, <3A3FB74B.FA16927@hivolda.no>, scripsit Ole
Christian Eidheim <eidheim@hivolda.no>:
>How do I figure out if a class include method A or not?
Consult its manpage?
Or: try it and see whether it blows up?
>
>I wish "defined($class->A)" worked, but it doesn't.
There is a difference between asking whether the result of a function
call is defined, and whether the function call itself is viable.
You probably want to simply use
$class->can("A")
which, under most (but not all) circumstances will reveal to you
the requested result.
--tom
PS: The "not all" caveat regards autoloaded methods sans predeclaration.
------------------------------
Date: Tue, 19 Dec 2000 11:15:30 -0800
From: "Sprint" <pyuson@yahoo.com>
Subject: Re: installing perl on win98
Message-Id: <axO%5.6325$bv3.58339@newscontent-01.sprint.ca>
You have to do several things:
- edit the registry: Click Star, Run, regedit.exe
- Click the following folders:
HKEY_LOCAL_MACHINE->System->CurrentControlSet->Services->w3svc->parameters->
Script Map
- Right click on the right frame. This will display a menu. Select New->
string value
- Enter .pl
- Right click on .pl and select Modify. This displays the edit String Window
- Assuming that perl is installed in C:\perl, on the Value data field, type:
C:\perl\bin\perl.exe %s %s
Note that this is case sensitive.
- create one for .cgi extension too.
Start the PWS.
- Click the Advanced icon. This displays the virtual directories.
- if there is no cgi-bin directory, create one. If there is, select it and
edit it. Check the following fields:
directory is C:\inetpub\wwwroot\cgi-bin
Alias is cgi-bin
Access - check Read, Execute, Scripts
Click OK.
- Create a CGI file. something like this:
#!/usr/bin/perl
print "content-type: text/html\n\n";
print "<HTML><BODY>";
foreach (sort keys %ENV)
print "<B>$_</B>: $ENV{$_}<BR>\n";
}
- save it as parms.pl in the directory you defined as the cgi-bin. in our
case: C:\inetpub\wwwroot\cgi-bin
- Start Internet Explorer.
- If you did not change anything in your PWS installation, you can go to
this URL:
http://localhost/cgi-bin/parms.pl
This should display the parms passed to your CGI.
===
Philip Yuson
Suite101.com Contributing Editor - Perl
http://www.suite101.com/welcome.cfm/perl
===========
<ananta_ahluwalia@hotmail.com> wrote in message
news:91ge1k$9i8$1@nnrp1.deja.com...
> Hi,
> I am running PWS4.0 on my win98 machine and have dowloaded ActivePerl-
> 5.6.0.620-MSWin32-x86-multi-thread.msi which is supposed to work fine.
> But it doesn't!
> Any ideas? I really need to deliver a project ASAP. Can u tell what
> regular hack you did to make it work for you ?
> Thanks,
> Ananta
>
> In article <Aal_5.18770$xW4.150123@news-server.bigpond.net.au>,
> "SuperGumby" <tick.toff@spam.com> wrote:
> > ActivePerl and Win98PWS works fine, just takes a small reg hack to
> associate
> > your web.doc.extension to perl (or does the way I did it :)
> >
> > Trevor Ward wrote in message <91cih7
> $39910@eccws12.dearborn.ford.com>...
> > >I have setup the local server quite easily, www.perl.com follow link
> to
> > >windows version of perl and download. It installs and runs nicely.
> For a
> > >server environment I went for OmniHTTP which is a very good web
> server.
> > >Tried apache and IIS or PWS but couldn't get the functionality
> working.
> > >
> > >Be aware that omnihttp is about $80 for a full license. But well
> worth it.
> > >
> > >Richard Leclair <leclair@iinet.net.au> wrote in message
> > >news:3A39B682.7A3D27D@iinet.net.au...
> > >>
> > >> I have written perl CGIs on my ISP (linux) with no problems, but
> I'd
> > >> like to test stuff locally on my machine, and someone said that I
> could
> > >> set up like a local server running ActivePerl.
> > >>
> > >> Does anyone know how I go about doing this?
> > >>
> > >> Any info would be helpful. Cheers.
> > >> mailto:leclair@iinet.net.au?subject=perl_on_win98
> > >>
> > >>
> > >> Richie !
> > >>
> > >
> > >
> >
> >
>
>
> Sent via Deja.com
> http://www.deja.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 5152
**************************************