[17976] in Perl-Users-Digest
Perl-Users Digest, Issue: 136 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 24 19:09:35 2001
Date: Wed, 24 Jan 2001 15:15:27 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <980378127-v10-i136@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 24 Jan 2001 Volume: 10 Number: 136
Today's topics:
sprint replaces spaces with tabs in my text nelsonjames@my-deja.com
Re: stability of threads + interpreter performance <dan@tuatha.sidhe.org>
Re: stability of threads + interpreter performance <uri@sysarch.com>
stock market simulator <vincentg@datashaping.com>
string manipulation <rahmed@corp.phone.com>
Re: string manipulation <tore@extend.no>
Syntax Trouble (BUCK NAKED1)
Re: Syntax Trouble <uri@sysarch.com>
Re: Syntax Trouble grehom@my-deja.com
Re: Time / Date Format <paul_wasilkoff@ucg.org>
Re: Time / Date Format <mothra@nowhereatall.com>
translator C to Perl <vincentg@datashaping.com>
Re: Trouble sorting array nobull@mail.com
Re: Trouble sorting array <mjcarman@home.com>
Re: Upgrading to Perl 5.6 under Debian 2.2 <pking123@sympatico.ca>
Re: Upgrading to Perl 5.6 under Debian 2.2 (Jon Bell)
Re: Upgrading to Perl 5.6 under Debian 2.2 (Andy Dougherty)
Very newbie question <ross@technipoint.ie>
Re: Very newbie question <ducateg@info.bt.co.uk>
Re: Very newbie question <gbouris@toxo.com>
Re: Very newbie question <eric.kort@vai.org>
While Loops with DBI amerar@ci.chi.il.us
Re: While Loops with DBI <camerond@mail.uca.edu>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 24 Jan 2001 22:46:12 GMT
From: nelsonjames@my-deja.com
Subject: sprint replaces spaces with tabs in my text
Message-Id: <94nlvh$11u$1@nnrp1.deja.com>
I hope someone knows how to preserve the oringinal
spaces in this problem.
When I cat my test file into this script, some of the
multiple spaces become tab(s). The concept of the
file inputed is a prefix of up to 16 chars with spaces
padding out whats left, then a wrapped line of text.
(The text can be very long.)
#!/usr/bin/perl -w
# mywrap jnelson@medar.com
use Text::Wrap;
while (defined($EACH= <STDIN>)){
$VARR=sprintf "%-16.16s", $EACH;
$EACH=~ s/................//;
$EACH=~ s/\,/\,\ /g;
$EACH=~ s/\ \ */\ /g;
print wrap("$VARR", "$VARR", "$EACH");
printf "%s\n", $VARR ;
};
I piped the output to "od -c" to verify that
indeed, tabs were added that were not there
before.
Example of unwanted tabs using "mywrap":
head ../medar.inv|mywrap|od -c
0000000 0 0 0 - 0 0 0 0 \t E N G I N E E
0000020 R I N G A S S I S T A N C E
0000040 R E Q ' D ; ; T E S T D R A
0000060 W I N G # F I E L D 0 \n 0
0000100 0 0 - 0 0 0 0 \n
0000120 0 0 0 - 0 0 0 0 0 0 0 0 \t M F G
0000140 / E N G / O F F I C E E X P E
0000160 N S E D S U P ; 0 \n 0 0 0 -
0000200 0 0 0 0 0 0 0 0 \n 0 0 0
0000220 - 0 0 0 0 0 0 0 0 \t P O R T I
...
Fragrement of test file thru od:
head ../medar.inv|od -c
0000000 0 0 0 - 0 0 0 0
0000020 E N G I N E E R I N G A S S I
0000040 S T A N C E R E Q ' D ; ;
0000060 T E S T D R A W I N G # F
0000100 I E L D 0 \n 0 0 0 -
0000120 0 0 0 0 0 0 0 0 M F G /
0000140 E N G / O F F I C E E X P E N
0000160 S E D S U P ;
0000200
0000220 0 \n 0 0 0 - 0 0 0 0
0000240 0 0 0 0 P O R T I T E
0000260 M S ; ; \n 0 0 0 - 0 0 0 0 X
0000300 D U M M Y I T E M
...
Fragrament of test file:
000-0000 ENGINEERING ASSISTANCE REQ'D;; TEST DRAWING #
FIELD 0
000-00000000 MFG/ENG/OFFICE EXPENSED
SUP; 0
000-00000000 PORT ITEMS;;
000-0000X DUMMY
ITEM 0
000-0001 FLOPPY DISK-DSDD
360KB;; 6
000-0002 14 7/8 X 11 1412TC GREEN
BAR 24
000-0002 WILLAMETTE #141107
000-0003 9 1/2 X 11 9510AJ WHT
CONTINUE 3
...
Version on our Sun system:
perl -v
This is perl, version 5.004_04 built for sun4-solaris
Copyright 1987-1997, Larry Wall
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 24 Jan 2001 18:10:21 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: stability of threads + interpreter performance
Message-Id: <hUEb6.154440$P82.18692973@news1.rdc1.ct.home.com>
Koen Bossaert <not@defined.com> wrote:
> My problem is following : I need a script that connects to a few servers
> every so many seconds to get some information. Then it uses that information
> in some calculations and the result is stored in memory. In the mean time
> it should listen at a certain port to provide clients that connect with the
> latest results from the calculations. I thought 2 threads could be the
> solution because they share the same memory.
That's a reasonable problem for threads. Given threads instability (and
generally speaking, even if threaded perl was rock solid, using threads
tends to make things rather more interesting than you might like) what
I'd do instead is to split this into two processes--one that handles the
connection to the servers, and another that handles the connections
looking for info. Have your server check process connect to the data
serving process when it's got new data and spit out the new info to
it.
Not quite as simple, but not bad.
Dan
------------------------------
Date: Wed, 24 Jan 2001 20:23:38 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: stability of threads + interpreter performance
Message-Id: <x7g0i8wvg5.fsf@home.sysarch.com>
>>>>> "KB" == Koen Bossaert <not@defined.com> writes:
>> You can check the Event module for possible alternative.
KB> It's an interesting module, but I don't think it's the solution
KB> I'm looking for because from what I read I understood that I can't
KB> share data between the callback function used to handle the events
KB> and the main app.
where did you get this idea? all callbacks in event.pm are just perl
code. you can store data anywhere you want. many complex server (much
bigger than your needs) use event.pm.
KB> My problem is following : I need a script that connects to a few
KB> servers every so many seconds to get some information. Then it
KB> uses that information in some calculations and the result is
KB> stored in memory. In the mean time it should listen at a certain
KB> port to provide clients that connect with the latest results from
KB> the calculations. I thought 2 threads could be the solution
KB> because they share the same memory.
you could do that in event.pm in a few hours. you don't have multiple
memories in any perl program. you might have thread private data but
event.pm data can be global with no issues. where did you get this
misconception?
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Wed, 24 Jan 2001 13:15:40 -0600
From: Vincent Granville <vincentg@datashaping.com>
Subject: stock market simulator
Message-Id: <3A6F29DC.5A7EFEDC@datashaping.com>
I have it written in C. Anyone interested in a Perl version. I plan to
distribute it free from my website (http://www.datashaping.com ), and
will put a Perl version if enough people are interested.
Vincent
------------------------------
Date: Wed, 24 Jan 2001 10:10:23 -0800
From: "Razi Ahmed" <rahmed@corp.phone.com>
Subject: string manipulation
Message-Id: <94n5pk$qc5$1@news.phone.com>
I have a config file with the following value
mta=(s1,s2,s3)
Now i want to put the above value in an array like that
@mta=qw(s1 s2 s3)
can i get some idea please...
------------------------------
Date: Wed, 24 Jan 2001 19:32:56 +0100
From: Tore Aursand <tore@extend.no>
Subject: Re: string manipulation
Message-Id: <MPG.14d93e486d05e24c98985c@news.online.no>
In article <94n5pk$qc5$1@news.phone.com>, rahmed@corp.phone.com says...
> Now i want to put the above value in an array like that
> @mta=qw(s1 s2 s3)
'perldoc -f split'
--
Tore Aursand - tore@extend.no - http://www.extend.no/~tore/
------------------------------
Date: Wed, 24 Jan 2001 11:56:10 -0600 (CST)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Syntax Trouble
Message-Id: <10059-3A6F173A-31@storefull-245.iap.bryant.webtv.net>
I've written this sub to remove $dir if it's more than 2 hours old, and
it works fine.
## Remove this directory after 2 hours
sub rmtmp{ $age = (-M "$dir")*24;
if ($age > 2) { `rm -r $dir`
}
};
print &&rmtmp;
However, I really don't want to remove $dir, but remove subdirectories
inside of $dir. Here's the hard part... I do not know the names of the
subdirectories inside of $dir. I want to keep $dir and just remove the
older subdirectories inside of it. All of the directories inside of $dir
that I want to remove if older than 2 hours have names that consists of
4 numerical chars.
I've tried
$dir = "wkdir";
$sdir =~ m/^\d{4}$/;
print $dir/$sdir;
just to see if a scalar would access the subdirectories before doing a
procedure, but the above code only prints "wkdir". It doesn't print
something like "wkdir/6442", as I had hoped.
Maybe I don't need to match the subdirectory filenames anyway, because I
want to remove the subdirectories($sdir) inside of $dir, regardless of
their filename, if they are over 2 hours old.
So, how do I accomplish this? I've researched this for 2 days
unsuccessfully.
Thank You,
Dennis
------------------------------
Date: Wed, 24 Jan 2001 20:32:53 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Syntax Trouble
Message-Id: <x7d7dcwv0q.fsf@home.sysarch.com>
>>>>> "BN" == BUCK NAKED1 <dennis100@webtv.net> writes:
BN> ## Remove this directory after 2 hours
BN> sub rmtmp{ $age = (-M "$dir")*24;
BN> if ($age > 2) { `rm -r $dir`
BN> }
BN> };
BN> print &&rmtmp;
first, fix your indenting.
second, why use backticks if you are not using the returned results? use
system.
third, why are you using the rm program when you can use rmdir in
perl. if the dir is not empty, there is a module you can use for that.
fourth, what is &&rmtmp?
BN> However, I really don't want to remove $dir, but remove subdirectories
BN> inside of $dir. Here's the hard part... I do not know the names of the
BN> subdirectories inside of $dir. I want to keep $dir and just remove the
BN> older subdirectories inside of it. All of the directories inside of $dir
BN> that I want to remove if older than 2 hours have names that consists of
BN> 4 numerical chars.
BN> I've tried
BN> $dir = "wkdir";
BN> $sdir =~ m/^\d{4}$/;
and what is in $sdir? that statement doesn't do anything (except set $&
and friends).
BN> print $dir/$sdir;
BN> just to see if a scalar would access the subdirectories before doing a
BN> procedure, but the above code only prints "wkdir". It doesn't print
BN> something like "wkdir/6442", as I had hoped.
use readdir to get the dir names. then filter them on date and name.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page ----------- http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net ---------- http://www.northernlight.com
------------------------------
Date: Wed, 24 Jan 2001 20:51:12 GMT
From: grehom@my-deja.com
Subject: Re: Syntax Trouble
Message-Id: <94nf7s$qa4$1@nnrp1.deja.com>
In article <10059-3A6F173A-31@storefull-245.iap.bryant.webtv.net>,
dennis100@webtv.net (BUCK NAKED1) wrote:
> I've written this sub to remove $dir if it's more than 2 hours old,
and
> it works fine.
>
> ## Remove this directory after 2 hours
> sub rmtmp{ $age = (-M "$dir")*24;
> if ($age > 2) { `rm -r $dir`
> }
> };
> print &&rmtmp;
>
> However, I really don't want to remove $dir, but remove subdirectories
> inside of $dir. Here's the hard part... I do not know the names of the
> subdirectories inside of $dir. I want to keep $dir and just remove the
> older subdirectories inside of it. All of the directories inside of
$dir
> that I want to remove if older than 2 hours have names that consists
of
> 4 numerical chars.
>
> I've tried
> $dir = "wkdir";
> $sdir =~ m/^\d{4}$/;
> print $dir/$sdir;
>
> just to see if a scalar would access the subdirectories before doing a
> procedure, but the above code only prints "wkdir". It doesn't print
> something like "wkdir/6442", as I had hoped.
>
> Maybe I don't need to match the subdirectory filenames anyway,
because I
> want to remove the subdirectories($sdir) inside of $dir, regardless of
> their filename, if they are over 2 hours old.
>
> So, how do I accomplish this? I've researched this for 2 days
> unsuccessfully.
>
> Thank You,
> Dennis
You might like to look at this for ideas:
#!perl
use strict;
use warnings;
use File::stat;
my $dir = $ARGV[0] || "*"; # if first parameter on command line
# null get all files in current dir
my $epoch_secs_2hrs_ago = time() - 2 * 3600;
my @files = glob $dir;
foreach my $f (@files) {
if ( -d $f # is file a directory?
&& ($f !~ /^\.\.?$/) # is it directory above (..) !
# or && ($f =~ /^\d{4}$/) # is file name 4 digits?
) {
my $stats = stat($f); # get this file's statistics using
# recommended object oriented module
if ($stats->mtime > $epoch_secs_2hrs_ago) {
# epoch secs when created > 2 hours ago...
print $f, " created ",
time() - $stats->mtime,
" seconds ago\n";
}
}
}
1;
>
>
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 24 Jan 2001 13:11:07 -0500
From: "PaAnWa" <paul_wasilkoff@ucg.org>
Subject: Re: Time / Date Format
Message-Id: <t6u6q1q3nb1u86@corp.supernews.com>
($sec,$min,$hour,$mday,$mon,$year) =(localtime)[0..5];
printf("the currect day and time is %04d/%02d/%02d %02d:%02d:%02d\n",
$year+1900, $mon+1, $mday, $hour, $min, $sec);
Is there a way to place this into a string variable?
------------------------------
Date: Wed, 24 Jan 2001 11:36:31 -0800
From: mothra <mothra@nowhereatall.com>
Subject: Re: Time / Date Format
Message-Id: <3A6F2EBF.8F20DA97@nowhereatall.com>
> ($sec,$min,$hour,$mday,$mon,$year) =(localtime)[0..5];
> printf("the currect day and time is %04d/%02d/%02d %02d:%02d:%02d\n",
> $year+1900, $mon+1, $mday, $hour, $min, $sec);
>
> Is there a way to place this into a string variable?
perldoc -f sprintf
------------------------------
Date: Wed, 24 Jan 2001 13:17:39 -0600
From: Vincent Granville <vincentg@datashaping.com>
Subject: translator C to Perl
Message-Id: <3A6F2A53.F3426298@datashaping.com>
Is there such a translator on the market? I would like to use one to
translate a stock market simulator I will distribute on my website
(http://www.datashaping.com ). Thanks.
Vincent
------------------------------
Date: 24 Jan 2001 18:17:53 +0000
From: nobull@mail.com
Subject: Re: Trouble sorting array
Message-Id: <u9ae8gizla.fsf@wcl-l.bham.ac.uk>
David Waters <davidwaters@bigfoot.com> writes:
>
> 3,postcode,ro_address
> 3+,line_two,ro_address
> 2,accounts_type,companies_house_data
> 2,acc_ref_date,companies_house_data
> 2,acc_made_up_date,companies_house_data
> 2+,ro_address,companies_house_data
> 1+,companies_house_data,
>
> I would like to sort the array in reverse order so it would be 3's then
> 2's then 1's. However, there are some lines which have a '+' after the
> number which I would like to be at the top of each set of numbers.
How about a comparison block:
{ $b <=> $a || ( $b =~ /^\d+\+/ ) <=> ( $a =~ /^\d+\+/ ) }
If you don't know what to do with a comparison block see the
documentation of the sort() function or see the FAQ.
Note this is optomised for simplicity rather than speed on the
assumption that this is a small arry. If the array is other than
small then see above mentioned documentation for ways to make it more
efficient.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 24 Jan 2001 08:15:29 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: Trouble sorting array
Message-Id: <3A6EE381.AFD484A5@home.com>
David Waters wrote:
>
> I have the following lines of text as separate elements in an array
> (not necessarily in this order).
>
> 3,postcode,ro_address
> 3+,line_two,ro_address
> 2,accounts_type,companies_house_data
> 2,acc_ref_date,companies_house_data
> 2,acc_made_up_date,companies_house_data
> 2+,ro_address,companies_house_data
> 1+,companies_house_data,
>
> I would like to sort the array in reverse order so it would be 3's
> then 2's then 1's. However, there are some lines which have a '+'
> after the number which I would like to be at the top of each set
> of numbers.
Did you read the FAQ entry "How do I sort an array by (anything)?"
-mjc
------------------------------
Date: Wed, 24 Jan 2001 16:14:20 GMT
From: Paul King <pking123@sympatico.ca>
Subject: Re: Upgrading to Perl 5.6 under Debian 2.2
Message-Id: <f43u6t0rtm7pj4vjgknq0ejlvkb2u26qod@4ax.com>
On 24 Jan 2001 13:18:50 GMT, damian@qimr.edu.au (Damian James) wrote:
>Thus spake Martien Verbruggen on Wed, 24 Jan 2001 23:43:39 +1100:
>>
>>... Maybe you've got some tools that were expecting another
>>version of Perl, and that didn't deal with the newer version correctly,
>>but I'd hardly call that 'problem in the operating system'.
>>
>
>Actually, I once managed to break lp on a DG/UX installation by upgrading
>to Perl 5. Seriously, the lp that shipped with the system depended on Perl
>4, and didn't work with 5. The word from the vendor was "upgrade DG/UX!",
>but since (for us) that would have meant a hardware upgrade too, it was no
>go. I ended up running /usr/bin/perl5 next to /usr/bin/perl (4), and did
>some interesting things with environment variables to make @INC work.
>
The root of many of the problems after the upgrade was in wondering
how @INC was set (since it complained about this-and-that library not
being found under @INC), and I later decided that it was easier to
reinstall Debian's Perl 5.005 over again. If there was a way to set
@INC or (a previous poster suggested) PERL5LIB, I have a feeling
things would install fairly invisibly, as I would expect.
What did you do to get @INC to work?
Paul
>Cheers,
>Damian (who is now two jobs past that nightmare site)
------------------------------
Date: Wed, 24 Jan 2001 16:28:16 GMT
From: jtbell@presby.edu (Jon Bell)
Subject: Re: Upgrading to Perl 5.6 under Debian 2.2
Message-Id: <G7oDr4.55F@presby.edu>
In article <k_Cb6.147256$f36.5843184@news20.bellglobal.com>,
Debian User <pking123@sympatico.ca> wrote:
>In article <slrn96tjfr.n5q.mgjv@martien.heliotrope.home>,
>mgjv@tradingpost.com.au wrote:
>
>> [removed comp.lang.perl. That group hasn't existed for years. Notify
>> your news admin]
>> [remove alt.perl. That group doesn't exist as far as I'm concerned]
>
>There are about 500+ posters who don't seem to agree with you :) However,
>unless there is proof that the forementioned groups are deprecated, I
>am in favour of posting anywhere I feel I can obtain the proper help.
As far as alt.perl is concerned, the "validity" of an alt group has no
formal meaning. If people are using it, it's valid for them; and most
server admins would probably add it on reqest from one of their users.
As far as comp.lang.perl is missing, it *is* invalid in the sense that it
is not recognized by the moderator of news.announce.newgroups. Properly
configured servers do not carry it, and probably many fewer admins would
add it if requested by one of their users.
--- paste ---
From tale@uunet.uu.net Tue Aug 8 10:36:39 1995
Path: uunet!in2.uu.net!tale
From: tale@uunet.uu.net (David C Lawrence)
Newsgroups: comp.lang.perl
Subject: rmgroup comp.lang.perl
Control: rmgroup comp.lang.perl
Approved: tale@uunet.uu.net
Message-ID: <807892212.25259@uunet.uu.net>
Date: Tue, 8 Aug 1995 14:30:13 GMT
Lines: 3
Xref: uunet control.rmgroup:69
comp.lang.perl has been superseded by comp.lang.perl.misc, an unmoderated
newsgroup which passed its vote for creation by 328:48 as reported in
news.announce.newgroups on 1 May 1995.
--- end paste ---
--
Jon Bell <jtbell@presby.edu> Presbyterian College
Dept. of Physics and Computer Science Clinton, South Carolina USA
------------------------------
Date: Wed, 24 Jan 2001 19:29:13 -0000
From: doughera@maxwell.phys.lafayette.edu (Andy Dougherty)
Subject: Re: Upgrading to Perl 5.6 under Debian 2.2
Message-Id: <slrn96ubag.ms4.doughera@maxwell.phys.lafayette.edu>
In article <k_Cb6.147256$f36.5843184@news20.bellglobal.com>, Debian User wrote:
>I think the real cause is Debian's over-dependance on Perl, and on its
>insistance to "expect" files such as libraries and modules to be in a
>certain place.
I think it makes perfect sense for Debian to have such a dependence on perl.
It saves them re-inventing the same facilities over and over again in each
of the packages that would have to be rewritten to not depend on perl.
This is why perl is tagged as 'Required'. It is also why updating it
is not to be done lightly and the whole 5.005 -> 5.6 transition needs
to be done carefully, as you are discovering.
If you want to build a version yourself, one easy thing to do is
build your own and put it in /usr/local/bin/perl (or wherever you like
as long as you don't touch Debian's version). You can use your new perl
for whatever you like while still having your Debian version work just fine.
(This advice applies to Solaris 8 users too, since Sun now ships perl5.005
with Solaris 8 and you probably don't want to mess with the Sun installation
either.)
Another possibility is to get the source from Debian itself.
The .diff file contains the debian/rules file used to build perl --
using it is one way to add in the appropriate extra directories.
What is best depends on why you wish to upgrade to 5.6.0.
[Another responder asked]
>> Doesn't Debian have a package fot 5.6.0 yet? How Slack.
Yes, it does, but the original poster is running the current
"stable" distribution, which has 5.005_03. Perl-5.6.0 is
currently in the 'unstable' branch.
--
Andy Dougherty doughera@lafayette.edu
Dept. of Physics
Lafayette College, Easton PA 18042
------------------------------
Date: Wed, 24 Jan 2001 16:24:25 -0000
From: "Ross McLoughlin" <ross@technipoint.ie>
Subject: Very newbie question
Message-Id: <94mvlp$ok5$1@kermit.esat.net>
Apologies if this sounds stupid!
I'm new to the world of Perl.
I want to install ActivePerl on Windows98, and run them locally before
adding them to the website. For example, is it possible to run a form
validation script separate from the web server?
------------------------------
Date: Wed, 24 Jan 2001 17:09:46 -0000
From: "Géry" <ducateg@info.bt.co.uk>
Subject: Re: Very newbie question
Message-Id: <94n2dt$q96$1@pheidippides.axion.bt.co.uk>
A form validation script typically sits in the CGI bin, which typically is
on the web server. If you are talking about a computer behind an ISP, I
think you can forget about it. If you are talking about a computer on the
same network as the web server itself, my guess is that it is possible but
it is a long shot. The server has to identity one of your directories as a
valid CGI bin. I do not know how this can be done, but you would have to
sort out the web server CGI configuration and have your machine constantly
accessible from the server (mapping your hard disk to the server...).
To summarise, you'd probably be better off geting access to the server and
run perl from there as most people would do ;)
--
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Géry
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
"Ross McLoughlin" <ross@technipoint.ie> wrote in message
news:94mvlp$ok5$1@kermit.esat.net...
> Apologies if this sounds stupid!
>
> I'm new to the world of Perl.
>
> I want to install ActivePerl on Windows98, and run them locally before
> adding them to the website. For example, is it possible to run a form
> validation script separate from the web server?
>
>
------------------------------
Date: Wed, 24 Jan 2001 22:37:15 +0200
From: "George Bouris" <gbouris@toxo.com>
Subject: Re: Very newbie question
Message-Id: <980368642.482976@athnrd02.forthnet.gr>
Of course is possible, but difficult ! You must install a web server on
your local pc (like Apache Win32 http://www.apache.org) and make it run.
Then put your scripts in the cgi-bin folder and try to run them.
*It's not so easy as it sounds! You may have some problem during set up but
it's worth it. So go on!
"Ross McLoughlin" <ross@technipoint.ie> wrote in message
news:94mvlp$ok5$1@kermit.esat.net...
> Apologies if this sounds stupid!
>
> I'm new to the world of Perl.
>
> I want to install ActivePerl on Windows98, and run them locally before
> adding them to the website. For example, is it possible to run a form
> validation script separate from the web server?
>
>
------------------------------
Date: Wed, 24 Jan 2001 15:57:44 -0500
From: "Eric" <eric.kort@vai.org>
Subject: Re: Very newbie question
Message-Id: <94nfau$1o4d$1@msunews.cl.msu.edu>
"Ross McLoughlin" <ross@technipoint.ie> wrote in message
news:94mvlp$ok5$1@kermit.esat.net...
> Apologies if this sounds stupid!
>
> I'm new to the world of Perl.
>
> I want to install ActivePerl on Windows98, and run them locally before
> adding them to the website. For example, is it possible to run a form
> validation script separate from the web server?
>
Indigo perl comes with the Apache Web Server to allow you to do exactly
this. See:
http://www.indigostar.com/indigoperl.htm
------------------------------
Date: Wed, 24 Jan 2001 17:15:02 GMT
From: amerar@ci.chi.il.us
Subject: While Loops with DBI
Message-Id: <94n2ia$dia$1@nnrp1.deja.com>
Hello,
I'm a bit new to DBI. I am trying to write a while loop to do a nested
select. Below is the code I wrote, which is NOT working at all. Can
anyone help out or point me to where I can find some examples of this?
Please CC a copy to my e-mail.....thanks.
$select = "SELECT caps_code,tot_rev, tot_eft
FROM revanal_summary
WHERE summary_date_time =
TO_DATE(?,'MMDDYYYY')";
$mon_db = $dbh->prepare($select);
$mon_db->execute( $mon_st );
($caps_code,$monthly_neft,$monthly_eft)=$mon_db->fetchrow();
while ( $caps_code =
$mon_db->fetchrow_array( ) ) {
$select = "SELECT SUM(NVL(amt_cash,0)) +
SUM(NVL(amt_check,0)) +
SUM(NVL(advice_of_credit,0)) +
SUM(NVL(letter_of_credit,0)) +
SUM(NVL(food_stamps,0)) +
SUM(NVL(credit_others,0)),
SUM(NVL(electronic_fund_transfer,0))
FROM payment_history_view
WHERE trandatetime >=
TO_DATE(?,'MMDDYYYY') AND
trandatetime <=
TO_DATE(?,'MMDDYYYY') AND
caps_code = ?";
$ph_db = $dbh->prepare($select);
$ph_db->execute($mon_st,$mon_end, $caps_code);
($payhis_neft,$payhis_eft)=$ph_db->fetchrow();
.
.
.
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Wed, 24 Jan 2001 11:38:34 -0600
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: While Loops with DBI
Message-Id: <3A6F131A.BB4483EE@mail.uca.edu>
amerar@ci.chi.il.us wrote:
>
> Hello,
>
> I'm a bit new to DBI. I am trying to write a while loop to do a nested
> select. Below is the code I wrote, which is NOT working at all. Can
> anyone help out or point me to where I can find some examples of this?
DBI isn't your (only) problem. Your first problem is that you don't tell
us what *does* happen when you run the script, so any advice we can give
here is only guessing. That being said, there are a couple of points
which are easy guesses to make.
1. *If you output to a file, you obviously didn't run with the -w
switch, because the first line of output would have told you your
problem (at least one of them).
2. *If you output to STDOUT (i.e., so you can see it on the screen), you
didn't test things with the -cw switches, so the program would just
check for syntax and warnings (using just the -c switch here may have
given "syntax OK," so it doesn't help much, I didn't run your database
code, just the one obvious error I saw in your generic perl statement to
ferret out the system messages).
I'll leave running things to you so you can become more familiar with
the -c and -w switches, they're infinitely useful, I literally couldn't
do perl without them.
>
> Please CC a copy to my e-mail.....thanks.
Okay, done.
>
> code snipped
Cameron
--
Cameron Dorey
Associate Professor of Chemistry
University of Central Arkansas
Phone: 501-450-5938
camerond@mail.uca.edu
------------------------------
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 V10 Issue 136
**************************************