[16049] in Perl-Users-Digest
Perl-Users Digest, Issue: 3461 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 23 06:10:50 2000
Date: Fri, 23 Jun 2000 03:10:26 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <961755026-v9-i3461@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 23 Jun 2000 Volume: 9 Number: 3461
Today's topics:
PERL Trouble <username@domainname.com>
Re: PERL Trouble amitr@w-o-i.com
Re: PERL Trouble <username@domianname.com>
Permissions problems w/ Perl CGI script <nobody@bellsouth.net>
Re: Permissions problems w/ Perl CGI script <lilleyb001@hawaii.rr.com>
Re: Permissions problems w/ Perl CGI script (Rafael Garcia-Suarez)
Re: Permissions problems w/ Perl CGI script <nobody@bellsouth.net>
Please help a desperate Perl Win32 Newbie genius_boy@my-deja.com
Re: Please help a desperate Perl Win32 Newbie <blah@nospam.com>
Re: Please help a desperate Perl Win32 Newbie <thibault.delplanque@renault.fr>
Re: PPM Hotfix Fails <gellyfish@gellyfish.com>
Problem with MLDBM.pm <naidenm@americasm01.nt.com>
Re: Problems working with CPAN and ftp... <gellyfish@gellyfish.com>
Re: regex engin's undocumented behaviour? (Tad McClellan)
Re: REGEX Mystery nobull@mail.com
Regex replacing bits & pieces of a string in one shot.. <egberts@mac.com>
Re: Regex replacing bits & pieces of a string in one sh (Rafael Garcia-Suarez)
return by value <kamri@asiapacificm01.nt.com>
Re: return by value <lilleyb001@hawaii.rr.com>
Script to test whether the GIF is animated marekwww@my-deja.com
Re: Simple brain picker <sushi38@my-deja.com>
Re: SSL Post Method (Michael Budash)
Re: Swapping a picture using perl on error. <egberts@mac.com>
Re: Swapping a picture using perl on error. <egberts@mac.com>
Re: Testing a process on NT with Perl ? <thibault.delplanque@renault.fr>
Re: Urgent: Perl Access to MySql wihout DBI.pm possible <bill.kemp@wire2.com>
Re: use of eval and strict does not correctly set $@ <adamsch1NOadSPAM@yahoo.com.invalid>
Re: use of eval and strict does not correctly set $@ nobull@mail.com
Re: Who is the Perl Princess ? <gellyfish@gellyfish.com>
Why I can't use -d:DProf? <pl@cs.virginia.edu>
Re: zope, python vs apache, perl <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 23 Jun 2000 00:30:24 -0700
From: Username <username@domainname.com>
Subject: PERL Trouble
Message-Id: <3953120F.8F2F081A@domainname.com>
My PERL scripts started returning this error today (see below ERROR)
They worked yesterday.(CLUE 1)
My ISP (Globalserve/IPrimus) tech support tells me it my script and that
this is a typical script error..
I think it's their server configuration... (That's what it says..(CLUE
2)
See test script below (IT IS CORRECT-CLUE 3)
The #! line is the one they told us to use, along with alternate
#!/usr/bin/perl.
.cgi is the proper extention.
Has anyone seen this error and tell me what's going on?
I work on PERL on an NT server, this a ZEUS server.
Can't duplicate Error locally..
Thanks,
/username/
ERROR
Script execution error
Unable to execute script due to a configuration problem.
Please notify the webmaster of this error.
exec() returned: 2: No such file or directory
TEST SCRIPT
#!/bin/perl
# test.cgi
print "Content-type: text/html \n\n";
------------------------------
Date: Fri, 23 Jun 2000 08:09:25 GMT
From: amitr@w-o-i.com
Subject: Re: PERL Trouble
Message-Id: <8iv5ve$iii$1@nnrp1.deja.com>
Hi!
> #!/bin/perl
I think the above line should be
#!/usr/bin/perl -w
and it SHOULD be the FIRST line.
cheers
Amit
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 05:45:56 -0700
From: "/$username/" <username@domianname.com>
Subject: Re: PERL Trouble
Message-Id: <39535C04.5CCEA617@domianname.com>
Thanks for your suggestion.
With -w, I just get "The page you requested was not found on this
server" - Standard IE page not a server or script error message.
amitr@w-o-i.com wrote:
> Hi!
>
> > #!/bin/perl
>
> I think the above line should be
>
> #!/usr/bin/perl -w
>
> and it SHOULD be the FIRST line.
>
> cheers
> Amit
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 01:50:49 -0400
From: "Charles Lavin" <nobody@bellsouth.net>
Subject: Permissions problems w/ Perl CGI script
Message-Id: <EUC45.10299$HQ2.654249@news3.mia>
Hi --
I'm posting this on behalf of one of my programmers, so I may be somewhat
vague ...
We have a Perl script that includes a 'system("date")' call. This script was
written for one of our Web forms. On our outside Web server, this script
runs fine from a command line. However, when run as a CGI script, the
program bombs with a permissions error when trying to execute the date call.
Our outside Web server allows custom cgi-bin scripts, and provides Perl and
a slew of other things for CGI script development. The script _does_ run; it
just doesn't run correctly inside our Web site. Can anyone tell us what we
should be doing to resolve this problem?
Thanks,
CL
------------------------------
Date: Fri, 23 Jun 2000 06:22:39 GMT
From: "Benji Lilley" <lilleyb001@hawaii.rr.com>
Subject: Re: Permissions problems w/ Perl CGI script
Message-Id: <PmD45.7810$aB6.34582@typhoon.hawaii.rr.com>
Charles,
> We have a Perl script that includes a 'system("date")' call
The system(command) function in Perl attemtps to execute 'command' on your
operating system. Your 'date' command is located in /usr/bin/date (or a
similar directory).
> program bombs with a permissions error when trying to execute the date
call.
When your script runs as a CGI on the web server, it is run under uid
'nobody' or 'cgi' - which do not get file execute permissions to the
/usr/bin directory - that is where the permissions error comes from. When
you run it from the command line, you are running the script under your own
uid, and you of course have execute permission for /usr/bin/date so it
works.
You should replace the 'system("date")' call with Perl's own built-in
date/time function:
This way will emulate the date command you were using:
$date = scalar localtime;
Here's another way to use localtime ... see the camel book pg 185 for an
explanation of output.
($second,$minute,$hour,$mday,$month,$year,$wday,$yday,$isdst) =
localtime(time);
Charles Lavin <nobody@bellsouth.net> wrote in message
news:EUC45.10299$HQ2.654249@news3.mia...
> Hi --
>
> I'm posting this on behalf of one of my programmers, so I may be somewhat
> vague ...
>
> We have a Perl script that includes a 'system("date")' call. This script
was
> written for one of our Web forms. On our outside Web server, this script
> runs fine from a command line. However, when run as a CGI script, the
> program bombs with a permissions error when trying to execute the date
call.
>
> Our outside Web server allows custom cgi-bin scripts, and provides Perl
and
> a slew of other things for CGI script development. The script _does_ run;
it
> just doesn't run correctly inside our Web site. Can anyone tell us what we
> should be doing to resolve this problem?
>
> Thanks,
> CL
>
>
>
------------------------------
Date: Fri, 23 Jun 2000 06:28:35 GMT
From: garcia_suarez@hotmail.com (Rafael Garcia-Suarez)
Subject: Re: Permissions problems w/ Perl CGI script
Message-Id: <slrn8l6149.eh8.garcia_suarez@rafael.kazibao.net>
Charles Lavin wrote in comp.lang.perl.misc:
>Hi --
>
>I'm posting this on behalf of one of my programmers, so I may be somewhat
>vague ...
>
>We have a Perl script that includes a 'system("date")' call. This script was
>written for one of our Web forms. On our outside Web server, this script
>runs fine from a command line. However, when run as a CGI script, the
>program bombs with a permissions error when trying to execute the date call.
if you want the date, why not using the builtin localtime function? It
avoids the overhead of creating a forked process and also avoids relying
on availability of external programs.
--
Rafael Garcia-Suarez
------------------------------
Date: Fri, 23 Jun 2000 02:59:05 -0400
From: "Charles Lavin" <nobody@bellsouth.net>
Subject: Re: Permissions problems w/ Perl CGI script
Message-Id: <DUD45.10349$HQ2.756081@news3.mia>
Thanks to you both for the quick reply! I'll pass this along. We're new at
Perl scripting and he may not have found the localtime function.
Thanks again!
"Benji Lilley" <lilleyb001@hawaii.rr.com> wrote in message
news:PmD45.7810$aB6.34582@typhoon.hawaii.rr.com...
> Charles,
>
> > We have a Perl script that includes a 'system("date")' call
> The system(command) function in Perl attemtps to execute 'command' on your
> operating system. Your 'date' command is located in /usr/bin/date (or a
> similar directory).
>
> > program bombs with a permissions error when trying to execute the date
> call.
> When your script runs as a CGI on the web server, it is run under uid
> 'nobody' or 'cgi' - which do not get file execute permissions to the
> /usr/bin directory - that is where the permissions error comes from. When
> you run it from the command line, you are running the script under your
own
> uid, and you of course have execute permission for /usr/bin/date so it
> works.
>
> You should replace the 'system("date")' call with Perl's own built-in
> date/time function:
>
> This way will emulate the date command you were using:
> $date = scalar localtime;
>
> Here's another way to use localtime ... see the camel book pg 185 for an
> explanation of output.
> ($second,$minute,$hour,$mday,$month,$year,$wday,$yday,$isdst) =
> localtime(time);
>
>
>
> Charles Lavin <nobody@bellsouth.net> wrote in message
> news:EUC45.10299$HQ2.654249@news3.mia...
> > Hi --
> >
> > I'm posting this on behalf of one of my programmers, so I may be
somewhat
> > vague ...
> >
> > We have a Perl script that includes a 'system("date")' call. This script
> was
> > written for one of our Web forms. On our outside Web server, this script
> > runs fine from a command line. However, when run as a CGI script, the
> > program bombs with a permissions error when trying to execute the date
> call.
> >
> > Our outside Web server allows custom cgi-bin scripts, and provides Perl
> and
> > a slew of other things for CGI script development. The script _does_
run;
> it
> > just doesn't run correctly inside our Web site. Can anyone tell us what
we
> > should be doing to resolve this problem?
> >
> > Thanks,
> > CL
> >
> >
> >
>
>
------------------------------
Date: Fri, 23 Jun 2000 05:51:00 GMT
From: genius_boy@my-deja.com
Subject: Please help a desperate Perl Win32 Newbie
Message-Id: <8iuts0$cps$1@nnrp1.deja.com>
Hullo seasoned Perl Lovers,
I have a simple simple simple simple SIMPLE script.
print "HELP\n";
I get this error everytime i try to run.
Unrecognized character \xFF at myfirst.pl line 1.
I'm desperate all i wan't is for this simple newbie script to work.
genius_boy
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 09:48:43 +0200
From: Marco Natoni <blah@nospam.com>
Subject: Re: Please help a desperate Perl Win32 Newbie
Message-Id: <3953165B.93450A48@nospam.com>
genius_boy,
genius_boy@my-deja.com wrote:
> I have a simple simple simple simple SIMPLE script.
> print "HELP\n";
> I get this error everytime i try to run. Unrecognized character
> \xFF at myfirst.pl line 1. I'm desperate all i wan't is for
> this simple newbie script to work.
Which kind of editor have you used to write this script? Try with
NOTEPAD.EXE or use just the command line:
$ perl -e "print qq(HELP\n)"
and tell us which is the result.
Best regards,
Marco
------------------------------
Date: Fri, 23 Jun 2000 10:34:17 +0200
From: Thibault DELPLANQUE <thibault.delplanque@renault.fr>
Subject: Re: Please help a desperate Perl Win32 Newbie
Message-Id: <39532109.3B408FD6@renault.fr>
...???
Your first line should be something like that :
#!\bin\perl
ok ?
genius_boy@my-deja.com wrote:
> Hullo seasoned Perl Lovers,
> I have a simple simple simple simple SIMPLE script.
> print "HELP\n";
> I get this error everytime i try to run.
> Unrecognized character \xFF at myfirst.pl line 1.
> I'm desperate all i wan't is for this simple newbie script to work.
> genius_boy
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
--
Thibault DELPLANQUE
RENAULT - Unix Team -
Tel : 01 41 04 18 66
Fax : 01 41 04 50 44
GSM : 06 08 47 21 33
http://www.renault.com
------------------------------
Date: 23 Jun 2000 08:28:51 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: PPM Hotfix Fails
Message-Id: <8iv3jj$3fs$1@orpheus.gellyfish.com>
On Thu, 22 Jun 2000 15:26:00 GMT bayers@my-deja.com wrote:
> I've encluded the output of the hotfix below. The hotfix fails to
> repair PPM.
>
> Any ideas? I might have to go back to an older version.
>
> ====================================
>
> C:\Perl\bin>perl -x -S "ppm" verify --upgrade --location=. PPM
> Cannot forceunlink C:\Perl\bin\ppm.bat: Permission denied at
So why dont you change attributes of the file and run it again ?
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Fri, 23 Jun 2000 04:40:27 -0400
From: "Markachev, Naiden [SKY:4Y21:EXCH]" <naidenm@americasm01.nt.com>
Subject: Problem with MLDBM.pm
Message-Id: <3953227B.C1BBD8A@americasm01.nt.com>
...or with me
What I am trying to do is to save a data structure [together with the
data] to a file and I was advised to use MLDBM.pm and Data::Dumper.pm.
Here is how I do it:
#!/usr/bin/perl -w
BEGIN {
$LIBPATH = '/home/users/naidenm/lib/perl5/site_perl';
$PREFIX = '/home/users/naidenm/public_html/cue/www';
$DATAFILE = $PREFIX . '/data/products';
push (@INC, $LIBPATH);
}
use MLDBM;
use Fcntl;
use Data::Dumper;
tie(%dbmhash, 'MLDBM', "$DATAFILE", O_CREAT|O_RDWR, 0640) or die "Cannot
open the data file$!";
$count = 0;
while (<>) {
chomp;
($product, $rel, $product_ver, $bundle, $dlvrd, $pcked, $instl,
$ready) = split(/:/);
$entry->{"$product"}[$count]=[($rel, $product_ver, $bundle, $dlvrd,
$pcked, $instl, $ready)];
$count++;
if ($count == 4) { #middle array has 4 elements
$count = 0;
}
}
@dbmhash{qw(entry)} = ($entry);
print Data::Dumper->Dump([@dbmhash{qw(entry)}], [qw(entry)]);
#debugging
untie(%dbmhash) or die "cannot close the dbfile\n";
exit(0);
Here is the dumped data: $entry = {
'Product1' => [
[
'57,
'3.01',
'P',
'***',
'***',
'***',
'***'
],
[
'62S',
'3.01',
'T',
'***',
'***',
'***',
'***'
],
[
'62M',
'4.05',
'T',
'***',
'***',
'***',
' '
],
[
'80',
'4.05',
'T',
'***',
'***',
' ',
' '
]
],
'Product2' => [
[
'57',
'1.0',
'I',
'***',
'***',
'***',
'***'
],
[
'62S',
'6.2',
'L',
'***',
'***',
'***',
'***'
],
[
'62M',
'6.2',
'L',
' ',
' ',
' ',
' '
],
[
'80',
'6.2',
'L',
'***',
'***',
' ',
' '
]
],
'Product3' => [
[
'57',
'3.01',
'P',
'***',
'***',
'***',
'***'
],
[
'62S',
'3.01',
'T',
'***',
'***',
'***',
'***'
],
[
'62M',
'3.01',
'T',
'***',
'***',
'***',
etc...
My problem is that saving 4 or less of those products is fine but once I
try to save 5 or more I am getting an error. It is as follow:
"sdbm store returned -1, errno 22, key "entry" at
/home/users/naidenm/lib/perl5/site_perl/MLDBM.pm line 161, <> chunk 20."
Here is line 161 from MLDBM.pm
sub STORE {
my ($s, $k, $v) = @_;
$v = $s->{SR}->serialize($v);
$s->{DB}->STORE($k, $v); <----- line 161
}
And here is the error that I get when I run the program with the -d flag
sdbm store returned -1, errno 22, key "entry" at
/opt/corp/local/perl-5.004/lib/perl5db.pl line 1126, <IN> chunk 122.
MLDBM::STORE('MLDBM=HASH(0x4025a4c8)', 'entry',
'HASH(0x40262380)') called at ./addentry.pl line 40
DB::fake::(/opt/corp/local/perl-5.004/lib/perl5db.pl:2043):
I know that errno 22 means invalid argument but which argument this
error refers to ? And why I am able to save up to 4 entries but not more
?
By the way my perl version is 5.004
Any comments will be appreciated,
Naiden
------------------------------
Date: 23 Jun 2000 08:18:11 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Problems working with CPAN and ftp...
Message-Id: <8iv2vj$3ed$1@orpheus.gellyfish.com>
In comp.lang.perl.misc Sergey Gribov <sergey@cgen.com> wrote:
> Hello,
>
> I have the firewall setup which requires me to work with passive ftp.
> CPAN tries to use ftp, NET::FTP & LWP, but all of them fails because
> I can't use active ftp...
>
> When I'm trying to inialize CPAN it tries to get MIRRORED.BY file,
> but fails...
>
> I've configured lynx to use passive ftp, but it doesn't use lynx at
> this stage.
>
> How can I configure CPAN to use passive ftp?
>
You will need to configure Net::FTP to use passive mode (LWP uses this
for ftp: schemes). If you look at the Net::Config manpage (it may not
have installed as a manpage actually so you will have to use 'perldoc
Net::Config') it will describe how you can make the appropriate configuration
in a .libnetrc file in your home directory.
You might end up with a .libnetrc like :
{
ftp_ext_passive => 1,
ftp_int-passive => 1
};
Alternatively you could either reinstall libnet and reconfigure it when
asked or you could alter Net::Config directly ...
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Thu, 22 Jun 2000 23:14:56 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: regex engin's undocumented behaviour?
Message-Id: <slrn8l5p20.13h.tadmc@maxim.metronet.com>
On Thu, 22 Jun 2000 10:29:25 -0400, Drew Simonis <care227@attglobal.net> wrote:
>Tad McClellan wrote:
err, you snipped the regex that is being discussed.
I went and found it, and put it back in:
>>> /^(aa(bb)?)+$/;
>> aabbaa
>> ^^^^
>>
>> That much matches, then the engine needs to start over again
>> because it is not yet at end-of-string.
>>
>> The dollar-digit variables are reset to undef when it starts over.
Ack!
This followup gives me a chance to fix that last sentence:
The dollar-digit variables that don't match are reset to undef
when the match *succeeds*.
>> aabbaa
>> ^^
>>
>> That matches the second time around (allowed by the +).
>>
>
>I thought the regex engine would always hold a marker for the first
>position matched and backtrack to it??
Backtracking only happens when the engine cannot match.
It _can_ match in this case, so there is no backtracking
in that match.
>What you are saying makes
>logical sense, but it sure isn't the intuitive way of matching, IMO.
You misunderstand backtracking, I think.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 23 Jun 2000 09:54:52 +0100
From: nobull@mail.com
Subject: Re: REGEX Mystery
Message-Id: <u9hfak6alf.fsf@wcl-l.bham.ac.uk>
Kip Hampton <khampton@totalcinema.com> writes:
> Okay, I'm stumped. . .
> Can anybody at the RE-Guru level explain why the following snippet:
Yes I think they could. As indeed could anyone who had carefully read
the perlre and perlop manpages.
> foreach my $elem ('hi', 'ih') {
> print "found an i in $elem\n" if $elem =~ /i/g;
> print "found an h in $elem\n" if $elem =~ /h/g;
> }
> NOTE the missing "found an h in hi"!!!
The behavior is correct. Check the docs for the meaning of m//g in a
scalar context. (Start this search where the previous one left off).
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Fri, 23 Jun 2000 16:59:17 +0800
From: Bert <egberts@mac.com>
Subject: Regex replacing bits & pieces of a string in one shot... how?
Message-Id: <395326D8.15D65AD7@mac.com>
Hi people,
Need help on the following, I'm atrocious at REGEX.
From a database search, I've retrieved a string of codes, eg. "A, B, c,
D, e"
A means "string1",
B means "string2",
c means "string3", and so on.
How do I write a regex expression that replaces all the codes with its
proper string value? All at once? Or bit by bit. becoming "string1,
string2, string3..."
Thanks in advance.
Egbert
egberts@mac.com
------------------------------
Date: Fri, 23 Jun 2000 09:52:27 GMT
From: garcia_suarez@hotmail.com (Rafael Garcia-Suarez)
Subject: Re: Regex replacing bits & pieces of a string in one shot... how?
Message-Id: <slrn8l6d2g.fea.garcia_suarez@rafael.kazibao.net>
Bert wrote in comp.lang.perl.misc:
>Hi people,
>
>Need help on the following, I'm atrocious at REGEX.
>
>From a database search, I've retrieved a string of codes, eg. "A, B, c,
>D, e"
>
>A means "string1",
>B means "string2",
>c means "string3", and so on.
>
>How do I write a regex expression that replaces all the codes with its
>proper string value? All at once? Or bit by bit. becoming "string1,
>string2, string3..."
my %translate = (
A => 'string1',
B => 'string2',
C => 'string3',
);
$mystring =~ s/(A|B|C)/$translate{$1}/g;
--
Rafael Garcia-Suarez
------------------------------
Date: Fri, 23 Jun 2000 15:21:05 +1000
From: "Amri, Kuross [WOLL:4009-I:EXCH]" <kamri@asiapacificm01.nt.com>
Subject: return by value
Message-Id: <8ius3l$bvs$1@bcrkh13.ca.nortel.com>
Hello,
I have a hash say -> %hash
I have passed it by value to a subroutine but now when I try to pass it
back, I can't get the values from it.
How do you pass a value already passed by value it it like
return %$hash; ?
or return $hash; ?
or return \%hash; ?
I'd like to return it by value as well.
Thanks
Kuross
------------------------------
Date: Fri, 23 Jun 2000 06:59:38 GMT
From: "Benji Lilley" <lilleyb001@hawaii.rr.com>
Subject: Re: return by value
Message-Id: <uVD45.7909$aB6.34701@typhoon.hawaii.rr.com>
Kuross,
> I have a hash say -> %hash
>
> I have passed it by value to a subroutine but now when I try to pass
it
> back, I can't get the values from it.
Assuming that you passed the hash by value like this:
&subroutine(%hash);
To return it also by value you simply need:
return %hash;
a simple working example:
#--------
%hash = ('name' => 'foo');
sub return_by_value{
my %subroutine_hash = shift;
$subroutine_hash{name} = 'bar';
return %subroutine_hash;
}
%newhash = &return_by_value(%hash);
print "$hash{name}\n";
print "$newhash{name}\n";
#--------
would produce:
foo
bar
Regards,
Ben
------------------------------
Date: Fri, 23 Jun 2000 09:52:45 GMT
From: marekwww@my-deja.com
Subject: Script to test whether the GIF is animated
Message-Id: <8ivc1e$5mq$1@nnrp2.deja.com>
Hi
I looked for such a script and for
specification of GIFs but my research failed.
Perhaps you know how to test it?
Please let me know.
Mark
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 07:07:42 GMT
From: Igor Mack <sushi38@my-deja.com>
Subject: Re: Simple brain picker
Message-Id: <8iv2bo$fg2$1@nnrp1.deja.com>
I guess it should read $third_fourth_fifth instead :)
But if you literally mean where from it was from the example in the
Perl FAQ. For once someone read the FAQ before coming to the NG.
Thanks all for the input.
bart.lateur@skynet.be (Bart Lateur) wrote:
> >$first_five = substr($serialno, 3, 3);
> >$version = substr($first_five, 0, 1) . "." . substr($first_five, 1,
2) ;
>
> (where did you get that idea of "first five"?)
>
> --
> Bart.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 23 Jun 2000 01:41:03 -0700
From: mbudash@sonic.net (Michael Budash)
Subject: Re: SSL Post Method
Message-Id: <mbudash-2306000141030001@adsl-216-103-91-123.dsl.snfc21.pacbell.net>
In article <NXA45.22328$ef6.287332@news1.rdc1.ab.home.com>, "Tarun Tuli"
<tulit.nospam@nospam-rzsoft.com> wrote:
> Hi, I was wondering if anyone knew how I could possibly post a form
> (automatically) using perl. The form that I am posting to only supports a
> POST method. As an added twist, it also only allows SSL connections.
>
> Any advice on how to tackle this one would be greatly appriciated.
>
> Thanks.
IIUYQ, you'll want to start with the LWP (libwww-perl) package at:
http://www.perl.com/CPAN-local/modules/by-module/LWP/
read its README.SSL file for info on the additional packages you'll need.
this method has worked for me on numerous occasions - good luck!
--
Michael Budash ~~~~~~~~~~ mbudash@sonic.net
------------------------------
Date: Fri, 23 Jun 2000 15:43:53 +0800
From: Bert <egberts@mac.com>
Subject: Re: Swapping a picture using perl on error.
Message-Id: <3953152F.AE467287@mac.com>
Tom Phoenix wrote:
> Sure. If you're checking whether the picture is available on your
> filesystem, check out the -X filetests in the perlfunc manpage.
I tried something like this:
$test = " ../images/picture.jpg";
$pic = "../images/notavailable.jpg" unless -e $test;
$pic = "../images/picture.jpg" if -e $test;
but it didn't work... did I do it correctly?
Thanks, I'd appreciate any help....
Egbert
egberts@mac.com
------------------------------
Date: Fri, 23 Jun 2000 16:52:36 +0800
From: Bert <egberts@mac.com>
Subject: Re: Swapping a picture using perl on error.
Message-Id: <39532548.713DB808@mac.com>
Bert wrote:
> Tom Phoenix wrote:
>
> > Sure. If you're checking whether the picture is available on your
> > filesystem, check out the -X filetests in the perlfunc manpage.
>
> I tried something like this:
> $test = " ../images/picture.jpg";
>
GOT IT!!
the test bit needed to be an absolute path!
>
> $pic = "../images/notavailable.jpg" unless -e $test;
> $pic = "../images/picture.jpg" if -e $test;
>
> but it didn't work... did I do it correctly?
>
> Thanks, I'd appreciate any help....
>
> Egbert
> egberts@mac.com
Thanks Tom!
Egbert
egberts@mac.com
------------------------------
Date: Fri, 23 Jun 2000 07:15:28 +0200
From: Thibault DELPLANQUE <thibault.delplanque@renault.fr>
To: mnatoni@rumbanet.it
Subject: Re: Testing a process on NT with Perl ?
Message-Id: <3952F270.D8D011C3@renault.fr>
Thanks !!!
Marco Natoni wrote:
> Thibault,
>
> Thibault DELPLANQUE wrote:
> > I'd like to testing if a process is running or not... (I'm
> > using ActivePerl on Win95 / 98 / NT)... Anybody here knows how to
> > do ?
>
> If you do not know the handle of the process it could be very hard. A
> way there is using the third party TLIST.EXE utility coming with the
> resource kit (callable via command line).
>
> <code>
> map { print "Running\n" if /TASKNAME\.EXE/ } (`TLIST.EXE`);
> </code>
>
> Best regards,
> Marco
--
Thibault DELPLANQUE
RENAULT - Unix Team -
Tel : 01 41 04 18 66
Fax : 01 41 04 50 44
GSM : 06 08 47 21 33
http://www.renault.com
------------------------------
Date: Fri, 23 Jun 2000 08:57:14 +0100
From: "W Kemp" <bill.kemp@wire2.com>
Subject: Re: Urgent: Perl Access to MySql wihout DBI.pm possible ???
Message-Id: <961747156.4128.0.nnrp-09.c3ad6973@news.demon.co.uk>
>But how can i have access to MySql from a Perl-Script without the DBI
Module
>?????
(1) by writing a huge and complex piece of code that will take years and
years to do
(2) Change the name of the module, and tell the system administrator that it
isn't DBI
------------------------------
Date: Thu, 22 Jun 2000 22:37:15 -0700
From: dfdf <adamsch1NOadSPAM@yahoo.com.invalid>
Subject: Re: use of eval and strict does not correctly set $@
Message-Id: <12deb3ea.abbb2dda@usw-ex0105-040.remarq.com>
Jeff Helman <jhelman@wsb.com> wrote:
>dfdf wrote:
>>
>
>{SNIP}
>
>> #odd.pl
>> $foo = 'use strict; $SIG{PIPE} = Plumber';
>> eval $foo;
>> print "Error $@ if $@;
>>
>> If you ran this code, you wil notice that the $SIG{PIPE} =
>> Plumber; code generates a strict related error of
>>
>> Bareword "foo" not allowed while "strict subs" in use at (eval
>> 1) line 1.
>>
>> However it is not set to $@. Any thoughts?
>
>If I recall correctly, using the strict pragma forces perl to
check for
>violations at compile time (vs. at run-time). Thus, the eval
never runs
>because your script dies during compile. Thus $@ is never set.
>Incidently, I should hope that the last line of your code
snippet is a
>syntax error. :)
>
>Hope this helps,
>JH
>
>
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: 23 Jun 2000 10:07:13 +0100
From: nobull@mail.com
Subject: Re: use of eval and strict does not correctly set $@
Message-Id: <u9em5o6a0u.fsf@wcl-l.bham.ac.uk>
dfdf <adamsch1NOadSPAM@yahoo.com.invalid> writes:
> Bareword "foo" not allowed while "strict subs" in use at (eval
> 1) line 1.
>
> However it is not set to $@. Any thoughts?
This is a known bug. Try a deja search to see previous threads on the
subject.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 22 Jun 2000 23:23:34 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Who is the Perl Princess ?
Message-Id: <8iu3l6$246$1@orpheus.gellyfish.com>
On Thu, 22 Jun 2000 17:26:32 GMT martinagoo@my-deja.com wrote:
> Find out about this web phenom at
> http://oozinggoo.com/perlprincess
> She's sweeping the web!
> How did this all start?!?!
>
You think I'm stupid enough to look ?
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
Date: Fri, 23 Jun 2000 06:01:19 -0400
From: k <pl@cs.virginia.edu>
Subject: Why I can't use -d:DProf?
Message-Id: <3953356F.1FBDC5B7@cs.virginia.edu>
Hi,
I want to profile the perl scripts on my web site. I can use DProf
through command line like this: perl5 -d:DProf myperl.pl
However, how can I use -d:DProf when myperl.pl is browsed througth
browsers?
I change the first line of myperl.pl from
#!/usr/bin/perl5
to
#!/usr/bin/perl5 -d:DProf
but when I browse myperl.pl, I got error message like this:
=================================
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, root@badlands.cs.virginia.edu
and inform them of the time the error occurred, and anything you might
have done that may have caused the error.
More information about this error may be available in the server error
log.
=================================
Then I tried another way:
I renamed /usr/bin/perl5 as /usr/bin/myperl5, and write a shell script
named perl5. There is only one line in script perl5 --
/usr/bin/myperl5 -d:DProf
However, I got the same error message.
So, DProf only can be used through command line???
Thanks for helping!
--- Rick
------------------------------
Date: 23 Jun 2000 09:30:05 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: zope, python vs apache, perl
Message-Id: <8iv76d$3lb$1@orpheus.gellyfish.com>
On Thu, 22 Jun 2000 08:03:32 GMT amitr@w-o-i.com wrote:
>
> I want to evaluate zope, python vs apache, perl.
>
This is a newsgroup for the discussion of the Perl programming language,
we dont talk about zope, python or apache.
Experience has shown that these things always turn nasty.
/J\
--
** This space reserved for venue sponsor for yapc::Europe **
<http://www.yapc.org/Europe/>
------------------------------
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 3461
**************************************