[12421] in Perl-Users-Digest
Perl-Users Digest, Issue: 6021 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 16 17:07:25 1999
Date: Wed, 16 Jun 99 14:00:31 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 16 Jun 1999 Volume: 8 Number: 6021
Today's topics:
Re: @INC question (Abigail)
[Fwd: c::scan and c modules] <jonlee@sls.lcs.mit.edu>
Re: a thread on threads <gbartels@xli.com>
Re: Can anyone explain this behavior? (Bryan D Howard)
Re: Check URL (Abigail)
cookies <leonid76@erols.com>
Re: Events in CGI/Perl (Abigail)
Re: exclusive open (Abigail)
Re: Executing a unix command from Perl (Abigail)
Re: File Processing (Abigail)
Re: File Processing (Abigail)
Re: File Processing (Bart Lateur)
Re: File Uploading (Abigail)
forceing only post methods with perl CGI module <agianni@acsu.buffalo.edu>
Re: Fresh Newbie...Question <d-edwards@uchicago.edu>
Re: Fresh Newbie...Question (Kvan)
Re: Fun with STDERR... <rootbeer@redcat.com>
Re: Help with UDP in Win32 <MurphKE1@aplmsg.jhuapl.edu>
Re: How to extract emails from Outlock Express <rootbeer@redcat.com>
Re: How to scan a directory and put all the files and t <rootbeer@redcat.com>
how2 find first occurence of... <mvp@backrub.cs.itc.hp.com>
Re: how2 find first occurence of... <mvp@backrub.cs.itc.hp.com>
Re: I dont understand system calls (Abigail)
Re: including another variable into an array (Abigail)
IO::Pipe question... <chris.ice@cisco.com>
Re: Is it better perl than awk ? quiver@io.com
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 16 Jun 1999 09:03:06 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: @INC question
Message-Id: <slrn7mfc54.do2.abigail@alexandra.delanet.com>
Bob Stickel (bbgraph@mail2.ee.net) wrote on MMCXV September MCMXCIII in
<URL:news:7k86f1$av2$1@news2.ee.net>:
|| I'm just getting started with Perl and I'm not sure what the @INC does.
There's a man page devoted to explaining all special variables.
There's another man page devoted explaining all the error messages.
Why didn't you consult them first?
Abigail
--
perl -wle 'print "Prime" if ("m" x shift) !~ m m^\m?$|^(\m\m+?)\1+$mm'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 16 Jun 1999 16:51:47 -0400
From: Jonathan Lee <jonlee@sls.lcs.mit.edu>
Subject: [Fwd: c::scan and c modules]
Message-Id: <37680E63.282BA2A5@sls.lcs.mit.edu>
This is a multi-part message in MIME format.
--------------66466DA60CEBA656BC38D26E
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
perhaps someone in this ng could help me as well (originally sent this
to comp.lang.perl.modules)
--------------66466DA60CEBA656BC38D26E
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
X-Mozilla-Status2: 00000000
Message-ID: <3767FE7D.BE416141@sls.lcs.mit.edu>
Date: Wed, 16 Jun 1999 15:43:57 -0400
From: Jonathan Lee <jonlee@sls.lcs.mit.edu>
X-Mailer: Mozilla 4.5 [en] (X11; U; Linux 2.2.9 i686)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.lang.perl.modules
Subject: c::scan and c modules
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
hello,
i'm a young, naive perl programmer who needs to do some interfacing
between c and unix. but i've come across problems.
so i got c::scan and data::flow and i've been trying to use h2xs. i had
purchased and read through oreilly's advanced perl programming book and
had gone through some of the examples.
but for some reason when i try to do everything on my own, i get errors
(of either type 1 or 2) when i try to execute "make". perl Makefile.PL
works, but then "make" and "make test" don't.
here's a couple other things:
i'm a mere undergrad research assistant, of sorts. so on the network i
can't be "superuser" and thus have no writing access to the
/usr/local/lib/perl5 directories to install. so i tried to have all the
.pm and .xs files install on my own dir. (for example, i modify the
Makefile.PL file by adding the line 'PREFIX'=> '/usr/users/jonlee',)
******i would like someone to simply explain what files i need to have
created first (and what actions i need to carry out) so that i can use
Makefile, and my glue code to make my perl program able to call these C
functions.
i have a .c file that has a whole bunch of subroutines. do i need to
have a .h file as well? does my .h file only have the basic prototype
structures, or can they have the whole subroutine included also? do i
need to use #include? any special lines like you need to use in perl
(#!/usr/local/bin/perl5). can you have .pm modules installed elsewhere
instead of the main perl5 directory?
i've been frustratingly reading and rereading these books (i've got 4 of
them on my desks) to no avail for the past week now.
jon
--------------66466DA60CEBA656BC38D26E--
------------------------------
Date: Wed, 16 Jun 1999 15:31:26 -0400
From: Greg Bartels <gbartels@xli.com>
Subject: Re: a thread on threads
Message-Id: <3767FB8E.17DBA92@xli.com>
Uri Guttman wrote:
> actually it sounds more like co-routines to me.
ah, new-terminology to me, since I'm a hardware guy, but it sounds like
we're getting close to something that would work.
> in fact you could do all of this with a single state machine
> which is easy to implement with refs to subs and hash tables.
state-machines I understand very well, but in verilog or vhdl.
could you point me to an example in perl that uses sub refs and
hash tables?
> just break up all your subs so that where you would call sleep, store
> the next state (a code ref) so that it can return there when scheduled.
ok, so when I first tried to think of a solution, I came up with
the idea of using something like goto statements whenever I needed
to do a switch. but that got really messy really fast.
I'm trying to imagine breaking it up into subroutines and how that
would work.
oh, and here's the one other design requirement, that puts a
wrinkle on this:
I wont be writing the subs. The idea was to write a simulator
so that it would be easy to prototype some hardware in perl.
that was why I gave up on the goto approach, because people
using the simulator would have to keep track of all
the gotos and whatever.
thats why I was trying to figure out a way to do it
with a call to some magical routine called MySleep(#);
The only other alternative is to have the users pass
in a string which looks like subroutine code, but it
gets interpreted and cut up anytime there is
a call to MySleep.
its a separate issue, but one that needs to be dealt with
in some way.
Greg
------------------------------
Date: 16 Jun 1999 13:36:07 -0700
From: bryan@solstice.jpl.nasa.gov (Bryan D Howard)
To: bobmin@nidlink.com
Subject: Re: Can anyone explain this behavior?
Message-Id: <7c674nkhmx.fsf@solstice.jpl.nasa.gov>
[[courtesy cc sent to original poster]]
Bob Minnick <bobmin@nidlink.com> writes:
> I've run across something interesting concerning split and am wondering
> if anyone can explain this behavior.
RTFM.
> Consider the following;
>
> ($var1, $var2)=split(/ /,$arrary[$index],2);
>
> According to my documentation (camel book) split should split the array
> into the two variables where it finds the space (contained between the
> slashes), but what is happening is $var2 is getting the second value,
> but it also contains a trailing space. I can easily code around this
> problem, but it would be more elegant to doing it with the split,
> assuming split works the way the documentation claims it does. Now my
> camel book was up to date as of perl4, has the functionality changed
> since then?
Nope, this is exactly how it's been documented to work for as long as
I can remember.
Since you gave it the number of things to split it into (2), split
does just that.
split(/ /,"foo bar gag blah",2) ====> ("foo", "bar gag blah")
Maybe you *meant* to write:
($var1, $var2)=split(/ /,$arrary[$index]);
This is documented to split it into one more piece that you've used
(in this case 3) and throw away the last one.
{Bryan}
--
Bryan D Howard, EIS FIL Unix Toolbuilder
JPL Section 363, Pasadena, CA, USA <bryan@solstice.jpl.nasa.gov>
------------------------------
Date: 16 Jun 1999 09:04:17 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Check URL
Message-Id: <slrn7mfc7c.do2.abigail@alexandra.delanet.com>
Twarren10 (twarren10@aol.com) wrote on MMCXIV September MCMXCIII in
<URL:news:19990615102751.11866.00000055@ng-fn1.aol.com>:
== Hey Guys,
== Is there any simple way in perl to check a list of
== URL's to make sure they are still current? Not
== to get info from the page or anything, just to check to see if
== it's not a dead link?
use LWP;
Abigail
--
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 16 Jun 1999 16:55:26 -0400
From: "Leonid Goltser" <leonid76@erols.com>
Subject: cookies
Message-Id: <7k92tq$16t$1@autumn.news.rcn.net>
Where can I find some kind of tutoring to make cookies with perl?
------------------------------
Date: 16 Jun 1999 08:56:15 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Events in CGI/Perl
Message-Id: <slrn7mfbo9.do2.abigail@alexandra.delanet.com>
Raj (technology@workmail.com) wrote on MMCXIV September MCMXCIII in
<URL:news:37667F69.6EA57BEC@workmail.com>:
[] Hi,
[] How can an OnClick event on a link on my CGI/Perl Script
[] 1. Invoke a " Save As" Message Box to let the user save the target file
[] into the local hard drive..?
[] 2.Maintain a counter of OnClicks on the Server ( to track the downloads)
In the same way as you would do for a CGI/FORTRAN Script.
You should ask elsewhere (but not in comp.lang.fortran).
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 16 Jun 1999 09:05:26 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: exclusive open
Message-Id: <slrn7mfc9d.do2.abigail@alexandra.delanet.com>
Oreg Dixie (maistro@swi.hu) wrote on MMCXIV September MCMXCIII in
<URL:news:7k6fh5$bta$1@pollux.matav.net>:
%%
%% I wrote a complete forum in perl, but I've got one problem with it: When two
%% or more users write to it simultaneously, then there'll be some garbage in
%% the log file. How Can I open the forum's log file exclusively? And what'll
%% happen when someone locked the file (the script is writing the message into
%% the log file) and another request comes from another user? It would be nice
%% to keep the other users wait till the writing procedure ends.
Did you bother checking the documentation about file locking?
It looks to me all your questions are answered there.
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 16 Jun 1999 09:06:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Executing a unix command from Perl
Message-Id: <slrn7mfcb8.do2.abigail@alexandra.delanet.com>
Steve E. Koon (sekoon@siteconnect.com) wrote on MMCXIV September MCMXCIII
in <URL:news:929475457.882.12@news.remarQ.com>:
## I am trying to execute a the "cp" in Linux from within my perl script. I
## know I should be able to find this in my Perl 5 Hot-To book, but call me
## stupid, I didn't.
Did you check the manual that comes with Perl? Perhaps you should.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 16 Jun 1999 09:09:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: File Processing
Message-Id: <slrn7mfcgt.do2.abigail@alexandra.delanet.com>
chumho@my-deja.com (chumho@my-deja.com) wrote on MMCXIV September
MCMXCIII in <URL:news:7k4qro$drq$1@nnrp1.deja.com>:
|| Hi,
||
|| Can anyone explain why the first code works but not the second? Do I
|| have any misconception ?
||
|| ####Right####
||
|| local($r);
|| $r = <f>;
||
|| ####Wrong####
||
|| local($r) = <f>;
||
|| The only difference between the "wrong" and "right" is in the
|| initialization of local variable $r. The "wrong" one declare and
|| initial $r to be the first record of the file in one line. Where the
|| "right" one does it in two separate lines.
scalar vs list context.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 16 Jun 1999 09:11:48 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: File Processing
Message-Id: <slrn7mfcle.do2.abigail@alexandra.delanet.com>
Wyzelli (wyzelli@yahoo.com) wrote on MMCXV September MCMXCIII in
<URL:news:ymH93.12$E4.15259@vic.nntp.telstra.net>:
&&
&& It's amazing what I can learn just by following some of these threads...
But it's even more amazing that this thread doesn't answer the question
originally asked.
Abigail
--
perl -wle 'print "Prime" if (0 x shift) !~ m 0^\0?$|^(\0\0+?)\1+$0'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 16 Jun 1999 20:24:26 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: File Processing
Message-Id: <376a0793.7414984@news.skynet.be>
Randal L. Schwartz wrote:
>Bart> local($r) = scalar <f>;
>
>Or even local $r = <f>;
You must have missed the rest of the thread. Didn't you see that the
original poster wrote:
>I'm pondering Bart's reply.
Guess what. This WAS precisely my reply. Afterwards, I thought that this
new variation, with an explicit "scalar", might help closing the mental
gap between the two original cases:
local $r = <f>;
local($r) = <f>;
Bart.
------------------------------
Date: 16 Jun 1999 08:43:28 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: File Uploading
Message-Id: <slrn7mfb0a.do2.abigail@alexandra.delanet.com>
Aneesha (aneesha@vettweb.net.au) wrote on MMCXV September MCMXCIII in
<URL:news:CPE93.172$lc5.489@ozemail.com.au>:
{} Hi
{}
{} > What makes you think you need tech support to install a module?
{} >
{} Look, i did say at the beginning of my post that I was not familiar with
{} perl or unix at all.
{} Have you ever been new to something or were you born with the knowledge of
{} the universe.
By the time I started using Perl, I could already read.
{} > You have paying customers and you don't even know the basics about
{} > installing modules? Poor customers.
{}
{} I'm still learning the basics. But if you ever need any help with Javascript
{} or ASP, I'll be glad to help you even if you ask simple questions.
No need. I can read.
Abigail
--
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 16 Jun 1999 16:17:46 -0400
From: Andrew S Gianni <agianni@acsu.buffalo.edu>
Subject: forceing only post methods with perl CGI module
Message-Id: <3768066A.BD622D3B@buffalo.edu>
Is there anyway to do this? I'd like to be able to protect some scripts
from people passing whatever arguments to them they want. Is there a
pragma in this module I can use?
Andrew
--
Andrew Gianni - Developer "You are about to be told one
UNIX Guy/Juggler Extraordinaire more time that you are America's
SUNY at Buffalo ACS/CIT most valuable natural resource...
ph:(716)645-3587x7009 Have you seen what they do to
fx:(716)645-3588 valuable natural resources?"
agianni@buffalo.edu -Utah Phillips
http://www.cs.buffalo.edu/~agianni/
------------------------------
Date: Wed, 16 Jun 1999 20:20:24 GMT
From: Darrin Edwards <d-edwards@uchicago.edu>
Subject: Re: Fresh Newbie...Question
Message-Id: <tgiu8n5247.fsf@noise.bsd.uchicago.edu>
Franklin Edward Sadler <gte482i@prism.gatech.edu> writes:
> Ok...First off Im a newbie at PERL (started yesterday). My question is how
> do u access double arrays??? Like $array[a,b]; or $array[a][b]; or
> neither???
perldoc perllol #How to do the above, assuming you know reference syntax
perldoc perldsc #More complicated data structures, again assuming
#your familiarity with reference syntax
perldoc perlref #Reference syntax in all its glory, with less emphasis
#on particular data structures; you may care less about this
#if you only want to know _how_ to do things without worrying
#about the why's -- not that I'm advocating such a
#philosophy, especially where Perl's concerned
> My array basically consists of records that themselves are also arrays.
> If someone could please give me the correct format I would certainly
> appreciate it.
Good. That's pretty much how multidimensional arrays are implemented
in Perl; see above refs for some of the Many Ways to Do it.
> Also, what if had an array of records that held lists, how
> would I go about accessing something in the list of any record?
I'm having trouble parsing that, because I'm not sure if the distinction
you're making between "list" and "array" is the same as that which
Perl makes. See perldata for more detail. If you just mean an array
of references to anonymous arrays, then the syntax is the same as
that for accessing elements of a _named_ array through a reference to
that array.
> Thanx...
Hope this helped,
Darrin
------------------------------
Date: Wed, 16 Jun 1999 19:59:40 GMT
From: kvan@dis.dk (Kvan)
Subject: Re: Fresh Newbie...Question
Message-Id: <376801b5.536570377@news.newsguy.com>
On 16 Jun 1999 17:40:16 GMT, Franklin Edward Sadler
<gte482i@prism.gatech.edu> wrote:
>Ok...First off Im a newbie at PERL (started yesterday). My question is how
>do u access double arrays??? Like $array[a,b]; or $array[a][b]; or
>neither???
The latter one is the correct shorthand notation. For in-depth
explanation of how to access data in data structures, see the sections
on references and data structures in your text book, or read the
included documentation (ref, dsc and lol):
perldoc perlref
perldoc perldsc
perldoc perllol
- in that order.
Kvan.
-------Casper Kvan Clausen------ | 'A *person* is smart. People are
---------<kvan@dis.dk>---------- | dumb, panicky, dangerous animals
| and you know it.'
| - "K" in Men in Black.
------------------------------
Date: Wed, 16 Jun 1999 13:52:16 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Fun with STDERR...
Message-Id: <Pine.GSO.4.02A.9906161350500.26850-100000@user1.teleport.com>
On Wed, 16 Jun 1999, Mitch wrote:
> my $output;
> $output = open(IFCONFIG, "/sbin/ifconfig $parm 2>&1
> 1>/dev/null");
Assuming that you didn't mean to put the newline into the command, do you
realize that $output is not the output of the command? But I think that's
doing what you want it to do. If you're still having trouble, try making a
small (but complete) example program that others can try running to see
what's really happening. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 16 Jun 1999 16:09:45 -0400
From: "Kevin Murphy" <MurphKE1@aplmsg.jhuapl.edu>
Subject: Re: Help with UDP in Win32
Message-Id: <7k909f$89s$1@houston.jhuapl.edu>
I eventually got it solved. I wasn't setting the SO_BROADCAST option
correctly and I was overspecifying the receiver "IO::Socket" object.
I ended up with the following baseline receiver - which worked nicely.
use IO::Socket;
use strict;
my $MAXLEN = 32;
my $msg = "";
my ($eout,$rout,$rin) = 0;
my $sock = IO::Socket::INET->new(
Proto => 'udp',
LocalPort => '5500',
);
$sock->bind(0,'255.255.255.255');
$sock->setsockopt( SOL_SOCKET, SO_BROADCAST, pack("l", 1));
while (1) {
select(undef,undef,undef,0.2);
vec($rin, fileno($sock), 1) = 1;
if (select($rout=$rin, undef, $eout=$rin, 1)) {
$sock->recv($msg, $MAXLEN);
}
if ($msg ne "") {
printf "Received : $msg\n";
$msg = "";
}
}
Thanks,
--
"I know nothing, and that which I believe is mostly
wrong and subject to continual revision"
Kevin Murphy
------------------------------
Date: Wed, 16 Jun 1999 13:55:36 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How to extract emails from Outlock Express
Message-Id: <Pine.GSO.4.02A.9906161353580.26850-100000@user1.teleport.com>
On Wed, 16 Jun 1999, Mosl Roland wrote:
> how to extract from the Outlock Express files?
If you want to know how to open files and read their data, try the
functions in the perlfunc manpage.
If you want to know the format of files used by Outlock Express (whatever
that is) check the docs, FAQs, and newsgroups about it.
If you think there might be a module made for working with these files
from Perl, check the Module List on CPAN.
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 16 Jun 1999 13:43:09 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How to scan a directory and put all the files and their size to a text file
Message-Id: <Pine.GSO.4.02A.9906161342380.26850-100000@user1.teleport.com>
On Wed, 16 Jun 1999, Dariush_news wrote:
> open (INFILE, "upfiles.txt");
> open (OUT, ">uplist.txt");
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
Thanks!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 16 Jun 1999 14:15:18 -0600
From: Marshall V Pierce <mvp@backrub.cs.itc.hp.com>
Subject: how2 find first occurence of...
Message-Id: <376805D6.CFAEBB0D@backrub.cs.itc.hp.com>
I know there's a better way to code this - help?
I have a .forward script which has to deal with multiple occurences of
"Subject" lines.
First way I thought of was:
$SubLine = "first";
while(<>) {
if(/^Subject: /) {
if($SubLine eq "first") {
($junk, $msgsub) = split /Subject: /;
}
else {
$SubLine = "notfirst";
}
}
}
TIA
--
Marshall V Pierce /_ __ Hewlett-Packard Company
marshall_pierce@hp.com / //_/ Americas IT
USA (719) 590-3461 /
------------------------------
Date: Wed, 16 Jun 1999 14:25:48 -0600
From: Marshall V Pierce <mvp@backrub.cs.itc.hp.com>
Subject: Re: how2 find first occurence of...
Message-Id: <3768084C.4F3C7BD6@backrub.cs.itc.hp.com>
Oh, geesh! DUNH! Nevermind, although there must be a more efficient
way to code this?
Marshall V Pierce wrote:
>
> I know there's a better way to code this - help?
>
> I have a .forward script which has to deal with multiple occurences of
> "Subject" lines.
> First way I thought of was:
>
> $SubLine = "first";
> while(<>) {
> if(/^Subject: /) {
> if($SubLine eq "first") {
> ($junk, $msgsub) = split /Subject: /;
> }
> else {
> $SubLine = "notfirst";
> }
> }
> }
>
> TIA
>
> --
> Marshall V Pierce /_ __ Hewlett-Packard Company
> marshall_pierce@hp.com / //_/ Americas IT
> USA (719) 590-3461 /
--
Marshall V Pierce /_ __ Hewlett-Packard Company
marshall_pierce@hp.com / //_/ Americas IT
USA (719) 590-3461 /
------------------------------
Date: 16 Jun 1999 09:19:23 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: I dont understand system calls
Message-Id: <slrn7mfd3l.do2.abigail@alexandra.delanet.com>
Mark Conlin (Mark.Conlin@bridge.bellsouth.com) wrote on MMCXIV September
MCMXCIII in <URL:news:37667742.9F485A10@bridge.bellsouth.com>:
?? I am having problems understanding the system command.
??
?? I want to use system to look for a file, How can I get
?? the results from
??
?? system("ls"); or
?? system("find", "myfile");
By using qx.
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 16 Jun 1999 09:20:55 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: including another variable into an array
Message-Id: <slrn7mfd6i.do2.abigail@alexandra.delanet.com>
Matt (splinter@monmouth.com) wrote on MMCXV September MCMXCIII in
<URL:news:7k6skk$q34$1@news.monmouth.com>:
{} Hey,
{}
{} Very simple question.
{}
{} I have an array. I have a variable. I want the variable appended onto that
{} array.
{}
{} Obviously I can't just do
{}
{}
{} @array .= $variable
{}
{} So what should I do?
push
Abigail
--
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 16 Jun 1999 13:40:10 -0700
From: Chris Ice <chris.ice@cisco.com>
Subject: IO::Pipe question...
Message-Id: <37680BAA.1354445@cisco.com>
I'm using IO::Pipe to open a pipe to a child process...and am then using
IO::Select to do non-blocking reads on it.
Two questions:
1) how do I know that the piped command successfully started (yes, I
read the faq re. pipe opens, fork, exec, etc.) However, I was hoping
IO::Pipe would give me a more graceful mechanism.
Currently I'm doing:
eval {
$pipe->reader( $cmd );
}; die "Failed: $!" if $@;
2) How can I tell that the piped command is STILL there? Say for some
reason piped command dies (drops core, etc)...how can I test to ensure
it's still a valid handle to read from?
Chris
--
--------
+----------------------------| _ /| |-----------------------------+
| Chris Ice, Web Programmer | \`o_O' | Cisco Systems, Inc. |
| http://www.trub.com/ | ( ) | http://www.cisco.com/ |
| mailto:chris.ice@cisco.com | U | 170 W. Tasman Dr., SJ-05/1 |
| 408.525.7373 | Syn, | San Jose, CA 95134-1706 USA |
+----------------------------| Ack! |-----------------------------+
My opinions may not reflect -------- the views of my employer.
------------------------------
Date: 16 Jun 1999 20:38:54 GMT
From: quiver@io.com
Subject: Re: Is it better perl than awk ?
Message-Id: <7k920u$kr5$1@hiram.io.com>
In comp.lang.awk Uri Guttman <uri@sysarch.com> wrote:
[snip]
> i don't want this to become a flame war like we have seen with perl
> vs. (python, lisp, c++, your favorite langauge). perl and awk/sed don't
> even occupy the same problem space so comparing them is moot.
I work with databases on a number of platforms. Awk and a variety of editors
are my basic tools for the textual ones. Given this narrow range of
activity, awk is more than enough and perl is over-kill. And as for
aesthetics, I enjoy the simplicity of awk and find the kitchen-sink approach
of perl to be butt-ugly. But when I need more starch (rare, but it happens),
I will struggle with perl because it incorporates the features of awk in a
relatively familiar format...
--
quiver@io.com - Jim Eikner at Illuminati Online in Austin, Texas
http://www.io.com/~quiver
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 6021
**************************************