[8487] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2104 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 15 19:07:28 1998

Date: Sun, 15 Mar 98 16:00:29 -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           Sun, 15 Mar 1998     Volume: 8 Number: 2104

Today's topics:
        ?Occasional perl runtime exception. Why? <nospam.shardy@seanet.com>
    Re: Cross product (Robert F. Harrison)
    Re: Cross product <uri@sysarch.com>
    Re: Cross product <kapur@cbl.ncsu.edu>
        elsif question <doug@ccinet.com>
    Re: elsif question (Mike Heins)
    Re: File::Find and -w (Martin Vorlaender)
    Re: Getting Remote File Size <chasecreek.systemhouse@usa.net>
    Re: How to print a text file? (Andrew M. Langmead)
    Re: In the news .... (Andrew M. Langmead)
    Re: Is there a "Newsgroup" for Newbies to Perl? (Martin Vorlaender)
    Re: Large programs: is Perl up to it? (Mike Heins)
    Re: Large programs: is Perl up to it? <chasecreek.systemhouse@usa.net>
        Multiple substitues dfrench@aig.vialink.com
        New to Perl/TK (John)
    Re: New to Perl/TK <chasecreek.systemhouse@usa.net>
    Re: NT option pack 4 (Andrew M. Langmead)
        Perl and Windows NT question <ecs@talstar.com>
    Re: Perl and Windows NT question <chasecreek.systemhouse@usa.net>
    Re: Reading excel files under Unix (Peter G. Martin)
        Redirect according to refferer (Peter)
    Re: Redirect according to refferer <chasecreek.systemhouse@usa.net>
    Re: Sets (collections) in Perl (Robert F. Harrison)
    Re: System ? (Martin Vorlaender)
    Re: tainted glob confusion (Greg Bacon)
    Re: Weird? problems with perldoc (Andrew M. Langmead)
    Re: You have 1 message(s) - how to print plurals? (Damian Conway)
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 15 Mar 1998 12:46:14 -0800
From: "Steve Hardy" <nospam.shardy@seanet.com>
Subject: ?Occasional perl runtime exception. Why?
Message-Id: <6eheoa$9a@q.seanet.com>

The following is part of a script that runs on about 30 workstations. On two
of those systems, i consistently see a runtime exception (perl writes
"runtime exception" and then aborts). The death blow seems to be happening
in the following (findtime) function, but i don't see why.

Can anyone shed any light on what might be wrong with the following?  (note,
in case it matters, i'm running perl version 5.003_07 build 310 on NT 4)

the function gets invoked as follows:

my @timechk;
my $i = 0;
# check system clock synchronization
@timechk = `echo N|net time \\\\$server /set 2>nul`;
$servertime = findtime(\@timechk, \$i);
$localtime = findtime(\@timechk, \$i);
if ( $servertime ne $localtime )
 ...

general comments on improvements to this function implemention are also
welcome. I'm no perl expert.

thanks.

steve
shardy@seanet.com

########################################
# findtime: find timestamp in output of NET TIME command
#   which has the form:
#
#> Current time at \\steveh_home is 3/15/98 11:52 AM
#>
#> The current local clock is 3/15/98 11:52 AM
#> Do you want to set the local computer's time to match the
#> time at \\steveh_home? (Y/N) [Y]:
########################################
sub findtime
    {
    #ptimechk references an array that holds the output from NET TIME
    #pndx is reference to the index into the timechk array
    my ($ptimechk, $pndx) = @_;
    my $i;
    my $mytime;
    for ($i=$$pndx; $i<scalar(@$ptimechk); $i++)
        {
        if (@$ptimechk[$i] =~ m/ is /)
            {
            #print " "; #uncomment this to make exception go away...

            #trim all up to and including (" is ")
            @$ptimechk[$i] =~ s/ is /~/;
            @$ptimechk[$i] =~ s![^~]*~(.*)!$1!;

            @$ptimechk[$i] =~ s!\r!!; # lose garbage output from NET TIME
            $mytime = @$ptimechk[$i];
            chomp $mytime;
            $$pndx = $i;
            return $mytime;
            }
        }
    return 0;
    }





------------------------------

Date: 15 Mar 98 21:17:40 GMT
From: harrison@pixi.com (Robert F. Harrison)
Subject: Re: Cross product
Message-Id: <slrn6gohan.emh.harrison@localhost.localdomain>

On 15 Mar 1998 20:35:17 GMT, Jack Applin <neutron@fc.hp.com> wrote:
> I've written a routine to calculate the cross product of two arrays
> (that is, (a,b) x (c,d) is (ac,ad,bc,bd)).  I don't like how I've done it.
> Can anybody suggest a snazzier implementation?  Perhaps something using
> nested maps could be done.

Math::MatrixReal on CPAN?  Look on http://www.perl.com/

It works like a charm and allowed me to impress the hell out of a
friend of mine in no time at all. ;-)

