[12791] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 201 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jul 20 14:07:32 1999

Date: Tue, 20 Jul 1999 11:05:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Tue, 20 Jul 1999     Volume: 9 Number: 201

Today's topics:
    Re: --Help Wanted <cassell@mail.cor.epa.gov>
    Re: basename regexp? (elephant)
    Re: basename regexp? (Walter Tice USG)
    Re: basename regexp? <laurens@bsqaure.com>
    Re: basename regexp? (Larry Rosler)
        DOS Hidden File Attribute <david@temss2.isr.temple.edu>
    Re: DOS Hidden File Attribute (elephant)
        Exec, stty, trapping INTR ben@spectrumwireless.net
    Re: fetch url with standard modules? <revjack@radix.net>
    Re: flock() replacement in Win32 ? arpith@hotmail.com
    Re: flock() replacement in Win32 ? <cassell@mail.cor.epa.gov>
    Re: flock() replacement in Win32 ? <cassell@mail.cor.epa.gov>
    Re: hashes and arrays... (Gary O'Keefe)
    Re: How to get total line numbers in a text file ? <qwerty@post.utfors.se>
    Re: How to get total line numbers in a text file ? (Tad McClellan)
    Re: How to get total line numbers in a text file ? (Larry Rosler)
    Re: how to get total matched lines number ? <laughingotter@foxinternet.net>
    Re: How to open database just once? <laughingotter@foxinternet.net>
    Re: How to open database just once? <swiftkid@bigfoot.com>
    Re: How to open database just once? (Larry Rosler)
    Re: How to open database just once? <emschwar@rmi.net>
        HTTP PUT method keydet89@yahoo.com
    Re: HTTP PUT method <mlopresti@bigfoot.com>
        inn 2.2 Perl 5.00503  AIX 4.3.2 make errors (Mike Ellwood)
    Re: lexical $_ with threads question? <derek_sherlock@hp.com>
    Re: lexical $_ with threads question? <tchrist@mox.perl.com>
    Re: looking for a flate txt file searching script. <laughingotter@foxinternet.net>
    Re: looking for a flate txt file searching script. <factory@factory.co.kr>
        Perl and IIS gregf1@my-deja.com
        problems with MIME::Parser <gbc1@humboldt.edu>
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Tue, 20 Jul 1999 10:41:34 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: --Help Wanted
Message-Id: <3794B4CE.B44D5CE7@mail.cor.epa.gov>

Dylan Beattie wrote:
> 
> On 19 Jul 1999, Abigail wrote:
> 
> > bob@tokensystems.com (bob@tokensystems.com) wrote on MMCXLVIII September
> 
> > ?? Must be able to create anything we need in Perl,
> >
> > I'm sorry, but I can't create hot nude babes in Perl.
> 
> At least, not yet... Babe::HotNude should be in final beta by the end of
> the week, though. :)

Oh, great.  Just great.  Now EVERYONE will be asking lame
questions filled with great desperation in this ng, not just 
newbie programmers and scriptkiddies.

Unless you're referring to Babe the pig...

David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Wed, 21 Jul 1999 02:31:57 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: basename regexp?
Message-Id: <MPG.11ff4f87a6d20be0989b54@news-server>

Jonathan Stowe writes ..
>elephant <e-lephant@b-igpond.com> wrote:
>> my Linux perl gives just the script name (the basename) with $0 .. my 
>> ActiveState perl on NT gives me the whole filename
>
>The differences are almost certainly down to the command interpreter or
>shell in question ....  This is a good reason to be using File::Basename.

ooh .. you're right - thanks

-- 
 jason - remove all hyphens for email reply -


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

Date: 20 Jul 1999 16:29:36 GMT
From: tice@hunch.zk3.dec.com (Walter Tice USG)
Subject: Re: basename regexp?
Message-Id: <7n285g$asq@zk2nws.zko.dec.com>

In article <37948E1E.28C77299@ds10.hobby.nl> jona@ds10.hobby.nl writes:
>Hi,

