[10290] in Perl-Users-Digest
Perl-Users Digest, Issue: 3883 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Oct 3 12:07:22 1998
Date: Sat, 3 Oct 98 09:00:26 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 3 Oct 1998 Volume: 8 Number: 3883
Today's topics:
Re: A bug in Perl 5.003??? <gellyfish@btinternet.com>
Beginner - Help with simple calculation... <pasdespam@pasdespam.com>
Re: Beginner - Help with simple calculation... <ajg141@psu.edu>
Re: Beginner - Help with simple calculation... <pasdespam@pasdespam.com>
Re: bidirectional pipes & pttys? <gellyfish@btinternet.com>
Re: Copying files <gellyfish@btinternet.com>
Re: Copying files (Tad McClellan)
Extracting Data out of a delimited file <arm@home.com>
Re: Extracting Data out of a delimited file (Larry Rosler)
Re: Extracting Data out of a delimited file <ajg141@psu.edu>
Re: Extracting Data out of a delimited file <ajg141@psu.edu>
Re: Getopt::Std <gellyfish@btinternet.com>
Re: Getting thePerl script's directory name <gellyfish@btinternet.com>
Re: Hashes - defined or not? <gellyfish@btinternet.com>
Re: haw copy file? <gellyfish@btinternet.com>
Re: help needed <gellyfish@btinternet.com>
Re: Help with regular expression!!! <gellyfish@btinternet.com>
Re: Help with system() on NT <tb@csi.com>
Help! Problem using Sprite SQL module <look@bottom.of.message>
Re: I hate it when I do that. (Bart Lateur)
Re: mailing from within PERL <gellyfish@btinternet.com>
Re: Multiple Form Results <gellyfish@btinternet.com>
Re: Name of subroutine (Matthew Bafford)
Re: Name of subroutine <gellyfish@btinternet.com>
Re: need a regular expressions expert.... <gellyfish@btinternet.com>
Re: Need help from Perl guru <mkahn@vbe.com>
Re: Need help with interpolation of a scalar !! ? <gellyfish@btinternet.com>
Re: new term for illogical <gellyfish@btinternet.com>
Re: passing javascript vars to CGI <gellyfish@btinternet.com>
Re: Passing Perl Var To JavaScript - How? dsaff@tvisions.com
Re: problem running perl script under apache server <gellyfish@btinternet.com>
Re: Problem with HTTP::Request::Common <gellyfish@btinternet.com>
Re: Script does not write to file <gellyfish@btinternet.com>
Re: Shared memory, ftok and FreeBSD <gellyfish@btinternet.com>
Re: string from array (Bart Lateur)
Re: Too late for "-T" option ? (Marc Haber)
Re: uppercase to lowercase <gellyfish@btinternet.com>
Re: UserGetMisc.al library <gellyfish@btinternet.com>
Re: using sendmail with accents in a cgi? <samwang@freewwweb.com>
Re: Win32, Net::Ping and alarm <gellyfish@btinternet.com>
Re: Win32::AdminMisc UserChangePassword Quesiton <gellyfish@btinternet.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 3 Oct 1998 15:09:28 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: A bug in Perl 5.003???
Message-Id: <6v5en8$tp$1@gellyfish.btinternet.com>
On Fri, 02 Oct 1998 12:08:57 -0700 Jim Vaught <jvaught@ichips.intel.com> wrote:
> Am I doing something wrong or is this a bug in Perl? This is the
> strangest thing I've ever seen in all my days of programming. Here is
> my entire program
> sub jim {die;}
> if (defined $a)
> {&jim(1);}
> (since netscape does wierd things with whitespace I should mention that
> the {&jim is indented by 3 spaces to make this bug appear).
> This gives me the error:
> Number found where operator expected at try line 6, near "&jim(1"
> (Missing operator before 1?)
> It seems that this error occurs when all of the following are true:
<snip examples>
Yep, wierd definitely,bug possibly. But as perl is now at 5.005.02 and
neither that nor 5.004.04 exhibit the behaviour you describe I dont think
anyones going to get too excited about it.
I'd just upgrade Perl, have a few beers and laugh it off.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 3 Oct 1998 10:05:49 -0400
From: "Raynald Provencher" <pasdespam@pasdespam.com>
Subject: Beginner - Help with simple calculation...
Message-Id: <6v5anf$ai6$1@news.quebectel.com>
I a very new in PERL. I have tried some things, but it didn't work. This is
a simple calculation:
$total = $price * 0.9
This gives me, for example:
6.95 * 0.9 = 6.255 or
110.00 * 0.9 = 99
What should I do to get "6.25" instead of "6.255" and "99.00" instead of
"99"?
Thanks
Raynald
You may use rproven@microtec.net to anwser....
------------------------------
Date: Sat, 03 Oct 1998 10:47:50 -0400
From: Abdulaziz Ghuloum <ajg141@psu.edu>
Subject: Re: Beginner - Help with simple calculation...
Message-Id: <36163916.8A839CA0@psu.edu>
Raynald Provencher wrote:
> $total = $price * 0.9
> This gives me, for example:
> 6.95 * 0.9 = 6.255 or
> 110.00 * 0.9 = 99
>
> What should I do to get "6.25" instead of "6.255" and "99.00" instead of
> "99"?
try:
printf ("Total = \$%.2f\n", $total);
Aziz,,,
------------------------------
Date: Sat, 3 Oct 1998 11:42:47 -0400
From: "Raynald Provencher" <pasdespam@pasdespam.com>
Subject: Re: Beginner - Help with simple calculation...
Message-Id: <6v5gd2$odr$1@news.quebectel.com>
Sorry, it does not work...
Any other suggestion?
Abdulaziz Ghuloum a icrit dans le message <36163916.8A839CA0@psu.edu>...
>Raynald Provencher wrote:
>> $total = $price * 0.9
>> This gives me, for example:
>> 6.95 * 0.9 = 6.255 or
>> 110.00 * 0.9 = 99
>>
>> What should I do to get "6.25" instead of "6.255" and "99.00" instead of
>> "99"?
>
>try:
>printf ("Total = \$%.2f\n", $total);
>
> Aziz,,,
------------------------------
Date: 3 Oct 1998 16:55:42 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: bidirectional pipes & pttys?
Message-Id: <6v5kue$123$1@gellyfish.btinternet.com>
On Fri, 02 Oct 1998 20:28:54 GMT James Davis <james.davis@corp.home.net> wrote:
> Have a tty-less PERL script running rsh commands, unable to receive
> results of output using open2. Any way to establish a ptty beforehand,
> and will this solve the problem?
Not entirely sure what you are after but do you mean something
like Net::Telnet;
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 14:34:47 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Copying files
Message-Id: <6v5cm7$pn$1@gellyfish.btinternet.com>
On Sat, 03 Oct 1998 10:47:45 +0200 Nico <info@edoc.co.za> wrote:
> I'm trying to copy a JPG file (Per5.004 win 95)
> The following code opens the file, but does not copy all the contents.
> The source file etc does exist.
<snip>
Check out:
perldoc -f binmode
You will find that will almost certainly solve your problem.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 3 Oct 1998 09:03:19 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Copying files
Message-Id: <7ra5v6.ep6.ln@flash.net>
Nico (info@edoc.co.za) wrote:
: Stacy Doss wrote:
: Thanks for the answer...
: but being a bit of a newbie, where can I read more on the use of
: file::copy?
Well, case matters in Perl.
So there is no 'file::copy' ;-)
With a correctly installed perl, you should be able to:
perldoc File::Copy
: > Nico wrote:
: >
: > > I'm trying to copy a JPG file (Per5.004 win 95)
: > >
: > > The following code opens the file, but does not copy all the contents.
: > > The source file etc does exist.
: > >
: > > Please help
: >
: > #code deleted
: >
: > use File::Copy;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sat, 03 Oct 1998 14:22:03 GMT
From: Alan Melton <arm@home.com>
Subject: Extracting Data out of a delimited file
Message-Id: <3616317C.D9750149@home.com>
Example of delimited file:
1998]Spring]MAE]5583]0-13-359993-0]ALL]PRINCIPLES CORROSION]92.25
1998]Spring]STAT]4091]1-58025-018-1]ALL]SAS SYSTEM ANALYSIS]28.25
1997]Fall]CIED]3710]0-87120-228-X]003,004]INSPIRING LEARNING]14.95
1998]Fall]PSYCH]1113]0-15-510231-1]901]IN SEARCH MACINTOSH CD ROM]87.50
I have a program that will allow extraction of data out of
a fixed length file:
for $filename ("ftext.txt") {
open (IN, "<$filename") or die "Cannot read $filename: $!";
@titles = qw/CAT CAT5 SEC CAT2 CAT1 CAT4 NAME SKU/;
while (<IN>) {
chomp;
@f = unpack 'A9 A11 A9 A16 A4 A12 A71 A13', $_;
print OUTPUT join ('|', map {$_ . '=' . shift @f} @titles), "|\n";
}
close IN;
}
1;
and then join them with a | delimiter and add to each field
extra i.e. CAT=1998
What do I change in the above file to extract and join data
based on the above "]" delimited file
Alan Melton
------------------------------
Date: Sat, 3 Oct 1998 08:08:36 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Extracting Data out of a delimited file
Message-Id: <MPG.107fddd0355f4fa7989898@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and copy mailed.]
In article <3616317C.D9750149@home.com> on Sat, 03 Oct 1998 14:22:03 GMT,
Alan Melton <arm@home.com> says...
...
> I have a program that will allow extraction of data out of
> a fixed length file:
...
> @f = unpack 'A9 A11 A9 A16 A4 A12 A71 A13', $_;
...
> What do I change in the above file to extract and join data
> based on the above "]" delimited file
'fixed length file' => unpack 'A9 A11 ...'
'"]" delimited file' => split /]/
For details, `perldoc -f split`
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Sat, 03 Oct 1998 11:02:57 -0400
From: Abdulaziz Ghuloum <ajg141@psu.edu>
Subject: Re: Extracting Data out of a delimited file
Message-Id: <36163CA1.9AA95EBF@psu.edu>
Alan Melton wrote:
> while (<IN>) {
> chomp;
> @f = unpack 'A9 A11 A9 A16 A4 A12 A71 A13', $_;
> print OUTPUT join ('|', map {$_ . '=' . shift @f} @titles), "|\n";
> }
> close IN;
> }
> What do I change in the above file to extract and join data
> based on the above "]" delimited file
how about:
$f = split(']');
Aziz,,,
------------------------------
Date: Sat, 03 Oct 1998 11:04:34 -0400
From: Abdulaziz Ghuloum <ajg141@psu.edu>
Subject: Re: Extracting Data out of a delimited file
Message-Id: <36163D02.FD67C046@psu.edu>
I meant:
@f = split(']');
Aziz,,,
------------------------------
Date: 3 Oct 1998 15:41:48 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Getopt::Std
Message-Id: <6v5gjs$10b$1@gellyfish.btinternet.com>
On Fri, 02 Oct 1998 23:39:01 GMT Corey <corey@virtual-impact.com> wrote:
> Hello there,
>
> I've found myself at somewhat of a loss in implementing a
> nice way of issuing a usage function under the circumstance
> in which a correct option is specified ( as declared via
> a 'getopts' statement ), but is lacking an argument.
> As I have found, if a valid option ( $opt_e for demonstration
> purposes ) is passed but does not contain an argument, rather
> than issueing a syntax error ( such as 'Option requires
> argument' or some such ) or even defining $opt_e as empty,
> Getopt::Std seems to simply discard it completely, making it
> very difficult to present a usage clause under the above
> scenerio - because I can't say "present error if $opt_e
> exists but is empty, otherwise process $opt_e as normal".
> i.e., something similar to:
> #!/usr/bin/perl
> use Getopt::Std;
> getopts('e:');
> if (defined $opt_e) {
> ($opt_e eq "") and die "needs argument");
> &do_stuff;
> }
<snip>
You should be checking the return of "getopts" i.e.:
getopts('e:') || usage();
getopts will return a false value if either an invalid switch is passed
or one which requires an argument without an argument. But I have to say
it doesnt actually say that in the manpage.
In the latter case this does not indicate which option was lacking an
argument however.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 11:45:08 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Getting thePerl script's directory name
Message-Id: <6v52o4$iu$1@gellyfish.btinternet.com>
On Wed, 30 Sep 1998 17:24:47 +0100 Nigel Parker <95ncp@eng.cam.ac.uk> wrote:
> On Wed, 30 Sep 1998 jesten@wdynamic.com wrote:
> : In article <361155E2.CB719A6E@oxsigen.com>,
> : Bart Thielges <bart@oxsigen.com> wrote:
> : > When I write applications that are actually clusters of several
> : > executables (a main script calls subordinate scripts), I usually
> : > want to make that cluster relocatable without requiring the user
> : > to set search paths or special environment variables. In the past
> : > [snip]
> : > Does anyone know how to do this in Perl ? More specificially,
> : > how do I do the getExecutablePath() in Perl - I know how do
> : > do the rest.
> : >
> I thought that the following two evironment variables were universally
> used:
> $script_location = "http://$ENV{SERVER_NAME}$ENV{SCRIPT_NAME}";
> You may want to add something to do with the port number using
> $ENV{SERVER_PORT}, but this isn't usually necessary.
Pray tell, where exactly in the original post did it mention anything about
CGI and even if one were to have special knowledge that his application was
an CGI it would be $ENV{SCRIPT_FILENAME} clearly from his description of the
situation - otherwise some solution involving $0 is what is wanted.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 14:11:45 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Hashes - defined or not?
Message-Id: <6v5bb1$pc$1@gellyfish.btinternet.com>
On Fri, 2 Oct 1998 06:32:49 -0700 Larry Rosler <lr@hpl.hp.com> wrote:
> To quote from the original submission,
>> Are there any Perl gugus who can explain this behaviour as it appears to be
>> different to the behaviour described in the Camel book.
> How about it, gugus?
Its obviously the season for neologisms - or am I being a right reese gugus.
;-P
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 13:43:15 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: haw copy file?
Message-Id: <6v59lj$mh$1@gellyfish.btinternet.com>
On Thu, 01 Oct 1998 11:34:51 GMT Krzysztof Kunowski <kyniu1@friko3.onet.pl> wrote:
> Haw copy file form one dir to other in Perl?
the File::Copy module that comes with Perl supplies methods to do this.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 14:45:18 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: help needed
Message-Id: <6v5d9u$t5$1@gellyfish.btinternet.com>
On Sat, 03 Oct 1998 15:26:13 +0400 Aleksey A. Pavlov <paaa@uic.nnov.ru> wrote:
> bjjgann wrote:
>>
>> I have a small perl script which opens a file , searches for a string and
>> replaces the string then saves the outcome to another file. This works fine
>> unless the serach string is a + to which i get an error :-
>>
>> /+/: ?+* follows nothing in regexp
>>
>> below is the code:-
>>
>> ($infilename = a);
>> ($outfilename = b);
>> ($search = "+");
>> ($replace = "");
>>
>> open(IN,$infilename) || die "cannot open $infilename for reading";
>> open(OUT,"?$outfilename") || die "cannot create $outfilename";
>>
>> while (?IN?) {
>> s/$search/$replace/gie;
>> print OUT $_; # print that line to file $b
>>
>>
>> }
>> close(IN);
>> close(OUT);
>>
>> The code works fine with other $search variables such as = or ?
>>
>> Any help appreciated
> Try this:
> $repalce ="\\+";
> because you must do s/\+/.../; instead of s/+//;
Of course the general solution would be to use quotemeta as others have
pointed out here.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 13:09:35 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Help with regular expression!!!
Message-Id: <6v57mf$la$1@gellyfish.btinternet.com>
On Wed, 30 Sep 1998 22:02:10 GMT nguyen.van@imvi.bls.com wrote:
> Hi gus,
> I have a little problem with regex. Below is my access file. I want to print
> out to a file with only "crno=number"(i.e crno=7035269) and
> "Mozilla/number.numbers"(i.e Mozilla/3.0). However, I just want to pick these
> out of lines without AOL number.numbers(i.e AOL 3.01) and MSIE
> number.numbers(i.e MSIE 4.02). For example, I'm interested in the following
> lines: 207.172.36.247 - - [30/Jul/1998:00:49:16 -0400] "GET
> /GFX/quick_gray.gif HTTP/1 .0" 304 0
> "http://www.yp.bellsouth.com/?mkt=****&crno=7035273" "Mozilla/4.5b1 [ en]
> (WinNT; I)"
Havent you posted this question before ? Or was the last guy who couldnt
do it sacked ;-P
This looked familiar so i looked at the old examples I have given here and I
found this dated Sept 4 (at the risk of making YALR sick again):
#!perl
while(<DATA>)
{
if(m/(\d+\.\d+\.\d+\.\d+)\s # IP Number of client
(\S*)\s(\S*)\s # User ?
\[(.*)\]\s # Time
"([^"]*)"\s # Request
(\d{3})\s # Status
(\d*)\s # Size of data xfered
"([^"\s]*)"\s # Host
"([^"]*)"$ # User Agent
/x
)
{
print "Address = ",$1,"\n";
print "Time = ",$4,"\n";
print "Request = ",$5,"\n";
print "Status = ",$6,"\n";
print "Amount = ",$7,"\n";
print "Host = ",$8,"\n";
print "Agent = ",$9,"\n";
}
}
__END__
152.163.195.181 - - [30/Jul/1998:00:01:07 -0400] "GET X?crno=7034572&mkt=**** HTTP/1.0" 200 14122 "http://bellsouth.bigfoot.com/SEARCH" "Mozilla/2.0 (compatible ; MSIE 3.02; Update a; AK; AOL 3.0; Windows 95)"
152.163.204.136 - - [30/Jul/1998:00:01:37 -0400] "GET / HTTP/1.0" 200 23641 "http://www.florida.com/realestate/cities.html" "Mozilla/2.0 (compatible; MSIE 3.02; Update a; AOL 3.0; Windows 95)"
209.214.81.7 - - [30/Jul/1998:00:01:37 -0400] "POST / HTTP/1.0" 200 5587 "http:/ /yp.bellsouth.com/" "Mozilla/4.04 [en] (WinNT; I)"
The regex will split your log into its constituent parts which you can then
match and play with to your hearts content.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 03 Oct 1998 11:40:24 -0400
From: Tom Baldwin <tb@csi.com>
Subject: Re: Help with system() on NT
Message-Id: <36164568.1145@csi.com>
Martin Vorlaender wrote:
>
> George Kuetemeyer (george.kuetemeyer@mail.tju.edu) wrote:
> : scottw7562@my-dejanews.com wrote:
> : > I read the docs and apparently the `backtick` method is not supported under
> : > NT ?? otherwise I should be able to capture and supress the output of the
> : > command.
> :
> : The `backtick` method *does* work with NT.
>
> ...unless you are using Perl for CGI scripting, have IIS, and didn't tell
> it to create a new console with each script.
>
> For IIS v2 and v3:
>
> Insert Registry key
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\
> CreateProcessWithNewConsole , contents REG_DWORD 1
> and restart IIS.
>
> For IIS v4:
>
> - Make sure that you've got "Windows Scripting Host" installed as
> part of Option Pack 4. You can verify this by looking for the file
> %system32%\cscript.exe. If it isn't there, run setup.exe from
> the Option Pack CD-ROM and install it.
> - Using the CLI, go to %system32%\inetsrv\adminsamples.
> - Run this:
>
> adsutil.vbs SET W3SVC/1/CreateCGIWithNewConsole 1
>
> (the number after "W3SVC/" may vary if you have multiple websites.
> If you have, repeat the procedure for all websites.)
> It'll say that CScript isn't set up to handle this. That's ok.
> - Click Ok.
> - Click yes, you want to register.
> - Run it again.
> - Using the ISM, restart all web sites.
>
> cu,
> Martin
> --
> | Martin Vorlaender | VMS & WNT programmer
> VMS is today what | work: mv@pdv-systeme.de
> Microsoft wants | http://www.pdv-systeme.de/users/martinv/
> Windows NT 8.0 to be! | home: martin@radiogaga.harz.de
Along the lines of using system() on NT. When executing a simple script
such as:
print "This is a line\n";
system ('sc query Eventlog');
print "This is the last line";
The output shows the output from the sc query command followed by
This is a line
This is the last line
It appears the system call is executed, then the print commands are
executed. Why does this happen ? Any hints are appreciated.
Thank you.
Tom Baldwin
------------------------------
Date: Sat, 03 Oct 1998 16:30:28 +0100
From: "Lee J. Stoneman" <look@bottom.of.message>
Subject: Help! Problem using Sprite SQL module
Message-Id: <36164313.88CEC734@bottom.of.message>
HI,
I am getting strange results from my use of the SQL module Sprite.
Instead of returning a list of records matching the SQL query, all I get
is the following:
ARRAY(0x8161af4)
ARRAY(0x8162368)
ARRAY(0x81649f8)
ARRAY(0x8165048)
This matches up with the fact that there are 4 records in the file and
that it's the correct number for a 'select * from database' command, but
I was expecting the actual records to display not pointers to an array.
Have I done something stupid? Obviously I have, but what?
Thanks for any help,
Lee.
--
I Made This! --> The UK DVD Debate Website @ http://www.dvd-debate.com
lee at dvd-debate dot com
-------------------------------------------
#!/usr/local/bin/perl -w
BEGIN
{
unshift (@INC,"/home/webweave/www/cgi-bin/");
}
use lib '/home/webweave/www/cgi-bin/';
use Sprite;
$rdb = new Sprite;
$rdb->set_delimiter ("Read", "|");
$rdb->set_os ("UNIX");
@data = $rdb->sql (<<End_of_Query);
select * from dat/films.dat
End_of_Query
$rdb->close;
$status = shift (@data);
$no_elements = scalar (@data);
if (!$status) {
die "Sprite database error. Check your query!", "\n";
} elsif (!$no_elements) {
print "There are no records that match your criteria!", "\n";
exit (0);
} else {
local $^W = 0;
foreach $record (@data)
{
$record =~ s/\0/,/g;
print $record, "\n";
}
}
exit (0);
------------------------------
Date: Sat, 03 Oct 1998 14:22:50 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: I hate it when I do that.
Message-Id: <361624f6.2420709@news.ping.be>
Andrew M. Langmead wrote:
>Sorry, didn't mean to offend. Its just that there is a school of
>thought that in writing substantial programs one should avoid implicit
>$_. I don't necessarily agree with it, but I do see their
>point. (Although I'd probably feel comforable with the rule "assign to
>an explicit variable instead of $_ if you can no longer see in your
>text editor both where $_ gets set and where it is used without
>scrolling."
Do without $_? Nah. But you have to avoid treating $_ as just an
ordinary variable.
I think of it as the Perl equivalent of the accumulator in assembler
(general purpose CPU register). It's a convenient short term place to
manipulate values that you need to access more than once in subsequent
statements.
You may not expect to keep the value in there for long; it will soon be
overwritten. So, if you ever use it so that subsequent uses don't even
fit on the same screen in the editor, then you're definitely using it
the wrong way.
BTW a "nice" way to manipulate a variable through $_, is using "for":
for($ary[-1]) {
chomp;
tr/,/./;
}
This will manipulate the last item of this array.
It's actually a looping construct, but with only one item in the array
it's looping through, it will be executed exactly once. I would like it
if Perl allowed a yet more conventient synonym for the "for" (but
what?), but it will do for now.
Bart.
------------------------------
Date: 3 Oct 1998 15:23:29 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: mailing from within PERL
Message-Id: <6v5fhh$uh$1@gellyfish.btinternet.com>
On 3 Oct 1998 02:03:06 -0700 philip@Spamlessnessconnect.ie wrote:
> Hi pete,
> I use the following formula,
> open (MAIL,"|/usr/lib/sendmail -t"); #opens the sendmail program
> #and allows you to specify recipient etc
> print MAIL "To:recipient@home.ie\nSubject: Mail sending\nFrom:me@here.ie";
> print MAIL $content;
> Thats all there is to it
Assuming of course that $content begins with "\n\n" otherwise the last
header must end in "\n\n".
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 10:35:21 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Multiple Form Results
Message-Id: <6v4ul9$hk$1@gellyfish.btinternet.com>
On Thu, 01 Oct 1998 17:16:42 GMT Abe Davison <331@allied.demon.co.uk> wrote:
> With an html form generated by a perl script in the lower frame (main)
> what form action=? could be used to display one set of results in the
> main frame and a second set of results in the top frame.
> This means two form actions and two targets from one form submit
> button.
Check out the CGI.pm documentation particularly the section entitled:
"Working with Netscape Frames"
Beyond that this really a generic CGI question which would be more
appropriately put to a newsgroup dedicated to such matters.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 3 Oct 1998 09:54:00 -0400
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Name of subroutine
Message-Id: <MPG.107ff6762a0bf9d99896c2@news.south-carolina.net>
In article <36161e3d.0@newsread1.dircon.co.uk> on Sat, 3 Oct 1998
13:57:51 -0700, Paul Davies (cobalt@dircon.co.uk) pounded in the
following text:
=> Hi
=>
=> Does anyone know if there is an easy way to get the name of a subroutine I'm
=> in, is there a variable
=> which stores this?
What you want is the caller function. For your problem, it'd
be:
(caller 0)[3]
=> Thanks
Hope This Helps!
=> Paul
--Matthew
------------------------------
Date: 3 Oct 1998 15:20:55 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Name of subroutine
Message-Id: <6v5fcn$ue$1@gellyfish.btinternet.com>
On Sat, 3 Oct 1998 13:57:51 -0700 Paul Davies <cobalt@dircon.co.uk> wrote:
> Hi
> Does anyone know if there is an easy way to get the name of a subroutine I'm
> in, is there a variable
> which stores this?
Try this:
#!/usr/bin/perl
sub blah
{
$i = 0;
while(@callstuff = caller($i++))
{
print "$i : @callstuff \n";
}
}
sub woof
{
&blah;
}
&woof ;
__END__
Then read the perlfunc entry for "caller"
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 11:09:54 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: need a regular expressions expert....
Message-Id: <6v50m2$hu$1@gellyfish.btinternet.com>
On 29 Sep 1998 21:58:17 GMT Abigail <abigail@fnx.com> wrote:
> Alan Davis (adavis@tivoli.com) wrote on MDCCCLV September MCMXCIII in
> <URL:news:36112AC1.568073FD@tivoli.com>:
> ++ I have a need to have a program spit back any string that DOESN'T start
> ++ with "BAD"
> perl -nwe 'print if index $_, "BAD"'
> perl -nwe 'print unless /^BAD/'
> ++ but I cannot use perl's inherent "!" syntax.
> Why not?
perhaps the "!" key on his PC is broken - I dont remember seeing any "1"s in
his posting either.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 03 Oct 1998 09:34:14 -0500
From: Mark Kahn <mkahn@vbe.com>
Subject: Re: Need help from Perl guru
Message-Id: <361635E6.F079A755@vbe.com>
> while ( ($key2,$value2) = each(%{$rh_class->{rh_student}[$studid]}) )
You are implying:
1. $rh_class is a reference to a hash.
2. $rh_class{rh_student} is a reference to an array.
3. element [$studid] of the array contains a reference to a hash.
Without knowing how you populated these data stuctures it is impossible
to tell what the problem is. Keep in mind that perl can create a data
element when reference even though you did not initialize it earlier.
This is the "springs into existance through useage" feature.
Below is an example of what I think you are trying to do. Note that I
assume you are incrementing your "$studid" variable inside the while
loop.
HTH.
P.S.: I don't know about that "guru" part.
------------------------------------------------------------
#!/usr/bin/perl -w
my (%hash1,@arr1,$ref,@out1,$var1);
%hash1 = (
key1 => \@arr1,
);
$ref = \%hash1;
@{$ref->{key1}}[0] = {"KEY1","VAL1"};
@{$ref->{key1}}[1] = {"KEY2","VAL2"};
@{$ref->{key1}}[2] = {"KEY3","VAL3"};
$var1 = 0;
while (@out1 = each(%{$ref->{key1}[$var1]})) {
print "key = $out1[0] val = $out1[1]\n";
$var1++;
}
------------------------------------------------------------
--
Mark Kahn
mkahn@vbe.com
PGP Fingerprint20 = FEF0 1F3F 94C0 EE77 790B 45EA B1C0 262A D7E0 C865
------------------------------
Date: 3 Oct 1998 11:16:16 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Need help with interpolation of a scalar !! ?
Message-Id: <6v5120$ig$1@gellyfish.btinternet.com>
On Tue, 29 Sep 1998 21:48:00 GMT Steve maZe <steveg@nospam.org> wrote:
> I am assuming it's something like $current = basename($temp);
use File::Basename;
my ($file,$path,$suffix) = parsefile($filepath,@suffic_list);
If you want to use the path information separately as well.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 11:29:29 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: new term for illogical
Message-Id: <6v51qp$ik$1@gellyfish.btinternet.com>
On 30 Sep 1998 00:44:20 -0400 Uri Guttman <uri@sysarch.com> wrote:
>>>>>> "A" == Abigail <abigail@fnx.com> writes:
> A> *plonk*
> poor abby couldn't handle some acerbic comments back at he/r!
Actually I might have considered the big P for "dear jonny" as well.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 13:37:26 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: passing javascript vars to CGI
Message-Id: <6v59am$li$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Phinneas G. Stone <phinneas@eskimo.com> wrote:
> Is it possible to process a variable with javascript, then pass that
> value along to a CGI script? What I'm trying to do is preserve the line
> breaks in a <textarea> by encoding with the javascript escape() function
> and decoding them with perl once the form has been submitted.
Of course this has nothing to do with Perl but whats wrong with
setting the value of hidden field to your variable before you submit ?
comp.lang.javascript only next time please.
[followup set]
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 03 Oct 1998 14:08:08 GMT
From: dsaff@tvisions.com
Subject: Re: Passing Perl Var To JavaScript - How?
Message-Id: <6v5b45$thl$1@nnrp1.dejanews.com>
Sorry, forgot the quotes in the JavaScript. Instead, try:
print qq(
function addToList(inform) {
if ("$usingName" == "no")
{
alert("\\nYou must use a first name\\n");
continue;
}
}
);
Without the quotes, JavaScript will interpret the value of $usingName as a
variable named "yes" or "no", and since neither is probably defined, the value
will never match the _string_ "no".
Learning to keep my eyes open,
David Saff
In article <6v2r3q$d4n$1@nnrp1.dejanews.com>,
dsaff@tvisions.com wrote:
> In article <3611a18c.7462898@news.mindspring.com>,
> ralph@primemail.com wrote:
> > I have a perl/cgi form with some JavaScript in it - I'm trying to pass
> > a perl variable to a javascript function and cannot quite figure out
> > how to do this. My perl code reads a variable ($usingName) out of a
> > file on the server side and I need to pass this value to my JS for
> > some checking.
> >
> > What I have thus far:
> >
> > (snippet of code in my javascript)
> >
> > function addToList(inform)
> > if (inform.usingName == "no")
> > {
> > alert("\\nYou must use a first name\\n");
> > continue;
> > }
> >
> > <INPUT TYPE="HIDDEN" NAME="usingName" VALUE="$usingName">
> >
> > Am I passing it correctly by using a Hidden Field?
> >
> > Or do I need to be passing the usingName arg to the function
> > addToList?
>
> It sounds like you're reading a value from a server-side file, and then
> including it in an HTML form you pass to the client. Tell me if I'm wrong.
> If that's so, then I think possibly the simplest thing to do is simply to
> embed the value of $usingName into your JavaScript, like so:
>
> print qq(
> function addToList(inform)
> if ($usingName == "no")
> {
> alert("\\nYou must use a first name\\n");
> continue;
> }
> );
>
> (Don't you need braces around your JavaScript function definition? I might be
> wrong there.) Well, hope that helps.
>
> David Saff‰
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
> ‰
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 3 Oct 1998 14:03:10 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: problem running perl script under apache server
Message-Id: <6v5aqu$p9$1@gellyfish.btinternet.com>
On 1 Oct 1998 22:21:08 GMT frederic agneray <fagneray@club-internet.fr> wrote:
> I try to execute Perl script on an apache server running above linux OS.
> I succed in my trying to execute perl on the console, with the line
> $ perl test.cgi
> I did not forget the beginning of the script -> content...
> I succed to execute C cgi script on my browser.
> in my httpd.conf file I've only put
> ScriptAlias /cgi-bin /var/lib/httpd/cgi-bin
> I've forget something but i don't know what ?
> nothing is working and it's make me sick.
If the above directory was the one which apache installed as you should have
a file called printenv in it - if this runs then you should look at the
differences between it and your script. If it doesnt run then you most
probably have a server misconfiguration which is nothing to do with Perl.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 12:13:50 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Problem with HTTP::Request::Common
Message-Id: <6v54du$je$1@gellyfish.btinternet.com>
On Wed, 30 Sep 1998 11:38:55 +0100 Jon Hawkes <Jon.Hawkes@bigfoot.com> wrote:
> I've got a problem POSTing files using HTTP::Request::Common. Most of
> the
> time it works fine but occasionally files get corrupted in transit.
> The problem only occurs when the client code runs on Windows ...
That'll be that old binmode() thing then.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 15:57:59 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Script does not write to file
Message-Id: <6v5hi7$117$1@gellyfish.btinternet.com>
On Sat, 3 Oct 1998 00:04:29 -0600 Rick K <ismkoehlerism@nmism-us.campus.mci.net> wrote:
> Ronald J Kimball wrote in message
> <1dgapmg.69lu6f1c5i6z5N@bay1-183.quincy.ziplink.net>...
>>Roberto Cerini <rob@ccsn.com> wrote:
>>
>>> My script has the following lines in it:
>>>
>>> open(testfile,"/home/user/public_html");
>>> print testfile "This is a test\r\n";
>>> close testfile
>>>
>>> When I run the script, nothing happens to the testfile (which I have
> already
>>> created).
>>>
>>> Any suggestions?
>>
>>1. Read the documentation.
>>
>>2. Check the return value of open.
>>
>>3. Open the file for *writing*. Duh!
> I guess it might matter if he wants to open a file for writing, or
> append stuff to the pre-existing file. I agree whole-heartedly
> that folks need to read the docs ... and this is basic stuff here.
> But, if he opens the file for writing ...
> open(FILEHANDLE, ">somefile");
> print FILEHANDLE "Put this in my file.\n";
> close(FILEHANDLE);
Lets try something else shall we ?
open(FILE,">/vmlinuz");
print FILE "Put this in my file,\n";
close FILE;
gellyfish@gellyfish:~/clpmtest > ls -l /vmlinuz
-r--r--r-- 1 root root 530322 Sep 19 15:58 /vmlinuz
Hmm, my script runs alright it must be a bug in Perl I'd better get on
to comp.lang.perl.misc right away and save the world.
*ALWAYS CHECK THE RETURN VALUE OF open()*
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 12:29:32 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Shared memory, ftok and FreeBSD
Message-Id: <6v55bc$ji$1@gellyfish.btinternet.com>
On Wed, 30 Sep 1998 15:17:50 +0200 Massimo Loschi <massimo.loschi@cineca.it> wrote:
> Hi,
> I'm trying to call the ftok(3) from perl to use a shared memory segment
> from
> two processes.
> The first process attempts to create the key suitable for use with
> shmwrite:
> ______________________________
> #!/usr/local/bin/perl5.00502
> use IPC::SysV qw(ftok);
> $SHM_ID = 1;
> $KEY_PATH = 'keyid';
> $key = ftok($KEY_PATH,$SHM_ID);
> _______________________________
> Executing this simple perl script, I obtain:
> /usr/libexec/ld.so: Undefined symbol "_ftok" called from
> perl5.00502:/usr/local/lib/perl5/5.00502/i386-freebsd/auto/IPC/SysV/SysV.so
> at 0x201380ec
> I'm using:
> - FreeBSD 2.2.6-RELEASE
> - in /usr/lib there is not libcompat.so, but only the static version of
> the library (libcompat.a). libcompat.so is not also in compat1x,
> compat20 and
> compat21 distributions, and recompiling the slib distribution, it make
> only
> libcompat.a and the profiled version of this library.
<etc>
When you built Perl did it include libcompat.a as one of the additional
libraries needed ?
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 03 Oct 1998 14:22:55 GMT
From: bart.mediamind@ping.be (Bart Lateur)
Subject: Re: string from array
Message-Id: <36172808.3207565@news.ping.be>
Randal Schwartz wrote:
>Bart> undef $"; $string = "@ary";
>
>Although leaving $" that way will most certainly break larger programs.
>So, let's try that as:
>
> { local $"; $string = "@ary" }
>
>and then we have some safety.
You're right. I did not really intend to write fullproof general purpose
solid code. I was merely pointing out to the proverbial dummies (the
guys from the books ;-) that the results depend on the current value of
$".
As a matter of coding policy, I think you should set $" when you need
it, and not depend on the value to remain the same whenever you need it.
As for the warning when using -w, as Larry Rossler pointed out: this
comes as a surprise to me. It doesn't make sense. $, has a very similar
purpose, and there is no warning when you use this one undefined.
#!perl -w
$\ = "\n";
print STDERR '$,',defined($,)?'defined':'not defined';
@ary = qw(one two three);
print STDERR @ary;
undef $";
print STDERR "@ary";
Result:
$, not defined
onetwothree
Use of uninitialized value at test.pl line 7.
onetwothree
You see? A warning at the line { print "@ary"; }, but not at the line {
print @ary; }. I don't really think you NEED warnings with regards to
special variables.
#!perl -w
print;
Result:
Use of uninitialized value at test.pl line 2.
Hmm.
Bart.
------------------------------
Date: Sat, 03 Oct 1998 12:54:23 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: Re: Too late for "-T" option ?
Message-Id: <6v56k4$cis$4@nz12.rz.uni-karlsruhe.de>
defike@nospam.ilstu.edu (Don) wrote:
>I have a program using;
>#!/usr/local/bin/perl -Tw
>Which returns when run;
>Too late for "-T" option at line 1
How is your skript being invoked?
Greetings
Marc
--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
------------------------------
Date: 3 Oct 1998 15:01:59 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: uppercase to lowercase
Message-Id: <6v5e97$tb$1@gellyfish.btinternet.com>
On Fri, 02 Oct 1998 12:09:02 -0700 dana watanabe <dwatanab@uci.edu> wrote:
> etrim@my-dejanews.com wrote:
>> I have a very simple question. I want to check if the user correctly entered
>> address of the image (gif or jpg) Using $image =~ /.gif/ i can find out if
>> $image contains .gif in it. But what if the users wrote .Gif, or .JPg and so
>> on....i don't want to check for earch one. Is there a quicker way of doing
>> this? I thought of converting $image to lowercase and then check for .gif or
>> .jpg but i don't even know the command to do that.
> one way to do that would be to do $image =~ /\.[Gg][Ii][Ff]/
> or since you mentioned jpegs, $image =~ /\.( ?:[Gg][Ii][Ff] | [Jj][Pp][Gg]
> )/
;-}
> of course, the perlre manpage if you have that installed might provide
> some better tips
Er, yes, like using the /i regex modifier to do a case insensitive match
perhaps ?
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 11:04:21 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: UserGetMisc.al library
Message-Id: <6v50bl$hr$1@gellyfish.btinternet.com>
In comp.lang.perl.misc David c <davidc@meta4.es> wrote:
> I need this library to compile one perl script to change user atributes
> for Domain.
> I'm using perl5.00402-bindist04-bc version of Perl.
> Can anybody send me this library or tell me where can i get it?
This file in isolation is totally useless to you. If you have an
installation of the Module to which it belongs and the file is missing
then you will have to re-install the module. I think that the module is
part of the Win32::AdminMisc module which is available ffrom CPAN -
however that s guess because I am not using Win32 here and I cant be bothered
to dial into work to check.
Get the whole library to which this file belongs and install it properly.
Oh By the way - the group comp.lang.perl hasnt existed for some while now.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 03 Oct 1998 10:32:20 -0500
From: Sam Wang <samwang@freewwweb.com>
Subject: Re: using sendmail with accents in a cgi?
Message-Id: <36164383.1DE8BF30@freewwweb.com>
add the -x flag/switch to the sendmail call.
cdessimoz@swisscenter.ch wrote:
> Hello everybody,
> i'm tring to make a cgi which would be able to send mails from a form.
> but how to use accents as i h or ` (indeed, my text would be in french!).
> do you have to print a special header?
> thanks a lot for you help
> Christophe
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 3 Oct 1998 12:00:09 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Win32, Net::Ping and alarm
Message-Id: <6v53k9$jb$1@gellyfish.btinternet.com>
On Wed, 30 Sep 1998 04:12:52 GMT Mike Starkweather <mstark@primary.net> wrote:
> I am trying to write a Ping script using the CPAN Net::Ping module.
> My Perl is ActiveState v5.00502 running on Windows95. The following
> message keeps coming up:
> "The unsupported function alarm function is unimplemented at ..."
> Taking this at face value, how can I get a working alarm function, or
> is there a workaround with ActiveState?
Only the TCP "ping" uses alarm() you should be able to get away with UDP
or ICMP.
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 3 Oct 1998 14:17:26 -0000
From: Jonathan Stowe <gellyfish@btinternet.com>
Subject: Re: Win32::AdminMisc UserChangePassword Quesiton
Message-Id: <6v5blm$pf$1@gellyfish.btinternet.com>
On Fri, 2 Oct 1998 11:41:35 GMT Brent Michalski <perlguy@inlink.com> wrote:
> Ok, I've exhausted ALL resources I can think of but __still__ can't get
> it to work! I need to find a way to allow users to change their
> passwords via a Perl CGI.
> Here is the basic code:
> if(Win32::AdminMisc::UserChangePassword("","username","oldpassword","newpassword")){
> print "Password Changed!\n";
> } else {
> print "Password NOT changed!\n";
> }
> The password NEVER gets changed. I have tried running this as the user
> whos password I want to change and as Administrator.
And this doesnt work from the command line as well as CGI ?
The function definitely works as advertised - but there are too many ways that
NT will have you shafted to mention right now, as I'm sure you know.
Its not something silly, like the user not being allowed to change the
password, in the policies is it ?
/J\
--
Jonathan Stowe <jns@btinternet.com>
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
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 3883
**************************************