-- 
rfh harrison@pixi.com



------------------------------

Date: 15 Mar 1998 16:42:26 -0500
From: Uri Guttman <uri@sysarch.com>
To: neutron@fc.hp.com (Jack Applin)
Subject: Re: Cross product
Message-Id: <x7btv7ljgd.fsf@sysarch.com>

neutron@fc.hp.com (Jack Applin) writes:

> I've written a routine to calculate the cross product of two arrays
> (that is, (a,b) x (c,d) is (ac,ad,bc,bd)).  I don't like how I've done it.
> Can anybody suggest a snazzier implementation?  Perhaps something using
> nested maps could be done.
> 
> #! /bin/perl -wl
> 
> @c = cross(['a','b'], [1,2,3]);
> 
> sub cross($$) {
> 	my $aref = shift;
> 	my $bref = shift;
> 	my @result = ();
> 
> 	for my $a (@$aref) {
> 		for my $b (@$bref) {
> 			push @result, $a.$b;
> 		}
> 	}

	my $b ;

	@result = map { $a = $_ ; map{ "$a$_" } @$bref } @$aref ;


> 	return @result;
> }


uri


-- 
Uri Guttman                     SYStems ARCHitecture and Software Engineering
uri@sysarch.com                                          Have Perl, Will Hack
http://www.sysarch.com                (781) 643-7504 x*2  FAX: (781) 643-2710
Try the Best Search Engine on the Net -------->  http://www.northernlight.com


------------------------------

Date: 15 Mar 1998 16:50:41 -0500
From: Nevin Kapur <kapur@cbl.ncsu.edu>
To: neutron@fc.hp.com
Subject: Re: Cross product
Message-Id: <ty7m5vhbda.fsf@cbl.ncsu.edu>

I don't know how efficient this is, but it does the job:

sub cross{
  map {split} map{ $_.join " $_", @{$_[1]}} @{$_[0]};
}

-Nevin

[posted and mailed]

neutron@fc.hp.com (Jack Applin) writes:

> I've written a routine to calculate the cross product of two arrays
> (that is, (a,b) x (c,d) is (ac,ad,bc,bd)).  I don't like how I've done it.
> Can anybody suggest a snazzier implementation?  Perhaps something using
> nested maps could be done.
> 
[snip]
> 
> #! /bin/perl -wl
> 
> @c = cross(['a','b'], [1,2,3]);
> 
> print "cross product is @c";
> # Expected: a1 a2 a3 b1 b2 b3
> 
> sub cross($$) {
> 	my $aref = shift;
> 	my $bref = shift;
> 	my @result = ();
> 
> 	for my $a (@$aref) {
> 		for my $b (@$bref) {
> 			push @result, $a.$b;
> 		}
> 	}
> 	return @result;
> }


------------------------------

Date: Sun, 15 Mar 1998 14:50:49 -0800
From: "Doug Evans" <doug@ccinet.com>
Subject: elsif question
Message-Id: <350c5b6d.0@katana.randori.com>

I am using ActiveState, on an NT 4.0 work station. I am all the way up to
p.16 of "Learning Perl on Win32 Sytems". Why can't I get elsif to work, but
can make...

else
if

 ...work?

I recognize that the authors say it won't work on in all programming
languages, but shouldn't work in my case?

Thganks,
Doug





------------------------------

Date: 15 Mar 98 22:57:56 GMT
From: mikeh@minivend.com (Mike Heins)
Subject: Re: elsif question
Message-Id: <350c5cf4.0@news.one.net>

Doug Evans <doug@ccinet.com> wrote:
> I am using ActiveState, on an NT 4.0 work station. I am all the way up to
> p.16 of "Learning Perl on Win32 Sytems". Why can't I get elsif to work, but
> can make...

> else
> if

> ...work?