>I need to know the name of my script.
>$0 you'd say right? I know, but I just want the name, not the full
>pathname.
>I'd rather not use a shell
>Now I don't speak too fluently regular expressions (nor perl, for that
>matter),
>So, how do I strip the full path?

>Thanks,

>Joe

How bout' this?

$len = length($0);

for ($i=0; $i<$len; $i++) {
    $char = substr($0,$i,1);
    if ($char =~ /\//) { $k = $i }  ## make it /\\/ for DO$
}

$name = substr($0,$k);
print "$name\n";

W



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

Date: Tue, 20 Jul 1999 09:30:46 -0700
From: "Lauren Smith" <laurens@bsqaure.com>
Subject: Re: basename regexp?
Message-Id: <7n2888$lfe$1@brokaw.wa.com>


Lauren wrote in message <7n250t$ocu$1@nntp2.atl.mindspring.net>...
>Jona Andersen <jona@ds10.hobby.nl> wrote in message
>news:37948E1E.28C77299@ds10.hobby.nl...
>> Now I don't speak too fluently regular expressions (nor perl, for that
>> matter),
>> So, how do I strip the full path?
>If you promise to read up on regular expressions and learn Perl, an answer
>is:
>
>s/[^\\]+$//;  #You'll have to replace the '\\' with the directory delimiter
>of your OS
*grumble...*
if I would just recheck my code every now and then I could probably avoid
some flames.

instead of the above...
/([^\\]+)$/; #

$scriptname = $1;


>If you're unwilling to learn Perl, then all hope is lost...

and if I'm unwilling to check my own code, then I am lost too.

Lauren




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

Date: Tue, 20 Jul 1999 09:57:47 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: basename regexp?
Message-Id: <MPG.11fe4a672a65e40a989d03@nntp.hpl.hp.com>

In article <37949011.C9628DF5@americasm01.nt.com> on Tue, 20 Jul 1999 
10:04:49 -0500, Marshall Culpepper <marshalc@americasm01.nt.com> says...
> Jona Andersen wrote:
 ...
> > I need to know the name of my script.
> > $0 you'd say right? I know, but I just want the name, not the full
> > pathname.
 ...
> 
> $script=$0;
> $script=~ s/\/+\w+\///;
> print $script
> #$script is now the name of your script
> 
> :)

Is the smiley to show that the code is wrong, wrong, wrong???

> ~Marshall
> 
> 
> ----------------------------------
> just another guy trying to save the world
> ----------------------------------

Still trying to save the world with untested code (or inadequately 
tested, to give you the benefit of the doubt)?  Please give the world a 
break.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 20 Jul 1999 12:40:58 -0400
From: "David Forrest Tucker" <david@temss2.isr.temple.edu>
Subject: DOS Hidden File Attribute
Message-Id: <7n28qe$qb8$1@cronkite.ocis.temple.edu>

Is there a perl function or method by which a script can identify and/or set
the DOS "hidden file" attribute?




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

Date: Wed, 21 Jul 1999 03:10:58 +1000
From: e-lephant@b-igpond.com (elephant)
Subject: Re: DOS Hidden File Attribute
Message-Id: <MPG.11ff58b13901ae90989b55@news-server>

David Forrest Tucker writes ..
>Is there a perl function or method by which a script can identify and/or set
>the DOS "hidden file" attribute?

