[7600] in Perl-Users-Digest
Perl-Users Digest, Issue: 1226 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 24 19:37:20 1997
Date: Fri, 24 Oct 97 16:00:23 -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 Fri, 24 Oct 1997 Volume: 8 Number: 1226
Today's topics:
CGI module in PERL <lach@lach.net>
Re: context (brian d foy)
Re: Encryption (brian d foy)
Re: Encryption <rra@stanford.edu>
eval 'use Socket' vs. 'use socket' (Vikas Aggarwal)
Has Perl gone off the deep end or is it me??? <sdcairns@mindspring.com>
Re: Has Perl gone off the deep end or is it me??? (brian d foy)
Re: Has Perl gone off the deep end or is it me??? <sdcairns@mindspring.com>
Re: Has Perl gone off the deep end or is it me??? (Greg Mortensen)
Here Are The Best Adult Sites On The Net ! concrete@logica.com
How do I find out whether my script is running first ti <chenyang@mashie.ece.jhu.edu>
How to deref a ref to nested array in sub? (Steve Schlesinger)
Re: Lookaround? (Was: Re: Lookbehind) <rootbeer@teleport.com>
Re: Lookaround? (Was: Re: Lookbehind) (Mike Heins)
Re: Move specified number of variables into one array?? (Craig A. Shortreed)
Re: oraperl - connect string twod@not.valid
Re: Passing Associative Arrays to a subroutine (Greg Zevin)
Passing variables <dougw@dbis.ns.ca>
Re: Primes via regexen (Was: Re: non-greedy regexps) (John L. Allen)
question: C-to-Perl variable passing <natedogg@webbnet.com>
Reading line from file and assiging to variables <kathyl@cais.com>
Re: Running a Script at Startup (Craig A. Shortreed)
Re: sending a short file? (Craig A. Shortreed)
Re: SQL to update a row from a Perl script (Toutatis)
Re: Using .forward file to trigger Perl script <fp@pmpcs.com>
Re: Using .forward file to trigger Perl script <fp@pmpcs.com>
Re: Using .forward file to trigger Perl script (brian d foy)
Re: Year 2000 for GNU-Perl5 (A. Deckers)
Re: Year2000 problem with localtime(); <flavell@mail.cern.ch>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 24 Oct 1997 15:58:07 -0500
From: Lachlan Dunlop <lach@lach.net>
Subject: CGI module in PERL
Message-Id: <34510BDF.58B597A9@lach.net>
Hello group,
I'm running on linux RH42, perl 5.003. my script follows, It chokes on
print header(),
is the "use CGI qw(:standard);" valid under linux.
The Apache server returns:
Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your
request.
Please contact the server administrator, rleel@spcbrass.com and inform
them of the time the error
occurred, and anything you might have done that may have caused the
error.
The Script:
#!/usr/bin/perl
#cgi-bin/upsship.pl: program to go get ship info
#display version 1
use CGI qw(:standard);
print header(), start_html("Hello World"), h1("Hello World");
my $upsno = param("number");
print p("Your entry was $upsno.");
print end_html();
Any help would be appreciated!!!
Lach
------------------------------
Date: Fri, 24 Oct 1997 16:26:50 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: context
Message-Id: <comdog-ya02408000R2410971626500001@news.panix.com>
In article <62qfct$jlq$1@lyra.csx.cam.ac.uk>, mjtg@cus.cam.ac.uk (M.J.T. Guy) wrote:
[snip stuff on forcing string context]
> $result = "$var";
>But the circumstances where you need this sort of forcing are extremely
>rare. Perl usually does it for you.
i'm curious about the circumstances where this might be needed - are
there any examples?
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Fri, 24 Oct 1997 15:29:35 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Encryption
Message-Id: <comdog-ya02408000R2410971529350001@news.panix.com>
In article <Pine.GSO.3.96.971024112351.5898g-100000@usertest.teleport.com>, Tom Phoenix <rootbeer@teleport.com> wrote:
>On Fri, 24 Oct 1997, Amias wrote:
>
>> Does anyone know of any good perl modules for PGP style encryption ?
>
>If there's a module which does what you want, it should be listed in
>the module list on CPAN. If you don't find one to your liking, you're
>welcome and encouraged to submit one! :-)
in this case, i've wondered about submitting such a module. what happens
if RSA Data Security or PGP.com decides to per^H^Hrosecute the author,
for instance?
has there ever been a situation in which a module author got into legal
trouble for such a thing? How would CPAN maintainers handle this?
i'm not looking to establish policy or hear a formal declaration
of one. i'm just curious... :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 24 Oct 1997 12:50:32 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Encryption
Message-Id: <m3hga7rldj.fsf@windlord.Stanford.EDU>
brian d foy <comdog@computerdog.com> writes:
> in this case, i've wondered about submitting such a module. what
> happens if RSA Data Security or PGP.com decides to per^H^Hrosecute the
> author, for instance?
If it uses the pgp binary, I don't see what's wrong with it. It doesn't
contain any encryption code, it doesn't violate any patents, it's just a
wrapper around an existing program that provides a better interface to it.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 24 Oct 1997 21:26:16 GMT
From: vikas@newsreader.jvnc.net (Vikas Aggarwal)
Subject: eval 'use Socket' vs. 'use socket'
Message-Id: <62r3po$ou$1@newsreader.jvnc.net>
Folks, sorry to revisit this 'socket: protocol not supported' issue again,
but:
eval 'use Socket';
and
use Socket;
seem to be behaving differently in my script.
In the sample scripts below, if I replace the 'use Socket' to an eval,
then it does not seem to define the parameters correctly.
#!/usr/local/bin/perl5 -w
use Socket;
$proto = getprotobyname('tcp');
socket(S, PF_INET, SOCK_STREAM, $proto) || die "socket: $!" ;
print "END\n";
gives me:
Identifier "main::S" used only once:
However, if I change the 'use Socket' to:
#!/usr/local/bin/perl5 -w
eval 'use Socket';
..etc..
I get a:
Argument "SOCK_STREAM" isn't numeric in socket at ./a.pl line 8.
Argument "PF_INET" isn't numeric in socket at ./a.pl line 8.
socket: Protocol not supported at ./a.pl line 8.
Isnt the 'eval' supposed to scan in the Socket module in the current
context ?
Help, I am bugged :(
-vikas
------------------------------
Date: 24 Oct 1997 21:31:23 GMT
From: "Scott Cairns" <sdcairns@mindspring.com>
Subject: Has Perl gone off the deep end or is it me???
Message-Id: <01bce0c3$5882c160$d4000080@ccu09>
Execute the following code segment on an NT Win32 machine running Perl for
Win32 version 5.003_07:
use lib 'c:\perl\lib';
use lib 'c:\perl\lib\Win32';
$Type = "P";
print "Type = $Type\n";
if ($Type == "X")
{
print "Found X!\n";
}
else
{
print "Found A $Type!\n";
}
and I get the following results:
C:> test.pl
Type = P
Found X!
How can this possibly be?!?!?!?! I've spent the last 2 days trying to
debug a 700+ line perl program only to trace it down to the if statement
above which I extracted into a test file and verified that the if logic in
perl seems to be a bit askew...
------------------------------
Date: Fri, 24 Oct 1997 17:51:38 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Has Perl gone off the deep end or is it me???
Message-Id: <comdog-ya02408000R2410971751380001@news.panix.com>
In article <01bce0c3$5882c160$d4000080@ccu09>, "Scott Cairns" <sdcairns@mindspring.com> wrote:
>$Type = "P";
>
>print "Type = $Type\n";
>if ($Type == "X")
didn't you mean to use a string comparison operator rather than a
numeric one?
if ($Type eq "X") { ... }
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 24 Oct 1997 21:56:32 GMT
From: "Scott Cairns" <sdcairns@mindspring.com>
Subject: Re: Has Perl gone off the deep end or is it me???
Message-Id: <01bce0c6$dc522a50$d4000080@ccu09>
Never mind I just figured it out. The 'eq' operator vs. '==' operator
issue, right? I wish didn't know 'C' before I started learning perl!!!
Scott Cairns <sdcairns@mindspring.com> wrote in article
<01bce0c3$5882c160$d4000080@ccu09>...
> Execute the following code segment on an NT Win32 machine running Perl
for
> Win32 version 5.003_07:
>
> use lib 'c:\perl\lib';
> use lib 'c:\perl\lib\Win32';
>
> $Type = "P";
>
> print "Type = $Type\n";
> if ($Type == "X")
> {
> print "Found X!\n";
> }
> else
> {
> print "Found A $Type!\n";
> }
>
> and I get the following results:
>
> C:> test.pl
> Type = P
> Found X!
>
> How can this possibly be?!?!?!?! I've spent the last 2 days trying to
> debug a 700+ line perl program only to trace it down to the if statement
> above which I extracted into a test file and verified that the if logic
in
> perl seems to be a bit askew...
>
>
------------------------------
Date: Fri, 24 Oct 1997 22:47:42 GMT
From: loki@world.std.com (Greg Mortensen)
Subject: Re: Has Perl gone off the deep end or is it me???
Message-Id: <EIKvBI.4J5@world.std.com>
"Scott Cairns" <sdcairns@mindspring.com> writes:
>Execute the following code segment on an NT Win32 machine running Perl for
>Win32 version 5.003_07:
[code snipped]
>How can this possibly be?!?!?!?! I've spent the last 2 days trying to
>debug a 700+ line perl program only to trace it down to the if statement
>above which I extracted into a test file and verified that the if logic in
>perl seems to be a bit askew...
Running your script with the -w switch produces the following warning:
Argument "X" isn't numeric in eq at ./test.pl line 6.
Argument "P" isn't numeric in eq at ./test.pl line 6.
Meaning? == is a _numeric_ test. You want eq, instead: a _string_ test.
--
\|/ ___ \|/ loki@world.std.com +----- 2048/83C90191 -----+
@~./'O o`\.~@ | 0B 65 E0 58 F3 F9 81 F5 |
/__( \___/ )__\ Crypto, Security, and Phrack: | F0 72 75 FA 1E BD C9 66 |
`\__`U_/' http://world.std.com/~loki +--- via Finger or WWW ---+
------------------------------
Date: Fri, 24 Oct 1997 15:44:35 -0700
From: concrete@logica.com
Subject: Here Are The Best Adult Sites On The Net !
Message-Id: <241097154435@logica.com>
http://www.jiggle.com/
==<=<=>>=<=<>>=<>=><
------------------------------
Date: Fri, 24 Oct 1997 12:45:25 -0400
From: Chenyang Xu <chenyang@mashie.ece.jhu.edu>
Subject: How do I find out whether my script is running first time since login?
Message-Id: <3450D0A5.441B04E8@mashie.ece.jhu.edu>
How do I find out whether my perl script is running first time since my
recent login?
Any help is appreciated.
Thanks,
--
Chenyang Xu
\\|//
(o o)
--------------------------ooO-(_)-Ooo----------------------------------
(o) 410-516-6819 | Fax:410-516-5566
chenyang@jhu.edu | http://iacl.ece.jhu.edu/~chenyang
_________________________________________________________
/ Image Analysis and Communication Lab /
/ Department of the Electric and Computer Engineering /
/ The Johns Hopkins University /
/ Baltimore, MD 21218 /
=======================================================================
------------------------------
Date: 24 Oct 1997 10:25:59 -0700
From: steves@sparc.SanDiegoCA.NCR.COM (Steve Schlesinger)
Subject: How to deref a ref to nested array in sub?
Message-Id: <62qln7$ojl@sv077.SanDiegoCA.NCR.COM>
How do I dereference a reference to a nested array passed
to a subroutine?
The code below works, but instead of lines marked #!!!
I want to write something like:
@c = (something)aref(something);
$w = $c[0];
$x = $c[1];
Also, I need to be able to drop an element from the
passed array.
ie, something that would have the effect of
splice( @s, $m, 1 );
where instead of @s, there would be an expression with aref
thanks.
#------------------------------------------------------------
@s = ( [2,2], [1,2], [2,1], [4,2], [2,4] );
&p( \@s );
sub p {
local( $aref ) = @_;
local( $n );
local( $i );
$n = $#$aref;
print "n = $n\n";
for $i (0..$n) {
$w = $$aref[ $i ][0]; #!!!
$h = $$aref[ $i ][1]; #!!!
printf( "i=%d w=%d h=%d\n", $i, $w, $h);
}
}
#------------------------------------------------------------
--
===============================================================================
Steve Schlesinger 619-485-3528 VoicePlus 440-3528
FAX 619-485-3010 steve.schlesinger@SanDiegoCA.ncr.com
===============================================================================
------------------------------
Date: Fri, 24 Oct 1997 12:16:14 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: David Sewell <dsew@packrat.aml.arizona.edu>
Subject: Re: Lookaround? (Was: Re: Lookbehind)
Message-Id: <Pine.GSO.3.96.971024120421.5898j-100000@usertest.teleport.com>
On 24 Oct 1997, David Sewell wrote:
> I need to clean up text files in which (probably because of a bad
> tty setting) corrections exist as backspaces (^H) followed
> by the correct characters. For example, a line might look like
>
> My g^Hfavorite bnn^H^Hook is the Vby^H^H^HCat in the Hat
>
> So the need is to delete all instances of N chars followed by N ^H's.
Maybe you want this?
s{(.+?)(\x08+)}{ substr($1, 0, -length($2)) }ge
Although that's not able to handle the more general case.
Thiss S^Hstr^H^H^H^H^H string won't work.
I'd go with the repetitive solution, even though it can still fail.
1 while s/.\x08//s;
Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
Ask me about Perl trainings!
------------------------------
Date: 24 Oct 1997 19:33:35 GMT
From: mheins@prairienet.org (Mike Heins)
Subject: Re: Lookaround? (Was: Re: Lookbehind)
Message-Id: <62qt6f$7lb$1@vixen.cso.uiuc.edu>
David Sewell (dsew@packrat.aml.arizona.edu) wrote:
: In article <1997101800091724918410N@roxboro-169.interpath.net>,
: John Moreno <phenix@interpath.com> wrote:
: >I was reading the perl regular expression manual and it looks to me like
: >perl doesn't have a look behind extension is this true?
: >
: >Frex to find a 2 that was preceded by 1 and followed by a 3 I'd like to
: >write something like
: >
: >/:<12:>3/;
:
: I have a somewhat related question about the ability of regular
: expressions to handle recursive embedding (if that's the right term).
:
: I need to clean up text files in which (probably because of a bad
: tty setting) corrections exist as backspaces (^H) followed
: by the correct characters. For example, a line might look like
:
: My g^Hfavorite bnn^H^Hook is the Vby^H^H^HCat in the Hat
:
I am all for Perl, but if you are on a unix machine the
command to use is 'col -b'. It does this automatically. If
you don't want TABs in the document, use 'col -bx'. It will
also remove unknown control chars -- see the man page for
its functions.
--
Regards,
Mike Heins
This post reflects the
opinion of my employer.
------------------------------
Date: 24 Oct 1997 19:49:39 GMT
From: cshortreed@valnet.com (Craig A. Shortreed)
Subject: Re: Move specified number of variables into one array???
Message-Id: <62qu4j$hui$1@news1.rmi.net>
Depends if the array is a perl command line array. If you are calling your CGI
with ?this|that|theother then your array should already have the variables
defined in @ARGV[n].
CAS
In article <344E133D.4B1F@kst.siemens.de>, Michael.Bach@kst.siemens.de says...
>
>Hi there...
>
>I have the following problem:
>
>1) I get a certain number of arguments from a HTML-form via CGI.pm
>2) I know the number of arguments
>3) I do a loop to work on each of the arguments using the number of
>arguments
>
>... this is where my problem comes in... I guess it's probably sheer
>stupidity:
>
>I would like to do something like this:
>
>while ( $bla != $numberOfArguments) {
> do something with @argument[$bla] ;
> $bla++;
> }
>
>The problem is that I get variables $argument1 - $argumentn and can't
>seem to figure out how to get all those single variable into one
>array... constructs like $argument$bla don't seem to work.
>
>Help would be appreciated!
>
>Regards from Germany
>Mike
------------------------------
Date: 24 Oct 1997 21:32:47 GMT
From: twod@not.valid
Subject: Re: oraperl - connect string
Message-Id: <62r45v$99h$1@vnetnews.value.net>
Ky Nguyen (knguyen@ab.bluecross.ca) wrote:
: I amd using oraperl 2.4 on HP and it is working fine iff
: I login to one of the oracle sids in that local host. I
: would like to connect to an oracle sid on another box
: via Oracle sqlNet V2. What should my connect string be?
Just using the name field :-
&ora_login('', 'user/pass@db_alias', '');
Try the above connect string from the command line using Sql*Plus to make
sure that you can connect to the remote database. If you can't connect via
Sql*Plus it's very unlikely that you can connect via Oraperl.
Ever thought of upgrading the oraperl2.4 to use the Oraperl module of PERL5's
DBD-Oracle module ? The vast majority of oraperl2.4 scripts work with no
changes other than adding the line 'use Oraperl;'. The reason I mention this
is that the old oraperl really isn't supported at the current time. www.
hermetica.com or your nearest CPAN for the DBD-Oracle module.
IAP
--
In an attempt to reduce junk email I use an invalid 'From' address.
My correct email address can be determined by replacing 'not.valid' with
'value.net'
------------------------------
Date: 23 Oct 1997 10:01:34 +1000
From: greg@turing.une.edu.au (Greg Zevin)
Subject: Re: Passing Associative Arrays to a subroutine
Message-Id: <62m44u$i8u@turing.une.edu.au>
pasn@ix.netcom.com writes:
: I am trying to pass 2 associative arrays as arguments to a
:subroutine. I get the values of the first array only and the code
:looks like
:********
: ...
: ....
: &comp_str(%enustr,%frastr);
: ...
Well, all you need is to pass not the hashes (aka assoc. arrays) but the
pointers to hashes - this is VERY similar to C :))))
Greg
------------------------------
Date: 24 Oct 97 19:11:00 GMT
From: "Doug" <dougw@dbis.ns.ca>
Subject: Passing variables
Message-Id: <01bce0b0$ad49eba0$5720a283@~.acadiau.ca>
Hi,
I am designing an html form which asks for data from the user. I will then
e-mail the results to my address. However, before I e-mail the data I want
to give the user another page to 'confirm' they want to mail this
infomation. I am using the cgi-lib.pl library and need to pass the
variables from one cgi to another. Any ideas......
Thx,
Doug
dougw@dbis.ns.ca
------------------------------
Date: 24 Oct 1997 14:48:11 -0400
From: allen@gateway.grumman.com (John L. Allen)
Subject: Re: Primes via regexen (Was: Re: non-greedy regexps)
Message-Id: <62qqhb$jgq@gateway.grumman.com>
In article <slrn650ao9.qp.abigail@betelgeuse.wayne.fnx.com>,
Abigail <abigail@fnx.com> wrote:
>Ilya Zakharevich (ilya@math.ohio-state.edu) wrote on 1514 September 1993
>in <URL: news:62onnq$2dj$1@agate.berkeley.edu>:
>++ In article <62o2u6$24a@gateway.grumman.com>,
>++ John L. Allen <allen@gateway.grumman.com> wrote:
>++ >
>++ > exec >/dev/null
>++ >
>++ > N=$1
>++ >
>++ > time perl -le '$N = shift; while ($_.=1, $n++<$N) {
>++ > print $n if /^(?!(11+)\1+$)/ }' $N
>++ >
>++ > time perl -le '$N = shift; while ($_.=1, $n++<$N) {
>++ > print $n if !/^(11+?)\1+$/ }' $N
>++ >
>++ > For N=3000, I got real times of
>++ >
>++ > 1m36.93s
>++ > 0m43.57s
>++
>++ This is very strange. There should be no substantial difference in
>++ time due to (?!), and I would think that 1+? should be slower for
>++ failing matches, when + and +? are semantically equivalent.
>++
>++ Since 7/8 matches fail, one should not observe any real difference.
>
>No. 7/8 matches *don't* fail. What you are looking for whether the
>string has composite length, the regex engine stops looking as soon
>as it finds a possibility. By using (11+?), a matching length for
>\1 is found the first step in 50% of the cases - all even numbers.
>
>By using (11+), you'd need at least n/2 tries before finding
>a matching length. Hence the difference.
Well, my timings seem to have been a fluke. +? _is_ slightly
slower! I don't understand it, but it's true. Moreover, this
#--------
sub test {
my ($n) = sprintf "%6d", $_[0];
$x = 1 x $n;
timethese 2000, {
"$n (abi) " => '$x =~ /^(?!(11+)\1+$)/',
"$n (john)" => '$x !~ /^(11+?)\1+$/',
};
print "\n";
}
test 300;
test 3000;
test 30000;
#--------
results in
Benchmark: timing 2000 iterations of 300 (abi) , 300 (john)...
300 (abi) : 1 secs ( 1.12 usr 0.00 sys = 1.12 cpu)
300 (john): 2 secs ( 1.21 usr 0.00 sys = 1.21 cpu)
Benchmark: timing 2000 iterations of 3000 (abi) , 3000 (john)...
3000 (abi) : 11 secs (10.83 usr 0.00 sys = 10.83 cpu)
3000 (john): 15 secs (15.44 usr 0.00 sys = 15.44 cpu)
Benchmark: timing 2000 iterations of 30000 (abi) , 30000 (john)...
30000 (abi) : 109 secs (108.23 usr 0.00 sys = 108.23 cpu)
30000 (john): 212 secs (208.31 usr 0.00 sys = 208.31 cpu)
as you can see, +? gets slower for bigger numbers. Abi wins!
John.
--
_/JohnL\_allen@gateway.grumman.com <Sun>: 9.5 billion pounds per sec to energy
~\Allen/~Fax: 516-575-7428 <Universe>: 1e22 stars = 22 solar masses per sec
------------------------------
Date: Fri, 24 Oct 1997 12:52:37 -0700
From: Chief Boot Knocka <natedogg@webbnet.com>
Subject: question: C-to-Perl variable passing
Message-Id: <3450FC85.4896@webbnet.com>
It seems that it would be tricky for a perl routine to call a C program
and try to get more than one value returned from it. I was wondering if
anyone had any methods to do this.
What I'm trying to do is syscall(cprogram, var1, var2, etc...). Then
there are three values that cprogram has to return. It would be great if
perl could pass pointers to those variables through the syscall; then C
could modify the values pointed to, then just exit. If this can be done,
I don't know how. If not, is there a way?
--
Nate Grover (http://www.webbnet.com/~natedogg)
"Everything is dangerous if you're stupid"
------------------------------
Date: 24 Oct 1997 21:57:19 GMT
From: "Kathy " <kathyl@cais.com>
Subject: Reading line from file and assiging to variables
Message-Id: <01bce0c6$a0580240$133dfccd@kathyl>
I'm currently trying to read in a file, one line at a time, and assign
diffeent "fields" based on the field separator, then manipulate certain
fields. I've tried:
@fields = split(/\s+\);
print $field[0];
I can print this, but I cannot print $field[1] or any subsequent fields.
Any ideas? Thanks...
------------------------------
Date: 24 Oct 1997 19:54:18 GMT
From: cshortreed@valnet.com (Craig A. Shortreed)
Subject: Re: Running a Script at Startup
Message-Id: <62quda$hui$3@news1.rmi.net>
<!--#exec cgi="/cgi-bin/yourprogram.cgi or .pl" --> inside the HTML.
CAS
In article <01bcdde4$1b727860$82100193@sinw0313.bechtel.com>,
jrcruto@bechtel.com says...
>
>How do I execute a Perl script automatically when a page is initially
>loaded?
>Can anyone show me please?
>
>Thanks.
>
------------------------------
Date: 24 Oct 1997 19:51:44 GMT
From: cshortreed@valnet.com (Craig A. Shortreed)
Subject: Re: sending a short file?
Message-Id: <62qu8g$hui$2@news1.rmi.net>
Why not just download one of the several upload perl cgi's out there? Go to
www.worldwidemart.com for Matt's Script Archives, he's got one, I use it and
simply modified it to suit my taste.
CAS
In article <62oi4a$q7r$1@news.smart.net>, becker@smart.net says...
>
>Hello perl world,
>
> I'm trying to devise the easy/best way to accomplish this perhaps some
>of you can hint me. I have a set of Javascripts which do a bunch of
>HTML page layout and creates a dynamic form. At the point where the user
>clicks a SUBMIT button I need to gather all of the fields on this form and
>put it on a flat file on a server thru ftp would be guess... What's the
>best approach for this??
> o I thought about a perl script to start an ftp session but I don't
>have a file to put..since they come from memory
> o Do I have to get down to the sockets to do this?
> o A telnet session that appends lines to a file and closes once my pipe
>is finished??
>
> Any ideas/hint appreciated
>
> Becker Cuellar
>
------------------------------
Date: 24 Oct 1997 19:26:37 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: SQL to update a row from a Perl script
Message-Id: <toutatis-ya023180002410972126330001@news.euro.net>
Henry Hartley <HARTLEH1@westatNOSPAM.com> wrote:
> I have a perl script that contains the following:
>
> $sql = sprintf("select * from Users where UserID='%s'", $uid);
> $query->sql($sql);
> $query->fetchrow();
>
> I then get the column data from that returned record and display it as
> the field data in a form. I want to have a "select" button that takes
> any changes to the data in the form and writes it back to the MS Access
> database. Something like using UPDATE although I've never used that so
> don't really know how. Any help would be appreciated.
This newsgroup would be the last place to find an answer. The manual of
your database (and the perl interface to it) would be the first. Almost any
database has one online. Anyway, I'll take a guess:
while (($k,$v) = each %newdata){
push @data, "$k = '$v'";
}
my $sql = "update Users set ".join(",",@data)." where UserID=$uid";
$query->sql($sql);
But there's a lot more to it. Well, you'll find out. :-)
--
Toutatis
no mail replies please
------------------------------
Date: 24 Oct 97 21:39:03 GMT
From: "Peter Perchansky" <fp@pmpcs.com>
Subject: Re: Using .forward file to trigger Perl script
Message-Id: <01bce0c5$35bba3c0$6dd548a6@pmp>
Hi Matthew:
Thank you.
--
===========================================================
Peter Perchansky, Computer Consultant & Microsoft FrontPage MVP
PMP Computer Solutions
FrontPage Web Hosting at
http://www.pmpcs.com/services/fpwebhosting.htm
FrontPage Support http://www.pmpcs.com/support/frontpage.htm
------------------------------
Date: 24 Oct 97 21:39:31 GMT
From: "Peter Perchansky" <fp@pmpcs.com>
Subject: Re: Using .forward file to trigger Perl script
Message-Id: <01bce0c5$4e17e820$6dd548a6@pmp>
Hi Brian:
> man forward tells you all about it. :)
man is only good if you have access to the shell.
--
===========================================================
Peter Perchansky, Computer Consultant & Microsoft FrontPage MVP
PMP Computer Solutions
FrontPage Web Hosting at
http://www.pmpcs.com/services/fpwebhosting.htm
FrontPage Support http://www.pmpcs.com/support/frontpage.htm
------------------------------
Date: Fri, 24 Oct 1997 17:59:29 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Using .forward file to trigger Perl script
Message-Id: <comdog-ya02408000R2410971759290001@news.panix.com>
In article <01bce0c5$4e17e820$6dd548a6@pmp>, "Peter Perchansky" <fp@pmpcs.com> wrote:
>> man forward tells you all about it. :)
>
>man is only good if you have access to the shell.
well, you could FTP it. :) i also think that there is a web interface
to the man pages somewhere - yep - Yahoo lists interfaces for several
OSes, although they all appear to be pretty old...
basically it says that you can pipe input to external programs with a
line like:
"| /export/home/user/script.pl"
the script will receive the input through STDIN.
good luck :)
--
brian d foy <comdog@computerdog.com>
NY.pm - New York Perl M((o|u)ngers|aniacs)* <URL:http://ny.pm.org/>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: 24 Oct 1997 19:46:42 GMT
From: alain.deckers@man.ac.uk (A. Deckers)
Subject: Re: Year 2000 for GNU-Perl5
Message-Id: <slrn651up2.lif.alain.deckers@nessie.mcc.ac.uk>
In <3454fac1.432258905@igate.hst.moc.com>,
Jeremy D. Zawodny <zawodny@hou.moc.com> wrote:
>[cc'd automagically to original author]
>
>On Wed, 22 Oct 1997 06:59:23 -0500, Michael P Chandler
><mpchandler@mema.mail.fedex.com> wrote:
>
>> Is there a site/page/etc where I can find out if Perl5 (gnu version),
>> or Perl5 in general, is Year 2000 compliant???
>>
>> I understand many considerations are hardware/OS dependent,
>> but I'm concerned about getting any patches/fixes if need-be.
>
>Unfortunately, searching http://www.perl.com/ for '2000' or '1900' or
>'compliant' doesn't turn up much. :-(
OTOH, searching the Perl FAQ does. :)
ALain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl archive: <URL:http://www.perl.com/CPAN/>
>>>>>>>> comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<
------------------------------
Date: Fri, 24 Oct 1997 21:39:02 GMT
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Year2000 problem with localtime();
Message-Id: <Pine.A41.3.95a.971024233611.66598O-100000@sp049>
On Fri, 24 Oct 1997, an entity calling itself Nick Jones trolled:
(three dozen lines of quote, including .sig, merely in order to add)
> oh err. this was a bit catty wasn't it?
So you don't believe in reading the documentation then?
You won't get far on this group, I predict.
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
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 1226
**************************************