Without a code example, I am pretty sure there is nothing anyone
can do for you. I personally am not a mindreader.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
"The U.S. Senate -- white           131 Willow Lane, Floor 2  | ||  _ \
male millionaires working           Oxford, OH  45056         | || |_) |
for YOU!" -- Dave Barry             <mikeh@minivend.com>     |___|  _ <
                                    513.523.7621 FAX 7501        |_| \_\


------------------------------

Date: Sun, 15 Mar 1998 21:32:30 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: File::Find and -w
Message-Id: <350c3ade.524144494f47414741@radiogaga.harz.de>

Kent E. Holsinger (kent@darwin.eeb.uconn.edu) wrote:
: >>>>> "Martin" == Martin Vorlaender <martin@RADIOGAGA.HARZ.DE> writes:
:     Martin> Doc not read error:
:     Martin>   File::Find assumes that you don't alter the $_ variable.
:     Martin>   If you do then make sure you return it to its original
:     Martin>   value before exiting your function.
:     Martin> Re-write the while(<FILE>) loop in mygrep().

: Sorry for being dense, but I'm not sure if I understand this comment
: correctly. (I did read the docs, but it appears that I did not fully
: understand them.

If you look into File::Find::finddir() (where the error occurs), you'll
see the reason for the above paragraph in the File::Find POD. There are
loops using $_ ("for (@filenames)") in which the wanted() routine is
called. Especially in the else case for loop it is crucial that wanted()
does not alter $_, as it is used further down the loop body.

: Am I correct in inferring that the problem is that the while (<FILE>)
: loop resets $_? Rewriting mygrep() as follows eliminates the warning,
: but I want to make sure that I understand why.

:    sub mygrep {
:        my $store = $_;
:        my ($pattern, $name) = @_;
:        open (FILE, "<$name") or die "Could not open $name for input: $!";
:        while ( <FILE> ) {
:            print "$name:$_" if /$pattern/oi;
:        }
:        close (FILE);
:        $_ = $store;
:    }

Yup, that's one way, although Jonathan Feinberg already pointed out that
localizing $_ will do the same with much less effort.

: I'd also appreciate comments on whether there's a way to avoid
: resetting $_ completely.  Thanks.

You can avoid using $_ completely by re-writing the while loop as

        my $line;
        while ( defined($line = <FILE>) ) {
            print "$name:$line" if $line =~ /$pattern/oi;
        }

cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


------------------------------

Date: Sun, 15 Mar 1998 22:33:50 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
To: Jesse Rosenberger <jesse@savalas.com>
Subject: Re: Getting Remote File Size
Message-Id: <350C55FF.8FCECCF6@usa.net>

Since I totally misunderstood this question (I thought Jesse was on the
server he wanted the image size info from, I went down the wrong path to
help answer it.)  But, since I did get a server version working, no since in
wasting the code; so here is a server version of getting the file size --
Any File size :)

Man, does this OPEN a BIG security hole :)
/^Enjoy$/;
Sneex :)

#!/usr/local/bin/perl -w

use CGI qw(:all);
use strict;
# use diagnostics; # Display all diagnostics in browser anyways...

print header; # In case there is an early error...
my $basedir = '/drv2/usr/ns-home/docs'; # Limit the damage area...
$_ = query_string() if query_string();
my $wFile =  /=/;
$wFile = $';

# Some cool CGI.pm stuff - a plug for Lincoln's CGI.pm Module :)
if (accept())          { print "<P>Browser MIME List: &nbsp;", accept() }
if (auth_type())       { print "<BR>Authentication Type: &nbsp;",
auth_type() }
if (raw_cookie())      { print "<BR>Raw Cookie: &nbsp;", raw_cookie() }
if (path_info())       { print "<BR>Path Info: &nbsp;", path_info() }
if (path_translated()) { print "<BR>Path Translated: &nbsp;",
path_translated() }
if (query_string())    { print "<BR>Query String: &nbsp;", query_string() }
if (referer())         { print "<BR>Referrer: &nbsp;", referer() }
if (remote_addr())     { print "<BR>Remote Addr: &nbsp;", remote_addr() }
if (remote_ident())    { print "<BR>Remote Ident: &nbsp;", remote_ident() }
if (remote_host())     { print "<BR>Remote Host: &nbsp;", remote_host() }
if (remote_user())     { print "<BR>Remote User: &nbsp;", remote_user() }
if (request_method())  { print "<BR>Request Method: &nbsp;",
request_method() }
if (script_name())     { print "<BR>Script Name: &nbsp;", script_name() }
if (server_name())     { print "<BR>Server Name: &nbsp;", server_name() }
if (server_software()) { print "<BR>Server Software: &nbsp;",
server_software() }
if (virtual_host())    { print "<BR>Virtual Host: &nbsp;", virtual_host() }
if (server_port())     { print "<BR>Server Port: &nbsp;", server_port() }
if (user_agent())      { print "<BR>User Agent: &nbsp;", user_agent() }
if (user_name())       { print "<BR>User Name: &nbsp;", user_name() }

