[25709] in Perl-Users-Digest
Perl-Users Digest, Issue: 7949 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 6 18:10:21 2005
Date: Wed, 6 Apr 2005 15:10:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 6 Apr 2005 Volume: 10 Number: 7949
Today's topics:
Re: Perl on TRIPOD hosted sites..file uploading questio <wdflannery@aol.com>
Re: Perl on TRIPOD hosted sites..file uploading questio <noreply@gunnar.cc>
Re: Perl on TRIPOD hosted sites..file uploading questio <segraves_f13@mindspring.com>
PPM fails on a Windows 2003 with a existing Oracle 10g <vignesh_a@hotmail.com>
Re: PPM fails on a Windows 2003 with a existing Oracle <andy@andyh.co.uk>
Re: Q: // and "magic" <nobull@mail.com>
Re: Regular expression question. <nobull@mail.com>
Re: Shell Commands (Getting PID and Timing Them) <nobull@mail.com>
Soft refs problem with cgi - soft ref appears empty :- <google@global4.freeserve.co.uk>
Re: Soft refs problem with cgi - soft ref appears empty xhoster@gmail.com
Re: Soft refs problem with cgi - soft ref appears empty <noreply@gunnar.cc>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 6 Apr 2005 11:32:10 -0700
From: "joesplink" <wdflannery@aol.com>
Subject: Re: Perl on TRIPOD hosted sites..file uploading question..
Message-Id: <1112812330.900786.274770@o13g2000cwo.googlegroups.com>
>>>>>>>Not exactly. While Tripod DOES have a module called TripodCGI,
it is not a
version of the CGI module, which they also provide.
You are correct (thanks).I was confused, partly because TripodCGI does
contain a param function.
>>>>>>>>They DO provide
documentation for their modules,
Nope. I could quote the almost non-existent TripodCGI documentation,
FWIW, but, it ain't worth much.
>>>>>>>>>>>>>>>>>>ISTM, if there was no error message, you didn't ask
for any.
You are correct again (thanks again). See below.
>>>>>>>They DO support file uploading. You might examine the file
manager interface
to see how they do it.
This doesn't seem germane. I'm trying to upload from my own form.
>>>>..I don't see a Perl question here,
I"VE GOT ONE.... AT LAST..... A PERL QUESTION.....................
As it turns out, my previous efforts were not to the point....and my
current efforts have foundered in a flurry of Perl errors.....
The beginning of my program is (which, minus the Tripod... works fine
on another host)....
..
my $cgi = new CGI();
my $Tripodcgi = new TripodCGI();
$page->printHeader();
#
# If we're invoked directly, display the form and get out.
#
if (! $Tripodcgi->param("button") ) {
DisplayForm();
exit;
}
A FEW OF THE ERROR MESSAGES ARE ..... (now that I know where to look
for them).......
Use of uninitialized value in pattern match (m//) at CGI.pm line 30.
Use of uninitialized value in scalar dereference at CGI.pm line 1589.
Use of uninitialized value in concatenation (.) or string at CGI.pm
line 1589.
Use of uninitialized value in split at TripodCGI.pm line 76.
Use of uninitialized value in pattern match (m//) at CGI.pm line 30
THere are a lot more errors of the same type.
I don't have a clue as to what the problem is.
------------------------------
Date: Wed, 06 Apr 2005 21:05:59 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Perl on TRIPOD hosted sites..file uploading question..
Message-Id: <3biqhcF6d17o5U1@individual.net>
joesplink wrote:
> The beginning of my program is (which, minus the Tripod... works fine
> on another host)....
> ..
> my $cgi = new CGI();
> my $Tripodcgi = new TripodCGI();
>
> $page->printHeader();
>
> #
> # If we're invoked directly, display the form and get out.
> #
> if (! $Tripodcgi->param("button") ) {
> DisplayForm();
> exit;
> }
>
> A FEW OF THE ERROR MESSAGES ARE ..... (now that I know where to look
> for them).......
>
> Use of uninitialized value in pattern match (m//) at CGI.pm line 30.
> Use of uninitialized value in scalar dereference at CGI.pm line 1589.
> Use of uninitialized value in concatenation (.) or string at CGI.pm
> line 1589.
> Use of uninitialized value in split at TripodCGI.pm line 76.
> Use of uninitialized value in pattern match (m//) at CGI.pm line 30
>
> THere are a lot more errors of the same type.
>
> I don't have a clue as to what the problem is.
If you want help with finding out, please post a short but *complete*
program that people can copy and run and that exhibits the problem.
See the posting guidelines for this group:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 06 Apr 2005 19:36:51 GMT
From: "Bill Segraves" <segraves_f13@mindspring.com>
Subject: Re: Perl on TRIPOD hosted sites..file uploading question..
Message-Id: <nTW4e.4600$44.3252@newsread1.news.atl.earthlink.net>
"joesplink" <wdflannery@aol.com> wrote in message
news:1112812330.900786.274770@o13g2000cwo.googlegroups.com...
<snip>
> >>>>>>>They DO support file uploading. You might examine the file
> manager interface
> to see how they do it.
>
> This doesn't seem germane. I'm trying to upload from my own form.
>
If you'd like to upload from your own form and are not succesful at doing
it, you may wish to look at how Tripod does it. That was the context of my
suggestion.
<snip>
> my $cgi = new CGI();
> my $Tripodcgi = new TripodCGI();
>
> $page->printHeader();
1. After your $cgi object has read everything that was available on STDIN,
what would you expect for your $Tripodcgi object to find on STDIN. This may
explain why you received the error message "Use of uninitialized value in
split at TripodCGI.pm line 76."
2. printHeader is a function provided by the module TripodPage; yet I don't
see you've created a TripodPage object.
<snip>
Debugging programs at a remote site for which you don't have a shell account
can be extremely laborious. You might try installing local versions of all
of your Tripod modules and perform your debugging on your own workstation
before uploading your scripts to Tripod.
I expect you'll find very little interest among the participants in this
newsgroup in helping to solve your Perl problems at Tripod, when you persist
in not letting perl help you to solve your own problems.
--
Bill Segraves
------------------------------
Date: 6 Apr 2005 12:57:11 -0700
From: "Vig" <vignesh_a@hotmail.com>
Subject: PPM fails on a Windows 2003 with a existing Oracle 10g installation
Message-Id: <1112817431.465998.60560@l41g2000cwc.googlegroups.com>
Fellow techies,
I have a windows 2003 machines on which I have installed Oracle 10g.
I need to install perl on the database server to use the backup scripts
that I previously created. I was able to successful install perl. The
"perl" executable runs without problems.
I now need to install the Mime-Lite module to enable notification
functionality in my perl scripts.
I tried using PPM to install the package but it fails with the below
error.
Perl lib version (v5.6.1) doesn't match executable version (v5.8.6) at
D:\oracle\product\10.1.0\em_1\perl\5.6.1\lib\MSWin32-x86/Config.pm line
21.
Compilation failed in require at
D:\oracle\product\10.1.0\em_1\perl\5.6.1\lib\MSWin32-x86/DynaLoader.pm
line 25.
BEGIN failed--compilation aborted at
D:\oracle\product\10.1.0\em_1\perl\5.6.1\lib\MSWin32-x86/DynaLoader.pm
line 25.
Compilation failed in require at
D:\oracle\product\10.1.0\em_1\perl\site\5.6.1\lib/Win32API/Registry.pm
line 10.
Compilation failed in require at
D:\oracle\product\10.1.0\em_1\perl\site\5.6.1\lib/Win32/TieRegistry.pm
line 26.
BEGIN failed--compilation aborted at
D:\oracle\product\10.1.0\em_1\perl\site\5.6.1\lib/Win32/TieRegistry.pm
line 26.
Compilation failed in require at C:\Perl\bin\ppm.bat line 15.
BEGIN failed--compilation aborted at C:\Perl\bin\ppm.bat line 15.
The library paths for the ppm executable seems to be pointing to the
Perl installation that comes with Oracle.
Any idea what I need to do to run PPM properly ? Also, is there some
post-installation step I am forgetting ?
Thanks in advance,
Vig
------------------------------
Date: Wed, 06 Apr 2005 23:04:15 +0100
From: Andy Hassall <andy@andyh.co.uk>
Subject: Re: PPM fails on a Windows 2003 with a existing Oracle 10g installation
Message-Id: <73n851hs5hnt5elsu4c9r7e5i4b2534if8@4ax.com>
On 6 Apr 2005 12:57:11 -0700, "Vig" <vignesh_a@hotmail.com> wrote:
>I have a windows 2003 machines on which I have installed Oracle 10g.
10g is particularly cheeky and modifies your PATH and particularly PERL5LIB to
point to its (old) version of Perl.
>I tried using PPM to install the package but it fails with the below
>error.
>
>Perl lib version (v5.6.1) doesn't match executable version (v5.8.6) at
>D:\oracle\product\10.1.0\em_1\perl\5.6.1\lib\MSWin32-x86/Config.pm line
>21.
>
>The library paths for the ppm executable seems to be pointing to the
>Perl installation that comes with Oracle.
>
>Any idea what I need to do to run PPM properly ? Also, is there some
>post-installation step I am forgetting ?
Modify your environment, removing PERL5LIB, and ensure there isn't an entry in
PATH pointing to the Perl under the Oracle home, then wave fist at the Oracle
installer for doing such a thing in the first place.
--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
------------------------------
Date: Wed, 06 Apr 2005 17:45:12 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Q: // and "magic"
Message-Id: <d313bo$h17$2@sun3.bham.ac.uk>
xhoster@gmail.com wrote:
> "A. Sinan Unur" <1usa@llenroc.ude.invalid> wrote:
>
>> If the PATTERN evaluates to the empty string, the last
>> *successfully* matched regular expression is used instead. In
>> this case, only the "g" and "c" flags on the empty pattern is
>> honoured - the other flags are taken from the original pattern.
>> If no match has previously succeeded, this will (silently) act
>> instead as a genuine empty pattern (which will always match).
>
> So, does anyone find this behavior useful? I've never intentionally used
> it, and I can't imagine doing so in the future.
>
> Xho
I'm with Xho on this.
------------------------------
Date: Wed, 06 Apr 2005 17:42:47 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Regular expression question.
Message-Id: <d31378$h17$1@sun3.bham.ac.uk>
John W. Krahn wrote:
> A. Sinan Unur wrote:
>
>>
>> use strict;
>> use warnings;
>>
>>> $required_pattern = "(\\|Line 4)";
>>
>> my $required_pattern = '(\|Line 4)';
>
> Or even better:
>
> my $required_pattern = qr'(?:\|Line 4)';
Or even better:
my $required_pattern = qr/\|Line 4/;
When there's no beniefit gained from using non-standard delimiters on
qr// it's best not to do so (IMNSHO).
Precompiling a regex with qr// implicitly has the same effect as
wrapping it in (?:...).
------------------------------
Date: Wed, 06 Apr 2005 19:21:09 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Shell Commands (Getting PID and Timing Them)
Message-Id: <d318vl$jo9$1@sun3.bham.ac.uk>
Tad McClellan wrote:
> Hal Vaughan <hal@thresholddigital.com> wrote:
>
>>Joe Smith wrote:
>>
>>>Hal Vaughan wrote:
>>>
>>>>In Perl I know how to fork and get a PID, and I know how to use
>>>>`command` to get a commands output, but I can't find a way to run a
>>>>command from Perl and get the PID so I can kill it when I want.
>>>
>>> my $child_pid = fork();
>>> die unless defined $child_pid;
>>> if ($child_pid) { # Parent
>>> sleep $sleep_time;
>>> kill 2,$child_pid;
>>> } else { # Child
>>> exec "command </dev/null >/dev/null 2>&1";
>>> die "Could not run 'command'";
>>> }
>>>-Joe
>>
>>Thanks, but that gives me the PID of the forked process.
>
>
>
> Which is the process that you want to time-out.
>
>
>
>>I want to run a
>>BASH command from Perl, and get the PID of the BASH command.
> You got it (if /bin/sh is bash on your system. If not then
> replace "command" above with "/bin/bash").
That would be:
exec "/bin/bash </dev/null >/dev/null 2>&1";
Er no, that would run bash instead of command, not run command under bash.
To force the command line to be processed by /bin/bash rather than /bin/sh:
exec '/bin/bash', '-c', 'command </dev/null >/dev/null 2>&1';
------------------------------
Date: 6 Apr 2005 13:51:50 -0700
From: "ade0" <google@global4.freeserve.co.uk>
Subject: Soft refs problem with cgi - soft ref appears empty :-(
Message-Id: <1112820710.267799.147540@g14g2000cwa.googlegroups.com>
Hi Group,
I'm a relative cgi newbie. In the script below, I am trying to cycle
through 3 variables using a loop to create a soft reference for each,
and print the contents of each reference.
When I print the dereferenced value, it is always empty - but when I
print the variables themselves ($p0_mount etc), they contain the
correct values.
Can anybody see what I'm doing wrong.
Thanks
Adrian
#!/usr/bin/perl -wT
use strict;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);
my ($ref,$p0_mount,$p1_mount,$p2_mount,$q,$val);
$ENV{'PATH'}="/bin:/usr/bin";
print header, start_html("Test Soft Refs"), h1("Test Soft Refs");
$q=new CGI;
if ($q->param()) { # the form has already been filled out
# Read in parameters
$p0_mount=$q->param("p0_mount");
$p1_mount=$q->param("p1_mount");
$p2_mount=$q->param("p2_mount");
{
no strict 'refs';
for $val (0,1,2) {
# Create p0_mount, p1_mount, p2_mount etc
$ref="p${val}_mount";
# Ref in the following line always empty
print "Ref for value $val=$$ref",p;
}
print hr;
}
# The following provides correct values
print "Ref for value 0=$p0_mount",p,
"Ref for value 1=$p1_mount",p,
"Ref for value 2=$p2_mount",p,
hr;
} else {
print start_form;
print h2("Test soft refs");
print $q->textfield(-name=>'p0_mount',-value=>'p0');
print $q->textfield(-name=>'p1_mount',-value=>'p1');
print $q->textfield(-name=>'p2_mount',-value=>'p2');
print p(submit("Submit"),reset("clear"));
print end_form(), hr();
}
print end_html;
Script provides output like this:
Ref for value 0=
Ref for value 1=
Ref for value 2=
-------------------------------------------------------------------Ref
for value 0=p0
Ref for value 1=p1
Ref for value 2=p2
------------------------------
Date: 06 Apr 2005 21:07:58 GMT
From: xhoster@gmail.com
Subject: Re: Soft refs problem with cgi - soft ref appears empty :-(
Message-Id: <20050406170758.929$fw@newsreader.com>
"ade0" <google@global4.freeserve.co.uk> wrote:
> Hi Group,
>
> I'm a relative cgi newbie. In the script below, I am trying to cycle
> through 3 variables using a loop to create a soft reference for each,
> and print the contents of each reference.
You probably shouldn't do that.
> When I print the dereferenced value, it is always empty - but when I
> print the variables themselves ($p0_mount etc), they contain the
> correct values.
>
> Can anybody see what I'm doing wrong.
Other than using symbolic reference in the first place, you are trying to
use symbolic references to lexical variable. You can't do that.
> my ($ref,$p0_mount,$p1_mount,$p2_mount,$q,$val);
$p0_mount is now a lexical variable. It can't be accessed through
symbolic references.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
------------------------------
Date: Wed, 06 Apr 2005 23:23:01 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Soft refs problem with cgi - soft ref appears empty :-(
Message-Id: <3bj2jiF6i57d3U1@individual.net>
ade0 wrote:
> In the script below, I am trying to cycle
> through 3 variables using a loop to create a soft reference for each,
> and print the contents of each reference.
>
> When I print the dereferenced value, it is always empty - but when I
> print the variables themselves ($p0_mount etc), they contain the
> correct values.
>
> Can anybody see what I'm doing wrong.
Answer 1:
You are using soft references when you easily could replace them by
using e.g. a hash. For instance:
my %par = map { $_, $q->param("p${_}_mount") } 0,1,2;
for my $key (0,1,2) {
print "Value $key=$par{$key}",p;
}
Answer 2:
The $p0_mount etc. variables are my() declared, while they'd need to be
package globals.
Answer 3:
You didn't check the FAQ before posting here. The FAQ entry
perldoc -q "variable name"
provides both answer 1 and 2 above.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 V10 Issue 7949
***************************************