[7707] in Perl-Users-Digest
Perl-Users Digest, Issue: 1333 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 17 19:17:22 1997
Date: Mon, 17 Nov 97 16:00:20 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 17 Nov 1997 Volume: 8 Number: 1333
Today's topics:
Re: +>> <zenin@best.com>
Comments Tk vs Browser/CGI <bromberek@cems.umn.edu>
eval and scoping problem <lucs@cam.org>
Re: Help with jump.cgi (brian d foy)
Re: Help: Recursive functions in Perl (E.None Archibald)
Re: Help: Recursive functions in Perl (Brock Sides)
Re: Help: Recursive functions in Perl (Brock Sides)
Joining Scalars... This has been a nightmare for me (Scott DiNitto)
Re: Joining Scalars... This has been a nightmare for me (brian d foy)
Re: PATH_INFO (brian d foy)
Re: PATH_INFO <djb@16straight.com>
Removing text regex? (William L. Gorder)
Re: Removing text regex? (brian d foy)
Re: Removing text regex? <usenet-tag@qz.little-neck.ny.us>
split problems <verhaege@esat.kuleuven.ac.be>
Re: system("...") on Perl 5 on OS/2 (Ilya Zakharevich)
This perl/cgi script on my web site... <cboget@apdi.net>
Re: Tracking people leaving a website (brian d foy)
Upgrading from Active State to Current Build versions (Doran)
Win95, Perl, and Personal Web Server (Doran)
Re: xemacs comint support for perl shell? <jay@rgrs.com>
Re: Year2000 problem with localtime(); (I R A Aggie)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 17 Nov 1997 20:56:10 GMT
From: Zenin <zenin@best.com>
Subject: Re: +>>
Message-Id: <879800328.95057@thrush.omix.com>
Steve <syarbrou@ais.net> wrote:
: Is +>> (read/append) a valid command in perl for opening a file?
Yes, but it is likely to bite you if you're not aware of what
this actually does. When opening a file in this mannor, you
can not get to the beginning of it. When your pointer is at
0 you're at the end of the file as it was when you first opened
it. -Which makes some sense, because you opened it for appending.
But you have no way to seek() to the real start of the file.
This probably made no sense, but since I've had no sleep in the last
24 hours I really don't care. :)
: I
: thought perl only allowed reading or writing of a file but not both?
You're mistaken. I'd recommend using +< over +>>, but of course
you'd need to test to make sure there is actually a file to
open before trying +<.
: If valid, does it have any problems associated with it?
See above.
--
-Zenin
zenin@best.com
------------------------------
Date: Mon, 17 Nov 1997 16:51:08 -0600
From: Bruce Bromberek <bromberek@cems.umn.edu>
Subject: Comments Tk vs Browser/CGI
Message-Id: <3470CA5C.41C6@cems.umn.edu>
I've written several perl scripts to preform a variety of function on
our image analysis system. My coworkers have said "Great, but can you
make it easier to use" I've been trying to decide between a Browser/CGI
solution and or PerlTk.
The browser/cgi solution has the advantage that I've done it before +
the wealth of CPAN modules to help with the drudgery. But I have
concerns about how errors and such during image aqusitions would be
handled during script operation and updateing the viewed web page. Also
how permisions for files generated by such a CGI scripts would be set
correctly. [For the curious, the script controls a micrscope stage ans
image acquisition, about 200 images is typical]
The PerlTk solution looks great (as seen from the demo in PerlTk) but
has a learning curve to overcome.
Any input fromm people who have used either would be appreciated. Thanks
in advance.
Bruce Bromberek
------------------------------
Date: Mon, 17 Nov 1997 18:13:37 -0500
From: Luc St-Louis <lucs@cam.org>
Subject: eval and scoping problem
Message-Id: <3470CFA1.2FC02013@cam.org>
I have the following two files:
----------------------------------------------
# test.pl
use strict;
use pkg;
pkg::Foo();
print "$pkg::A1 $pkg::A2 $pkg::B1 $pkg::B2\n";
----------------------------------------------
# pkg.pm
package pkg;
use strict;
$pkg::A1 = 1;
eval "\$pkg::A2 = 2";
sub Foo
{
$pkg::B1 = 11;
eval "\$pkg::B2 = 22";
}
1;
----------------------------------------------
When I run 'perl -w test.pl', I get the output :
Name "pkg::B2" used only once: possible typo at test.pl line 5.
1 2 11 22
Two questions :
1. Why does Perl complain about B2, but not about A2?
2. How can I use the 'eval' within sub Foo() without raising a complaint
(while keeping 'use strict')? I am looking for something that would
happen around the eval itself in the pkg.pm file, not something like 'no
strict' in front of the variable usage in test.pl.
Thanks
------------------------------
Date: Mon, 17 Nov 1997 17:16:24 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Help with jump.cgi
Message-Id: <comdog-ya02408000R1711971716240001@news.panix.com>
In article <879797187.8842@dejanews.com>, zebrafink@gmx.net wrote:
>I want to use this script with frames ! Script in one frame called AUSWAHL
>and the Links should be shown in the next frame called INHALT !
see the CGI Meta FAQ for the Frames documentation. they have examples
of your intended solution :)
--
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: 17 Nov 1997 21:13:30 GMT
From: yevgene@xochi.tezcat.com (E.None Archibald)
Subject: Re: Help: Recursive functions in Perl
Message-Id: <64qc1q$qfg$1@tepe.tezcat.com>
Use perl -w. Use perl -w. Use perl -w.
use for $nextname (glob "$dir/*") instead of while ($nextname = <*>).
note that using glob returns $nextname as things like "./foodir" so you
need only recurse with &scan_dir($nextname).
this is part of the answer to your two questions below - but using the
-w switch to perl would have told you that right off the bat.
You are not doing a chdir BACK to your original directory after recursion.
Recursive example:
http://www.perl.com/CPAN-local/doc/FAQs/FAQ/PerlFAQ.html#How_do_I_permute_N_elements_of_a
Use my(), not local().
You'll probably want to push directories onto an array for processing after
the main directory if you'll be printing this. otherwise (even working)
your directory tree will still *look* wrong even when the recursion is
working properly.
Read the FAQ. Twice.
-e.
In article <347092E0.F57D5A3F@nba19.med.uth.tmc.edu> you wrote:
: Hello all. I am trying to write a recursive function in Perl. I have
: been unable to find a single example on-line. Any pointers would be
: greatly appreciated. As a start I have the following simple script:
: My questions: why does sub2 get printed while processing sub1? And after
: finishing with sub1 why does the script not process sub2?
My final working (to your algorithmic specs anyhow) product:
&scan_dir($ARGV[0]);
sub scan_dir {
my($dir);
my($nextname);
$dir = $_[0];
chdir($dir);
print "Current dir ==> $dir\n\n";
for $nextname (glob "$dir/*") {
print "\t$nextname\n";
if (-d $nextname) {
&scan_dir($nextname);
chdir($dir);
}
}
}
------------------------------
Date: Mon, 17 Nov 1997 16:26:41 -0600
From: cbks@NOSPAM.magibox.net (Brock Sides)
Subject: Re: Help: Recursive functions in Perl
Message-Id: <cbks-1711971626410001@dave.magibox.net>
In article <347092E0.F57D5A3F@nba19.med.uth.tmc.edu>, Viren Patel
<vpatel@nba19.med.uth.tmc.edu> wrote:
> Hello all. I am trying to write a recursive function in Perl. I have
> been unable to find a single example on-line. Any pointers would be
> greatly appreciated. As a start I have the following simple script:
>
> &scan_dir($ARGV[0]);
>
> sub scan_dir {
> local($dir);
> local($nextname);
>
> $dir = $_[0];
> chdir($dir);
>
> print "Current dir ==> $dir\n\n";
>
> while ($nextname = <*>) {
> print "\t$nextname\n";
> if (-d $nextname) {
> &scan_dir($dir."/".$nextname);
> }
> }
> }
>
>
> On the following directory structure:
>
> ddd
> sub1
> sub1_file1
> sub1_file2
> sub2
> sub2_file1
> ddd_file1
>
> I get the following output:
>
> Current directory ==> ddd
>
> ddd_file1
> sub1
>
> Current directory ==> ddd/sub1
>
> sub2
> sub1_file1
> sub1_file2
>
>
> My questions: why does sub2 get printed while processing sub1? And after
> finishing with sub1 why does the script not process sub2?
I'm not sure about the answer to your first question, but the answer to your
second question is that you never chdir'd back up at the end of the subroutine.
Add
chdir ..;
to the end of the subroutine. Another suggestion: instead of using
while (<*>)
use
foreach (glob("*"))
See Camel, 2nd ed., pp. 55-57.
Brock Sides
cbks@NOSPAM.magibox.net
http://www.magibox.net/~brock/
To reply by email, remove the string "NOSPAM." from reply address.
------------------------------
Date: Mon, 17 Nov 1997 17:24:48 -0600
From: cbks@NOSPAM.magibox.net (Brock Sides)
Subject: Re: Help: Recursive functions in Perl
Message-Id: <cbks-1711971724480001@dave.magibox.net>
In article <347092E0.F57D5A3F@nba19.med.uth.tmc.edu>, Viren Patel
<vpatel@nba19.med.uth.tmc.edu> wrote:
> Hello all. I am trying to write a recursive function in Perl. I have
> been unable to find a single example on-line. Any pointers would be
> greatly appreciated. As a start I have the following simple script:
>
> &scan_dir($ARGV[0]);
>
> sub scan_dir {
> local($dir);
> local($nextname);
>
> $dir = $_[0];
> chdir($dir);
>
> print "Current dir ==> $dir\n\n";
>
> while ($nextname = <*>) {
> print "\t$nextname\n";
> if (-d $nextname) {
> &scan_dir($dir."/".$nextname);
> }
> }
> }
[snip]
> My questions: why does sub2 get printed while processing sub1? And after
> finishing with sub1 why does the script not process sub2?
To answer the second question: because you didn't go back up a level at the
end of the sub. Add chdir ".."; to the end of the sub.
Two other things you need to do (1) Take $dir."/" out of the recursive
call, and
just use $nextname. You've already chdired into $dir, so you won't find any
further subdirectories if you prepend $dir. (2) Instead of while
($nextname = <*>), use a foreach loop on the list glob("*").
When I made these corrections, your script worked just fine.
To
Brock Sides
cbks@NOSPAM.magibox.net
http://www.magibox.net/~brock/
To reply by email, remove the string "NOSPAM." from reply address.
------------------------------
Date: Mon, 17 Nov 1997 22:16:23 GMT
From: sdinitto@kronos.com (Scott DiNitto)
Subject: Joining Scalars... This has been a nightmare for me
Message-Id: <3470bc71.616161313@news>
I am trying to join two values from two scalars and make them one
scalar that would be referencing a scalar from a module. Let me
explain through code:
mod.pm
#!/usr/bin/perl
package mod;
$foo_usrhome = 12;
$foo_usrlocal = 7;
1;
main.pl
#!/usr/bin/perl
use mod;
package mod;
open (FILE, "volume.scn"); #This file only contains one line:
/usr/home
$VolumeInf = <FILE>;
close FILE;
@VolumeInfA = split (/\//, $VolumeInf);
$VolumeInfJ = join ("", @VolumeInfA); #Now this should look like
this:"usrhome"
#Now I want to get the value of $foo_usrhome which is 12.. how can I
do this? My guess that is wrong was:
$SuperFoo = "\$foo_$VolumeInfJ"; #If I were to print this out, the
value assigned to $SuperFoo is "$foo_usrhome", the same as in mod.pm!
$main::KungFoo = $SuperFoo;
package main
print "$$KungFoo"; #I would expect the number 12 to appear. But the
statement is blank. I was assuming when $$KungFoo is called upon to
print, it references $SuperFoo which contains the value "$foo_usrhome"
that is re-referenced and grabs the value 12. But it doesnt work that
way. If I change $SuperFoo to $SuperFoo = "usrhome", then it works.
It's really wierd. Can anyone explain whats going on here, or better
yet, another way for me to accomplish my goal? Thanks
SD
------------------------------
Date: Mon, 17 Nov 1997 17:40:00 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Joining Scalars... This has been a nightmare for me
Message-Id: <comdog-ya02408000R1711971740000001@news.panix.com>
In article <3470bc71.616161313@news>, sdinitto@kronos.com (Scott DiNitto) wrote:
=====mod.pm======
>#!/usr/bin/perl
>
>package mod;
>$foo_usrhome = 12;
>$foo_usrlocal = 7;
>1;
=====main.pl=====
>
>#!/usr/bin/perl
>
>use mod;
>
>package mod;
>$SuperFoo = "\$foo_$VolumeInfJ";
what are you trying to do here? $SuperFoo is set to the literal
string starting with $foo (that's a literal $)
>$main::KungFoo = $SuperFoo;
so you assign that value to a variable in the main package...
>package main
>
>print "$$KungFoo";
then you do a wierd $$ thing.
perhaps you wanted something like
#!/usr/bin/perl
package mod;
$foo_usrhome = 12;
$volume_info = 'usrhome';
#string interpolates to "$super_foo = $foo_usrhome"
#when evaluated, this sets $super_foo to 12
eval( "\$super_foo = \$foo_$volume_info" );
print "super_foo is [$super_foo]\n";
#now let's assign to a variable in a different package:
$main::kung_foo = $super_foo;
#change the package and let's see if we've done what we did
package main;
print "kung_foo is [$kung_foo]\n";
__END__
super_foo is [12]
kung_foo is [12]
--
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: Mon, 17 Nov 1997 17:15:08 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: PATH_INFO
Message-Id: <comdog-ya02408000R1711971715080001@news.panix.com>
[followups set]
In article <3470CFC5.4661@prism.gatech.edu>, "Jodi M. Shephard" <gt1295b@prism.gatech.edu> wrote:
>How do I set a $ENV{PATH_INFO}? I need to track a user_name through
>this.
you construct a URL like
http://somewhere.com/rainbow.html/user_name
to access the file rainbow.html, in which case PATH_INFO is set
to the remaining portion of the PATH - "/user_name".
perhaps you wanted a different answer?
--
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: Mon, 17 Nov 1997 16:56:58 -0500
From: Dan Birchall <djb@16straight.com>
To: gt1295b@prism.gatech.edu
Subject: Re: PATH_INFO
Message-Id: <3470BDAA.6A029439@16straight.com>
Jodi M. Shephard wrote:
>
> How do I set a $ENV{PATH_INFO}? I need to track a
> user_name through this.
Instead of calling foo.cgi?name=foo
call foo.cgi/foo
$ENV{'PATH_INFO'} will then be "/foo", strip the slash.
-Dan
--
Dan Birchall - Internet Sysadmin - 16 Straight Communications
520 Fellowship Road, Suite A-112, Mount Laurel, NJ 08054-3400
Print design, web design and hosting... from a single source!
djb@16straight.com - http://www.16straight.com - 609.231.7887
------------------------------
Date: Mon, 17 Nov 1997 21:17:28 GMT
From: no@spam.please (William L. Gorder)
Subject: Removing text regex?
Message-Id: <slrn671cmt.akl.no@user2.infinet.com>
I am a newbie at regular expressions (and a total Perl neophite) and I have
been trying to come up with an understanding of how I would accomplish the
following: I need to remove a section or sections of text from a file (well,
OK, 2000+ files). The text in question looks something like this:
LD ID = "L501"
EB = "SS"
LG = "STATEEST"
WEXIST = 0.0
VEXIST = 0.0
LDXM MW = "N"
MVAR = "N"
VL ID = "EQX"
That is, an identifier (in this case "LD" or "LDXM") followed by any number
of attributes (the lines with "=")followed by another identifier. I do not
want to delete the line with the following identifier, in this case, the
deletion should end at the end of the line *before* the "VL" identifier.
The way I have been approaching this is to try to match the first group
("LD") as follows:
/^\s*LD(.*)\s*\w\s*[^=]/
meaning (to my *very* limited understanding :-):
match the beginning of the line followed by any amount of white-space, the
letters "LD", followed by any amount of white-space, and a word *not*
followed by white-space and an "=". I figure once I've got the "LD" section
working the "LDXM" part should be easy (as it follows the same rules).
I hate to ask, but I think I'm missing something basic, and I forgot my
"Mastering Regualr Expressions" book at home! Could someone point me in the
right direction?
Thanks for any help in advance,
Bill
--
My real e-mail address is wlg AT infinet | Sorry for the trouble, but I HATE
dot com | junk e-mail!
------------------------------
Date: Mon, 17 Nov 1997 17:20:12 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Removing text regex?
Message-Id: <comdog-ya02408000R1711971720120001@news.panix.com>
In article <slrn671cmt.akl.no@user2.infinet.com>, no@spam.please (William L. Gorder) wrote:
>I am a newbie at regular expressions (and a total Perl neophite) and I have
>been trying to come up with an understanding of how I would accomplish the
>following: I need to remove a section or sections of text from a file (well,
>OK, 2000+ files). The text in question looks something like this:
>
> LD ID = "L501"
> EB = "SS"
> LG = "STATEEST"
> WEXIST = 0.0
> VEXIST = 0.0
>
> LDXM MW = "N"
> MVAR = "N"
>
> VL ID = "EQX"
if this is how the text really looks, then why not set the input
record separator to "\n\n", read in a record at a time, and print
it only if it doesn't have "LD\s" or "LDXM\s" at the beginning of
the record. seems much more efficient than trying to use a regex
to do the whole process.
too bad you munged your email address though...
--
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: 17 Nov 1997 23:08:42 GMT
From: Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
Subject: Re: Removing text regex?
Message-Id: <eli$9711171739@qz.little-neck.ny.us>
William L. Gorder <no@spam.please> wrote:
x1> LD ID = "L501"
x1> EB = "SS"
x1> LG = "STATEEST"
x1> WEXIST = 0.0
x1> VEXIST = 0.0
x1>
x2> LDXM MW = "N"
x2> MVAR = "N"
x2>
K > VL ID = "EQX"
> That is, an identifier (in this case "LD" or "LDXM") followed by any number
> of attributes (the lines with "=")followed by another identifier. I do not
> want to delete the line with the following identifier, in this case, the
> deletion should end at the end of the line *before* the "VL" identifier.
I think the best way to do this, if I understand you -- you want
all of the x.> lines deleted, and the K.> line kept -- is to write
an RE that deletes the x1> lines and then the x2 lines.
> /^\s*LD(.*)\s*\w\s*[^=]/
> meaning (to my *very* limited understanding :-):
> match the beginning of the line followed by any amount of white-space, the
You'll want /m for ^ to work.
> letters "LD", followed by any amount of white-space, and a word *not*
You have it followed by any amount of anything but nl, which won't help.
> followed by white-space and an "=".
If you want an "=", specify it, not \w which won't be "=".
> I figure once I've got the "LD" section
> working the "LDXM" part should be easy (as it follows the same rules).
Do them both at once. Assuming the whole of your file is in $_:
s/(\A|\n+) # start of buffer or at least one nl (capturing: $1)
\s* # whitespace (will eat blank lines before LD
# without above)
LD # literal text LD
(?:XM)? # optionally followed by XM (non-capturing)
(?: # grouping paren (non-capturing)
\s+ # non-optional-whitespace
\S+ \s* = # identifier optional-whitespace =
\s* \S+ # optional-whitespace value
# (needs more work than \s+ if quoted stings can
# have whitespace in them)
) # end group
+ # one or more of the group
/$1/xg; # $1: the blank lines saved
# /x eXtended format allows for comments
# /g Globally replace
> My real e-mail address is wlg AT infinet | Sorry for the trouble, but I HATE
> dot com | junk e-mail!
Elijah
------
that's okay, you do read the group don't you?
------------------------------
Date: Mon, 17 Nov 1997 22:18:55 +0100
From: Wim Verhaegen <verhaege@esat.kuleuven.ac.be>
Subject: split problems
Message-Id: <3470B4BE.F5278BB7@esat.kuleuven.ac.be>
Hi you Perl friends,
I am facing the following problem: I need to parse a file containing
lines like
mxxx a b c d e par1=val1 par2=val2 attr3 par4 = val4 attr5
The mxxx a b c d e part is compulsory, so I got the idea to use split to
parse this line. However the remaining of the line uses a different
syntax, with the assignment to parameter fields and single attributes
freely mixed.
This makes the task a lot more difficult.
In the following, I always use the example
m1 a b c d e foo=5 bar=6 foobar pi=3.1415
I have tried stuff like this:
($name, $a, $b, $c, $d, $e, @pars) = split /\s+|(\w+\s*=\s*\w+)/;
which will include the par=val fields in the list as they are considered
as
parenthesized delimiters. The resulting list is however interspersed
with
undef's (even more than I expected after reading the explanation of
split
in the Camel book).
So I try to remove the undef's with:
($name, $a, $b, $c, $d, $e, @pars) =
grep { defined; } split /\s+|(\w+\s*=\s*\S+)/;
but end up with a bunch of empty fields in the result
Could someone please explain this to me?
So I than closed my eyes and tried
($name, $a, $b, $c, $d, $e, @pars) =
grep { defined && !/^\s*$/; } split /\s+|(\w+\s*=\s*\S+)/;
in order to find out that it works!! The frustrating part is of course
that I do not understand the need for such overkill.
This brings me to my second question. It would be a lot easier if
I could
split off a part of a string, and get the remainder of the string which
split has not looked at (or at least the starting position of the
remainder).
Any idea how this can be accomplished?
Thanks in advance.
Wim Verhaegen
------------------------------
Date: 17 Nov 1997 21:47:33 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: system("...") on Perl 5 on OS/2
Message-Id: <64qe1l$7fm$1@agate.berkeley.edu>
In article <3470A91C.2F87@caibm.ibm.com>,
Larry Menard <lmenard@caibm.ibm.com> wrote:
> In my testing of Perl 5 on OS/2, I've found that system("...") no
> longer works: system("cmd /c ...") must be used.
Sure. I hope that you like the fact that it sticks to the
documentation now ;-). No shell is involved unless asked for.
And this shell is not going to be broken cmd.exe.
Ilya
------------------------------
Date: Mon, 17 Nov 1997 14:22:25 -0500
From: "Sorrow" <cboget@apdi.net>
Subject: This perl/cgi script on my web site...
Message-Id: <64q5kf$5mi$1@news2.cais.com>
...doesn't seem to be working
I'm trying to set up an Upload cgi script written
in perl (I got it from one of the archives) and
I consistantly get the same error. This is the
second upload script that I've tried and the first
one gave the same error, which follows:
----
A network error occuured while Netscape
was sending data.
(Network Error: Connection reset by peer)
Try connecting again.
----
I'm running IIS 3.0 on NT 4.0.
The version of perl I'm using is 5.003_7
In the registry, the .cgi extension is mapped
to PerlIS.dll.
Also, in the activeware area of the registry,
the "EnableCGIHeader" in PerlIS is set
to "0".
To see what is going on, you can go to
www.aspenpub.com/cgi-bin/upload.htm
I believe I've included as much information
as I could. If you have any other questions
about my configuration, please ask.
If you have any suggestions, solutions, etc,
then I'd be more than happy to hear them.
I've been trying to get this to work for quite
sometime to no avail.
Thank you.
Chris
------------------------------
Date: Mon, 17 Nov 1997 17:05:49 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Tracking people leaving a website
Message-Id: <comdog-ya02408000R1711971705490001@news.panix.com>
In article <879799996.546860@thrush.omix.com>, Zenin <zenin@best.com> wrote:
>brian d foy <comdog@computerdog.com> wrote:
>: In article <879759472.311694@thrush.omix.com>, Zenin <zenin@best.com> wrote:
>: > Untested and off the top of my head, but here ya go:
>: hmmm... a combination that usually leads to bad answers...
>
> Well, ya get what ya pay for. :)
just because your work is free is no reason for it to suck.
>: from where does that $ARGV come? doesn't the script complain
>: about unimported variables and use of uninitialized values?
>: > print "Location: http://$ARGV/\n\n";
>
> Here, change it to:
>
> print "Location: http://$ARGV[0]/\n\n";
>
> There, feel better? :-)
no. where does $ARGV[0] come from? this is a CGI script isn't it?
have you ever done this before?
--
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: Mon, 17 Nov 1997 21:19:09 GMT
From: rbj@NOSPAMix.netcom.com (Doran)
Subject: Upgrading from Active State to Current Build versions
Message-Id: <3470b3e9.16821785@nntp.ix.netcom.com>
I'm currently using Active State's build 3.13 on my NT and Win95
machines, but would just as soon use one of the current builds of
Perl. What is the best way to uninstall the old one and install the
new? Should I just blow everything away and start from scratch or can
I install the new one over the old. Active State's version seems to be
a little (lot?) different from the "real" version, that's why I ask.
Thanks,
Doran...
Please remove the NOSPAM when replying via email.
------------------------------
Date: Mon, 17 Nov 1997 21:15:15 GMT
From: rbj@NOSPAMix.netcom.com (Doran)
Subject: Win95, Perl, and Personal Web Server
Message-Id: <3470a311.12508892@nntp.ix.netcom.com>
Like a bunch of others, I'm hoping to bang away at some scripts at
home using my Win95 machine running M$'s Personal Web Server. I want
to use the Win95 machine instead of my SGI since (1) The SGI isn't
networked to anything and (2) the scripts will end up running on an NT
server running IIS.
I've found *very* little documentation about Win95 & Perl beyond the
"win95.txt" which tells of the alternative to command.com. What
little help there is basically sez "It used to not work on Win95, now
it should. See WinNT setup for more details." This isn't much help.
That said, it seems I was able to get things mostly set up. The
problem now is that no matter which perl script is specified in my
HTML anchor, it's the first one in directory that gets launched (not
the one specified in the link). If I remove all but the target script
from the directory, then it executes fine.
I think I might know what the problem is, but I'm hoping for some
confirmation. In my registry, I have set the Script Map in
LOCAL_MACHINE/SYSTEM/CURRENTCONTROLSET/SERVICES/W3SRV/PARAMETERS
to execute the following for .pl and .cgi extentions:
c:\perl\bin\perl.exe %1 %*
I did this because I read it in two places online last night. But this
morning when I came to work and checked the NT machine I noticed that
it's line had %s instead of %1 and %*. So the NT registry reads:
c:\perl\bin\perl.exe %s %s
Could this be the cause of the problem (executing the first script in
the directory), having %1 %* instead of %s %s?
I'll give it a try when I get home tonight, but I was hoping to get
some feedback from somebody whose succesfully installed and run perl
scripts on PWS.
I should also mention I'm using Active State's build 3.13.
Email responses are probably best, but I'll also check back here too.
Thanks,
Doran...
Please remove the NOSPAM when replying via email.
------------------------------
Date: 17 Nov 1997 16:17:39 -0500
From: Jay Rogers <jay@rgrs.com>
To: lnewton@berio.phx.mcd.mot.com (Lynn D. Newton)
Subject: Re: xemacs comint support for perl shell?
Message-Id: <82iutrjk3w.fsf@shell2.shore.net>
lnewton@berio.phx.mcd.mot.com (Lynn D. Newton) writes:
> Has anyone written any Emacs lisp code (preferably for
> XEmacs), perhaps using the comint command interpreter
> wrapper, to run Perl with a -d switch like a shell
> interpreter?
>
> Yes, I'm sure I could just start a shell and run perl
> -d.
Too lazy to type it in shell mode eh? You possess one of the virtues
that Larry Wall ascribes to great programmers :-)
Well this works for my locally installed Emacs 19.34, but not for the
XEmacs 19.14. Hmmm - I wonder why not? Well, I'd look into it but
I'm just too lazy :-) Perhaps it works in a later version of XEmacs.
(defun perldb-shell ()
"Prompt for perl commands in debug mode"
(interactive)
(perldb "perl -de 1"))
--
Jay Rogers
jay@rgrs.com
------------------------------
Date: Mon, 17 Nov 1997 16:57:50 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Year2000 problem with localtime();
Message-Id: <-1711971657500001@aggie.coaps.fsu.edu>
In article
<Pine.GSO.3.96.971117095407.12318P-100000@usertest.teleport.com>, Tom
Phoenix <rootbeer@teleport.com> wrote:
+ On 14 Nov 1997, Mr. Yen-Ming Chen wrote:
+
+ > In a DEC Alpha, the localtime can present up to year 2038, Jan. 19th,
+ > 11:14:07. So that means it(Unix) will have a "year 2038" problem?? :)
+ Many of us are planning to retire from the world of programming at the end
+ of 2037. :-)
Hell, I'll only be 74. I suspect that I'll have to work another 20 years
after that before I can retire. I don't think I'd want a career change that
late in life... :)
James
--
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
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 1333
**************************************