[9468] in Perl-Users-Digest
Perl-Users Digest, Issue: 3062 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jul 4 23:07:12 1998
Date: Sat, 4 Jul 98 20:00:25 -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 Sat, 4 Jul 1998 Volume: 8 Number: 3062
Today's topics:
Re: 2-byte code match problem (Yun Giljung)
Re: better way of getting the last modified file? <eugene@verticalnet.com>
Re: better way of getting the last modified file? (Jonathan Stowe)
Re: better way of getting the last modified file? (Larry Rosler)
Compiling Perl for SunOS4 (Roddy Knight)
Re: Compiling Perl for SunOS4 (Jonathan Stowe)
Re: E-Mail Validation (easy question) (Jeremy D. Zawodny)
Faq annotation #1 (Halian Phillips)
Re: first mess up (Jonathan Stowe)
How do I dereference an object when 'use strict' pragma <jc_cann@ix.netcom.com>
Re: How do I dereference an object when 'use strict' pr (Jonathan Stowe)
LD_LIBRARY_PATH question (Rich Miller)
Length and stripping function <terry@aol.com>
Re: limits of glob() ? (Bbirthisel)
Re: perl asp question (Jeremy D. Zawodny)
Perl download (acting as a Browser) <douglas@home.com>
Re: Perl download (acting as a Browser) (Jonathan Stowe)
Re: print $ENV{'PATH_INFO'} problem (Jeremy D. Zawodny)
Re: public news server (Brian Kraft)
repost perl asp question (correct e-mail adress) <efs@rocketmail.com>
Re: repost perl asp question (correct e-mail adress) (Jonathan Stowe)
Re: Script text editor (Alan Meyer)
Re: size limit on array ? (Jonathan Stowe)
Re: Why no Perl news/mailreader? lvirden@cas.org
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 05 Jul 1998 00:06:02 GMT
From: mingtian@hanmail.net (Yun Giljung)
Subject: Re: 2-byte code match problem
Message-Id: <359ec0aa.2503830@usenet.kornet21.net>
abigail@fnx.com (Abigail) wrote:
>I18N or Unicode is not useless nor annoying, as it includes a lot more
>than just Korean, Chinese, Japanese and Western languages. But Perl
>cannot be incompatible with what it is being used for now. Hence the
>decision to do UTF-8, as that encodes ASCII with a single byte.
i think using unicode as internal fixed code system is useless or more
likely to be just annoying, not unicode itself.
the reason is that, it's much difficult or sometimes impossible to handle
such cjk native codes with java,tcl..etc, it makes things worse.
>Could you then please formulate those objections in a reasonable way
>instead of just saying it's bad?
if you try to handle such codes then you'll find..
for me i prefer MS asian version OS like way of treating i18n stuff.
for example, when displaying other languages under korean version, there
would not be any complaint 'this is not ksc5601...!@#$'
just let them be out then user will select big5 font or gb font, that's all.
in fact, it's much easy to handle other langs under korean version of win95,
but sometimes it does not work when we install english version of software that checks
the country code in win95 setting, so we have to set to US and reboot
install, reset to korea and run the program, why check it? for what??
if user want to install then just do install, that's all.
i think handling i18n is just let it be not checking..and doing something,
user will select. in mamy cases checking locale or country code..are
not useful.
------------------------------
Date: Sat, 04 Jul 1998 19:40:10 -0400
From: Eugene Sotirescu <eugene@verticalnet.com>
Subject: Re: better way of getting the last modified file?
Message-Id: <359EBD5A.DD379E00@verticalnet.com>
Thanks.
I had checked the "-X stuff" before posting.
The closest is the -M operator, though it takes some doing to make it
behave like the -t option of ls. I'm looking to keep things simple and
make them more efficient, but so far I couldn't find a clean Perl
solution that fulfills these requirements in this case. That's why
I posted.
Jonathan Stowe wrote:
> On Sat, 04 Jul 1998 07:35:30 -0400, Eugene Sotirescu wrote :
>
> >I'm getting the last modified file in a directory thusly:
> >
> > @my_files = `ls -t $DIR`;
> > $myfile = $my_files[0];
> >
> >Is there any better way of doing this, without spawning a shell?
> >
> check out perlfunc for the -X stuff
> i.e :
> perldoc -f -X
> or whatever "man perlfunc" then /-X blah blah
> Perl has a whole shed-load of ways of finding this kind of stuff out.
>
> >Thanks.
> >
>
> Anyhow did you hear that Louise Woodward got a new job as the manager
> of The Spice Girls now she's been let out ? The first thing she's
> going to do apparently is drop Baby Spice.
>
> /J\
> Jonathan Stowe
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sun, 05 Jul 1998 01:31:32 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: better way of getting the last modified file?
Message-Id: <359ed4f9.6805921@news.btinternet.com>
On Sat, 04 Jul 1998 19:40:10 -0400, Eugene Sotirescu wrote :
>Thanks.
>I had checked the "-X stuff" before posting.
>The closest is the -M operator, though it takes some doing to make it
>behave like the -t option of ls. I'm looking to keep things simple and
>make them more efficient, but so far I couldn't find a clean Perl
>solution that fulfills these requirements in this case. That's why
>I posted.
>
This is a little hack I had kicking around that finds the oldest file:
#!perl
opendir(THEDIR,".") || die "Outta here -$!\n";
while(defined($file = readdir(THEDIR)))
{
next if $file =~ m%^.{1,2}$%;
if ( ($moddate = -M $file) > $lastmod )
{
$lastmod = $moddate;
$lastfile = $file ;
}
}
close THEDIR;
print $lastfile;
__END__
Now I'm sure this *could* be better, more efficient etc
but it is an example of how such a thing can be done. How to get it
to do the other way round is left as an exercise (it is half past two
after all ).
/J\z
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 4 Jul 1998 19:01:45 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: better way of getting the last modified file?
Message-Id: <MPG.10087e62998a94fa989713@nntp.hpl.hp.com>
[This followup was posted to comp.lang.perl.misc and a copy was sent to
the cited author.]
In article <359ed4f9.6805921@news.btinternet.com> on Sun, 05 Jul 1998
01:31:32 GMT, Jonathan Stowe <Gellyfish@btinternet.com> says...
...
> This is a little hack I had kicking around that finds the oldest file:
>
> #!perl
>
> opendir(THEDIR,".") || die "Outta here -$!\n";
>
> while(defined($file = readdir(THEDIR)))
> {
> next if $file =~ m%^.{1,2}$%;
Are you prejudiced against all namelength-deprived files?
next if $file =~ m%^\.{1,2}$%;
...
> Now I'm sure this *could* be better, more efficient etc
> but it is an example of how such a thing can be done. How to get it
> to do the other way round is left as an exercise (it is half past two
> after all ).
I guess :-)
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 4 Jul 1998 23:34:55 GMT
From: rknig@nospam.csus.com (Roddy Knight)
Subject: Compiling Perl for SunOS4
Message-Id: <6nme6v$btc@dfw-ixnews8.ix.netcom.com>
I am trying to compile the latest version of Perl for SunOS4 running on a
Sparc5. I get the following error when I type make:
ld: Undefined symbol
_memmove
*** Error code 2
make: Fatal error: Command failed for target `miniperl'
Can anyone help me out with this error message?
------------------------------
Date: Sun, 05 Jul 1998 00:55:41 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Compiling Perl for SunOS4
Message-Id: <359ecc1f.5388362@news.btinternet.com>
On 4 Jul 1998 23:34:55 GMT, Roddy Knight wrote :
>I am trying to compile the latest version of Perl for SunOS4 running on a
>Sparc5. I get the following error when I type make:
>
>ld: Undefined symbol
> _memmove
>*** Error code 2
>make: Fatal error: Command failed for target `miniperl'
>
>Can anyone help me out with this error message?
>
Yeah the linker cant find memmove in any of the libraries its been
told to search. This seems kind of unusual for the perl configuration
because I seem to remember that it will actually extract the symbols
from the libraries during Configure in order to find out whether it
needs to fix up any messing functions. The usual problems are with
the header files I've found.
You might want to check up on the memmove function manpage on your
system and see which library it comes from and then check the Makefile
to see if it is actually using that library and if not the add a
-l<whatever> bit to your CFLAGS or whatever it is. Of course if you
dont understand about the C compilation system then all bets are off -
I'd find a local C expert to help you debug the make.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 04 Jul 1998 19:27:06 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: E-Mail Validation (easy question)
Message-Id: <m3zpepb3jp.fsf@peach.z.org>
charlie@antipope.org (Charlie Stross) writes:
> I suspect I'm about to be drowned out by Tom Christiansen chanting "there
> is no way to verify an email address!" with a chorus of SMTP hackers
> chanting RFCs in the background.)
Heh. You're obviously not new to the group then...
If posters were more specific about what they wanted to "verify,"
life would be much easier.
Jeremy
--
Jeremy D. Zawodny Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/ jzawodn@wcnet.org
LOAD "LINUX",8,1
------------------------------
Date: 5 Jul 1998 01:51:58 GMT
From: gusline@mindspring.com (Halian Phillips)
Subject: Faq annotation #1
Message-Id: <gusline-0407982000280001@pool-207-205-130-229.atln.grid.net>
I've just spent the past little while trying to figure out what exactly is
going on in the Perl code mentioned on the Faq under "computing the
difference of two arrays, ... the intersection of two arrays?" Here is my
annotation of it, please send me any corrections or comments you might
have.
@union=@intersection=@difference=();
%count=();
foreach $element(@array1,@array2) {$count{$element}++}
foreach $element(keys %count) {
push @union, $element;
push @{$count{$element}>1 ? \@intersection : \@difference},$element;
}
Lines 1 and 2 set the arrays @union, @intersection, @difference, and the
hash %count to the null value.
Line 3 says for each $element in @array1 and @array2, make an element of
the %count hash to have a key of $element and a value of +1 to the same
element that may already be in the hash at the time. i.e. the first time
"dog" gets put into the hash, it gets a value of 1, the second time "dog"
gets put into the hash, it gets a value of 2, etc..
Line 4 says for every $element in the key of the %count hash, execute the
following block.
Line 5 says to put the $element at the end of the @union array, and go on
to the next command.
Line 6 says first check to see if the value of the key in the %count hash
is greater than one. If it is, then put the $element at the end of the
@intersection array. If it is not then put the $element at the end of the
@difference array.
So what we end up with is three arrays! One with all the elements of
@array1 and @array2, one with just the single occurances of the elements
of @array1 and @array2, and one with the multiple occurances of the
elements of @array1 and @array2. This only works if the elements in each
array are unique.
-Hal
------------------------------
Date: Sun, 05 Jul 1998 00:33:23 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: first mess up
Message-Id: <359ec6b7.4005021@news.btinternet.com>
On Sat, 4 Jul 1998 15:25:18 -0500, Howard Dierking wrote :
>I corrected the syntax stuff I think--at least I I don't think this sounds
>like a syntax error:
>
>exec of /usr/local/etc/httpd/cgi-bin/validateid.pl failed, errno is 2
>[Sat Jul 4 13:14:47 1998] access to
>/usr/local/etc/httpd/cgi-bin/validateid.pl
>failed for 1cust103.tnt1.hou1.da.uu.net, reason: Premature end of script
>headers
>
>(that's the error)
>
>Is there a list somewhere of errors and what they mean exactly?
>
I think you probably still have a problem with your script. If you
are using CGI.pm as has been suggested then you can run this from the
command line to see if it works correctly. If this seems fine but it
still fails when run as a CGI you might think of using:
use CGI::Carp qw(fatalsToBrowser);
at the beginning of your script, or alternatively on e of the many
other CGI die handlers that have been proposed in this group and
elsewhere in recent months.
The perldiag manpage has a list of all the diagnostic messages emitted
by Perl - this information can also be obtained by using the
diagnostics pragma i.e.
use diagnostics;
For errors with HTTP (or CGI) you might need to look at the relevant
document which I think is referenced from the URL in my signature.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: Sat, 04 Jul 1998 17:55:34 -0600
From: Jeffery Cann <jc_cann@ix.netcom.com>
Subject: How do I dereference an object when 'use strict' pragma is used?
Message-Id: <359EC0F6.93F2BB9A@ix.netcom.com>
Greetings.
I am going through Tom's Perl Tutorial in the Perl docs (perltoot). I am confused at this
point!
I am trying to compile the 'PERSON' package and some example code with the 'use strict'
pragma. After assigning the member field 'NAME' using the method PERSON::name(), I am
attempting to call this method again and dereference my object to find out his name. The
example in the tutorial without the 'use strict' pragma is:
------------ tutorial code -------------
$him = Person->new();
$him->name("Jason");
printf "His name is %s\n", $him->name;
----------------------------------------
The problem is that if I use the same dereference of my $him object with use strict as
below, the perl interpreter complains that my reference to the name method is not scoped
-- i.e., I should be calling the name method as PERSON::name. (see code below)
So I have some questions/clarifications.
1. Clarification: In the call to PERSON::name() in line 10, I am not creating a new
object, but merely using the PERSON::name() method to assign "Jason" to the PERSON->NAME
member of my $him object. Is this an accurate description of what is going on?
2. Question: How can I can call PERSON::name() to retrieve "Jason" from my $him object
when 'use strict' pragma is on?
3. Question: Looking at the perl faq, I did not see much on object-oriented aspects of
perl. Could someone post some URLs where I can read more about it? I am aware of the
perltoot, perlobj, and perlbot in the perl docs, but am looking for another vantage point.
Thanks
Jeff
------------------- test.pl -------------------
1 #!/usr/bin/perl
2
3 use diagnostics;
4 use strict;
5 use PERSON;
6
7 my $him;
8
9 $him = PERSON::new();
10 $him = PERSON::name("Jason");
11 printf "Person is named %s\n",$him->name;
------------------- Person.pm ------------------
package Person;
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
$self->{NAME} = undef;
bless ($self, $class);
return $self;
}
##############################################
## methods to access per-object data ##
## ##
## With args, they set the value. Without ##
## any, they only retrieve it/them. ##
##############################################
sub name {
my $self = shift;
if (@_) { $self->{NAME} = shift }
return $self->{NAME};
}
--
+--------------------------+-------------------------+
| Jeffery Cann | This message sent from |
| JCDS Managing Developer | a Linux Workstation |
+--------------------------+-------------------------+
http://www.netcom.com/~jcds
------------------------------
Date: Sun, 05 Jul 1998 00:55:44 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: How do I dereference an object when 'use strict' pragma is used?
Message-Id: <359ece77.5988912@news.btinternet.com>
On Sat, 04 Jul 1998 17:55:34 -0600, Jeffery Cann wrote :
>Greetings.
>
>I am going through Tom's Perl Tutorial in the Perl docs (perltoot). I am confused at this
>point!
>
>I am trying to compile the 'PERSON' package and some example code with the 'use strict'
>pragma. After assigning the member field 'NAME' using the method PERSON::name(), I am
>attempting to call this method again and dereference my object to find out his name. The
>example in the tutorial without the 'use strict' pragma is:
>
>------------ tutorial code -------------
> $him = Person->new();
> $him->name("Jason");
>
> printf "His name is %s\n", $him->name;
>----------------------------------------
>
<etc>
try
my $him = Person->new();
etc
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 4 Jul 1998 23:50:08 GMT
From: rchmllr@ix.netcom.com (Rich Miller)
Subject: LD_LIBRARY_PATH question
Message-Id: <6nmf3g$pml@sjx-ixn2.ix.netcom.com>
When I set the LD_LIBRARY_PATH environment variable in a BEGIN block
at the beginning of a script, why doesn't the change take effect in
subsequent calls to dynamic loading functions which use this variable?
As an example, I set LD_LIBRARY_PATH from the command line:
> export LD_LIBRARY_PATH=abc
and then execute the following simple script:
#!/opt/perl/bin/perl
BEGIN {$ENV{LD_LIBRARY_PATH} = 'xyz'; $| = 1;
print "pid [$$], library path [$ENV{LD_LIBRARY_PATH}]\n"}
use Sybase::DBlib;
with the ld debugger on to see how the dynamic loading is handled:
> LD_DEBUG=libs ld_test.pl
22526:
22526: find library=libsocket.so.1; searching
22526: search path=abc (LD_LIBRARY_PATH)
22526: trying path=abc/libsocket.so.1
22526: search path=/usr/lib (default)
22526: trying path=/usr/lib/libsocket.so.1
22526:
(snip)
22526:
22526: transferring control: /opt/perl/bin/perl
22526:
pid [22526], library path [xyz]
22526:
22526: find library=libsybdb.so; searching
22526: search path=abc (LD_LIBRARY_PATH)
22526: trying path=abc/libsybdb.so
22526: search path=/opt/sybase/lib:/lib (RPATH from file /opt/perl/lib/site_pe
rl/sun4-solaris/auto/Sybase/DBlib/DBlib.so)
22526: trying path=/opt/sybase/lib/libsybdb.so
22526: trying path=/lib/libsybdb.so
22526: search path=/usr/lib (default)
22526: trying path=/usr/lib/libsybdb.so
22526:
22526: ld.so.1: /opt/perl/bin/perl: fatal: libsybdb.so: open failed: No such fil
e or directory
22526:
Can't load '/opt/perl/lib/site_perl/sun4-solaris/auto/Sybase/DBlib/DBlib.so' for
module Sybase::DBlib: ld.so.1: /opt/perl/bin/perl: fatal: libsybdb.so: open fai
led: No such file or directory at /opt/perl/lib/DynaLoader.pm line 140.
at /opt/perl/lib/site_perl/Sybase/DBlib.pm line 304
BEGIN failed--compilation aborted at ld_test.pl line 5.
(snip)
As you can see from the messages, the change to LD_LIBRARY_PATH
appears to have taken effect when the print statement is reached,
but when the subsequent "use Sybase::DBlib" is executed and tries to
link in the libsybdb.so file, the search path ld.so.1 is using is
still the old one, even though it appears to be the same process
in which I've successfully changed it. Can anyone explain why?
Rich Miller
richard.a.miller@norwest.com or
rchmllr@ix.netcom.com
------------------------------
Date: Sun, 05 Jul 1998 02:35:43 GMT
From: "Terry" <terry@aol.com>
Subject: Length and stripping function
Message-Id: <3EBn1.1137$OY1.3633784@nnrp2.ptd.net>
I run an online newsletter, and on the form the value of the only field is
"put your email here" (due to space consideration) anyway
I get people who don't remove that and put their email before it and submits
me their email which a PERL scripts automatically stres into a text file.
What I want to do is find a way to strip that line if it is there.
Here is part of my code (where address is the variable)
// Check for @ symbol
if ($in{'address'}!~ /@/){&bademail}
foreach $member(@addresses)
{
chomp($member);
if ($in{'address'} eq $member){&already_subscribed}
}
push (@addresses,$in{'address'});
open(LIST,">>$list_file");
print LIST "$in{'address'}\n";
close(LIST);
Any help would be great. Please email me anything you all can come up with
to:
terry@tbonnet.com, please don't post to the list just incase I don't get
back here for a while. thanks
------------------------------
Date: 4 Jul 1998 23:51:12 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: limits of glob() ?
Message-Id: <1998070423511200.TAA29392@ladder01.news.aol.com>
Hi Dan:
>> : What IS the limit?
>>
>> It depends on the shell, not on perl.
>-------
>how about on win32?
Still depends on the shell. Vanilla Win95 is just under 128 (126).
Others differ.
>> : i.e. when should I
>> : consider using opendir(), readdir(), closedir()?
>>
>> Always.
>sorry, haven't memorized the docs yet! I have 5 different books I look
>at, and none of them had good answers on these topics, so I thought I'd
>ask. The problem is WHICH doc to look at!
The ones that come up with the above answer should be consulted
first (easy test). And since you mention the Gecko, try pages 142-143.
-bill
Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: 04 Jul 1998 19:36:12 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: perl asp question
Message-Id: <m3ogv5b34j.fsf@peach.z.org>
"ee" <ee@juno.com> writes:
> The following is my attempted perl port of a vbscript example. It should
> open a file and display all of its contents.
>
> <%
> $filesys = $Server->CreateObject("Scripting.FileSystemObject");
> $filea = $filesys->OpenTextFile("c:\inetpub\wwwroot\copy.txt");
> $Response->write ($filea->ReadAll);
> %>
>
>
> However I get the following message:
>
> $filea = $filesys->OpenTextFile("c:\inetpub\wwwroot\copy.txt");
> $Response->write ($filea->ReadAll); error '80004005'
>
> Can't call method "ReadAll" without a package or object reference.
>
> /test.asp, line 17
>
>
> Does someone know what I'm doing wrong.
This isn't the answer you're looking for, but IMHO what you're doing
wrong is trying to use Perl like VBScript.
You can do that in Perl without having to dig into VBScript's object
model. Something like:
<%
open(BLAH, "<C:/inetpub/wwwroot/copy.txt") or die "$!";
while(<BLAH>) {
print;
}
close(BLAH) or die "$!";
%>
Of course, there's more than one way to do it.
My guess is that you've got the syntax slightly messed up for
translating VBScript to Perl. But I can't help you much there, 'cause
I try to avoid doing exactly that.
The few timed I did try it, I found the syntax cumbersome. I ended up
needing lost of {} pairs in places where it didn't feel natural. Maybe
you need $filea->{ReadAll} or something along those lines.
Good Luck,
Jeremy
--
Jeremy D. Zawodny Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/ jzawodn@wcnet.org
LOAD "LINUX",8,1
------------------------------
Date: Sun, 05 Jul 1998 01:12:27 GMT
From: Douglas Galbraith <douglas@home.com>
Subject: Perl download (acting as a Browser)
Message-Id: <359ED2DD.52B0367F@home.com>
Hello,
Does someone have an example perl script which downloads information off
the web using a Window95 machine? (For example: how would you download
a web page from "http://www.yahoo.com" and pull information from it?)
I'm asking for this help because my perl manuals focus on server side
uses, not the client side (just the opposite of what I need).
I'd like to use a perl script to download information off of the net and
process it on my local Windows95 machine. (For example, downloading
news articles and stock quotes). I've installed perl and run some test
scripts successfully. I do NOT have a server installed on my machine.
But since my browsers access web sites without a local server, I would
assume that perl scripts should also be able to access those same sites.
Below is my system configuration:
system: Windows95 (4.00.950a)
perl version: perl 5.003_07
perl download:
ftp://ftp.activestate.com/Perl-Win32/Release/Pw32i316.exe
browsers: Internet Explorer 3.02
browsers: Netscape Communicator 4.02
thanks for the help in advance;
DGalbra862@aol.com
------------------------------
Date: Sun, 05 Jul 1998 01:45:26 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Perl download (acting as a Browser)
Message-Id: <359ed910.7852572@news.btinternet.com>
On Sun, 05 Jul 1998 01:12:27 GMT, Douglas Galbraith wrote :
>Hello,
>
>Does someone have an example perl script which downloads information off
>the web using a Window95 machine? (For example: how would you download
>a web page from "http://www.yahoo.com" and pull information from it?)
>
Go to CPAN grab yourself libwww-perl (LWP) unpack and install it and
read the documentation, which is copious, this can do all that you
want and more and relatively simply.
>I'm asking for this help because my perl manuals focus on server side
>uses, not the client side (just the opposite of what I need).
>
Hmmm, But there are some good examples of doing client stuff in the
FAQ.
<snip>
>
>Below is my system configuration:
> system: Windows95 (4.00.950a)
> perl version: perl 5.003_07
> perl download:
>ftp://ftp.activestate.com/Perl-Win32/Release/Pw32i316.exe
> browsers: Internet Explorer 3.02
> browsers: Netscape Communicator 4.02
>
I would suggest that you get rid of that ActiveState thing and get the
"standard" binary distribution for Win32 from www.perl.com which is at
5.004.02 and has the full(ish) documentation set and a far more
comprehensive set of modules.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 04 Jul 1998 19:28:45 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: print $ENV{'PATH_INFO'} problem
Message-Id: <m3u34xb3gy.fsf@peach.z.org>
Mark Stier <slayer.man@usa.net> writes:
[nothing]
We're gonna need a little more than that to do on. But based on the
subject line, you may want to target one of the WWW/CGI newsgroups
instead.
Jeremy
--
Jeremy D. Zawodny Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/ jzawodn@wcnet.org
LOAD "LINUX",8,1
------------------------------
Date: Sat, 04 Jul 1998 23:21:28 GMT
From: bhkraft@gj.net (Brian Kraft)
Subject: Re: public news server
Message-Id: <6nmdgm$qea$1@jumbo.demos.su>
>I am looking for an access to a public news server to get comp.lang.perl.misc
I'm testing... jumbo.demos.su (for posting propagation);
...also try: taiwan.informatik.uni-rostock.de
news.reliastar.com
romberg.kiz.uni-vechta.de (5,000+ messages stored, read-only)
------------------------------
Date: Sat, 4 Jul 1998 19:06:32 -0400
From: "Frederik Sims" <efs@rocketmail.com>
Subject: repost perl asp question (correct e-mail adress)
Message-Id: <6nmcgo$sei@bgtnsc01.worldnet.att.net>
The following is my attempted perl port of a vbscript example. It should
open a file and display all of its contents.
<%
$filesys = $Server->CreateObject("Scripting.FileSystemObject");
$filea = $filesys->OpenTextFile("c:\inetpub\wwwroot\copy.txt");
$Response->write ($filea->ReadAll);
%>
However I get the following message:
$filea = $filesys->OpenTextFile("c:\inetpub\wwwroot\copy.txt");
$Response->write ($filea->ReadAll); error '80004005'
Can't call method "ReadAll" without a package or object reference.
/test.asp, line 17
Does someone know what I'm doing wrong.
Thanks
Frederik Sims
efs@rocketmail.com
ps. this is the vbscript sample that works
<%
Dim fs, a
set fs = CreateObject ("Scripting.FileSystemObject")
Set a = fs.OpenTextFile("c:\inetpub\wwwroot\copy.txt")
Response.Write (a.ReadAll)
a.Close
%>
------------------------------
Date: Sun, 05 Jul 1998 00:33:19 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: repost perl asp question (correct e-mail adress)
Message-Id: <359ebce1.1667193@news.btinternet.com>
On Sat, 4 Jul 1998 19:06:32 -0400, Frederik Sims wrote :
>The following is my attempted perl port of a vbscript example. It should
>open a file and display all of its contents.
>
><%
>$filesys = $Server->CreateObject("Scripting.FileSystemObject");
>$filea = $filesys->OpenTextFile("c:\inetpub\wwwroot\copy.txt");
>$Response->write ($filea->ReadAll);
>%>
>
>
>However I get the following message:
>
>$filea = $filesys->OpenTextFile("c:\inetpub\wwwroot\copy.txt");
>$Response->write ($filea->ReadAll); error '80004005'
>
>Can't call method "ReadAll" without a package or object reference.
>
I think its very virtuous of you to repost because you had an
incorrect address ;-}
I dont really know that much about ASP or the PerlScript
implementation but I think that you need to test whether $filea has a
valid value after the $filesys->OpenTextFile(..) - the same goes for
this sort of thing as does for the standard open.
Bear in mind that PerlScript is still Perl in its heart of hearts and
that path you fed to OpenTextFile would have broken in any script now
wouldnt it ? Perl will take / better than \ in pathnames but I'm sure
you can suss all of that business out for yourself.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 5 Jul 1998 00:53:45 GMT
From: ameyer@ix.netcom.com (Alan Meyer)
Subject: Re: Script text editor
Message-Id: <6nmiqp$ddg@dfw-ixnews6.ix.netcom.com>
In article <30xn1.36$3Z2.498983@news.axxsys.net>, willdeb@adelphia.net wrote...
>
>I have been advised that carriage returns are death to scripts. Can =
>anyone recommend an editor that will not put cr's in the script?
>
>Will
>CompwareUSA
>
If you have a DOS/Win32 script with CrLf under UNIX, you can remove the
Cr with:
tr -d "\015" < infile > outfile
Files with Lf only will be processed just fine on Win32 as well as UNIX,
but can't be edited gracefully with all editors.
--
Alan Meyer
AM Systems, Inc
Randallstown, MD
ameyer@ix.netcom.com
------------------------------
Date: Sun, 05 Jul 1998 00:33:21 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: size limit on array ?
Message-Id: <359ec1c8.2741801@news.btinternet.com>
On Sat, 04 Jul 1998 18:34:33 GMT, rferr wrote :
>i am performing the following command in my perl script:
>
>@matches = egrep -i -l '$user' dirname;.
>
I dont think that is what you can have meant. Perhaps
@matches = `egrep -i -l $user $dirname/*`;
makes more sense.
>if (! $matches[0])
> {
> &nofound;
> }
>
>this code works fine as long as the number of files in the search dir
>doesnot exceed
>a certain number. if i go above around 350-400 files it doesnt work.
Unless your system is particularly poxy I cant imagine that number of
array elements causing a problem. Are you checking $? after use of
the external command - it might be that your Perl is using a shell to
execute external commands that is unable to handle large command lines
whereas your login shell (being of a different temperament) can.
It might behove you to implement this kind of thing purely in Perl -
I'll probably get a dig for being 'anti-toolbox' but Perl does have a
greater freedom from arbitary limits than most Unix commands including
the shells.
/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
------------------------------
Date: 4 Jul 1998 23:02:49 GMT
From: lvirden@cas.org
Subject: Re: Why no Perl news/mailreader?
Message-Id: <6nmcap$bm7$1@srv38s4u.cas.org>
According to Gossamer <gossamer@tertius.net.au>:
:A geek-friend and I were conversing tonight (yes, face to face!) and
:discovered we'd both recently been looking at the Slrn and Mutt source
:code and thought, "This would be SO much easier in Perl".
Agreed. However, you might take a look at trn and it's perl filtering hook.
It's not what you specifically are looking for, but at least it's a start.
And Rn does have the same heritage as perl.
--
<URL:mailto:lvirden@cas.org> Quote: In heaven, there is no panic,
<*> O- <URL:http://www.teraform.com/%7Elvirden/> only planning.
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
------------------------------
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 3062
**************************************