the standard (with ActiveState's port) Win32::File module has exactly 
what you're looking for .. check your help for more details

-- 
 jason - remove all hyphens for email reply -


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

Date: Tue, 20 Jul 1999 17:48:10 GMT
From: ben@spectrumwireless.net
Subject: Exec, stty, trapping INTR
Message-Id: <7n2col$31a$1@nnrp1.deja.com>

Hi comp.lang.perl,
	I have an interesting problem that I'm trying to work through.  I have
a series of three perl scripts that represent, basically, text-based
menus.  A user moves from one menu to a sub menu by choosing a option
number.  Once the input is recieved, the "main" menu exec()s out into
the new submenu.  In all the sub menus, I'm trapping INTR to exec() back
to the main menu.  I have mapped INTR to the escape key (^[) for user
friendliness.  Here is the problem: I can leave the main menu for a sub
menu, play around in the submenu, then  I can escape (exec()) back to
the main menu.  Then, I once again exec() into the same sub menu that I
just left.  Now I'm in the submenu for the second time.  However, this
time when I SIG(INTR) (press escape), the submenu script doesn't trap
the signal, like it doesn't see it.

I'm using perl4.036 (space constraints) on Linux 2.0.37 GLIBC.  The main
menu and the sub menu are both separate scripts.  The environment
variables all check out, and a system call to stty --all from both the
main menu and the sub menu show that the INTR signal is still ^[ in all
cases, even where it fails to trap in the second running of the sub
menu.

Does anyone have any ideas?  This has really been bothering me for
awhile!  Or, does anyone have a better, functional, method in 4.036 to
exec from one program to the next and be able to break out of successive
scripts back to the one that exec()ed the sub menu, without leaving
additional Perl or shell processes running?

If anyone has some good ideas, please let me know via email:
ben@spectrumwireless.net

Thanks in advance!


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 20 Jul 1999 17:13:17 GMT
From: revjack <revjack@radix.net>
Subject: Re: fetch url with standard modules?
Message-Id: <7n2and$2fd$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight

Benjamin Franz explains it all:

[snip]

I have a bet riding on the followups to this. Don't let me down, people.


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

Date: Tue, 20 Jul 1999 16:12:19 GMT
From: arpith@hotmail.com
Subject: Re: flock() replacement in Win32 ?
Message-Id: <7n274m$ba$1@nnrp1.deja.com>



> flock() works on NT not Win95 - I would suggest that if you were going
> to try to do something that required flock() on Win95 then *something*
> was going to get damaged irrespective of whether flock() was available
> or not.

How come :( I have only '95. Then even a guestbook script won't work
right ?


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 20 Jul 1999 10:43:39 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: flock() replacement in Win32 ?
Message-Id: <3794B54B.3D1B08F1@mail.cor.epa.gov>

Andreas Fehr wrote:
> 
> On Tue, 20 Jul 1999 08:37:16 GMT, arpith@hotmail.com wrote:
> 
> >The flock() command locks files in Unix. Is there an alternative command
> >in Windows 95 ? If so what is it (if possible with an example please :)?
> >If I do not use it, will the data files get seriously damaged ?
> 
> flock does work under NT, it should work under Win95 too.

Contrary to popular opinion, these two are not the same OS.  flock()
works under NT.  It doesn't come close to working under win95.  This
is discussed in the ActivePerl FAQ, BTW.

> >Also, I need to find a pl file 'smtp-mail.lib', anyone know where I can
> >find it ? It is a replacement for mailing in unix, to work in Win.
> 
> Did you try libnet (load it with ppm). There is a module called
> Net::SMTP. This should work.

And this is covered in the ActivePerl FAQ, also.

HTH,
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Tue, 20 Jul 1999 10:49:38 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: flock() replacement in Win32 ?
Message-Id: <3794B6B2.977874D9@mail.cor.epa.gov>

arpith@hotmail.com wrote:

Here in c.l.p.misc we try to get our attributions correct.  Please try
to help us in future.  Thank you.

> > flock() works on NT not Win95 - I would suggest that if you were going
> > to try to do something that required flock() on Win95 then *something*
> > was going to get damaged irrespective of whether flock() was available
> > or not.
> 
> How come :( I have only '95. Then even a guestbook script won't work
> right ?

It won't work reliably.  There are icky, non-atomic kludges to try
to get around this [like creating a lock file when you want the file to
be locked, and deleting it when your process is finished writing - note
that this is generally considered A Bad Idea (tm) and can cause
annoying failures when the lock file doesn't get deleted].  But if 
your website is going to be fairly low-traffic, you should be able to
get away with this for the most part.

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

I know it's not your fault, but I'm really getting tired of that slogan.
"Share what you don't know.  Learn what you don't evaluate."
 
David
-- 
David Cassell, OAO                     cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician


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

Date: Thu, 15 Jul 1999 08:48:58 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: hashes and arrays...
Message-Id: <378b1386.438787879@news.hydro.co.uk>

On Fri, 09 Jul 1999 18:35:56 -0400, James Lovette
<jlovette@ic.sunysb.edu> wrote:

>how would I compare each element in an array to see if it matched any
>hash key?
>
>%dates = ("time1", "June 3 - June 10",
>          "time2", "June 10 - June 17",
>          "time3", "June 17 - June 24",
>          "time4", "June 24 - July 1",	
>          "time5", "June 1 - July 8",
>          "time6", "July 8 - July 15",
>          "time7", "July 18 - July 22",
>          "time8", "July 22 - July 29",
>          "time9", "July 29 - August 5",
>          "time10", "August 5 - August 12",
>          "time11", "August 12 - August 19",
>          "time12", "August 19 - August 26",
>          "time13", "August 26 - September 2");
>
>is my hash, and the keys are possible values in an array (depending on
>what the user choses). how can I compare the two, so that i can
>tell if $value[5] = "time11" that $value[5] is also equal to "August 12
>- August 19"? thanks for the help.

A bit more help is needed with problem definition here. If $value[5]
equals "time11" then it can't also equal "August 12 - August 19", can
it? Also, try "perldoc -f grep". The answers are in the documentation.

Assuming there is a list, @foo, that contains the array values and the
results of the search are going into @bar then

foreach $key ( keys ( %dates ) ) {
	@bar = ();
	@bar = grep ( /$key/, @foo );
	if ( @bar ) {
		# do stuff...
	} else {
		# do something else...
	}
}

Hope this helps

Gary

p.s. I hope Abigail posts one of her brain-twisting little snippets of
code. Try to figure out how it works as a penance for your sins and
read the docs the next time.
--
Gary O'Keefe
gary@onegoodidea.com

You know the score - my current employer has nothing to do with what I post


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

Date: Mon, 19 Jul 1999 18:55:12 +0200
From: "Dr. Who" <qwerty@post.utfors.se>
Subject: Re: How to get total line numbers in a text file ?
Message-Id: <37935870.8498D9C6@post.utfors.se>

"Yeong Mo/Director Hana co." wrote:

> if matchs one word in a line, how to get total matched lines number ?
>
> something like the following;
>    ($ex0, $categorys, $ex2) = split(/&&/, "$line");
>   if ($categorys eq "001") {
>        print "001 matchs total "16"  lines ";
> }
>
> Thanks in advance

$word="fuck";
$match=0;
foreach $row(@fil){ if($row=~/$word/) { $match++; }}
print $match;



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

Date: Tue, 20 Jul 1999 08:31:51 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How to get total line numbers in a text file ?
Message-Id: <n7q1n7.qu5.ln@magna.metronet.com>

V. Balaji (balaji@cray.com) wrote:

: How about using wc(1) instead of perl?


   Maybe because that does not do what was asked for?

   This might do it though:

      grep -c


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 20 Jul 1999 10:53:19 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to get total line numbers in a text file ?
Message-Id: <MPG.11fe576d38909d2d989d05@nntp.hpl.hp.com>

In article <37935870.8498D9C6@post.utfors.se> on Mon, 19 Jul 1999 
18:55:12 +0200, Dr. Who <qwerty@post.utfors.se> says...
> "Yeong Mo/Director Hana co." wrote:
> > if matchs one word in a line, how to get total matched lines number ?
> >
> > something like the following;
> >    ($ex0, $categorys, $ex2) = split(/&&/, "$line");
> >   if ($categorys eq "001") {
> >        print "001 matchs total "16"  lines ";
> > }
> 
> $word="fuck";

Gratuitous use of obscenity demeans its value for when it is really 
needed.

> $match=0;
> foreach $row(@fil){ if($row=~/$word/) { $match++; }}
> print $match;

print scalar grep /\b$word\b/, @fil;

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Tue, 20 Jul 1999 10:07:30 -0700
From: Steve Laybourn <laughingotter@foxinternet.net>
Subject: Re: how to get total matched lines number ?
Message-Id: <3794ACD2.CDAD359E@foxinternet.net>

Hmmm...let's try this:

$mtx=0;
chomp @stuff; # this would be your array of stuff
foreach $clam(0 .. $#stuff) {
 $line=@stuff[$clam];
 ($ex0, $categorys, $ex2) = split(/&&/, "$line");
 if ($categorys eq "001") { $mtx++; } }
print "001 matches a total of $mtx lines ";

   Sounds easy enough...
   I will probably get blasted from the rest of the group for lack of
programming style, but who cares?
   Anyways, with a little modification, you can use this to make a
sub-array of matching lines for later analysis, or you can modify what
gets searched for and make a primitive search engine.
   Good luck!
   Steve Laybourn, Part-Time Stapling Machine
   Laughing Otter Computing Services
   e-mail:otter101@hotmail.com


"Yeong Mo/Director Hana co." wrote:

> if matchs one word in a line, how to get total matched lines number ?
>
> something like the following;
>    ($ex0, $categorys, $ex2) = split(/&&/, "$line");
>   if ($categorys eq "001") {
> something here ???????
>        print "001 matchs total "16"  lines ";
> }
>
> Thanks in advance



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

Date: Tue, 20 Jul 1999 09:22:40 -0700
From: Steve Laybourn <laughingotter@foxinternet.net>
Subject: Re: How to open database just once?
Message-Id: <3794A250.49A73950@foxinternet.net>

Perhaps like this:

open(OTTER,"database.dat");
@clams=<OTTER>;
close(OTTER);

This will load the contents of a database file into an array that can be
used throughout the program. I don't believe there is a destructor
commonly accessible, uless you use something like:

$#clams=0;

which will leave the array clams defined but with no elements except the
first one, so that's close enough. Otherwise, I believe deallocation is
done once the script exits.

Hope this helps!
Good Luck!
Steve Laybourn, Camel Spotter
e-mail: otter101@hotmail.com

yangsu@ustc.edu wrote:

> My thought is that I can have some function like init() which
> will be called just once when the program runs. because the
> database operation is frequent and I don't want to waste time
> open the database connection again and again.
>
> I also hope I can have a cleanup function available when the program
> exits. This is done only once. (so it is similar to java servlet)
>
> yang
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.



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

Date: Tue, 20 Jul 1999 21:10:42 +0500
From: "Faisal Nasim" <swiftkid@bigfoot.com>
Subject: Re: How to open database just once?
Message-Id: <7n3ac2$dph1@news.cyber.net.pk>

: BEGIN{}, or also in later versions with extermely similar but not
: identical semantics, INIT{}.
:
: :I also hope I can have a cleanup function available when the program
: :exits. This is done only once. (so it is similar to java servlet)
:
: END{}

The user still needs to connect to say a SQL database each time he
run the program, wouldn't it be nice, you open it once, it stays out
there in memory, you can get the handle and continue .....?

The answer is mod_perl :P




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

Date: Tue, 20 Jul 1999 10:06:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to open database just once?
Message-Id: <MPG.11fe4c71ec94acbd989d04@nntp.hpl.hp.com>

In article <3794A250.49A73950@foxinternet.net> on Tue, 20 Jul 1999 
09:22:40 -0700, Steve Laybourn <laughingotter@foxinternet.net> says...
> Perhaps like this:
> 
> open(OTTER,"database.dat");
> @clams=<OTTER>;
> close(OTTER);
> 
> This will load the contents of a database file into an array that can be
> used throughout the program. I don't believe there is a destructor
> commonly accessible, uless you use something like:
> 
> $#clams=0;
> 
> which will leave the array clams defined but with no elements except the
> first one, so that's close enough. Otherwise, I believe deallocation is
> done once the script exits.

'Close enough' is good enough only in horseshoes or thermonuclear war.

  $#clams = -1;

  @clams = ();

  undef @clams;

-- 
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: 20 Jul 1999 11:18:03 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: How to open database just once?
Message-Id: <xkfd7xnme9g.fsf@valdemar.col.hp.com>

"Faisal Nasim" <swiftkid@bigfoot.com> writes:
> : Tom Christiansen, whose attribution was chopped by the aforementioned 
> : "Faisal Nasim" wrote:
> : BEGIN{}, or also in later versions with extermely similar but not
> : identical semantics, INIT{}.
> :
> : :I also hope I can have a cleanup function available when the program
> : :exits. This is done only once. (so it is similar to java servlet)
> :
> : END{}
> 
> The user still needs to connect to say a SQL database each time he
> run the program, wouldn't it be nice, you open it once, it stays out
> there in memory, you can get the handle and continue .....?

Yeah, too bad it won't work.

> The answer is mod_perl :P

mod_perl is an Apache thing, and has little to do with Perl, or even
perl.  If the original questioner had specified a web-based solution, or
even problem, it's one thing to look for.  But it doesn't seem to make
sense to me to recommend a mod_perl-based solution for a problem that
hadn't even had the magic phrase "CGI" mentioned.

Perl != CGI.
Perl != WWW.
Perl == Perl.

-=Eric


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

Date: Tue, 20 Jul 1999 16:27:48 GMT
From: keydet89@yahoo.com
Subject: HTTP PUT method
Message-Id: <7n281i$on$1@nnrp1.deja.com>

Does anyone have a working example of using the HTTP PUT method
in Perl?

I've done searches on the 'groups, and the AS listserver.  I have
also checked the CPAN scripts archive.

All I want to do is post a particular file on a web server, and
read back the response code (ie, automate web site updating and
log responses).

Thanks
Carv


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 20 Jul 1999 13:38:53 -0400
From: matt <mlopresti@bigfoot.com>
Subject: Re: HTTP PUT method
Message-Id: <3794B42D.80F9AAF2@bigfoot.com>

Try looking at the LWP.pm package. I do not have a working example, but
I know the answer is in there somewhere. Check the class HTTP::Response.

-Matt

keydet89@yahoo.com wrote:

> Does anyone have a working example of using the HTTP PUT method
> in Perl?
>
> I've done searches on the 'groups, and the AS listserver.  I have
> also checked the CPAN scripts archive.
>
> All I want to do is post a particular file on a web server, and
> read back the response code (ie, automate web site updating and
> log responses).
>
> Thanks
> Carv
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.






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

Date: 20 Jul 1999 16:35:57 GMT
From: mwe@unixfe.cc.rl.ac.uk (Mike Ellwood)
Subject: inn 2.2 Perl 5.00503  AIX 4.3.2 make errors
Message-Id: <7n28hd$1h26@newton.cc.rl.ac.uk>

Having installed Perl 5.00503 successfully on an AIX 4.3.2
system, I attempted to install inn 2.2.

I used the --with-perl option to configure, but make gave me
the following error:

         cc  -o innd art.o cc.o chan.o his.o icd.o innd.o lc.o nc.o newsfeeds.o ng.o  perl.o proc.o rc.o si
te.o status.o tcl.o timer.o wip.o ../storage/libstorage.a ../lib/libinn.a  ../lib/perl.o -L/usr/local/lib/p
erl5/5.00503/aix/CORE -bE:perl.exp -L/usr/local/lib /usr/local/lib/perl5/5.00503/aix/auto/DynaLoader/DynaLo
ader.a -L/usr/local/lib/perl5/5.00503/aix/CORE -lperl -ldbm -ldl -lld -lm -lc -lPW -lbsd -lnsl -lcrypt  -ln
sl
ld: 0706-004 Cannot find or read export file: perl.exp
        ld:accessx(): No such file or directory
make: The error code from the last command is 255.


I have a feeling this may be an AIX 4.3.2/Perl 5.00503 issue,
but I'm not really sure what has gone wrong here?

I am a novice with inn, and not very experienced with Perl.
In this context, it is "merely" a pre-req for installing inn.
It is possible to switch off the perl option to inn, but
I believe a lot of the power (filtering, etc) is lost, so
I would rather not.

Any pointers?

Thank you.

--
Mike.Ellwood@rl.ac.uk


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

Date: Tue, 20 Jul 1999 10:36:38 -0600
From: Derek Sherlock <derek_sherlock@hp.com>
Subject: Re: lexical $_ with threads question?
Message-Id: <3794A596.66B42D53@hp.com>


Hi,

If lexicals don't do anything special when a new thread is created,
what was the reason for turning $_ and @_ into lexicals when 
making perl thread-capable.  A lexical $_ belonging to the outer
lexical scope of the program is still shared between threads, just
as if it is a non-thread-specific global.  How does this help 
thread-safety?

Thanks,

Derek.

Tom Christiansen wrote:
> 
>      [courtesy cc of this posting mailed to cited author]
> 
> In comp.lang.perl.misc,
>     Derek Sherlock <derek_sherlock@hp.com> writes:
> :What happens to lexical variables that already exist when a thread
> :is created.
> 
> Nothing in particular.
> 
>     #!/usr/local/bin/filsperl
> 
>     use Thread;
> 
>     my $private = 27;
> 
>     printf "thread %d has private value $private\n",
>         Thread->self->tid();
> 
>     sub bump_priv {
>         lock($private);
>         $private++;
>         printf "thread %d has private value $private\n",
>             Thread->self->tid();
>     };
> 
>     $t1 = Thread->new(\&bump_priv);
>     $t2 = Thread->new(\&bump_priv);
> 
>     $t1->join();
>     $t2->join();
> 
>     printf "thread %d has private value $private\n",
>         Thread->self->tid();
> 
> Produces:
> 
>     thread 0 has private value 27
>     thread 1 has private value 28
>     thread 2 has private value 29
>     thread 0 has private value 29
> 
> --tom
> --
> "Lies written in ink can never disguise facts written in blood.  Blood debts
>  must be repaid in kind.  The longer the delay, the greater the interest."
>     --Chinese author Lu Xun, 1926

-- 
     _                                               _
    / ) +-----------------------------------------+ ( \
   / /  |                                         |  \ \
 _( /_  | _   Derek Sherlock                    _ |  _) )_
(((\ \> |/ )  Hewlett Packard  -   WSL         ( \| </ /)))
(\\ \_/ / /   Email : derek_sherlock@hp.com     \ \_/ ////)
 \       / Tel: 970-898-7582  Fax: 970-898-7388  \        /
  \    _/                                         \_     /
  /   / +-----------------------------------------+ \    \
 /   /                                               \    \


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

Date: 20 Jul 1999 11:06:12 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: lexical $_ with threads question?
Message-Id: <3794ac84@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    Derek Sherlock <derek_sherlock@hp.com> writes:
:If lexicals don't do anything special when a new thread is created,
:what was the reason for turning $_ and @_ into lexicals when 
:making perl thread-capable.  A lexical $_ belonging to the outer
:lexical scope of the program is still shared between threads, just
:as if it is a non-thread-specific global.  How does this help 
:thread-safety?

Certainly without per-thread versions, things like grep/sort/foreach
would interfere with other threads in a very nasty way.  Imagine 
one thread changing them out from under another thread's execution.

sort()'s $a and $b are still problems, however.

--tom

-- 
Sockets are the X windows of IO interfaces.  --Rob Pike


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

Date: Tue, 20 Jul 1999 10:10:40 -0700
From: Steve Laybourn <laughingotter@foxinternet.net>
Subject: Re: looking for a flate txt file searching script.
Message-Id: <3794AD90.EDD68A4B@foxinternet.net>

Well, what exactly did you want to search? Are you searching the entire line
($line) or one of the $ex0, $ex1, $ex2 variables for a match? The search
script's shape will depend on the answer to that.

Good luck!
Steve Laybourn, Hen-Teaser
Laughing Otter Computing Services
e-mail: otter101@hotmail.com

"Yeong Mo/Director Hana co." wrote:

> I am looking for a flate txt file searching script.
>
> I have something like this file
> ($ex0, $ex1, $ex2) = split(/&&/, "$line");
>
> if I Input one word from html post method, it should be searched the line
> and diplayed it.



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

Date: Wed, 21 Jul 1999 02:37:25 +0900
From: "Yeong Mo/Director Hana co." <factory@factory.co.kr>
Subject: Re: looking for a flate txt file searching script.
Message-Id: <7n2bj8$4f8$2@news1.kornet.net>

My answer is "Whole lines"



 ........
Steve Laybourn ÀÌ(°¡) <3794AD90.EDD68A4B@foxinternet.net> ¸Þ½ÃÁö¿¡¼­
ÀÛ¼ºÇÏ¿´½À´Ï´Ù...
>Well, what exactly did you want to search? Are you searching the entire
line
>($line) or one of the $ex0, $ex1, $ex2 variables for a match? The search
>script's shape will depend on the answer to that.
>
>Good luck!
>Steve Laybourn, Hen-Teaser
>Laughing Otter Computing Services
>e-mail: otter101@hotmail.com
>
>"Yeong Mo/Director Hana co." wrote:
>
>> I am looking for a flate txt file searching script.
>>
>> I have something like this file
>> ($ex0, $ex1, $ex2) = split(/&&/, "$line");
>>
>> if I Input one word from html post method, it should be searched the line
>> and diplayed it.
>




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

Date: Tue, 20 Jul 1999 16:13:56 GMT
From: gregf1@my-deja.com
Subject: Perl and IIS
Message-Id: <7n277m$ch$1@nnrp1.deja.com>

Hi,

I'm trying to make it so that a web page hosted on IIS will have a
button that when pressed, will ftp to a server, download a log file and
dump it in a local directory.

I've been told that a Perl script is the solution..
Does anyone have an exmaple of a simple script that would ftp somewhere
and transfer something?

Also, does any body know how i might go about implementing the script
in the web page?

thanks,

Greg



Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 20 Jul 1999 09:24:00 -0700
From: Greg Coit <gbc1@humboldt.edu>
Subject: problems with MIME::Parser
Message-Id: <3794A2A0.38CE6845@humboldt.edu>

Hello all,

I would appreciate any help I can get with the MIME-Tools package.  I'm
trying to get incoming attachments, but the docs don't make any sense to
me (and I'm quickly running out of time).  What I would like is to be
able to get the module to tell me
1)	how many attachments
2)	type of each attachment (not the message itself if the message is
multipart)

and then I would like to be able to post any html-compliant attachments
(text, html, gif, jpg...) to a web page and create links to any others
(word docs...).  I have read all the pertinant docs, but am having no
luck in figuring this out.

here is the code so far:

my $parser = new MIME::Parser output_dir =>"${base}/storage",
                                  output_to_core => 2000;
$entity = $parser->parse_data($message) or die "couldn't parse MIME
stream";
    
$number_of_parts = $entity->parts; #This works, but now what?

<RANT>I've been messing around with MIME::Parser for a couple of weeks,
and I
have never had so much trouble with a module before.  I have read most
of the
man pages associated with MIME::Parser, including MIME-Tools,
MIME::Parser-Base, and MIME::Entity.  I have found a couple things in
the man pages that just don't seem to work:

>From the MIME::Parser docs:

 Shortcuts: # Create a new parser object, and set some properties: 
my $parser = new MIME::Parser output_dir => "$ENV{HOME}/mimemail",
    output_prefix => "part", output_to_core => 20000;

the problem is that the attachment gets saved to disk regardless of size
of attachment and/or value of output_to_core.

>From the MIME::Entity docs:

# Get the body, as a MIME::Body;
        $bodyh = $ent->bodyhandle;

the problem here is that $bodyh has no value.

Also from the MIME::Entity docs:

# Get preamble, parts, and epilogue:
        $preamble   = $ent->preamble;          # ref to array of lines
        $num_parts  = $ent->parts;
        $first_part = $ent->parts(0);          # an entity
        $epilogue   = $ent->epilogue;          # ref to array of lines

$num_parts has the correct value, but I can't make any sense of what I
get from $first_part.  I emailed some of these problems to the
comp.lang.perl.modules group and the only reply I got was "yep, it's
very inconsitent".</RANT> - Okay, I feel a little better.

Thanks in advance for any and all help,
-- 
Greg Coit                                                         
Email: gbc1@humboldt.edu
Linux is not The Answer.  Yes is the answer.  Linux is The Question.


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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 V9 Issue 201
*************************************


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