print "<P>What you are looking for &nbsp;";
print $wFile;
print "<P>What I found: &nbsp;";

my $erc = system("find $basedir -name $wFile -print > /tmp/results") / 256;

if ($erc) {
 print "<P>An Error occurred $erc $! <BR>";
} else {
 open (inpFile, "/tmp/results") || die("<P>Can't open $! <BR>");
 while (<inpFile>) {
  chomp;
  $wFile =~ /^$basedir/;
  $wFile = $';
  print "<P>Found $_, with a size of ", (-s $_);
   # See if we can view it :)
  print "&nbsp;<img src=\"/$wFile\"></A><BR>";
 }
 close(inpFile);
}

exit;

# End of code...


Jesse Rosenberger wrote:

> How would you go about writing a perl script that would open a remote
> image (from a url: ex. http://www.yourdomain.com/myimage.gif) and and
> get a local perl script to get the file size (in bytes) and print it out
>
> to the browser?  If someone could provide an example of how to do
> this...it would be greatly appreciated.  Thanks in advance.
>
> Thanx,
> Jesse Rosenberger
> Webmaster - Savalas Productions, Inc.
> http://www.savalas.com
> webmaster@savalas.com





------------------------------

Date: Sun, 15 Mar 1998 22:11:52 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: How to print a text file?
Message-Id: <EpvsBt.834@world.std.com>

Rossen Mikhov <rossen@hikari-jhs.yamaguchi-u.ac.jp> writes:

>I would like to print a text file from a Perl script but all the
>variables to be interpolated. This is my script

Have you seen the section of the FAQ "How can I expand variables in
text strings?"

<URL:http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq4/
How_can_I_expand_variables_in_te.html>

You also might want to look at the Text::Template module:

<URL:http://reference.perl.com/module.cgi?Text::Template>



-- 
Andrew Langmead


------------------------------

Date: Sun, 15 Mar 1998 21:51:03 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: In the news ....
Message-Id: <EpvrD3.MD5@world.std.com>

"Steve Pacenka" <sp17@cornell.edu> writes:

>From an article today about the asteroid that was formerly scheduled to hit
>the Earth in a couple of decades:

I thought it was a great reason to stop worrying about the "year 2038"
problem.
-- 
Andrew Langmead


------------------------------

Date: Sun, 15 Mar 1998 21:45:39 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: Is there a "Newsgroup" for Newbies to Perl?
Message-Id: <350c3df3.524144494f47414741@radiogaga.harz.de>

Bob Gwynne (gwynne@utkux.utk.edu) wrote:
: 1. As Perl becomes more popular there will be more and more people who are
: new to the language and need help.
: 2. Because they arent familiar with the language, chances are they will
: logon to the newsgroup and venture to ask a question that has been asked
: many a time and oft. But they wont know that because they havent kept up
: with the postings.
: 3. They will get no answer at all, will get an arrogant answer, orif they
: ve posed the question to the satisfaction of the wizards, get an appropriate
: answer. However, its probable that they wont know how to pose the question
: because they dont know the rules, e.g., Newbie needs help matching words.

1. Most "people" aren't programmers, and if they are not willing to read,
   learn and experiment a lot (at home, that is), they will never be.
2. If "newbies" post questions to _any_ newsgroup without following it for
   at least a week or so, they should be taught some netiquette. So,
3. no or "arrogant" answers are quite in order, IMHO. If the newbies take
   some time trying to follow the newsgroup, they will catch up quickly,
   and some of their problems may even be solved by then. It's that "I have
   a problem, and I need help _immediately_" attitude that annoys "wizards"
   and/or UseNet oldsters.

cu,
  Martin
  (10 years into programming, and a newbie with respect to Perl)
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


------------------------------

Date: 15 Mar 98 20:58:54 GMT
From: mikeh@minivend.com (Mike Heins)
Subject: Re: Large programs: is Perl up to it?
Message-Id: <350c410e.0@news.one.net>

Jean-Louis Leroy <jll@skynet.be> wrote:
> I have been using Perl for two years now, but mostly as a text 
> cruncher. Recently I have began seriously exploring the rest o fthe 
> language (especially OO) and I'm impressed to see how 
> (mostly) everything falls in place.

I think it does too.

> Is it possible to write *large* apps in Perl? Hundreds of classes, 
> hundreds of screens, 10,000s lines of code? If not now, someday? Has 
> any of you actual experience with this?

I offer Minivend as a possible example. It runs as a server, so startup
time has no impact on its operation. It is in use on thousands of systems
worldwide, has over 25,000 lines of code -- many more if you count the use
it makes of standard library modules like MD5, Data::Dumper, DBI, and others.

It does use a fair amount of memory but not so much as to put it out
of range of most modern systems.

AFAIK, it is the largest freely-available Perl application out there.

-- 
Mike Heins                          http://www.minivend.com/  ___ 
                                    Internet Robotics        |_ _|____
There ain't nothin' in this world   131 Willow Lane, Floor 2  | ||  _ \
that's worth being a snot over.     Oxford, OH  45056         | || |_) |
--Larry Wall                        <mikeh@minivend.com>     |___|  _ <
                                    513.523.7621 FAX 7501        |_| \_\


------------------------------

Date: Sun, 15 Mar 1998 21:04:10 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
Subject: Re: Large programs: is Perl up to it?
Message-Id: <350C40FB.916C8204@usa.net>

Hello :)  I don't know about your other questions posted here, but
I can answer this one :)

