[9298] in Perl-Users-Digest
Perl-Users Digest, Issue: 2893 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 17 15:24:01 1998
Date: Wed, 17 Jun 98 12:00:30 -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 Wed, 17 Jun 1998 Volume: 8 Number: 2893
Today's topics:
Re: 2 questions about lists <quednauf@nortel.co.uk>
?CGI scripts & Explorer (steel)
A funny problem with "use integer" (Bernard Cosell)
Re: Array Combinations Question <jdporter@min.net>
Re: Array Combinations Question (Joel Coltoff)
Re: Benchmark module in Perl for Win32 <JKRY3025@comenius.ms.mff.cuni.cz>
Re: Copying files across NT servers <JKRY3025@comenius.ms.mff.cuni.cz>
Re: Copying files in perl across NT servers (Tye McQueen)
Re: getting first letter of a string scott@softbase.com
Re: Getting TEXTWIDTH from Perl (Kevin Reid)
Re: grep question <*@qz.to>
Re: HELP : Socket Problems with NT 4 Perl (Thomas Berger)
Re: htpasswd in perl? (Allan M. Due)
Re: I need a simple scrip that... (Mick Farmer)
IPC Piping Error <coreyp@rc.gc.ca>
Re: Multiple $ENV{PATH} entries on Win NT (Tye McQueen)
NEW: E-Data (E-mail Directory Management Tool) (Adventia)
perl -w diagnostic misses something it should have warn <brannon@lnc.usc.edu>
Re: perl -w diagnostic misses something it should have (Mike Stok)
Re: Perl CGI NT 4.0 follow up <bowlin@sirius.com>
Re: Perl shell scripts in IIS 4.0 scott@softbase.com
Re: Pod::Text -- Unix only? (Brad Murray)
Re: Problems with newlines in perl regexp <*@qz.to>
Re: Reading the values, not the characters <jdporter@min.net>
Re: Reading the values, not the characters (Stuart McDow)
Re: Reading the values, not the characters (Stuart McDow)
Re: Sending mail, can I set the $from ? (Mick Farmer)
Re: SMTP blocking detection script comments requested. <*@qz.to>
Re: SQL Server and Win 32 ODBC Problem <JKRY3025@comenius.ms.mff.cuni.cz>
Re: strange error message .. "value of <handle> ..." jabrah15@my-dejanews.com
Symlink and Link oliverg@primesourcebp.com
turning off caching with cgi.pm <peacockm@nortel.ca>
Re: Windows NT, how to copy binary files ! <JKRY3025@comenius.ms.mff.cuni.cz>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 17 Jun 1998 17:22:45 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: 2 questions about lists
Message-Id: <3587ED55.D5321B07@nortel.co.uk>
Michael J Gebis wrote:
>
> "Alex Farber" <alex@kawo2.rwth-aachen.de> writes:
>
> }1) Is there (could not find in Camel book yet) some single
> }operator to check if some element is contained in an array?
>
This IS in the FAQ
> }2) what happens if i do a foreach()-loop on some @list
> }and the push smth in that list IN THIS LOOP ? Like:
>
> Off the top of my head, I'm not sure. When you get your copy of perl
> working, you should be able to try it out. Also, I'm 99% sure
> that this is in the FAQ. (So there's a 1% chance it's not. Read the
> FAQ and show me up! I dare ya! Read it. Read it. Read it!)
As far as I can tell, this ISN't !~~! BOO-YA!! :)
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: Wed, 17 Jun 1998 13:32:30 -0500
From: steele@cybersol.com (steel)
Subject: ?CGI scripts & Explorer
Message-Id: <steele-1706981332300001@tc1-modem81.cybersol.com>
Hi,
I have a very basic perl cgi guestbook script that
works fine with Netscape but won't write when
I use Internet Explorer.
Any suggestions?
Thanks,
Steel
------------------------------
Date: Wed, 17 Jun 1998 16:31:40 GMT
From: bernie@fantasyfarm.com (Bernard Cosell)
Subject: A funny problem with "use integer"
Message-Id: <3588ecbd.65423351@ganymede.rev.net>
I don't know if this should be counted as a bug or just a subtle
misfeature, but there's a cute trap in the use of 'use integer'.
It seems to mess up how variables are stored. Very odd stuff.
Consider:
$a = "2709789211" ;
$b = "2706480429" ;
print $a - $b, "\n";
use integer ;
print $a - $b, "\n";
$a = "2709789211" ;
$b = "2706480429" ;
print $a - $b, "\n";
=========================
The output I get with "This is perl, version 5.003 with EMBED" is:
3308782
3308782
0
There are a bunch of other anomalies surrounding this whole mess, but
you get the idea... [e.g., you can try doing "$a + 0" and "$a * 1" and
see the odd results]
Anyone know what's going on here?
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
mailto:bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: Wed, 17 Jun 1998 16:05:20 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Array Combinations Question
Message-Id: <3587EAF8.1AE8@min.net>
zucker@my-dejanews.com wrote:
>
> $array[0][0] contains "hello"
> $array[0][1] contains "there"
> $array[1][0] contains "jupiter"
> $array[1][1] contains "saturn"
> $array[1][2] contains "mars"
> $array[2][0] contains "happy"
>
> I need the combinations:
>
> hello jupiter happy
> hello saturn happy
> hello mars happy
> there jupiter happy
> there saturn happy
> there mars happy
for ( rec( \@array ) ) {
print "$_\n";
}
sub rec {
my( $ar, @stack ) = @_;
return "@stack" unless @$ar;
my( $head, @a ) = @$ar;
map { rec( \@a, @stack, $_ ) } @$head;
}
I assumed that you actually wanted the strings, eg.
"there jupiter happy".
If you'd rather have an array of strings, e.g.
[ 'there', 'jupiter', 'happy' ], then change the return
statement in sub rec to read
return \@stack unless @$ar;
hth,
--
John Porter
------------------------------
Date: Wed, 17 Jun 1998 18:35:13 GMT
From: joel@wmi0.wmi.com (Joel Coltoff)
Subject: Re: Array Combinations Question
Message-Id: <6m9287$nra@netaxs.com>
In article <6m8mve$h2h$1@nnrp1.dejanews.com>, <zucker@my-dejanews.com> wrote:
>
>how can I get all of the combinations of a dynamic multidiminsional array?
>
>$array[0][0] contains "hello"
>$array[0][1] contains "there"
>$array[1][0] contains "jupiter"
>$array[1][1] contains "saturn"
>$array[1][2] contains "mars"
>$array[2][0] contains "happy"
This sounds a lot like a question I asked earlier today. There
is already one answer but if you need them one at a time the
trick is in getting the index of the last element of each array.
$#array -- will give you 2 (array[2][x])
$#{$array[2]} -- will give you 0 (the x from above)
If there are no holes in the arrays then you should be able to do
this with nested for loops. The loops are what I'm trying to avoid.
--
Joel Coltoff
I'd explain it, but there's a lot of math. -- Calvin
------------------------------
Date: Wed, 17 Jun 1998 19:15:54 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: Benchmark module in Perl for Win32
Message-Id: <3588785A.6DF5@comenius.ms.mff.cuni.cz>
greene@gucc.org wrote:
>
> In article <35830F61.CB096B@stuttgart.netsurf.de>,
> Jochen Froehlich <jf@stuttgart.netsurf.de> wrote:
> >
> > Hi everyone,
> >
> > I tried to 'use Benchmark' with Perl for Win32 Build 316 on NT and
> > got the following message:
> > [-message snipped-]
> >
> > The question is:
> > How can 'Benchmark' be used with Perl for Win32 if 'times'
> > is not implemented there (as the error message indicates)?
> >
> > Hope you can help. Thanks in advance!
> >
>
> Go to www.perl.com and get
> Gurusamy Sarathy's distribution of Perl, version 5.004_02, which comes with
> Win32 support -- Includes binaries for several useful Perl Modules
>
> The 5.004 release offers several features over the ActiveWare 5.003, including
> the perldoc utility, and many more 'standard' modules including Benchmark.
>
> HTH,
> JAGreene
And if you have something that requires the AS port, simply copy the
Benchmark.pm
from GS ports lib directory to the AS port's lib. Works for me.
You may even have both perl ports on one computer.
1. Do not install any of them into c:\perl
2. Set HKEY_LOCAL_MACHINE\SOFTWARE\ActiveWare\Perl5
PRIVLIB =
directories;with;your;modules;and;those;common;to;both;ports
3. Set the system variable PERL5LIB to the common directories only !
5. Rename one perl.exe to something else (eg. asperl.exe or gsperl.exe)
so that there is a way to distinguish the ports.
6. Add the bin directories of both ports to the PATH
4. Map the extensions as you like.
HTH, Jenda
------------------------------
Date: Wed, 17 Jun 1998 19:32:32 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: Copying files across NT servers
Message-Id: <35887C40.4313@comenius.ms.mff.cuni.cz>
nick_darby@my-dejanews.com wrote:
>
> I've got a file on one NT server that I want to copy to another server.
>
> I tried directing the output to the destination ie the code on 'machine 1' to
> get the file to 'machine 2' used UNC, with suitable values for machine2 and
> share_dir
> $FILE_DEST="////machine2//share_dir";
Ooops!?
You do not need to escape forward slashes.
$FILE_DEST="//machine2/share_dir";
> OPEN(DATA,">$FILE_DEST");
> ....
>
> When this didn't work, I tried to use the system command to copy the file
> from one server to another. I could COPY within the machine1, and I could do
> a range of other os commands (such as 'net use' to set up a network drive to
> machine2) but it would not copy a file from machine1 to machine2.
I'm pretty sure copy doesn't understand forward slashes. Always use
backward slashes
when passing filenames to windows/dos programs.
system('copy \\\\machine1\\share_dir\\file.txt
\\\\machine2\\share_dir\\file.txt')
> Any suggestions gratefully received.
>
There are modules for copying files.
1.
use File::Copy; # part of standard distribution
copy "\\\\machine1\\share_dir\\file.txt",
"\\\\machine2\\share_dir\\file.txt";
2.
use Win32::FileOp; # http://www.fmi.cz/private/Jenda/
Copy "\\\\machine1\\share_dir\\file.txt",
"\\\\machine2\\share_dir\\file.txt";
# # or
# CopyConfirm "\\\\machine1\\share_dir\\file.txt",
"\\\\machine2\\share_dir\\file.txt";
# # this one will ask you before it replaces a file and it will give
you a progress
# # dialog.
# # you may copy whole directories and use wildcards with this module.
I'm sure there are some other modules as well, but I do not remember
them.
HTH, Jenda
------------------------------
Date: 17 Jun 1998 13:04:12 -0500
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Copying files in perl across NT servers
Message-Id: <6m90es$r8g@fohnix.metronet.com>
nick_darby@my-dejanews.com writes:
) I've got a file on one NT server that I want to copy to another server.
)
) I tried directing the output to the destination ie the code on 'machine 1' to
) get the file to 'machine 2' used UNC, with suitable values for machine2 and
) share_dir
) $FILE_DEST="////machine2//share_dir";
) OPEN(DATA,">$FILE_DEST");
Since you didn't show any other code, I'l only comment on the above.
You want:
$FILE_DEST= "\\\\machine2\\share_dir\\path";
or
$FILE_DEST= "//machine2/share_dir/path";
then
open(DATA,">$FILE_DEST") or die "Can't write $FILE_DEST: $!\n";
The first one above is more versatile as passing the second
one to external commands often won't work because too many
external commands only allow backslash (\) as a directory
separator, thinking slash (/) is for options.
I added "\\path" or "/path" to the end because you can't write
directly to a shared directory, only to files within it.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: 17 Jun 1998 16:51:00 GMT
From: scott@softbase.com
Subject: Re: getting first letter of a string
Message-Id: <6m8s5k$hb3$3@mainsrv.main.nc.us>
Ritche Macalaguim (ritche@san.rr.com) wrote:
> How can I get the first letter of a string in Perl?
substr? Or is there more to the question than that?
Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.
------------------------------
Date: Wed, 17 Jun 1998 13:58:31 -0400
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Getting TEXTWIDTH from Perl
Message-Id: <1darfub.rmmy9bbqx6ifN@slip-32-100-246-94.ny.us.ibm.net>
Tim <tim@paco.net> wrote:
> Hi!
>
> Sorry for my english.
>
> You now that default 'Times' font used by browsers has different width
> of characters and string of ten 'I' much shorter than string of ten
> 'W'. The question is how to determine width of string to correctly fit
> it in table cell without wrap? Or I need to create array with
> approximate width of each char and then calculate width? Too slow, I
> think...
>
> Any ideas, please.
Don't try to do this. The font used by a web browser may not be Times,
may not be the size you expect, and the window width may not be the
same.
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: 17 Jun 1998 18:21:23 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: grep question
Message-Id: <eli$9806171421@qz.little-neck.ny.us>
In comp.lang.perl.misc, Tad McClellan <tadmc@flash.net> wrote:
> Eli the Bearded (*@qz.to) wrote:
> : chmod($input) unless you really want a \n in your search
> s/chmod/chomp/; # ...and they look alike too!
It was right in the sample code. perl -wx just doesn't work
well enough to deal with problems outside a single block of
sample code.
Elijah
------
maybe an iperlw a la ispell is needed
------------------------------
Date: 16 Jun 1998 14:31:58 GMT
From: ThB.com@t-online.de (Thomas Berger)
Subject: Re: HELP : Socket Problems with NT 4 Perl
Message-Id: <6m5vku$25a$1@news01.btx.dtag.de>
On Tue, 16 Jun 1998 12:23:16 +0100, "Anthony farrow"
<a.n.farrow@cranfield.ac.uk> wrote:
>It works fine on version 5.001, but if I use the latest perl version
>5.003_07 from www.activestate.com it does not work!!
A quick and dirty fix would be as follows:
The client has to flush the socket FH before closing it.
(this is done automatically by the standard port but not
by the ActiveState port)
But you really should consider to cleanup your code
(as it does not run under the standard port)
e.g. client:
use Socket;
socket(SOCKET, PF_INET, SOCK_STREAM, IPPROTO_TCP)
|| die ("socket".$!+0.0);
>#Remote Port
>$port = 2345;
>#remote address
$remote = pack("C4", 238, 250, 24, 103)
$serv_addr = pack("S n a4 x8", PF_INET, $port, $remote);
# or much better yet (but not for your port):
# $thataddr="238.250.24.103";
# $serv_addr = sockaddr_in($port, inet_aton($thataddr));
# why does everybody want to 'bind' the client side of a tcp-socket?
connect(SOCKET, $conn) || die "connect...";
>print SOCKET "ccaf;test1;Test Account;\\\\ccanf\\ccanf;CCC Staff";
# flush now
my $savefh = select(SOCKET); $|=1; print ''; select $savefh;
>close (SOCKET);
and so forth.
HTH
Thomas Berger
Thomas Berger
------------------------------
Date: 17 Jun 1998 17:04:19 GMT
From: due@murray.fordham.edu (Allan M. Due)
Subject: Re: htpasswd in perl?
Message-Id: <6m8suj$op1$0@206.165.146.16>
In article <diverdi-1706980940200001@algae2.verinet.com>, Joseph A.
DiVerdi, Ph.D. (diverdi@XTRsystems.com) posted...
|In article <8clnqwgmx2.fsf@gadget.cscaper.com>, Randal Schwartz
|<merlyn@stonehenge.com> wrote:
|
|> Need help with a script I am working on that will create
|> passwords the same as htpasswd executable.
|
|Randal,
|
|Here is a complete code snippit that shows you how to do it and actually
|works. The script is executed as follows:
[snip the code]
Hmm, do you think Dr. DiVerdi believes that Randal does not know how to
write a password script that "actually works", or do you suppose that
the misattribution of the original question to suggest that Randal made
the request was so that the author could show his children a post to
c.l.p.m in which it appears that the good Dr. was able to answer a Perl
question for the Randal L. Schwartz. Could just be an honest mistake I
suppose.
One should be careful in such instances.
--
Allan M. Due, Ph.D.
Due@Murray.Fordham.edu
The beginning of wisdom is the definitions of terms.
- Socrates
------------------------------
Date: Wed, 17 Jun 1998 16:16:10 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: I need a simple scrip that...
Message-Id: <EupEIy.37q@mail2.ccs.bbk.ac.uk>
Dear Andy,
We use two, a weekly and a daily summary. The URL for the
daily one is http://netpressence.com/accesswatch/.
Regards,
Mick
------------------------------
Date: Wed, 17 Jun 1998 13:28:23 GMT
From: "Corey Parsons" <coreyp@rc.gc.ca>
Subject: IPC Piping Error
Message-Id: <Eup6s4.D9L@rc.gc.ca>
A couple of people at work (including myself) have been getting the
following error:
[Wed Jun 17 09:14:37 1998] httpd: could not create IPC pipe
We're not using any pipes (to our knowledge). The only changes we've made is
a 'require' statement for a module that we wrote...the module just grabs the
IP from the user and does a comparison against several IP's stored in a
local array.
Are there any special 'formatting' issues asscoiated with modules that would
create an error like this? The module we're includng (using require) just
contains two simple subs and a return statement. Are we missing something?
Does anyone have any insight?
Thanx
Christy and Corey (two lost Perl Newbies)
------------------------------
Date: 17 Jun 1998 12:53:22 -0500
From: tye@fohnix.metronet.com (Tye McQueen)
Subject: Re: Multiple $ENV{PATH} entries on Win NT
Message-Id: <6m8vqi$oeu@fohnix.metronet.com>
) > >> Anybody knows how to add more than one? I am on NT Server 4.0, using
) > >> ActiveWare's Perl for Windows, Build 315.
) > lr@hpl.hp.com says...
) > LR>
) > LR>Use semicolon. Surprise!!!
) >
) In article <6lp4ja$1v$1@gte1.gte.net>, ehp@gte.net says...
) > Perhaps more precisely, use the $^O variable to test for the OS and if it
) > contains "Win32", use a semicolon, else use the colon (simply assuming unix
) > platform if not a Win32 platform).
In part, lr@hpl.hp.com (Larry Rosler) writes:
) If you're going to respond "Perhaps more precisely", you might as well be
) precise, or at least correct.
) perl -we "print $^O, qq{\n}"
) produces
) Windows_NT
) Windows_95
Even better:
#!/usr/bin/perl -w
use Config;
print qq<Use "$Config{path_sep}" to separate directories in the PATH.\n";
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: 17 Jun 1998 18:50:20 GMT
From: info@adventia.com (Adventia)
Subject: NEW: E-Data (E-mail Directory Management Tool)
Message-Id: <6m935c$3nae$1@newssvr04-int.news.prodigy.com>
--------
E-DATA 1.2
For all users and programmers interested in Perl programs,
there is a new web site, Adventia Software (www.adventia.com),
which is developing a series of Perl applications as well as ASP components that can be useful.
The newest one is the E-Data 1.2. E-Data is an e-mail directory written in Perl that allows you to enhance your web site by letting visitors add their personal information (e.g. name, e-mail, hobbies or activities, web address, etc.) to a directory.
E-Data 1.2 has the following features:
1.Easy search by first name, last name or e-mail
2.Entries alphabetically indexed
3.Users can update their own information
4.Easy customization of interface (HTML)
E-Data 1.2 can be found at http://www.adventia.com/e-data.htm
For a Live Demo please go to http://www.adventia.com/cgi-bin/dir.pl
Feedback regarding this product is very welcome at info@adventia.com.
Thanks,
Adventia
http://www.adventia.com
------------------------------
Date: 17 Jun 1998 10:34:31 -0700
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: perl -w diagnostic misses something it should have warned about
Message-Id: <lbemwo3paw.fsf@kelp.usc.edu>
This only warns that $c was used only once. It says nothing about $a,
regardless of if $a if defined before or after $c.
#!/usr/local/bin/perl -w
@vs=qw(a b c d);
sub print_if_defined {
foreach $var (@_) {
if ($$var) {print "$$var $var ";}
}
}
$a=12;
$c=16;
print_if_defined(@vs);
--
Terrence Brannon * brannon@lnc.usc.edu * http://lnc.usc.edu/~brannon
USC, HNB, 3614 Watt Way, Los Angeles, CA 90089-2520 * (213) 740-3397
Vi is a *VI*le, de*VI*lish, de*VI*ce. C-u 5000000 M-x all-hail-emacs
------------------------------
Date: 17 Jun 1998 18:36:18 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: perl -w diagnostic misses something it should have warned about
Message-Id: <6m92b2$he7@news-central.tiac.net>
In article <lbemwo3paw.fsf@kelp.usc.edu>,
Terrence Brannon <brannon@lnc.usc.edu> wrote:
>This only warns that $c was used only once. It says nothing about $a,
>regardless of if $a if defined before or after $c.
This will also only warn about $c:
#!/usr/local/bin/perl -w
$a = 'a';
$b = 'b';
$c = 'c';
__END__
$a and $b are "special" in that they are the names used by sort routines
so they're not grumbled about. That means
#!/usr/local/bin/perl -w
@sorted = sort {$a <=> $b} (1, 2, 4, 3);
__END__
will only grumble about @sorted which is considered a feature.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@colltech.com | Collective Technologies (work)
------------------------------
Date: Wed, 17 Jun 1998 09:40:03 -0700
From: Jim Bowlin <bowlin@sirius.com>
To: edgar@sbrt.com
Subject: Re: Perl CGI NT 4.0 follow up
Message-Id: <3587F163.2B4D3012@sirius.com>
Edgar wrote:
>
> This is a follow up of my yesterday's posting.
> If any one is experiencing something of the sort or anyone knows how to
> fix the problem please help.
>
> Problem:
>
> When a form calls a perl script in a directory where the scripts reside,
> the script that gets executed is ALWAIS the first one on the directory.
> That happens no matter what script name the form requires.
>
> Setup:
> Win NT 4.0 running IIS
> Perl version 5.004
>
> I have executed the self extracting perl .exe under InetPub\scripts\perl
>
> Then modified the Win NT registry as explained on the IIS documentation
> to make the .pl extension recognizable for the CGI interface and so on.
>
> Real directory structure as follows:
>
> dat
> web
> rx3 -> read permissions
> cgi-loc ->execute permissions
> program1.pl
> program2.pl
> program3.pl
> dir 1
> dir 2
> secure
> form1.htm
>
> Then rx3 is set also as a virtual directory with read permissions, and
> cgi-loc is set as virtual directory cgi-local with execute permissions.
>
> I have enabled the "examine directories" box on IIS so that one can get
> to rx3 and traverse down.
>
> Procedure:
> I open with Netscape 4.02 from1.htm under directory secure, fill it up
> and click send, which uses the post method to call program1.pl
> The post call in the form1.htm goes like this:
> http://server1/cgi-local/program1.pl
>
> The script runs fine and produces output. (Note: sever1 is the ineternet
> domain name, the machine is not currently connected to the internet. If
> I just say http://server1 the browser brings me the default IIS home
> page, meaning it is recognizing server1 as the internet domain.)
>
> When I go to the form1.htm and change the post request to call let's say
> program2.pl it just keeps executing program1.pl
> Furthermore if I change the call to http://server1/cgi-local/anything.pl
> it STILL OUTPUTS the stuff from program1.pl
> Now next step:
> If I rename program3.pl to aa.pl and submit the form, I get the output
> from program3.pl
> My conclusion: I am always getting the output from the first program in
> the cgi-local virtual directory, meaning the first in the ascending sort
> order by name.
>
> Please can I get a procedure to fix this ?
>
> Thanks, best regards.
>
> Edgar.
Edgar, This really does not sound like a Perl question to me.
This sounds very much like an IIS question. 100% of your problem
is with your web server and 0% of your problem is with Perl.
If you use a different web server, this problem will go away.
If you want help fixing IIS, either contact M$ directly or post
this question in a group that deals with IIS.
-- Jim Bowlin
------------------------------
Date: 17 Jun 1998 16:52:41 GMT
From: scott@softbase.com
Subject: Re: Perl shell scripts in IIS 4.0
Message-Id: <6m8s8p$hb3$4@mainsrv.main.nc.us>
gfarris@my-dejanews.com wrote:
> I can successfully execute a Perl script through IIS. However, I seem to be
> unable to return the results of a shell command.
I have the same problem. I want to run a Java application from
a Perl CGI wrapper, and nothing happens. The same program works
great from the command line. Hmmmm... beats me.
> If anyone has seen this before, I'd appreciate any help.
I've *seen* it, I just can't help. I'm looking into converting
my Java deal into a servlet to get around this. Might be a little
faster, too. :)
Scott
--
Look at Softbase Systems' client/server tools, www.softbase.com
Check out the Essential 97 package for Windows 95 www.skwc.com/essent
All my other cool web pages are available from that site too!
My demo tape, artwork, poetry, The Windows 95 Book FAQ, and more.
------------------------------
Date: 17 Jun 1998 08:32:36 -0700
From: murrayb@vansel.alcatel.com (Brad Murray)
Subject: Re: Pod::Text -- Unix only?
Message-Id: <6m8nik$es7@cadre2.vansel.alcatel.com>
It seems Tom Christiansen suggested...
>Portable doesn't mean "runs on a Mac". I code for corss-platform
>use. That means my code works on Linux, BSD, SunOS, *and* Solaris
>-- and probably any other profession/open/POSIX/Unix-like system.
>If you want more than that, you'll have to write the program yourself.
Maybe it should mean "runs on a Mac" or anything else for that matter. That's
what I call portability and that is, in fact, one of the huge advantages of
using Perl in the workplace: it's possible to write truly cross-platform
code, which gives you a great deal of freedom. It allows me, for example,
to build tools on any workstation in the office and have a reasonably good
chance of having them work unmodified on any other station. This in turn
gives many unanticipated returns when people use the tools in places that
the tools were not intended to run. And that's good value in tool production.
I grant that you're not interested in re-inventing wheels unnecessarily, but
sometimes you *do* have to carve a wheel when you're stuck some place that
has never heard of such a thing. Perl solves this without getting into
religious wars regarding operating environments. I'm not talking about
having a solid tool set here---we both understand that the Unix tool set
is available for most any platform---but rather about assuming bahviour of
internals and shells (fork, for example---still don't really understand why
it doesn't work in the NT port---and complex multiple redirection as per
bourne or c shell command lines) which may be less plausible to use in some
environments.
I would be keen to see what kinds of tools you can put together that are
truly cross-platform and not just multi-unix, Tom. I think you would solve
a lot more problems than you do now, thus further improving Perl's image
and, incidentally, making me look good in the office. :) If Perl looks
better and better, so do I---I advocate its usage nearly everywhere.
And fortunately Perl runs pretty much everywhere. I think it's good
form to write code that runs everywhere Perl does.
[BTW, I write scripts that run without modification under Win32, OS/2, Linux,
SunOS, Solaris, HP/UX, and NetBSD. I have no Macs to attempt further
generality, but I wouldn't mind trying.]
--
Brad Murray "The fall of modern man will be preceded by the
Software Analyst de-evolution of communications to the days of
Alcatel Canada oral tradition." --Tom Christiansen paraphrased
------------------------------
Date: 17 Jun 1998 18:41:44 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: Problems with newlines in perl regexp
Message-Id: <eli$9806171426@qz.little-neck.ny.us>
In comp.lang.perl.misc, Jan Inge Dalsbx <dalsboji@sjo.statkart.no> wrote:
> print "This is my \"file\":\n";
ARGH!
print qq/This is my "file":\n/;
The quoting operators are your friends.
> /123\n/; # search for "123\n" in $_
>
> $pre = $PREMATCH; # keep matching variables BEFORE next regexp
> $m = $MATCH;
> $post = $POSTMATCH;
Parens are more efficient:
($pre, $m, $post) = /(.*) (123\n) (.*)/sx;
/s . matches \n
/x ignore whitespace (for readablity)
> # seach for zero to 1 line at the end of $pre
> $pre =~ /(.*?\n){0,$lines}$/;
I think you want
$pre =~ /( # grabbing parens
(?: # grouping parens
[^\n]*\n # pattern
){0,$lines} # count of group
) # all captured
$ # anchor
/x; # /x ignore whitespace and comments
Your code is a bit difficult to read, by the way.
Elijah
------
and found it worse so since he is not used to 'use English';
------------------------------
Date: Wed, 17 Jun 1998 16:06:13 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Reading the values, not the characters
Message-Id: <3587EB37.10F4@min.net>
Petri Oksanen wrote:
>
> I want to know the value of a byte, not the ascii character it
> represents.
perldoc -f ord
--
John Porter
------------------------------
Date: 17 Jun 1998 16:19:28 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Reading the values, not the characters
Message-Id: <6m8qag$2pe$1@ns1.arlut.utexas.edu>
smcdow@arlut.utexas.edu (Stuart McDow) writes:
>
> $foo = 'a';
> printf("Char: %s\nDec: %d\n", $foo, ord($foo));
probably better experessed as
$foo = ord('a');
printf("Char: %c\nDec: %d\n", $foo, $foo);
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: 17 Jun 1998 16:17:14 GMT
From: smcdow@arlut.utexas.edu (Stuart McDow)
Subject: Re: Reading the values, not the characters
Message-Id: <6m8q6a$26q$1@ns1.arlut.utexas.edu>
Petri Oksanen <p3_oksanen@hotmail.com> writes:
>
> $foo = 'a';
> printf("Char: %s\nDec: %d\n", $foo, $foo);
perldoc -f ord
perldoc -f chr
$foo = 'a';
printf("Char: %s\nDec: %d\n", $foo, ord($foo));
--
Stuart McDow Applied Research Laboratories
smcdow@arlut.utexas.edu The University of Texas at Austin
"Look for beauty in roughness, unpolishedness"
------------------------------
Date: Wed, 17 Jun 1998 16:10:17 GMT
From: mick@picus.dcs.bbk.ac.uk (Mick Farmer)
Subject: Re: Sending mail, can I set the $from ?
Message-Id: <EupE95.31p@mail2.ccs.bbk.ac.uk>
Dear Chris,
Check which version of mail you're using. BSD-style mail
supports the -s option, but System V mailers don't.
Regards,
Mick
------------------------------
Date: 17 Jun 1998 18:50:49 GMT
From: Eli the Bearded <*@qz.to>
Subject: Re: SMTP blocking detection script comments requested.
Message-Id: <eli$9806171443@qz.little-neck.ny.us>
In comp.lang.perl.misc, gk <5@mail.com> wrote:
> it then telnets to port 25 of mailexchanger.domain.com
> tries to send an email from user@domainwhichmaybebeingblocked.com
> if it receives a 250 code (dunno if 'Sender ok' is universal), then that
> means, i *hope* that domain.com is not blocking mail from
> domainwhichmaybebeingblocked.com...
>
> Is my idea flawed? Am I not accounting for something? Below is my code
> which works the way I described above *crosses fingers*:
Flawed in the comp.mail.misc sense that you may not get the error
until after you also specify a recipient (which should be local
to that machine, try "postmaster"). Some MTAs deal very poorly
with getting errors on the MAIL FROM line and so delaying bouncing
based on that is best left until after the RCPT TO line. Also
some MTAs can have different restrictions for different users,
so this will complicate matters.
As for your perl code, use a line anchor in that test for status
lest you get confused by a
551 We don't want your stinking 250,000 letters.
Elijah
------
then there are always the ones that return the error after the '.'
------------------------------
Date: Wed, 17 Jun 1998 20:16:24 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: SQL Server and Win 32 ODBC Problem
Message-Id: <35888688.6C85@comenius.ms.mff.cuni.cz>
vinod@surya.rws.soft.net wrote:
>
> Hi, I installed Perl for win 32 from www.activeware.com (build 316). Then I
> copied the ODBC.pll file to lib\auto\win32\odbc\odbc.pll (which I got from
> Roth.net) but I can't seem to be able to run the test.pl which comes along
> with it. I get an error called "error:parse exception". According to
> instructions this error occurs only when Perl for Win 32 and ODBC.pll are not
> compatible. I think what I have done so far is correct, but then I can't
> seem to run this test.pl. Have I left out some thing? My other cgi programs
> are working fine. I'm using Windows 95. I need to establish connectivity to
> a remote database using ODBC (for accepting inputs through a web page and
> then storing it in a RDBMS). Any suggestions for this, other than IDC. Any
> help regarding would be greatly appreciated. I'm new to perl, so please make
> it as detailed as possible.
>
> Bye
>
> Vinod
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
You didn't copy the correct version of ODBC.pll for you build.
If I remember well there is a directory beta/ in the archive. Use the
.pll
from that directory. I'm pretty sure it' mentioned somewhere in the
readme.
Jenda
------------------------------
Date: Wed, 17 Jun 1998 17:43:56 GMT
From: jabrah15@my-dejanews.com
Subject: Re: strange error message .. "value of <handle> ..."
Message-Id: <6m8v8s$ts2$1@nnrp1.dejanews.com>
1. the error message "Value of <HANDLE> construct can be 0" means that
a filehandle could return the value "O" if that was a line in the file
you were reading, which would not constitute the EOF.
2. The line number I don't understand
3. The program runs from the command line but fails as cgi because the
stderr needs to be redirected to stdout -- cgi scripts can't send output
to STDERR, as the web server by default doesn't connect anything to it.
Redirect your STDERR to the browser instead with:
<pre>
use CGI::Carp;
use CGI::Carp qw(fatalsToBrowser);
</pre>
(You need the CGI modules installed);
or at the top of the file, put
$SIG{__WARN__} = {print STDOUT "Warning: $_[0]\n"}
$SIG{__DIE__} = {print STDOUT "Script died with $_[0]\n"
make sure that you've output the content type line first.
See Brian Foy's excellent "Dieing on the Web" in the latest Perl
Journal.
Please let me know if this helps.
Jim Abraham
In article <byronj-1506981301410001@t-man.nd.edu.au>,
byronj@nd.edu.au (Byron Jones) wrote:
>
> greetings
>
> (please cc any replies to my email address as i don't check this group
> frequently)
>
> i'm writing a perl program (suprise suprise) however when i run it i get :
>
> Value of <HANDLE> construct can be "0"; test with defined() at
> ./print.cgi line 65535.
>
> strange thing is, there's only 52 lines of code. the only 2 places where
> i'm reading from a file i've written as
>
> while (<HANDLE>)
>
> and i don't have a variable called "HANDLE".
>
> the program still runs with the above warning message, however as it's a
> cgi-based program it fails when i try to access it via the web.
>
> the source is at
>
> http://www.nd.edu.au/perl/print.pl
>
> (can you tell i'm still learning perl).
>
> | "Twitchy as a two legged : Byron Jones |
> || whippet." : Communications Manager ||
> || byronj@nd.edu.au : Notre Dame University ||
> | http://www.nd.edu.au/byronj/ : Fremantle, Australia |
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 17 Jun 1998 17:27:45 GMT
From: oliverg@primesourcebp.com
Subject: Symlink and Link
Message-Id: <6m8uag$s9d$1@nnrp1.dejanews.com>
Problem: symlink command in perl works, but error on open after link is
created.
Syntax:
$config_file = "/home/greo98/qconfig";
$original_config_file = "/home/greo98/qconfig.original.$todaydate";
$created_config_file = "/home/greo98/qconfig.new.$todaydate";
$config_file_test = "/home/greo98/qconfig.whatever";
sub LinkQueueFile {
symlink ($created_config_file, $config_file_test) or die "error";
}
Dir List: -rwxr-xr-x 1 greo98 staff 2316 Jun 17 12:21 qconfig -rw-r--r--
1 greo98 staff 2463 Jun 17 12:21 qconfig.new.06-17-98 -rw-r--r-- 1 greo98
staff 2316 Jun 17 12:21 qconfig.original.06-17-98 lrwxrwxrwx 1 root system
34 Jun 17 12:21 qconfig.whatever -> /home/greo98/qconfig.new.06-17-98
Problem: When I try to open the file I get this:
356 root primeg30 /home/greo98 >cat qconfig.whatever
cat: 0652-050 Cannot open qconfig.whatever.
The link exists though.. Linking from the commandline works just fine
though.. It has smething to do with the absolute paths in the variables
because if I just do a simple symlink(), with files in current directory, it
works fine.. Problem is, I have to have absolute pathnames for the script..
Any ideas?
Thanks,
Greg Oliver
oliverg@primesourcebp.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 17 Jun 1998 09:19:26 -0700
From: Margaret Peacock <peacockm@nortel.ca>
Subject: turning off caching with cgi.pm
Message-Id: <3587EC8E.33DD@nortel.ca>
Can I turn off the caching of a cgi script that is written in cgi.pm? I
realize that the script should not be caching, but on PCs it seems to be
loading up the form side of the script in cache... which is a problem
because it is supposed to read a cookie to generate parts of itself. Can
anyone help? Please send me email.. thanks.
peacockm@nortel.com
-Margaret
------------------------------
Date: Wed, 17 Jun 1998 20:28:10 -0700
From: Jan Krynicky <JKRY3025@comenius.ms.mff.cuni.cz>
Subject: Re: Windows NT, how to copy binary files !
Message-Id: <3588894A.FFB@comenius.ms.mff.cuni.cz>
Jahan K. Jamshidi wrote:
>
> I know how to read a ascii file using perl and write it out somewhere else. I
> have problem reading a binary file and write out to a new location (kind of
> like copying the an executable program to a new locaiton). Does perl support
> this function? Any help is greatly appriciated.
>
> Thanks in advance
>
> - J
If you realy only want to copy the file you may use either File::Copy
(standard distribution)
or Win32::FileOp ( http://www.fmi.cz/private/Jenda ). See included docs.
Otherwise
binmode THE_HANDLE;
(read perlfunc manpage)
Jenda
------------------------------
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 2893
**************************************