[17441] in Perl-Users-Digest
Perl-Users Digest, Issue: 4861 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 10 00:05:42 2000
Date: Thu, 9 Nov 2000 21:05:14 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <973832713-v9-i4861@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 9 Nov 2000 Volume: 9 Number: 4861
Today's topics:
Re: "couldn't spawn child process" error. (Gwyn Judd)
Re: Backtick problems on Windows98 hydsys@my-deja.com
Re: Excel and Graphics <hartleh1@westat.com>
Re: Excel and Graphics <bwalton@rochester.rr.com>
Re: getting a list of files like in @ARGV (Tad McClellan)
Re: grep and reg exp question (Tad McClellan)
Re: grep and reg exp question (Gwyn Judd)
Re: Handling Postcode Ranges <newsposter@cthulhu.demon.nl>
Re: Handling Postcode Ranges <ianb@ot.com.au>
Re: Handling Postcode Ranges <andrew_lee@earthlink.net>
Re: Hash assignments in loops? gelshocker@my-deja.com
Re: Hash assignments in loops? gelshocker@my-deja.com
Re: Hash assignments in loops? gelshocker@my-deja.com
Re: Hash assignments in loops? gelshocker@my-deja.com
Re: Hash assignments in loops? <lincmad001@telecom-digest.zzn.com>
Re: Hash assignments in loops? (Tad McClellan)
Re: Help with if(file_exists) (Tad McClellan)
Re: Help with if(file_exists) <andrew_lee@earthlink.net>
Re: how do i ask for input? <elephant@squirrelgroup.com>
How to force MSDOS window to stay open after perl? <st@nospam.prnet.hhrnet.jp>
Re: How to force MSDOS window to stay open after perl? <s2mdalle@titan.vcu.edu>
Kerberos 4 <lmpinto@dei.uc.pt>
Re: Kerberos 4 <joe+usenet@sunstarsys.com>
Re: make test (bad command or filename) <bwalton@rochester.rr.com>
Re: make test (bad command or filename) <andrew_lee@earthlink.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 10 Nov 2000 04:10:25 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: "couldn't spawn child process" error.
Message-Id: <slrn90mt9c.769.tjla@thislove.dyndns.org>
I was shocked! How could shyam_gedela@my-deja.com <shyam_gedela@my-deja.com>
say such a terrible thing:
>"The server encountered an internal error or misconfiguration and was
>unable to complete your request." error.
This doesn't sound like a Perl issue to me. Here is a pointer:
----------------> comp.infosystems.www.authoring.cgi
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
If you're not very clever you should be conciliatory.
-- Benjamin Disraeli
------------------------------
Date: Fri, 10 Nov 2000 04:21:03 GMT
From: hydsys@my-deja.com
Subject: Re: Backtick problems on Windows98
Message-Id: <8uft3a$51l$1@nnrp1.deja.com>
In article <8u75do$5a3$1@newstoo.ericsson.se>,
"Peter Lerup" <peter.lerup@ecs.ericsson.se> wrote:
> Hi
>
> I have a strange phenomenon that I wonder if someone else have seen
and
> hopefully have the solution for.
>
> The problem is that on some Windows 98 machines the redirection of
stdout
> doesn't seem to work. Whenever doing anything like
>
> $a = `dir`;
>
> The result of the command goes directly to the console window and not
into
> the variable.
>
> The strangest thing is that this only happens on some machines and not
> others, different hardware but all using the same version of Windows
98.
> I've tried several different versions of Win32 Perl but always the
same
> result.
>
> Thankful for any leads on this
>
> /Peter Lerup
> Ericsson Mobile Communications
>
>
Peter,
I too have seen this problem (twice), and have a fix for one version of
it. We deduced that the problem only cropped up after a Norton Antivirus
upgrade, and on further research discovered that if you have NAV check
only specified file suffixes, and not all files, the backticks start to
work again. Wierd, I suspect Norton snags command.com somehow.
I am now struggling with the same problem at another site where they
don't run NAV, they run McAfee, and even when it is disabled the problem
still crops up. All PCs suffer the problem, across several versions of
Windows from 95 to ME. I am suspicious of Tivoli, some kind of corporate
system management system that is all things to all men and can't seem to
be disabled.
I still don't know if this is really a Perl problem that only shows up
under certain circumstances, or if it is something nasty that other
software is doing. We are looking at getting rid of all backticks in
our Perl (a big job) and replacing them with a routine that pipes to a
file and then reads the file.
Any other ideas you hear of would be helpful,
Peter Heweston
HYDSYS Pty Ltd
Australia
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 09 Nov 2000 16:52:01 -0500
From: Henry Hartley <hartleh1@westat.com>
Subject: Re: Excel and Graphics
Message-Id: <3A0B1C80.7BFC341@westat.com>
o.richet@usa.net wrote:
>
> I am a young student in computing (first year student).
>
> For my school project, I search a Perl script with 2 functions :
> - Retrieve datas from CSV file from Excel
> - Show the results on graphic form to HTML page
Somehow, it seems more likely that your project was to write such a
script. Just finding one someone else has written is not much of a
project and probably wouldn't help you get past being a first year
student. When you have worked on your homework for a while and don't
understand something, there are lots of people here happy to help
explain it to you (assuming you look for the information in the
documentation first).
> If you know where I can find this script, thank you to e-mail me (not
> answer on this newsgroup because the access is impossible from my
> school) : o.richet@usa.net
Sorry, post here, read here.
--
Henry Hartley
Westat
Rockville, Maryland, USA
------------------------------
Date: Fri, 10 Nov 2000 03:49:10 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: Excel and Graphics
Message-Id: <3A0B7106.937B2175@rochester.rr.com>
o.richet@usa.net wrote:
...
> I am a young student in computing (first year student).
>
> For my school project, I search a Perl script with 2 functions :
> - Retrieve datas from CSV file from Excel
> - Show the results on graphic form to HTML page
>
> If you know where I can find this script, thank you to e-mail me (not
> answer on this newsgroup because the access is impossible from my
> school) : o.richet@usa.net
...
I don't think you'll get a script this way -- I doubt anyone has one
that will do exactly what you want. But you could write one fairly
easily. You could use the DBI module with the DBD::CSV driver to make
an elegant and simple interface to the CSV file and avoid the pitfalls
of properly parsing the CSV file yourself. To do the online graphics,
you could use the GD module (but recent versions may not support the gif
format), or maybe the Chart module (and probably lots of others). Good
luck!
--
Bob Walton
------------------------------
Date: Thu, 9 Nov 2000 19:51:04 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: getting a list of files like in @ARGV
Message-Id: <slrn90mhjo.d2a.tadmc@magna.metronet.com>
On Fri, 10 Nov 2000 09:39:25 +1000, Kim Saunders <kims@emmerce.com.au> wrote:
>> if I start my script with *.LOG on the command line I get all the
>> filenames ending with .LOG expanded in @ARGV q: How can I get a list
>> with filenames from a scalar with the value of *.LOG
>
>Sounds like you're using unix of some description...
>
>How about:
>
>$files = `echo *.LOG`;
>@files = split / /, $files;
How about:
my @files = `ls *.pl`;
chomp @files;
:-)
But that is "shelling out". Something to be avoided anyway.
>They may or may not have been the answer you are looking for. The
>non-shell way to do it would be to use opendir, readdir, etc to get ALL
>the files, then see if they match.
That would in fact be the Best Way. Native Perl very often beats
shelling out (faster, more portable...).
[ But if you have perl 5.6 then there is a third option that
is not shelling out. glob() (it is still shelling out in
earlier perl versions).
]
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 9 Nov 2000 21:35:13 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: grep and reg exp question
Message-Id: <slrn90mnn1.d2a.tadmc@magna.metronet.com>
On Thu, 09 Nov 2000 16:21:39 -0800, Gordon Vrdoljak
<vrdoljak@uclink.berkeley.edu> wrote:
>I have a user form which people fill out on the web.
So you are using CGI.pm and taint checking then?
Good.
>It searches for their last
>name from seperate text file which includes last name, first name, email, etc.
>If the search fails it gives them an error that they were not in our database.
>
>The code for checking looks like this:
>
>open (GREP, "grep -i '$lastname' format.txt|");
Errr, what keeps it from matching $lastname in fields other than
"last name"?
What if George Yahoo matches dude@yahoo.com in the email field?
Your algorithm is very broken.
>@search_result = <GREP>;
>close (GREP);
Why go through a pipe open if you are going to put the whole
thing in memory anyway?
Just use backticks instead of the 3 lines above:
@search_result = `grep -i '$lastname' format.txt`;
And you could (should) be doing it all in native Perl instead
of shelling out to grep(1) anyway.
>$search_result=@search_result;
>if ($search_result < 1)
You can replace those 2 lines with:
if ( @search_result )
>My problem is that if the person puts in nothing for their lastname, or if they
>put in a single letter, it gives a positive result for the search result.
You have more problems than just that (as above) :-)
>Is there a way of making it strictly find a last name in the text file, or just
>redirect if the $lastname variable they input is empty, or a single character?
Yes.
Just validate your data with a pattern match, you need to
untaint the data anyway.
You have not given enough information to answer your question.
What is the file format? (ie. how are the fields identified?)
Give example data. Give example values of $lastname that
are making false hits. Give us code we can run.
Give and ye shall receive :-)
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 10 Nov 2000 04:09:13 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: grep and reg exp question
Message-Id: <slrn90mt74.769.tjla@thislove.dyndns.org>
I was shocked! How could Gordon Vrdoljak <vrdoljak@uclink.berkeley.edu>
say such a terrible thing:
>Hello,
>thanks for your replies...
>No, I didn't use taint checks.
>
>The format of the text file I am pulling in is:
>"Elizabeth","Bergen","23763","","201 Wellman","","Resh"
>"Virginetta","Cannon","36230","","311 LSA","4860788","Keller"
>"Mark","Carrier","27742","","311A Koshland Hall","8499221","Sussex"
>etc...
>
>It is a comma seperated output of our filemaker database of users with first,
>lastname, phone, email, address, Lab phone, and supervisor.
In that case I would probably use the DBD::CSV module which is designed
to split CSV file like this, rather than just using grep(1) which isn't.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
In spite of everything, I still believe that people are good at heart.
-- Ann Frank
------------------------------
Date: 9 Nov 2000 21:48:40 GMT
From: Erik van Roode <newsposter@cthulhu.demon.nl>
Subject: Re: Handling Postcode Ranges
Message-Id: <8uf63o$ef9$1@internal-news.uu.net>
Peter Sundstrom <peter.sundstrom@eds.com> wrote:
> I'm looking for an efficient way of handling postcode ranges in reasonably
> large files (20Mb). I need to return a number of the postcode range
> sequence. For example:
> 0000-1000 return 1
> 1001-2000 return 2
> 2001-2500 return 3
> ...
> The postcode ranges will vary depending on the file being processed, so I
> need to initialise the postcode ranges from a configuration file.
> The postcodes will range from 0 to 9999. I was thinking about initialising
> a hash for the entire range, but it seems overkill to initialise 10,000
> values.
Have a look at Set::IntSpan and News::Newsrc, you might be able to use
those, or they might give you some ideas.
Erik
------------------------------
Date: Fri, 10 Nov 2000 14:35:50 +1100
From: Ian Boreham <ianb@ot.com.au>
Subject: Re: Handling Postcode Ranges
Message-Id: <3A0B6D16.4EDC91C4@ot.com.au>
Peter Sundstrom wrote:
> Ian Boreham <ianb@ot.com.au> wrote in message
> news:3A0B2423.869B85AD@ot.com.au...
> > Peter Sundstrom wrote:
> >
> > > The postcodes will range from 0 to 9999. I was thinking about
> initialising
> > > a hash for the entire range, but it seems overkill to initialise 10,000
> > > values.
> >
> > Why a hash an not just a good old-fashioned array? Lookup should be faster
> and
> > it should be more space-efficient, if you are populating the entire range.
>
> I'm unsure how you would implement it as an array lookup.
Perhaps I misunderstood you. I thought you were suggesting using individual
postcodes as keys in the hash, and adding an entry for each, to give you the
lookup facility. E.g. $range = $postcoderange{'1234'};
I was suggesting that if you were to do this for each postcode (which you were
saying seemed like overkill), that rather than populating 10000 hash entries,
you should use a 10000-entry array. Lookup would just use the (decimal, even
for 0200-style codes) numerical value of the postcode as an array index. E.g.
$range = $postcoderange[1234];
This is not that different from the hash idea (although slightly better, I
think) in terms of storage required and access speed, but I was just wondering
why you suggested a hash instead of an array? Did I completely miss the point?
Regards,
Ian
------------------------------
Date: Fri, 10 Nov 2000 04:42:47 GMT
From: Andrew Lee <andrew_lee@earthlink.net>
Subject: Re: Handling Postcode Ranges
Message-Id: <3A0B7D08.E4F4FC4C@earthlink.net>
Have you tried a DBM file tied to a hash?
Peter Sundstrom wrote:
> I'm looking for an efficient way of handling postcode ranges in reasonably
> large files (20Mb). I need to return a number of the postcode range
> sequence. For example:
>
> 0000-1000 return 1
> 1001-2000 return 2
> 2001-2500 return 3
> ...
>
> The postcode ranges will vary depending on the file being processed, so I
> need to initialise the postcode ranges from a configuration file.
>
> The postcodes will range from 0 to 9999. I was thinking about initialising
> a hash for the entire range, but it seems overkill to initialise 10,000
> values.
>
> Suggestions on how to handle it will be greatfully accepted.
------------------------------
Date: Fri, 10 Nov 2000 02:04:16 GMT
From: gelshocker@my-deja.com
Subject: Re: Hash assignments in loops?
Message-Id: <8ufl2u$uhm$1@nnrp1.deja.com>
Sure, here's the code...
for ($i=0;$i<$b;$i++) {
($account[$i], $username[$i]) = split/,/, $contentsAccounts[$i];
chomp($username[$i]);
chomp($account[$i]);
print DEST ("$username[$i],");
print DEST ("$account[$i]\n");
%accountnos=($username[$i] => $account[$i]);
}
Basically, I think the %accountnos.. line is wrong, I'm trying to run
through all the lines in @contentsAccounts (simple csv file with two
'elements' on each line), split them by comma into @account and
@username (process these arrays as necessary), then place all these
pairs into %accountnos where I can use hash lookup somewhere else.
Will try out the suggestions.
Thank you very much for your help. This is very much appreciated.
Cheers,
Jason Lam
In article <8udqlc$cpg$1@nnrp1.deja.com>,
gelshocker@my-deja.com wrote:
> Hi,
>
> For some reason I can't seem to populate hashes in a loop block. For
> example, I have a forloop that splits @lines into 2 elements,
assigning
> the elements as key/value into a %hash.
>
> Doesn't work: I only get one $hash, being the last elements from
> @lines. Tried the Cookbook but no examples of hash assignments in a
> loop block. And I missing something?
>
> Many, many thanks!
> Jason Lam
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 10 Nov 2000 02:07:07 GMT
From: gelshocker@my-deja.com
Subject: Re: Hash assignments in loops?
Message-Id: <8ufl89$urk$1@nnrp1.deja.com>
In article <slrn90kvs1.2jm.bernard.el-hagin@gdndev25.lido-tech>,
bernard.el-hagin@lido-tech.net wrote:
> On Thu, 9 Nov 2000 10:09:21 -0000, Trevor Ward <tward10@jaguar.com>
> wrote:
> >I tend to do this
> >
> >foeach $item (@array)
> >{
> > my ($pt1, $pt2) = split (/what/, $item);
> >
> > $hash{$pt1} = $pt2;
> >}
>
> That doesn't compile.
>
> Cheers,
> Bernard
> --
> perl -le '$#="Just Another Perl Hacker"; print \Bernard'
>
Yes, tried something like this before but it didn't pull off.
Jason Lam
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 10 Nov 2000 02:22:28 GMT
From: gelshocker@my-deja.com
Subject: Re: Hash assignments in loops?
Message-Id: <8ufm50$ver$1@nnrp1.deja.com>
In article <thlmutnu53.fsf@lautaret.grenoble.xrce.xerox.com>,
Julien Quint <julien.quint@xrce.xerox.com> wrote:
> gelshocker@my-deja.com writes:
>
> > For some reason I can't seem to populate hashes in a loop block. For
> > example, I have a forloop that splits @lines into 2 elements,
assigning
> > the elements as key/value into a %hash.
>
> A good, perlish way to do it is to use a map, for instance if there
are 2
> fields per line separated by a comma:
>
> my %h = map { my($k, $v) = split /,/; $k => $v } @lines;
>
> --
> Julien
>
Thank you Julien, this works as required.
Sorry if I didn't make myself more clear beforehand. Still don't quite
understand how to write the code as a forloop, to loop through a file
and assign hash pairs during the loop.
i.e. file contents:
apple,john
lemon,paul
orange,adam
...and to assign (fruit => person) during the loop.
Jason Lam
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 10 Nov 2000 02:46:45 GMT
From: gelshocker@my-deja.com
Subject: Re: Hash assignments in loops?
Message-Id: <8ufnik$nu$1@nnrp1.deja.com>
> >
> > my %h = map { my($k, $v) = split /,/; $k => $v } @lines;
> >
> > --
> > Julien
> >
>
> Thank you Julien, this works as required.
>
> Sorry if I didn't make myself more clear beforehand. Still don't quite
> understand how to write the code as a forloop, to loop through a file
> and assign hash pairs during the loop.
>
> i.e. file contents:
>
> apple,john
> lemon,paul
> orange,adam
>
> ...and to assign (fruit => person) during the loop.
>
This is so that (a forloop) allows me to do some more stuff on the
elements as I split them from the csv file, before populating the hash.
I wouldn't know how to hack the black magic statement above to allow it
to run several subs on the elements split $k, $v before they go into
the hash.... and of course, a forloop makes life more pleasant for my
teammates...
Jason Lam
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 09 Nov 2000 19:59:37 -0800
From: Linc Madison <lincmad001@telecom-digest.zzn.com>
Subject: Re: Hash assignments in loops?
Message-Id: <091120001959375598%lincmad001@telecom-digest.zzn.com>
In article <8ufm50$ver$1@nnrp1.deja.com>, <gelshocker@my-deja.com>
wrote:
> In article <thlmutnu53.fsf@lautaret.grenoble.xrce.xerox.com>,
> Julien Quint <julien.quint@xrce.xerox.com> wrote:
> > gelshocker@my-deja.com writes:
> >
> > > For some reason I can't seem to populate hashes in a loop block.
> > > For example, I have a forloop that splits @lines into 2 elements,
> > > assigning the elements as key/value into a %hash.
> >
> > A good, perlish way to do it is to use a map, for instance if there
> > are 2 fields per line separated by a comma:
> >
> > my %h = map { my($k, $v) = split /,/; $k => $v } @lines;
>
> Thank you Julien, this works as required.
>
> Sorry if I didn't make myself more clear beforehand. Still don't quite
> understand how to write the code as a forloop, to loop through a file
> and assign hash pairs during the loop.
>
> i.e. file contents:
>
> apple,john
> lemon,paul
> orange,adam
>
> ...and to assign (fruit => person) during the loop.
Why do you _want_ to write it in a "for" loop?
If you really want to have it in an explicit loop instead of using
"map," you can do something like this:
#-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-
#! perl -w
my %h;
while (<DATA>) {
my ($k, $v) = split /,/;
chomp $v; # remove the trailing newline
$h{$k} = $v;
# whatever else needs doing
}
foreach (sort keys %h) {
print "fruit: $_\tperson: $h{$_}\n";
}
__DATA__
apple,john
lemon,paul
orange,adam
#-=-=-=-=-=-=-=-=-=-=-=-=-=- cut here -=-=-=-=-=-=-
If you've already got @lines populated, though, and really, really want
to do the hash assignment in a for loop instead of a map, then what you
could do is something like this:
for (@lines) {
# same code as in the "while" loop above
}
In other words, extract the key and value from your data and then do an
explicit assignment into the hash.
Of course, this approach begs the question of how you populated @lines
in the first place, if not in a "while (<FH>)" loop where you could've
done the hash assignment right up front.
You can do it all in one swell foop like so:
my %h = map {
my($k, $v) = split /,/;
chomp $v;
# whatever else needs doing
$k => $v
} <DATA>;
Just be sure that $k => $v is the last thing in the block.
------------------------------
Date: Thu, 9 Nov 2000 22:31:11 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Hash assignments in loops?
Message-Id: <slrn90mqvv.d8a.tadmc@magna.metronet.com>
On Fri, 10 Nov 2000 02:22:28 GMT, gelshocker@my-deja.com
<gelshocker@my-deja.com> wrote:
>In article <thlmutnu53.fsf@lautaret.grenoble.xrce.xerox.com>,
> Julien Quint <julien.quint@xrce.xerox.com> wrote:
>> gelshocker@my-deja.com writes:
>>
>> > For some reason I can't seem to populate hashes in a loop block.
>> my %h = map { my($k, $v) = split /,/; $k => $v } @lines;
>Thank you Julien, this works as required.
>
>Sorry if I didn't make myself more clear beforehand. Still don't quite
>understand how to write the code as a forloop, to loop through a file
>and assign hash pairs during the loop.
>
>i.e. file contents:
>
>apple,john
>lemon,paul
>orange,adam
>
>...and to assign (fruit => person) during the loop.
foreach $_ ( @lines ) {
my($k, $v) = split /,/;
$h{$k} = $v; # assign one _element_ of the hash, not the whole hash
}
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 9 Nov 2000 21:44:58 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help with if(file_exists)
Message-Id: <slrn90mo9a.d2a.tadmc@magna.metronet.com>
On Thu, 09 Nov 2000 21:04:00 GMT, Phallicity <phallicity_2000@yahoo.com> wrote:
>I am trying to check the existance of a file. The cgi script is being
>run from www.somepage.com/cgi-bin/test/prog.cgi. I want prog.cgi to
>test for the existance of file www.somepage.com/junk/more/me.gif.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
That is not a file.
Looks kinda like a URL or something.
A URL is not a file spec (or even a file).
>Can
>someone tell me how to write the if statement?
With a "-e" file test, after you know how to tranlate the URL
into a file spec on your system.
> I have tried: if
>(/junk/more/me.gif) {...} but I get an error from the server when I
>try to run this.
Where a URL ends up in the file system depends on how your
web server is setup (and it may, in fact, not be a file at
all anywhere).
Ask your webmaster where her document root is or something.
Or, just use a module that talks HTTP to request the URL
and see if you get it or not.
LWP::Simple is a module that speaks web talk.
--
Tad McClellan SGML consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 10 Nov 2000 04:40:34 GMT
From: Andrew Lee <andrew_lee@earthlink.net>
Subject: Re: Help with if(file_exists)
Message-Id: <3A0B7C82.A2E6C682@earthlink.net>
perldoc -f -e
Phallicity wrote:
> I am trying to check the existance of a file. The cgi script is being
> run from www.somepage.com/cgi-bin/test/prog.cgi. I want prog.cgi to
> test for the existance of file www.somepage.com/junk/more/me.gif. Can
> someone tell me how to write the if statement? I have tried: if
> (/junk/more/me.gif) {...} but I get an error from the server when I
> try to run this.
>
> Thanks in advance
>
> --
> Phallicity
>
> "He must have a huge Schwanstucker!"
> -Young Frankenstein
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Fri, 10 Nov 2000 16:06:32 +1100
From: jason <elephant@squirrelgroup.com>
Subject: Re: how do i ask for input?
Message-Id: <MPG.14762d66d229fa8a98988d@localhost>
[ please post your reply AFTER the post you're replying to ]
EM wrote ..
>"jason" <elephant@squirrelgroup.com> wrote in message
>news:MPG.1474c1c1271e080198988b@localhost...
>> EM wrote ..
>> >I am using activeperl on windows
>> >how do i ask for user input
>>
>> there are a number of ways .. the simplest is to use angle brackets
>> around STDIN .. take a look at the perlop section of the manual under
>> "I/O Operators" for some examples
>>
>> perldoc perlop
>>
>> >like say i make a program that ask for a password
>> >and i make a prompt "Please enter password:"
>> >how do i allow the user to put in his password and put it in $password
>>
>> for specifics about password inputs .. take a look at the Perl FAQ by
>> typing the following at the command prompt
>>
>> perldoc -q password
>>
>> for more information on the perldoc utility type the following at the
>> command prompt
>>
>> perldoc perldoc
-
>perldoc doesnt seem to work
>when i type perldoc perlop i get this (yes it repeats 3 times)
>
>D:\Perl\bin>perldoc perlop
>Can't spawn "command.com": No such file or directory at perldoc.bat line
>383.
>Can't spawn "command.com": No such file or directory at perldoc.bat line
>383.
>Can't spawn "command.com": No such file or directory at perldoc.bat line
>383.
>
>the line at 383 is
>last if system("$pager $tmp") == 0;
>
>whats the problem?
I've seen this before in this group .. but I have no idea what causes
the problem .. perl is basically saying that it is unable to find your
Windows command interpreter
<off topic>
maybe you don't have your system directory in your PATH .. I really
don't know .. but it's a Windows problem and not a Perl one
if you're on Windows9x try adding the following to your PATH environment
variable
c:\windows\system
if you're on WindowsNT try adding
c:\winnt\system32
each operating system has it's environment variables set up in a
different place .. Win9x has it set in the c:\autoexec.bat file ..
whereas WinNT sets in the System control panel
make sure you put the appropriate separator in there as well (assuming
that there are existing values) .. in WinNT the separator is a semi-
colon .. I think it's the same in Win9x
</off topic>
--
jason -- elephant@squirrelgroup.com --
------------------------------
Date: Thu, 09 Nov 2000 18:16:16 -0800
From: Stephen <st@nospam.prnet.hhrnet.jp>
Subject: How to force MSDOS window to stay open after perl?
Message-Id: <8emm0t88nr6c1sebl0vrm1k5kfaq34dv31@4ax.com>
I am runnig ActiveState Perl on Win98. When I click on a perl file
(*.plx), it would execute the script in a popup msdos window. But as
soon as it finishes, the msdos window would close, making it too fast
for me to read the output. How do you tell msdos window to stay open
after executing the Perl script?
Thanks.
------------------------------
Date: Thu, 09 Nov 2000 23:27:32 +0500
From: "David Allen" <s2mdalle@titan.vcu.edu>
Subject: Re: How to force MSDOS window to stay open after perl?
Message-Id: <8uftmo$m36$1@bob.news.rcn.net>
In article <8emm0t88nr6c1sebl0vrm1k5kfaq34dv31@4ax.com>, "Stephen"
<st@nospam.prnet.hhrnet.jp> wrote:
> I am runnig ActiveState Perl on Win98. When I click on a perl file
> (*.plx), it would execute the script in a popup msdos window. But as
> soon as it finishes, the msdos window would close, making it too fast
> for me to read the output. How do you tell msdos window to stay open
> after executing the Perl script?
>
> Thanks.
Try checking the properties of a DOS window while
it's open. There should be an item in there
that is "Close on Exit" which I bet you've got
clicked on. Fix it.
BTW this is really a DOS question, doesn't have
much to do with perl.
--
David Allen
http://opop.nols.com/
----------------------------------------
5 out of 4 people don't understand fractions.
------------------------------
Date: Thu, 09 Nov 2000 14:28:18 -0100
From: "Luis M. Pinto" <lmpinto@dei.uc.pt>
Subject: Kerberos 4
Message-Id: <3A0AC292.EB3958F8@dei.uc.pt>
Hi!
I downloaded the krb4 perl module from cpan, but i am having some
troubles working with it. I am not too familiar with kerberos, and maybe
that is the problem.
Anyway, i would like to get some other examples of working with kerberos
inside perl (I want to do something that looks simple - authenticate a
user from a web interface, in a http server that doesnt belong to the
realm - is that a problem?)
I would be very thankfull to anyone who can help me...
Luis Pinto
------------------------------
Date: 09 Nov 2000 22:32:15 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Kerberos 4
Message-Id: <m3wvec8pts.fsf@mumonkan.sunstarsys.com>
"Luis M. Pinto" <lmpinto@dei.uc.pt> writes:
>
> Anyway, i would like to get some other examples of working with kerberos
> inside perl (I want to do something that looks simple - authenticate a
> user from a web interface, in a http server that doesnt belong to the
> realm - is that a problem?)
>
Are you sure you want to do this? There's really little point in using
kerberos if you're going to authenticate users by having them transmit
their passwords to your server in plaintext. You might wind up defeating
the whole point of using something like kerberos.
IIRC, there is a kerberos4 module for apache, but this is OT for
c.l.p.m. You might try asking in c.i.w.s.unix to learn more about
it; better yet search for it at
http://www.apache.org
--
Joe Schaefer
------------------------------
Date: Fri, 10 Nov 2000 03:41:41 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: make test (bad command or filename)
Message-Id: <3A0B6F44.14F3CAD6@rochester.rr.com>
EM wrote:
>
> in every module i download it says i need to do this
>
> 1. perl Makefile.PL
> 2. make
> 3. make test
> 4. make install
>
> step 1 works all others fail with error "bad command or filename"
> i know it means the file doesnt exist but where can i get it?
> i am using activeperl on windows me
...
Since you are running ActiveState Perl, you should get your modules from
ActiveState. Type "ppm" at a command prompt and do the help. If the
module you want isn't on ActiveState, then you will need to do some more
work to get it. "make" is a Unix thing, and the CPAN modules are
intended and aimed at Unix-type systems. You might find that Cygwin
will enable CPAN module installation on Windoze. If the module you want
is a pure Perl module (no C-language routines), just copying the .pm
file to someplace on your @INC list should make it work -- but the docs
won't be automatically added to your HTML files. Porting of modules
which use C-language code is typically a fairly major effort (and
requires a C compiler). If you want to be able to use all the modules
with no problems, install and use Linux.
--
Bob Walton
------------------------------
Date: Fri, 10 Nov 2000 04:35:05 GMT
From: Andrew Lee <andrew_lee@earthlink.net>
Subject: Re: make test (bad command or filename)
Message-Id: <3A0B7B37.7D8E03D0@earthlink.net>
EM wrote:
> in every module i download it says i need to do this
>
> 1. perl Makefile.PL
>
Yes. Perl.exe is in your PATH.
> 2. make
> 3. make test
> 4. make install
>
Evidently make is not.
Please look for a Win32 compatiple version of make (Try Gnu) -- This may
or may not work. Activeperl also has precompiled modules.
>
> step 1 works all others fail with error "bad command or filename"
> i know it means the file doesnt exist but where can i get it?
> i am using activeperl on windows me
>
> thanks
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 4861
**************************************