I haven't written many Perl programs (only been writing it for a year,
and have distributed 20 production systems.)  The biggest of those
was my first one - a Human Resources system which keeps track
of available jobs posted for advertisement on the Internet.  It handled
everything as one singular script - Security, html, ftp, et al - and
was 1,650 lines long - OK OK it was only 600 lines, but I had
1,050 lines of comments explaining it in case no could figure
out what it did... (Namely me :)

But, my point is, now that I am one Perl year older I realize now
I could have done it in less than 100 lines and much less documentation.

I just finished a site analysis system which looks for every possible
BinHex file on a 30GB site mirror and verifies the Headers, data
attributes, etc and it - being my best work to date - comments and
all, was only 550 lines...

So, you see, most of use newbies here cannot imagine what you are
doing when it gets beyond 2,000 lines; much less 10,000...

/^My 2 Cents worth$/
Sneex :)


Jean-Louis Leroy wrote:

> Hello,
>
> I have been using Perl for two years now, but mostly as a text
> cruncher. Recently I have began seriously exploring the rest o fthe
> language (especially OO) and I'm impressed to see how
> (mostly) everything falls in place.
>
> Is it possible to write *large* apps in Perl? Hundreds of classes,
> hundreds of screens, 10,000s lines of code? If not now, someday? Has
> any of you actual experience with this?
>
> jl





------------------------------

Date: Sun, 15 Mar 1998 16:47:30 -0600
From: dfrench@aig.vialink.com
Subject: Multiple substitues
Message-Id: <6ehlmo$9t6$1@nnrp1.dejanews.com>

I would like to perform multiple substitues on a single line.  For instance
using "sed" the I can do the following:

sed -e "s/A/a/g;s/B/b/g;s/C/c/g" filename

The content of the substitutes above were just an example, but I would like to
do the same kind of thing in perl.  I would like to do multiple substitues in
a single command,  somthing like:

$result = s/A/a/ && s/B/b/ && s/C/c/;

does anybody know a way to do this?



Regards,

Dana French
dfrench@aig.vialink.com

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: Sun, 15 Mar 1998 23:46:05 GMT
From: tom@marcan-dist.com (John)
Subject: New to Perl/TK
Message-Id: <350c5a42.876250@next-1.fh-lueneburg.de>

My ISP doesnt have the comp.lang.perl.tk group so I have to ask my
question here....
  If I write a perl/tk gui script will people visiting my site see the
gui on their end, whether or not they are using a browser?

thanks for any help...


------------------------------

