[15471] in Perl-Users-Digest
Perl-Users Digest, Issue: 2881 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 27 14:16:37 2000
Date: Thu, 27 Apr 2000 11:15:25 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <956859325-v9-i2881@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 27 Apr 2000 Volume: 9 Number: 2881
Today's topics:
reading .ost files amarodeeps@my-deja.com
Re: reading .ost files <rootbeer@redcat.com>
Regular Expression Newbie <gromanNOgrSPAM@thehelm.com.invalid>
Re: Regular Expression Newbie (Andrew Johnson)
Re: Regular Expression Newbie <rootbeer@redcat.com>
Running a remote shell script from Perl <nospamccorrigan@bradson.com>
Re: Running a remote shell script from Perl <rootbeer@redcat.com>
Re: Running a remote shell script from Perl <andrew.mcguire@walgreens.com>
SDBM and tie schnurmann@my-deja.com
Re: SDBM and tie <rootbeer@redcat.com>
Re: TCP/IP transfer timeout <akihabara@denno.gumi.com>
Re: TCP/IP transfer timeout <rootbeer@redcat.com>
Re: TCP/IP transfer timeout <akihabara@denno.gumi.com>
Re: TCP/IP transfer timeout <andrew.mcguire@walgreens.com>
Re: TCP/IP transfer timeout <rootbeer@redcat.com>
Re: TCP/IP transfer timeout <andrew.mcguire@walgreens.com>
Re: TCP/IP transfer timeout <akihabara@denno.gumi.com>
Re: Updating perl <rootbeer@redcat.com>
Value of Reference <samay1NOsaSPAM@hotmail.com.invalid>
Re: Value of Reference <rootbeer@redcat.com>
Re: Value of Reference nobull@mail.com
Re: Value of Reference nobull@mail.com
Win32::OLE=HASH(address) errors on NT b_stark@my-deja.com
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 27 Apr 2000 15:11:53 GMT
From: amarodeeps@my-deja.com
Subject: reading .ost files
Message-Id: <8e9lb9$36e$1@nnrp1.deja.com>
Does anyone know about reading .ost files with Perl?
I'm using Outlook 2000 at work (not my choice) and I
would like to be able to extract the attachments that
are embedded in these files (another stupid Microsoft
idea, IMHO) and put them in a folder on my hard drive.
Any thoughts, knowledge of file specifications, pointers
to documentation or modules, etc? Any help would be
greatly appreciated, thanks much!
-Dave
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 08:48:16 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: reading .ost files
Message-Id: <Pine.GSO.4.10.10004270847510.21722-100000@user2.teleport.com>
On Thu, 27 Apr 2000 amarodeeps@my-deja.com wrote:
> Does anyone know about reading .ost files with Perl?
If there's a module which does what you want, it should be listed in
the module list on CPAN. If you don't find one to your liking, you're
welcome and encouraged to submit one! :-) Hope this helps!
http://www.cpan.org/
http://search.cpan.org/
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 27 Apr 2000 10:16:26 -0700
From: Groman <gromanNOgrSPAM@thehelm.com.invalid>
Subject: Regular Expression Newbie
Message-Id: <0cc72f2a.121ad2c8@usw-ex0105-034.remarq.com>
Hi!
I know a little perl(been doing some basic scripts), but
have never used regular expressions. I have The Little Black
Book of perl, but it didn't really help me.
Is there a tutorial on the net that will help me, understand
regular expressions at least partially(to do some basic pattern
matching).
My current problem is the following:
I have a file, that is structured this way:
Number:Name:Text
..
Number:Name:Text
and I want to parse it with perl, the following way.
I want to isolate all entries from the file with Number
bigger than $maxnum
Later, I want to neutralize all the \n /n \t /t and HTML tags in
them.
and print them to STDOUT.
I can understand how to open a file. And dump it into an array
of scalars. (or something)
I can understand how to print it.
But how the hell do I parse it???
Thanx.
Groman.
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Thu, 27 Apr 2000 17:47:56 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Regular Expression Newbie
Message-Id: <g3%N4.8849$95.71270@news1.rdc1.mb.home.com>
In article <0cc72f2a.121ad2c8@usw-ex0105-034.remarq.com>,
Groman <gromanNOgrSPAM@thehelm.com.invalid> wrote:
[snip]
> Is there a tutorial on the net that will help me, understand
> regular expressions at least partially(to do some basic pattern
> matching).
Mark Kvale has recently written two regex tutorials available at:
http://keck.ucsf.edu/~kvale/perlretut.pod
http://keck.ucsf.edu/~kvale/perlrequick.pod
the second is the more basic introduction. You can also get the regex
chapter of my book (chapter 10) in PDF format at:
http://www.manning.com/Johnson/Chapters.html
regards,
andrew
--
Andrew L. Johnson http://members.home.net/andrew-johnson/epwp.html
In theory, there's no difference between
theory and practice, but in practice there is!
------------------------------
Date: Thu, 27 Apr 2000 10:51:31 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Regular Expression Newbie
Message-Id: <Pine.GSO.4.10.10004271047320.21722-100000@user2.teleport.com>
On Thu, 27 Apr 2000, Groman wrote:
> Subject: Regular Expression Newbie
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> Is there a tutorial on the net that will help me, understand regular
> expressions at least partially(to do some basic pattern matching).
Yes; several. Where have you searched that you didn't find one?
> I have a file, that is structured this way:
> Number:Name:Text
> ..
> Number:Name:Text
>
> and I want to parse it with perl, the following way.
> I want to isolate all entries from the file with Number
> bigger than $maxnum
Although you could do that with a pattern, it's probably better to use
numeric comparisons.
> Later, I want to neutralize all the \n /n \t /t and HTML tags in them.
What are /n and /t? Don't try to parse HTML with simple patterns; use
HTML::Parser. I think you probably want tr/// to strip out unwanted
characters, but I'm not sure.
> But how the hell do I parse it???
Have you seen the docs for 'split' in the perlfunc manpage? Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 27 Apr 2000 12:14:36 -0400
From: "Catherine" <nospamccorrigan@bradson.com>
Subject: Running a remote shell script from Perl
Message-Id: <KGZN4.373$o07.912@client>
Hi
I'm trying to run a remote shell script from a Perl script.
This is what I have:
use Shell;
rsh ("new.company.com" ,"/u/vacationf.sh","$username");
I'm getting the following error in the log file:
3004-302 Your account has expired; please see the system administrator.
Any ideas about what is going on?? The perl script is running as "nobody"
Thanks in advance.
Catherine
ccorrigan@bradson.com
------------------------------
Date: Thu, 27 Apr 2000 09:38:04 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Running a remote shell script from Perl
Message-Id: <Pine.GSO.4.10.10004270933270.21722-100000@user2.teleport.com>
On Thu, 27 Apr 2000, Catherine wrote:
> From: Catherine <nospamccorrigan@bradson.com>
> Reply-To: Catherine <ccorrigan@bradson.com>
Another failed spam block. Well, the spammers have you address now! :-)
> use Shell;
> rsh ("new.company.com" ,"/u/vacationf.sh","$username");
Probably better to use system() than Shell, but I suppose it's all
right.... But those quote marks around $username are merely misleading.
> I'm getting the following error in the log file:
> 3004-302 Your account has expired; please see the system administrator.
Perhaps you should see the system administrator. :-)
> Any ideas about what is going on?? The perl script is running as
> "nobody"
I'd guess that the account for user 'nobody' has expired, in the sense
that you can't rsh as user 'nobody'. That's security for you! But that
problem really doesn't have anything to do with Perl, in that case; trying
to run rsh from a C program (or, for that matter, run rsh directly) would
almost certainly give the same result.
You may wish to make your program set-id, to some other user than
'nobody', so be sure to read the perlsec manpage. Better, though, if you
can avoid that. Only your admin knows for sure.
Good luck with it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 27 Apr 2000 11:37:30 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: Running a remote shell script from Perl
Message-Id: <39086CCA.C4B43556@walgreens.com>
Catherine wrote:
>
> Hi
>
> I'm trying to run a remote shell script from a Perl script.
>
> This is what I have:
>
> use Shell;
> rsh ("new.company.com" ,"/u/vacationf.sh","$username");
>
> I'm getting the following error in the log file:
> 3004-302 Your account has expired; please see the system administrator.
>
> Any ideas about what is going on?? The perl script is running as "nobody"
This really is not a Perl problem, more than likely your
remote system does not allow login as nobody, hence the error.
I would follow the advice the error gives you, and contact
your sysadmin to make other arrangements for your script.
Cheers,
anm
--
Andrew N. McGuire
andrew.mcguire@walgreens.com
------------------------------
Date: Thu, 27 Apr 2000 15:59:09 GMT
From: schnurmann@my-deja.com
Subject: SDBM and tie
Message-Id: <8e9o42$65u$1@nnrp1.deja.com>
If I tie a hash to an sdbm file, do I have to do anything beyond
$myhash->{'key]} = value;
to store the data?
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 27 Apr 2000 09:28:06 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: SDBM and tie
Message-Id: <Pine.GSO.4.10.10004270927190.21722-100000@user2.teleport.com>
On Thu, 27 Apr 2000 schnurmann@my-deja.com wrote:
> If I tie a hash to an sdbm file, do I have to do anything beyond
>
> $myhash->{'key]} = value;
>
> to store the data?
Well, I'm sure you see the syntax error in your line, so I won't point it
out to you. :-)
But don't the docs make this clear? Is something not working as you think
it should?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 28 Apr 2000 00:06:11 +0900
From: "Akihabara" <akihabara@denno.gumi.com>
Subject: Re: TCP/IP transfer timeout
Message-Id: <8e9l14$1r89$1@news1.md.xaxon.ne.jp>
Thank you for reply.
> use LWP::Simple
> $file = get "http://www.yahoo.com:80/";
>
I tried using LWP:UserAgent and specified timeout(20),
but the response time is 72 second actually.
I want to make the actual timeout be 20 second by force.
How should I do?
------------------------------
Date: Thu, 27 Apr 2000 08:44:58 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: TCP/IP transfer timeout
Message-Id: <Pine.GSO.4.10.10004270844430.21722-100000@user2.teleport.com>
On Fri, 28 Apr 2000, Akihabara wrote:
> I want to make the actual timeout be 20 second by force.
>
> How should I do?
Have you seen the FAQ?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 28 Apr 2000 01:17:39 +0900
From: "Akihabara" <akihabara@denno.gumi.com>
Subject: Re: TCP/IP transfer timeout
Message-Id: <8e9p74$1tql$1@news1.md.xaxon.ne.jp>
> Have you seen the FAQ?
I'm sorry but I tried to find the line in the FAQ but I can't.
Would you tell me where it is?
------------------------------
Date: Thu, 27 Apr 2000 11:40:31 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: TCP/IP transfer timeout
Message-Id: <39086D7F.B4C94FAA@walgreens.com>
Akihabara wrote:
>
> > Have you seen the FAQ?
>
> I'm sorry but I tried to find the line in the FAQ but I can't.
>
> Would you tell me where it is?
Try:
perldoc perlfaq
or:
http://www.perlfaq.com
Regards,
anm
--
Andrew N. McGuire
andrew.mcguire@walgreens.com
------------------------------
Date: Thu, 27 Apr 2000 10:14:04 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: TCP/IP transfer timeout
Message-Id: <Pine.GSO.4.10.10004271013440.21722-100000@user2.teleport.com>
On Fri, 28 Apr 2000, Akihabara wrote:
> I'm sorry but I tried to find the line in the FAQ but I can't.
>
> Would you tell me where it is?
Sure! Look in section eight for "How do I timeout a slow event?". Enjoy!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 27 Apr 2000 12:13:52 -0500
From: "Andrew N. McGuire" <andrew.mcguire@walgreens.com>
Subject: Re: TCP/IP transfer timeout
Message-Id: <39087550.51E77CA0@walgreens.com>
"Andrew N. McGuire" wrote:
>
> Akihabara wrote:
> >
> > > Have you seen the FAQ?
> >
> > I'm sorry but I tried to find the line in the FAQ but I can't.
> >
> > Would you tell me where it is?
>
> Try:
>
> perldoc perlfaq
>
> or:
>
> http://www.perlfaq.com
Egg on my face, sheez, not a good morning for me.
Maybe I should lay off for now. Sorry again. :-(
Must proofread, and reread before posting. Bad me.
Cheers,
anm
--
Andrew N. McGuire
andrew.mcguire@walgreens.com
------------------------------
Date: Fri, 28 Apr 2000 02:12:16 +0900
From: "Akihabara" <akihabara@denno.gumi.com>
Subject: Re: TCP/IP transfer timeout
Message-Id: <8e9sdh$203i$1@news1.md.xaxon.ne.jp>
I cannot find the *line* in the FAQ but I can't.
please answer my question not by show faq but by concrete answer.
I want to make the timeout time be not over 20 second(35 sec,75sec..)
but *exactly* 20 second.
------------------------------
Date: Thu, 27 Apr 2000 08:23:32 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Updating perl
Message-Id: <Pine.GSO.4.10.10004270819260.21722-100000@user2.teleport.com>
On Thu, 27 Apr 2000, Holger van Koll wrote:
> I have several hosts (aix) where old versions of perl (4.x etc.) are
> in use.
Eek!
> I would like to update those hosts to perl 5.005 ; however, I dont
> know anything regarding backwards-compatibily of 5.005.
>
> Can I expect that all scripts that run under 4.x will run under 5.005
> too?
Nearly so. And the few incompatibilities are easy to fix. Also, you should
know that you don't have to remove your ancient perl while you're testing
the new one; see the docs which come with the perl source for more
details.
> Did you ever had any problems after upgrading perl?
Me? Never. :-) But any compatibility problems are small potatoes compared
to the problems which can result from security holes in antique software.
As soon as you've gotten things updated, get rid of that dead camel
carcass!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 27 Apr 2000 09:38:40 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Value of Reference
Message-Id: <29a496b5.ea048163@usw-ex0104-087.remarq.com>
try this print statements
$\="\n";
print eval ([]+0);
print eval({}+0);
print eval(sub {}+0);
When evaluated in 'numerical context' it gives some number..
It may have something to do with memory address converted from
hex into decimal.
Anyone can explain this behavior?
Is it reference anywhere in Perl documents, books??
How we can 'use' this behavior in the program. Any ideas?
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Thu, 27 Apr 2000 10:18:44 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Value of Reference
Message-Id: <Pine.GSO.4.10.10004271015300.21722-100000@user2.teleport.com>
On Thu, 27 Apr 2000, Samay wrote:
> try this print statements
I'd rather not. :-)
> $\="\n";
> print eval ([]+0);
That's doing the evil eval STRING on a pretty-strange string. Don't use
the evil eval STRING unless you know what you're doing.
> print eval({}+0);
> print eval(sub {}+0);
> Anyone can explain this behavior?
> Is it reference anywhere in Perl documents, books??
Yes. Start with perlfunc.
> How we can 'use' this behavior in the program. Any ideas?
What goal do you have in mind?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 27 Apr 2000 18:23:43 +0100
From: nobull@mail.com
Subject: Re: Value of Reference
Message-Id: <u9d7nbv4o0.fsf@wcl-l.bham.ac.uk>
Samay <samay1NOsaSPAM@hotmail.com.invalid> writes:
> try this print statements
>
> $\="\n";
> print eval ([]+0);
> print eval({}+0);
> print eval(sub {}+0);
What is the point of the eval() above? You've already forced the
value to be numeric so eval() is an identity operation.
> When evaluated in 'numerical context' it gives some number..
> It may have something to do with memory address converted from
> hex into decimal.
By "may have something to do with" you mean "appears to be equal to".
> Anyone can explain this behavior?
DWIM?
> Is it reference anywhere in Perl documents, books??
Not that I've ever noticed.
> How we can 'use' this behavior in the program. Any ideas?
I can't immediately see a use for it.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 27 Apr 2000 18:46:36 +0100
From: nobull@mail.com
Subject: Re: Value of Reference
Message-Id: <u9aeifv3lv.fsf@wcl-l.bham.ac.uk>
Tom Phoenix <rootbeer@redcat.com> writes:
> On Thu, 27 Apr 2000, Samay wrote:
> > Anyone can explain this behavior?
> > Is it reference anywhere in Perl documents, books??
>
> Yes. Start with perlfunc.
OK Tom, I call your bluff.
What logical sequence of steps starting at perlfunc will lead to the
documentation of the behaviour of a reference in a numeric context?
Please note: every time you "cry wolf" with an RTFM that directs
someone to a manual that doesn't answer their question you increase
the chance that valid RTFM responses will be ignored or resented.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 27 Apr 2000 15:27:49 GMT
From: b_stark@my-deja.com
Subject: Win32::OLE=HASH(address) errors on NT
Message-Id: <8e9m8v$41k$1@nnrp1.deja.com>
I know *very* little about perl, but I need to use it to grab some data
off a form and send an E-mail. I can get all the data off the form
fine... but when I go to combine the strings everything turns into
Win32::OLE=HASH(address). Here is the script:
# Let's say the value from the form here is Mr.
$myvar1 = $Request->Form('title');
# And this is Brad Stark
$myvar2 = $Request->Form('from');
# If I print $myvar1 & $myvar2 here... they print fine
$result = $myvar1.$myvar2;
$Response->Write ($result);
#after I combine them... instead of printing Mr. Brad Stark I get:
Win32::OLE=HASH(0x14aab50)Win32::OLE=HASH(0x14aab8c)
Any idea what I am doing wrong?
Thanks in advance
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 2881
**************************************