[10600] in Perl-Users-Digest
Perl-Users Digest, Issue: 4192 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Nov 10 17:07:36 1998
Date: Tue, 10 Nov 98 14:00:34 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 10 Nov 1998 Volume: 8 Number: 4192
Today's topics:
Re: adding \' to a string (Larry Rosler)
Re: amd-k as opposed to INTEL <keithmur@mindspring.com>
Re: Array-Hash-Problem (Kevin Reid)
Re: Array-Hash-Problem <jdf@pobox.com>
Re: camel races on CNN <keithmur@mindspring.com>
Difficulty with PERL ashish_nina@my-dejanews.com
drop handler for perl on win95? confucious@my-dejanews.com
Extension using tied hash <wsnyder@ultranet.com>
Modem Control <jim.mosier@usa.net>
Newbie question, uppercase a string.. <cdduerr@sprintmail.com>
Re: Newbie question, uppercase a string.. (Erik)
Re: Newbie question, uppercase a string.. <rootbeer@teleport.com>
Re: Newbie question, uppercase a string.. <uri@fastengines.com>
Re: Newbie question, uppercase a string.. (Matthew Bafford)
Re: Newbie question, uppercase a string.. (Larry Rosler)
Perl "Newbie" Needs Help Debugging Code nancy_delbecq@my-dejanews.com
Re: Perl "Newbie" Needs Help Debugging Code (Erik)
Re: Perl "Newbie" Needs Help Debugging Code <ludlow@us.ibm.com>
Re: Perl "Newbie" Needs Help Debugging Code jjd@ix.netcom.com
Re: Perl "Newbie" Needs Help Debugging Code jjd@ix.netcom.com
Perl 4 to Perl5 <rod.madden@cdc.com>
Re: Perl 4 to Perl5 <uri@fastengines.com>
PERL CGI on an ordinary file server? ashish_nina@my-dejanews.com
PerlShop, Missing File Title rip@5thpower.com
Re: Problem access Sun Apache server through Windows IE <rootbeer@teleport.com>
Problems With a CGI Script (Slidespy)
Re: pwd without backticks? <uri@fastengines.com>
Returning undef from an XSUB... <berend@istanbul.engr.sgi.com>
Re: Returning undef from an XSUB... (Ilya Zakharevich)
Re: Want to learm Perl <jdf@pobox.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 10 Nov 1998 12:52:14 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: adding \' to a string
Message-Id: <MPG.10b2475a92f1ee0d989868@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <kt8a27.3ad.ln@flash.net> on Tue, 10 Nov 1998 14:49:56 -0600,
Tad McClellan <tadmc@flash.net> says...
> Casema (ours@casema.net) wrote:
> : If ya got a string say, $name containing "Michel" is it possible to change
> : the content to:
> : "\'Michel\'" ????
> : isn't there a bind (=~) that does this?.....
>
> s/^/\\'/; # add to the beginning
> s/$/\\'/; # add to the end
>
> or
>
> s/(.*)/\\'$1\\'/s; # both at once
A lot of work. I would just use
"\\'$name\\'"
and wonder whether he *really* wants the single-quotes to be escaped.
Of course, he asked for a regex solution, which is what you gave him.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 10 Nov 1998 15:14:05 -0600
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: amd-k as opposed to INTEL
Message-Id: <3648AC9D.90D41597@mindspring.com>
stacy wright wrote:
>
> I'm trying to download an older version of perl from one of the sites
> suggested in "information about perl " section of the perl institute's
> homepage. My question is, can I use to perl download for the intel chip
> if I'm using a machine using an AMD-K processor. If this is a redundand
> question because i missed it in the FAQ's or the usenet subject
> headings,then my sincere apologies. thanks!
Tom Phoenix' reply is certainly correct, but:
I daresay the binary will work fine. I've been running both RedHat
Linux 5.1 and Windows 95 on my AMD K6 system at home, and have yet to
have problems that I believe are due to the AMD processor. I've
certainly run my (binary distribution of) Perl without any problems
whatsoever under Linux.
------------------------------
Date: Tue, 10 Nov 1998 16:38:50 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Array-Hash-Problem
Message-Id: <1di9yq6.bjvobg106wzosN@slip166-72-108-70.ny.us.ibm.net>
Jonathan Feinberg <jdf@pobox.com> wrote:
> kpreid@ibm.net (Kevin Reid) writes:
>
> > <nomam@my-dejanews.com> wrote:
> >
> > > print "Name: $item->{'name'}: Size $item->{'size'}";
> >
> > -> is an operator; operators are not parsed inside strings.
>
> [jdf@joshua jdf]$ perl -de 1
>
> Loading DB routines from perl5db.pl version 1.0401
> Emacs support available.
>
> Enter h or `h h' for help.
>
> main::(-e:1): 1
> DB<1> $foo->{a} = 'You were saying?';
>
> DB<2> print "$foo->{a}\n";
> You were saying?
Interesting. I didn't know this.
Is it documented? I don't see anything in perlop.pod.
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: 10 Nov 1998 22:54:22 +0100
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Array-Hash-Problem
Message-Id: <m3af1zusc1.fsf@joshua.panix.com>
kpreid@ibm.net (Kevin Reid) writes:
> Jonathan Feinberg <jdf@pobox.com> wrote:
> > DB<1> $foo->{a} = 'You were saying?';
> >
> > DB<2> print "$foo->{a}\n";
> > You were saying?
> Interesting. I didn't know this.
>
> Is it documented? I don't see anything in perlop.pod.
Have you read the rather long and detailed section in perlop about
interpolation? Here's a relevant excerpt:
Note also that the interpolating code needs to
make decision where the interpolated scalar
ends, say, whether "a $b -> {c}" means
"a " . $b . " -> {c}";
or
"a " . $b -> {c};
Most the time the decision is to take the
longest possible text which does not include
spaces between components and contains matching
braces/brackets.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Tue, 10 Nov 1998 15:38:03 -0600
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: camel races on CNN
Message-Id: <3648B23B.255D7BF6@mindspring.com>
Uri Guttman wrote:
>
> seems like our
> favorite language has not only the architecture but the personality of
> its mascot.
>
Does that mean it will turn around and bite you if you're not careful?
Too bad it doesn't have the friendlier disposition of its cousin, the
llama. (Suddenly, I am enlightened about the book covers... :-))
------------------------------
Date: Tue, 10 Nov 1998 21:28:41 GMT
From: ashish_nina@my-dejanews.com
Subject: Difficulty with PERL
Message-Id: <72ab69$5nd$1@nnrp1.dejanews.com>
Anybody and everybody, Am trying to learn PERL on NT. I do not have access to
any web server where I can test my scripts so am trying to do this on an NT
file server (in c: drive). The script does not seem to be able to write to
the browser. First of all, can I keep my script on a local directory and hope
that it will be executed? If yes, then what is wrong with the following
example? Calling page: <html> <body bgcolor="#FFFFFF">
<title>Guestbook</title> <h2>Please sign my guestbook</h2> <form method=post
action="scr.bat"> <input type=submit value="Sign in"> </form> </html>
Script: (converted to batch file)
@rem = '--*-Perl-*--
@echo off
perl -x -S %0 %*
goto endofperl
@rem ';
#!perl
#line 8
print "Content-type: text/html\n\n";
print "<body bgcolor=\"#FFFFFF\">\n";
print "<h2>This is a test</h2>\n";
__END__
:endofperl
Thx in advance.
Ashish
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 10 Nov 1998 21:20:44 GMT
From: confucious@my-dejanews.com
Subject: drop handler for perl on win95?
Message-Id: <72aanc$5a2$1@nnrp1.dejanews.com>
Has anyone made a drop handler shell extension for win32 perl? The behavior
I'm looking for is to allow a .pl file to have files dropped onto it in the
explorer and then have the shell automatically execute perl with the .pl file
as the script and the files dropped as the arguments. I'm aware this can be
done with a .bat file but I'm looking to drop more than 10 files and that
would involve a bunch of shifting and stuff that seem unlikely to scale to an
arbitrary number of files. I'm specifically looking for a solution for win95
and %* batch variable doesn't work for 95. This type of shell extension drop
handler seems to me the most elegant solution.
Diving into my registry for winzip which has this functionailty (you drop a
file unto a zip file and winzip pops up adding that file to the zip), it
seems like a special .dll needs to be in place to do the program calls with a
bunch of registry stuff as hooks.
Thanks for any help.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 10 Nov 1998 16:36:20 -0500
From: Wilson Snyder <wsnyder@ultranet.com>
Subject: Extension using tied hash
Message-Id: <3648B1D3.53E4C504@ultranet.com>
Ok, I've looked the obvious places.
Can someone point me to .xs C code that uses a tied hash? I
can successfully tie to hash elements, but want my program
to fake each, keys, and the like, without going through
tie code in perl.
The obvious hv_magic(hv,gv,'~'), then setting a accessor function
doesn't seem to ever call my functions. (In perl 5.005_02)
Thanks!
------------------------------
Date: Tue, 10 Nov 1998 21:02:42 GMT
From: "MoJi" <jim.mosier@usa.net>
Subject: Modem Control
Message-Id: <01be0ced$eb5bd880$750a22a6@jMosier>
OK, I think I have a better news reader this time so it wont post 4 times
:-(
This is what I have so far, with help from the RAM (cookbook), but it isn't
really getting to the modem, even though the script says it is. Also the
read never returns anything.
Please Help!
----------------------------
#!/usr/local/bin/perl
#
#------------------------------------------------------------
# Global Vars / Read ARGS
#------------------------------------------------------------
use Fcntl;
use POSIX qw(:errno_h);
$i=0;
#------------------------------------------------------------
# Open the port
#------------------------------------------------------------
sysopen( MODEM, "/dev/cua/a", O_NONBLOCK | O_RDWR ) ||
die "sysopen $!\n";
$buffer = "AT&FDT 5534\n";
$rv = syswrite( MODEM, $buffer, length $buffer );
if( defined( $rv ) && $! != EAGAIN ) {
print "WRITE!\n";
print "rv: $rv\n";
print "buffer: $buffer\n";
sleep 15;
}
elsif( $rv != length $buffer) {
print "Incomplete!";
sleep 5;
}
else {
print "WRITE ERROR!";
sleep 1;
}
until( $i eq 1000 ) {
$rv = sysread( MODEM, $buffer, $BUFSIZ );
if( defined( $rv ) && $! != EAGAIN ) {
print $buffer;
}
else { print "Error!\n"; }
$i++;
}
exit;
------------------------------
Date: Tue, 10 Nov 1998 14:02:19 -0800
From: Chris Duerr <cdduerr@sprintmail.com>
Subject: Newbie question, uppercase a string..
Message-Id: <3648B7EB.93E57D00@sprintmail.com>
Hi, Im sort of new to Perl and Im writing a small CGI script that will
require a variable to be changed to uppercase. Can anyone please help?
I basically need this
$test = "hi there"
to be turned into
$test = "HI THERE"
Should I be using regular expressions? Is there a string functin to
accomplish this? I've looked through my book (Learning Perl) and I cant
seem to find it, I've also skimmed through "man perlfunc" and still
nothing...
Thanks,
Chris
__cdduerr@sprintmail.com__
------------------------------
Date: 10 Nov 1998 21:24:53 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Newbie question, uppercase a string..
Message-Id: <72aav5$g7j$2@news.cyberhighway.net>
[Posted and mailed]
In article <3648B7EB.93E57D00@sprintmail.com>,
Chris Duerr <cdduerr@sprintmail.com> writes:
>
> Hi, Im sort of new to Perl and Im writing a small CGI script that will
> require a variable to be changed to uppercase. Can anyone please help?
[snip]
> Should I be using regular expressions? Is there a string functin to
> accomplish this? I've looked through my book (Learning Perl) and I cant
> seem to find it, I've also skimmed through "man perlfunc" and still
> nothing...
Well, if you wanted to use a regular expression, i guess you could use
something like:
$test =~ s/[a-z]/[A-Z]/g;
or something. But then, using
$test = uc($test);
is probably a little easier.
HTH!
--
Erik Nielsen, Cyberhighway Internet Services NOC
There ain't nothin' in this world that's worth being a snot over.
-- Larry Wall in <1992Aug19.041614.6963@netlabs.com>
------------------------------
Date: Tue, 10 Nov 1998 21:34:22 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Newbie question, uppercase a string..
Message-Id: <Pine.GSO.4.02A.9811101332470.7469-100000@user2.teleport.com>
On Tue, 10 Nov 1998, Chris Duerr wrote:
> Subject: Newbie question, uppercase a string..
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
> Hi, Im sort of new to Perl and Im writing a small CGI script that will
> require a variable to be changed to uppercase. Can anyone please help?
> I've also skimmed through "man perlfunc" and still nothing...
Maybe you should search for the text "uppercase". Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 10 Nov 1998 16:41:22 -0500
From: Uri Guttman <uri@fastengines.com>
To: Chris Duerr <cdduerr@sprintmail.com>
Subject: Re: Newbie question, uppercase a string..
Message-Id: <sariugn9qf1.fsf@camel.fastserv.com>
>>>>> "CD" == Chris Duerr <cdduerr@sprintmail.com> writes:
CD> Should I be using regular expressions? Is there a string functin to
CD> accomplish this? I've looked through my book (Learning Perl) and I cant
CD> seem to find it, I've also skimmed through "man perlfunc" and still
CD> nothing...
have you tried: man perlfaq4?
hth,
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Tue, 10 Nov 1998 16:18:07 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Newbie question, uppercase a string..
Message-Id: <MPG.10b2779e444a5aa598970a@news.scescape.net>
In article <3648B7EB.93E57D00@sprintmail.com>, Chris Duerr
<cdduerr@sprintmail.com> pounded in the following:
=>
=> Hi, Im sort of new to Perl and Im writing a small CGI script that will
=> require a variable to be changed to uppercase. Can anyone please help?
=>
=> I basically need this
=>
=> $test = "hi there"
=>
=> to be turned into
=>
=> $test = "HI THERE"
=>
=> Should I be using regular expressions? Is there a string functin to
=> accomplish this? I've looked through my book (Learning Perl) and I cant
=> seem to find it, I've also skimmed through "man perlfunc" and still
=> nothing...
=>
#!/usr/bin/perl -w
use locale;
my $upper;
my $lower = "See perllocale, perlfunc, and perlre for more info.";
$upper = uc($lower);
print "$upper\n";
$upper =~ s/^(.*)$/\U$1/;
print "$upper\n";
$upper = "\U$lower";
print "$upper\n";
__END__
=>
=> Thanks,
HTH,
=> Chris
--Matthew
------------------------------
Date: Tue, 10 Nov 1998 13:42:18 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Newbie question, uppercase a string..
Message-Id: <MPG.10b253144938e064989869@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <3648B7EB.93E57D00@sprintmail.com> on Tue, 10 Nov 1998
14:02:19 -0800, Chris Duerr <cdduerr@sprintmail.com> says...
...
> $test = "hi there"
>
> to be turned into
>
> $test = "HI THERE"
>
> Should I be using regular expressions?
That's one way:
s/(.*)/\U$1/;
> Is there a string functin to accomplish this?
Yes. 'uc'. That's Another Way To Do It.
> I've looked through my book (Learning Perl) and I cant
> seem to find it,
The index shows 'lowercase' on page 12, which gives Yet Another Way To
Do It:
tr/a-z/A-Z/;
This fails with locale-specific characters, though.
> I've also skimmed through "man perlfunc" and still nothing...
You should use 'grep' (or File:Find on Windows), not skimming.
Searching for 'upper' would have led you right to 'uc'.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 10 Nov 1998 20:45:06 GMT
From: nancy_delbecq@my-dejanews.com
Subject: Perl "Newbie" Needs Help Debugging Code
Message-Id: <72a8ki$3fn$1@nnrp1.dejanews.com>
Hello,
Although I'm a newbie to perl, I am close to
finishing my first "full blown" program. I have
encountered and successfully debugged (to my amazement)
most of the code.
However, I have encountered a mystery. Despite spending
nearly two days racking my brain...hours and hours at
the perl manpages...and referencing several books...
I cannot figure out what I'm doing wrong in the
following snippet of code.
It keeps "die"ing when trying to find the FILE "$db_name".
For some reason this path is returning as:
/home/www/mydomain/dbase//msg_content.txt
and it should be returning as:
/home/www/mydomain/dbase/(value of the variable)/msg_content.txt
To check if the variables value was returning null, I printed
the variable to STDOUT and it does print the value I
expected.
Can anyone shed some light as to what I'm doing
wrong?
Thanks in advance,
Nancy
P.S. Please be nice :-) this is my first post
and I have tried to include all relevant info!
###############################################
$basedir = "/home/www/mydomain";
$allsubs = "$basedir/allsubs.txt";
$dbasedir = "/home/www/mydomain/dbase";
$db_name = "$dbasedir/$dseries_name/msg_content.txt";
open (ALLSUBS,"$allsubs") || die;
@lines = <ALLSUBS>;
close (ALLSUBS);
foreach $line (@lines) {
&split_allsubs;
if ($unixtime >= "$dmsg_date") {
open (FILE,"$db_name") || die "Cannot read: $!";
@data = <FILE>;
close (FILE);
#################################
sub split_allsubs {
($demail, $dname, $dunixtime, $dmsg_date, $dnextmsg, $dseries_name, $dmsg) =
split (/:/, $line);
}
#################################
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 10 Nov 1998 21:18:55 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Perl "Newbie" Needs Help Debugging Code
Message-Id: <72aajv$g7j$1@news.cyberhighway.net>
[Posted and mailed]
In article <72a8ki$3fn$1@nnrp1.dejanews.com>,
nancy_delbecq@my-dejanews.com writes:
> P.S. Please be nice :-) this is my first post
> and I have tried to include all relevant info!
You've done very well in that respect.
>
> ###############################################
> $basedir = "/home/www/mydomain";
> $allsubs = "$basedir/allsubs.txt";
> $dbasedir = "/home/www/mydomain/dbase";
> $db_name = "$dbasedir/$dseries_name/msg_content.txt";
Oops...you're using the variable $dseries_name before it's even declared
to be anything! (perl -w would have shown you this).
> open (ALLSUBS,"$allsubs") || die;
> @lines = <ALLSUBS>;
> close (ALLSUBS);
>
> foreach $line (@lines) {
> &split_allsubs;
$dseries_name is only declared after the subroutine call...before that, the
value is undef. Therefore, the $db_name assignment should happen _after_
this line, not at the beginning of the script. Cut $db_name = "etc" and put
it right here instead, and things should work quite a bit better. On a side
note, calling a subroutine like this with the & character is not necessary,
and (i think) deprecated. Call it like a normal function. Use () if you're
a past C programmer and calling functions without an argument set makes you
feel dirty.
> if ($unixtime >= "$dmsg_date") {
>
> open (FILE,"$db_name") || die "Cannot read: $!";
> @data = <FILE>;
> close (FILE);
Your closing curly braces seem to have disappeared...I'll assume since the
script actually compiles, they're included in the actual script.
>
> #################################
> sub split_allsubs {
>
> ($demail, $dname, $dunixtime, $dmsg_date, $dnextmsg, $dseries_name, $dmsg) =
> split (/:/, $line);
> }
HTH!
--
Erik Nielsen, Cyberhighway Internet Services NOC
It's the Magic that counts.
-- Larry Wall on Perl's apparent ugliness
------------------------------
Date: Tue, 10 Nov 1998 15:13:55 -0600
From: James Ludlow <ludlow@us.ibm.com>
Subject: Re: Perl "Newbie" Needs Help Debugging Code
Message-Id: <3648AC93.30079B7A@us.ibm.com>
nancy_delbecq@my-dejanews.com wrote:
> $db_name = "$dbasedir/$dseries_name/msg_content.txt";
What does $dseries_name contain at this point?
> &split_allsubs;
$dseries_name is changed by &split_allsubs, but you don't update the
value of $db_name.
--
James Ludlow (ludlow@us.ibm.com)
(Any opinions expressed are my own, not necessarily those of IBM)
------------------------------
Date: Tue, 10 Nov 1998 16:38:54 -0500
From: jjd@ix.netcom.com
Subject: Re: Perl "Newbie" Needs Help Debugging Code
Message-Id: <3648B26E.604C@ix.netcom.com>
James Ludlow wrote:
>
> > $db_name = "$dbasedir/$dseries_name/msg_content.txt";
>
> What does $dseries_name contain at this point?
Now that you brought it up it doesn't contain anything.
>
> > &split_allsubs;
>
> $dseries_name is changed by &split_allsubs, but you don't update the
> value of $db_name.
>
Okay...so let me see if I understand you correctly.
I should define the $db_name variable after I &split_allsubs;
That makes sense...
I guess sometimes the most obvious mistakes are the first to be
overlooked.
Thanks!
Nancy
------------------------------
Date: Tue, 10 Nov 1998 16:56:33 -0500
From: jjd@ix.netcom.com
Subject: Re: Perl "Newbie" Needs Help Debugging Code
Message-Id: <3648B691.7208@ix.netcom.com>
> > P.S. Please be nice :-) this is my first post
> > and I have tried to include all relevant info!
>
> You've done very well in that respect.
Thank you Erik. I was a liitle nervous posting
as a "newbie". :-)
> Oops...you're using the variable $dseries_name before it's even
> declared to be anything! (perl -w would have shown you this).
-w did warn of uninitialized... but was confused as to why.
Now I know.
> $dseries_name is only declared after the subroutine call...before that, the
> value is undef. Therefore, the $db_name assignment should happen _after_
> this line, not at the beginning of the script. Cut $db_name = "etc" and put
> it right here instead, and things should work quite a bit better.
Gottcha! :-)
> On a side
> note, calling a subroutine like this with the & character is not necessary,
> and (i think) deprecated. Call it like a normal function. Use () if you're
> a past C programmer and calling functions without an argument set makes you
> feel dirty.
Actually... Perl is my first language (other than English) :-)
I'm a little short on style but getting better everyday.
Thanks for the tips.
> Your closing curly braces seem to have disappeared...I'll assume since the
> script actually compiles, they're included in the actual script.
You assume correctly.
> HTH!
You bet it did... Thanks!
Nancy
------------------------------
Date: Tue, 10 Nov 1998 16:25:37 -0500
From: Rodney A Madden <rod.madden@cdc.com>
Subject: Perl 4 to Perl5
Message-Id: <3648AF51.A9FAF13A@cdc.com>
Other than pl2pm.pl does anyone know of a program to assist in
converting
Perl4 to Perl5.
------------------------------
Date: 10 Nov 1998 16:45:08 -0500
From: Uri Guttman <uri@fastengines.com>
To: Rodney A Madden <rod.madden@cdc.com>
Subject: Re: Perl 4 to Perl5
Message-Id: <saremrb9q8r.fsf@camel.fastserv.com>
>>>>> "RAM" == Rodney A Madden <rod.madden@cdc.com> writes:
RAM> Other than pl2pm.pl does anyone know of a program to assist in
RAM> converting
RAM> Perl4 to Perl5.
shouldn't need one. most perl4 scripts run fine under perl5. read the
perltrap man page for help with any conversion problems.
hth,
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Tue, 10 Nov 1998 21:45:17 GMT
From: ashish_nina@my-dejanews.com
Subject: PERL CGI on an ordinary file server?
Message-Id: <72ac5d$6m3$1@nnrp1.dejanews.com>
Anybody and everybody, Am trying to learn PERL on NT. I do not have access to
any web server where I can test my scripts so am trying to do this on an NT
file server (in c: drive). The script does not seem to be able to write to
the browser. First of all, can I keep my script on a local directory and hope
that it will be executed? If yes, then what is wrong with the following
example? Calling page: <html> <body bgcolor="#FFFFFF">
<title>Guestbook</title> <h2>Please sign my guestbook</h2> <form method=post
action="scr.bat"> <input type=submit value="Sign in"> </form> </html>
Script: (converted to batch file)
@rem = '--*-Perl-*--
@echo off
perl -x -S %0 %*
goto endofperl
@rem ';
#!perl
#line 8
print "Content-type: text/html\n\n";
print "<body bgcolor=\"#FFFFFF\">\n";
print "<h2>This is a test</h2>\n";
__END__
:endofperl
Thx in advance.
Ashish
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 10 Nov 1998 20:56:39 GMT
From: rip@5thpower.com
Subject: PerlShop, Missing File Title
Message-Id: <3648a7bf.25908339@news.netdoor.com>
I have PerlShop installed on my site and as far as I can tell,
correctly ( but what do I know ), If some kind soul could explain what
would cause that error message i sure would appreciate it.
An email reply would be nice, but I'll check back here too.
Thanx,
Rip & Tim Sumrall
Authors of"5th POWER" THE PSP 5 Tutorial CD
http://www.5thpower.com
Enter our on-going contest by clicking on the logo!
sales@5thpower.com
Visit "The Button Hole" at
http://www.sumrallworks.com/freebies/buttonhole/
------------------------------
Date: Tue, 10 Nov 1998 21:25:57 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Problem access Sun Apache server through Windows IE4 or Netscape
Message-Id: <Pine.GSO.4.02A.9811101325250.7469-100000@user2.teleport.com>
On Tue, 10 Nov 1998 supradave@earthlink.net wrote:
> Are there any timing related issues with Windows browsers accessing an
> Apache server?
There may be; the docs, FAQs, and newsgroups about browsers and servers
may have some information to help you. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 10 Nov 1998 21:44:26 GMT
From: slidespy@aol.com (Slidespy)
Subject: Problems With a CGI Script
Message-Id: <19981110164426.00377.00002166@ng32.aol.com>
HELP!
Is anyone familiar with a shopping cart script called perlshop? It could be
downloaded from http://www.arpanet.com/PerlShop/download.html. Recently, I
downloaded this script and tried to install it on my server. I customized all
the variables the directions told me to customize. I checked and double-
checked the information I put for these variables and I am almost possitive
its right. But I still get that annoying 500 error. So I check the perl path
and all the variables again and I can't find anything wrong with it. So, I
check the script for error and it had none. Today I can upon a section in the
script I didn't notice ->
=======================================================
###---------- Get the Current Directory and program title ----------
$curr_dir = '';
$windows = 0;
if (index($0,'\\') != -1) #### True if running on Dos/Windows
{
$program_title = substr($0, rindex($0, '\\') + 1);
$curr_dir = substr($0,0,-(length($0) - rindex($0, '\\') - 1));
$windows = 1;
}
else #### else running on *nix
{$program_title = substr($0, rindex($0, '/') + 1);}
###-----------------------------------------------------------------
I don't know what directory I should put for $curr_dir = ''; and the program
title. I notice that in the script it calls for the program title ->
=======================================================
###push (@INC, $cgi_directory);
if ($use_cgiwrap eq 'yes')
{
umask 077; ## make readable/writeable by owner only
$cgi_prog_location = $server_address . $cgiwrap_directory .
"/$program_title";
}
else
{$cgi_prog_location = $server_address . $cgi_directory .
"/$program_title";}
$delim = chr(1);
$convert_delim_to_commas = 'yes';
$menu_bar = ""; #must be empty string here
$id_length = 9; #length of unique order id key, must be > 3.
$catalog_page = "";
###--------For Secure Server Setup----------------------------
if ($use_cgiwrap eq 'yes')
{$secure_prog_location =
"$secure_server_address$cgiwrap_directory/$program_title";}
else
{$secure_prog_location =
"$secure_server_address$cgi_directory/$program_title";}
$secure_image_location= "$secure_server_address$secure_image_directory";
###-----------------------------------------------------------
If you haven't noticed I am a novice when it comes to perl and it may seem
like a stupid question but what is the program title and how do I set the
variable $program_title. Is the program title the name of the script?
If anyone could help me it is most appreciated. Thank you for your time.
Mitchell
<mailto:Atiles@yahoo.com>
or
<mailto:Slidespy@aol.com>
------------------------------
Date: 10 Nov 1998 16:34:15 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: Re: pwd without backticks?
Message-Id: <sarlnlj9qqw.fsf@camel.fastserv.com>
>>>>> "IZ" == Ilya Zakharevich <ilya@math.ohio-state.edu> writes:
IZ> AFAIU, on many systems you cannot find cwd without being a superuser
IZ> :-(. Thus on many systems pwd() *will* fork and do `cwd`, which is
IZ> suid. Same with Cwd::cwd().
which systems are those? on most/all unix flavors getwd is a plain
library call that any user can run. Cwd::cwd just calls that in most
cases so you save the fork. if a system does restrict pwd to root (why?)
then you must fork but that shouldn't be common.
the basic algorithm of cwd is (loosely) 2 loops, first going up the dir
tree (opening ..) until you get to / storing the inode numbers of each
dir as you go up. then go down each dir from / looking for the next
inode number in that list. this needs checks for symlinks, mounted file
systems, etc. but nothing in general requires root permission.
the only major gotcha is if you start in some dir below a dir which
doesn't allow you to read it but it has execute permissions. you can
execute something with effectively a hidden cwd. then you need root
access. but on (at least) solaris pwd is not setuid.
i just played with this by having a shell below a dir with 0111 perms. i
can execute a script in there which runs pwd and it fails as it can't
read the dir. if i am above that dir, i can execute the script and it
works since it doesn't have to read the dir itself since the command is
run from above it. doing it as root works fine in both cases, of course.
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Tue, 10 Nov 98 13:13:47 PST
From: "Berend Ozceri" <berend@istanbul.engr.sgi.com>
Subject: Returning undef from an XSUB...
Message-Id: <72aaac$7vc9v@fido.engr.sgi.com>
I am having some trouble returning undef from an XSUB that's supposed to either
return a hash (HV *) or undef. I have:
HV *
gethash(name)
char *name;
CODE:
{
if( (RETVAL = (HV *)GetHash(name)) == NULL )
RETVAL = (HV *)&sv_undef;
}
OUTPUT:
RETVAL
The function correctly returns a hash when GetHash() returns non-NULL. However,
when GetHash() returns NULL, the function returns &sv_undef but the following
test doesn't catch it:
if( !defined(test::gethash("foobar")) ) {
print "undef\n";
}
Any ideas?
Thanks,
Berend
------------------------------
Date: 10 Nov 1998 21:28:01 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Returning undef from an XSUB...
Message-Id: <72ab51$5kv$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Berend Ozceri
<berend@istanbul.engr.sgi.com>],
who wrote in article <72aaac$7vc9v@fido.engr.sgi.com>:
> I am having some trouble returning undef from an XSUB that's supposed to either
> return a hash (HV *) or undef. I have:
>
> HV *
> gethash(name)
> char *name;
> CODE:
> {
> if( (RETVAL = (HV *)GetHash(name)) == NULL )
> RETVAL = (HV *)&sv_undef;
> }
> OUTPUT:
> RETVAL
>
> The function correctly returns a hash when GetHash() returns non-NULL. However,
> when GetHash() returns NULL, the function returns &sv_undef but the following
> test doesn't catch it:
>
> if( !defined(test::gethash("foobar")) ) {
> print "undef\n";
> }
a) sv_undef is not a valid HV*.
b) You cannot return a hash from a function, only several scalars.
Ilya
------------------------------
Date: 10 Nov 1998 22:56:34 +0100
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Want to learm Perl
Message-Id: <m390hjus8d.fsf@joshua.panix.com>
I found the book _Learming Perl_ to be quite helpful.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4192
**************************************