Date: Sun, 15 Mar 1998 23:50:21 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
To: John <tom@marcan-dist.com>
Subject: Re: New to Perl/TK
Message-Id: <350C67EE.A27D56C0@usa.net>

Mailed & Posted:
By 'visiting' you mean via the WWW?  Then, Nope.  They will need a TK
plug-in to see TK related content.  To see Perl/TK related content they
will need some form of client software, and no it doesn't have to be a
'browser' but it will have to know what to do with what it gets.

/^My 2 Cents$/;
Sneex :)


John wrote:

> My ISP doesnt have the comp.lang.perl.tk group so I have to ask my
> question here....
>   If I write a perl/tk gui script will people visiting my site see the
> gui on their end, whether or not they are using a browser?
>
> thanks for any help...





------------------------------

Date: Sun, 15 Mar 1998 21:35:49 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: NT option pack 4
Message-Id: <Epvqnp.F6u@world.std.com>

Bob Trieger <sowmaster@juicepigs.com> writes:

> I've been backwhacking all this time and I could have used regular
>slashes? When did this come about 

MS-DOS version 2. (Version 1 didn't have subdirectories, so didn't
allow either forward or backslashes when specifying files. Version 2
and later versions of the MS-DOS kernel (cough, cough) and Windows NT
kernel allow either character as a path separator.)


> and when are backwhacked backwhacks
>needed?

When you pass a string to the command interpreter with either
backticks, the system() function, or the open() function with the
backtick option. Because the command interpreter has its own ideas of
what forward slashes mean, it will mis-parse them as being options
specifiers.
-- 
Andrew Langmead


------------------------------

Date: Sun, 15 Mar 1998 16:47:14 -0500
From: "Eric Smith" <ecs@talstar.com>
Subject: Perl and Windows NT question
Message-Id: <6ehi0s$72t$1@news.fsu.edu>

A week ago I installed the lastest version of ActiveStates Perl on my NT
machine. I set up up the registry and all that good stuff. I placed my perl
scripts in the scripts directory. Called them from the browser and they
worked beutifully. A couple days ago my boss gave me the latest tech-net cd
with the NT Option Pack 4 on it. I installed it and now I'm geting an error
when I run my scripts from the browser. They still work perfectly from the
DOS prompt but I get the following error in the browser window:



Cgi Error

The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:

Can't open perl script
"??????????????????????????????1??????????????E??????????????????????E??????
?????????????c??c"; Invalid argument.


I have messed around with the Server config in the Management Console, but
nothing major. I know I've got all the newline characters correct and all
that. In fact I went to a site that had a test script on it and got the same
error. I'm not an Internet Information Server guru so I really don't know
what to do. When I first installed NT it put a version of IIS on the machine
called Peer Web Services. When I put the NT Option Pack 4 on it changed that
to Personal Web Server and put a cheesy homepage builder on my machine.

Any help is appreciated. Thanks in advance.

Eric


#####################################################
http://garnet.acns.fsu.edu/~eer6517/eric/
#####################################################


------------------------------

Date: Sun, 15 Mar 1998 21:59:04 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
To: Eric Smith <ecs@talstar.com>
Subject: Re: Perl and Windows NT question
Message-Id: <350C4DD9.8318F8D4@usa.net>

Mailed & Posted:

Contact ActiveState, others are having the same problem and if more Perlers make
them aware of the problem(s) it may be resolved faster.

Other than that, I am off to get the lastest and greatest and see what I can
break :)

/^C'Ya$/;
Sneex :)

Eric Smith wrote:

> A week ago I installed the lastest version of ActiveStates Perl on my NT
> machine.  With NT SP 4...  Oops :)

<Snip>



------------------------------

Date: 15 Mar 1998 21:38:10 GMT
From: peterm@zeta.org.au (Peter G. Martin)
Subject: Re: Reading excel files under Unix
Message-Id: <6ehho2$3dq$1@phaedrus.kralizec.net.au>

In article <889985807.169774@thrush.omix.com>,
	Zenin <zenin@archive.rhps.org> writes:
> [posted & mailed]
> 
> Tom <nelson24@insight.att.com> wrote:
>: I am looking for a module or any information that may be helpful
>: for reading MS excel files with perl on Unix systems.
> 
> 	Check out the Text::CSV module at your local CPAN.  The files
> 	will have to have been saved in "text" or "CSV" (Comma Seperated
> 	Values) format, pure "Excel" won't work.  This module can also
> 	create CSV files that Excel can read. -Note however that only
> 	values are available in CSV format, any and all "Excel" formatting
> 	embeded math, et al will not be available.
> 
> 	You could write a module to parse pure Excel files, but I think
> 	you'd have much more fun lying on train tracks. :-)

Well maybe the trains aren't too fierce in Germany... :-)

Progress has been made with OLE operations and Excel 
(as well as Word) internals.   See the latest version
of OLE::Storage..   I haven't tried it out, but Martin
Schwartz is in there, plugging away..

 

-- 
Peter G. Martin, Tech.Writer & Perl User
      The Scribe & Chutney Trust
peterm@zeta.org.au,  http://www.zeta.org.au/~peterm
ROZELLE, Australia       +61 2 9818 5094




------------------------------

Date: Sun, 15 Mar 1998 23:18:48 GMT
From: delphiask@sale-net.com.au (Peter)
Subject: Redirect according to refferer
Message-Id: <350d6096.46507099@loomi.telstra.net>

Hi all.

I need a script that I can run on my server that redirects a user to
another web page depending on who the refferer is.

I have a web page mirrored around the world on different servers. The
Perl script needs to be on my system. On the web page is an icon
saying whatever but something like "The web page host is here". Lets
say this is on www.somewhere.com/page.htm

If a user clicks on this link, it calls the Perl script on my server.
It reads a text file looking for the above refferer and when it finds
it it than redirects the browser to thier homepage. If no refferer is
found or the info is not sent, then it sends them to a default page.

Can anyone tell me where I might find such a script or would anyone be
interested in writing one for me for a price or exchange?

Many thanks, Peter May.
Please CC: to delphiask@sale-net.com.au as news is very slow.


------------------------------

Date: Sun, 15 Mar 1998 23:32:12 GMT
From: Sneex <chasecreek.systemhouse@usa.net>
To: delphiask@sale-net.com.au
Subject: Re: Redirect according to refferer
Message-Id: <350C63AC.B1FF0813@usa.net>

Mailed & Posted:

Hmmmm.  If what I think you are saying is - I have host A and a bunch of
other hosts like X Y and Z; and I want anyone clicking on a link on anyone
else's page (not A nor XYZ above) (but a link which represents A or XYZ
above?) to go to my site first via the clicking action and then based upon
referrer recieved - taken to one of XYZ above or a default page at A???

Is that right???  Couple of questions - Is the list of referrers
infinite?  Less than how many?

Sneex :)


Peter wrote:

> Hi all.
>
> I need a script that I can run on my server that redirects a user to
> another web page depending on who the refferer is.
>
> I have a web page mirrored around the world on different servers. The
> Perl script needs to be on my system. On the web page is an icon
> saying whatever but something like "The web page host is here". Lets
> say this is on www.somewhere.com/page.htm
>
> If a user clicks on this link, it calls the Perl script on my server.
> It reads a text file looking for the above refferer and when it finds
> it it than redirects the browser to thier homepage. If no refferer is
> found or the info is not sent, then it sends them to a default page.
>
> Can anyone tell me where I might find such a script or would anyone be
> interested in writing one for me for a price or exchange?
>
> Many thanks, Peter May.
> Please CC: to delphiask@sale-net.com.au as news is very slow.





------------------------------

Date: 15 Mar 98 21:23:46 GMT
From: harrison@pixi.com (Robert F. Harrison)
Subject: Re: Sets (collections) in Perl
Message-Id: <slrn6gohm5.emh.harrison@localhost.localdomain>

On Sun, 15 Mar 1998 21:52:19 +0100, Jean-Louis Leroy <jll@skynet.be> wrote:
> Hello,
> 
> I need the Perl equivalent of a Smalltalk Set (or C++ std::set<>), i.e. 
> a collection that doesn't create duplicates if you enter the same 
> element twice.

Not sure if it'll help, but you might look the Set::Scalar (and
friends) stuff on CPAN.

-- 
rfh harrison@pixi.com



------------------------------

Date: Sun, 15 Mar 1998 21:51:58 +0100
From: martin@RADIOGAGA.HARZ.DE (Martin Vorlaender)
Subject: Re: System ?
Message-Id: <350c3f6e.524144494f47414741@radiogaga.harz.de>

Keith (barberk3@pilot.msu.edu) wrote:
: Does anyone know how to use the system command to change a directory?

: I'm using perl5 and I need to move to another directory.  I've tried
: using: 
: system("cd, public_html");
:  where public_html is a vaild directory, but for some reason when I
: run my script at the prompt it stays in the same dir.  

: Any suggestions?

Either

  read about the system() function in the perlfunc POD,
  and

    enter the system command exactly as you would type it at the OS prompt:
    system('cd public_html');

  or

    make the command name and the parameters a real list:
    system('cd', 'public_html');

or

  read about the chdir() function in the perlfunc POD:
  chdir('public_html');


cu,
  Martin
--
                          | Martin Vorlaender | VMS & WNT programmer
 Ceterum censeo           | work: mv@pdv-systeme.de
 Redmondem delendam esse. |       http://www.pdv-systeme.de/users/martinv/
                          | home: martin@radiogaga.harz.de


------------------------------

Date: 15 Mar 1998 21:35:37 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: tainted glob confusion
Message-Id: <6ehhj9$1ra$3@info.uah.edu>

In article <Pine.A41.3.95a.980314140707.52844A-100000@rsplus10.cern.ch>,
	"Alan J. Flavell" <flavell@mail.cern.ch> writes:
: If I were as careless a programmer as you seem to fear, then I wouldn't
: have been using -T in the first place ;-)

I did not intend any insult, and I apologize if I came across that way.
I have been bitten on the ass too many times when I tried to play
Cavalier Programmer, so I practice and advocate defensive programming.
YMMV.

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


------------------------------

Date: Sun, 15 Mar 1998 22:04:09 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Weird? problems with perldoc
Message-Id: <Epvryy.4np@world.std.com>

hertlein@umich.edu (Marcus P Hertlein) writes:

>No matter what I type in any directory, I get "Command not found."
>What's going on? Is this a unix problem? My path seems to be set up
>correctly...

On many Unix systems, if the interpreter specified on the "#!" line
doesn't exist, you get "command not found", even though the program
that you are trying to run (the program that uses the interpreter)
exists.

On a system where the "#!" is handled in the kernel, when one of the
"exec" system call is invoked, it opens the file and examines the
beginning of the file. If the first two characters are "#!" it reads
up to the first group of whitespace for the name of the interpreter
and everything between the first and second group of whitespace for
the options to pass the file. (sometimes with a 32 character limit.)
It then replaces the command to run with the interpreter, gives it the
options that it found, and then gives the filename as an the next
argument. Since the interpreter, which is now the command, is not
found, it returns "Command not found" error code, and the shell prints
it.


Since you told "Configure" to install all of the programs in
"/ourapp/perl5.004install/bin/" it altered all the files so that it
referenced them there.

Maybe you would be better off leaving the files there and making
symlinks to the places you want to access them from.

Otherwise, maybe you could Configure and compile again, with the
correct path, and remove the pieces you don't want afterward.

-- 
Andrew Langmead


------------------------------

Date: 15 Mar 1998 23:15:36 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: You have 1 message(s) - how to print plurals?
Message-Id: <6ehneo$8hd$1@towncrier.cc.monash.edu.au>

Tom Christiansen <tchrist@mox.perl.com> writes:

> [courtesy cc of this posting sent to cited author via email]

>In comp.lang.perl.misc, damian@cs.monash.edu.au (Damian Conway) writes:
>:>: I have a pet peeve about having a ten thousand dollar computer telling
>:>: me "1 file(s) copied", 

>Me, too.

>If you try all to handle all the cases, you'll go nuts....
>
>	[Erudite and entertaining exposition of the
>	 extensive eccentricities of English excised]
>
>I very much respect your attempt, but doubt you'll be very successful
>in more than a scant few of the special cases.  Good luck, anyway. :-)

Well, I ran Text::Inflect::English over your set of examples and it got
80% of them correct (correct, that is, according to allowed plurals
specified in the OED). I'm fairly content to have a piece of software
that's 4/5ths as smart as Tom C. ;-)

(Of course, I've now added handlers for all the cases it originally missed,
 so the module is currently *100%* as smart as Tom - at least until he posts
 again :-)

BTW: Overall, it's now been tested on about 300 special cases, so
     "a scant few" might be a little harsh :-)

Damian


------------------------------

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 2104
**************************************

home help back first fref pref prev next nref lref last post