[16995] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4407 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 22 18:12:28 2000

Date: Fri, 22 Sep 2000 15:10:16 -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: <969660616-v9-i4407@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 22 Sep 2000     Volume: 9 Number: 4407

Today's topics:
    Re: Question to the wise - Reading From File <darryl@work-thicker.co.uk>
    Re: Question to the wise - Reading From File <lr@hpl.hp.com>
    Re: Question to the wise - Reading From File (Craig Berry)
    Re: Question to the wise - Reading From File <registered12345@hotmail.com>
    Re: Re-learn Perl (Ben Coleman)
    Re: Regex standards: ranges <bart.lateur@skynet.be>
    Re: Regex standards: ranges <bart.lateur@skynet.be>
        regexp woes w/ Text-BibTeX <jdhunter@nitace.bsd.uchicago.edu>
        REQ how to create one line of text <registered12345@hotmail.com>
    Re: REQ how to create one line of text stdenton@my-deja.com
    Re: REQ how to create one line of text (Chris Fedde)
    Re: REQ how to create one line of text <registered12345@hotmail.com>
    Re: REQ how to create one line of text <uri@sysarch.com>
    Re: Run C-Program from Perl <crowj@aol.com>
    Re: Setting all variables to null <cantrela@agcs.com>
        sorting a hash - quick answers <rga@io.com>
    Re: sprintf() rounding problem <rpolzer@web.de>
    Re: The Heartbreak of Inscrutable Perl Code (Ben Coleman)
        Thnaks to the Gurus! alphazerozero@my-deja.com
    Re: Threads are broken in ActiveState Perl v5.6. <jdb@wcoil.com>
    Re: Threads are broken in ActiveState Perl v5.6. (Ben Coleman)
    Re: Tutorial Perl? (Mark Dressel)
        use vs. @ISA bdesany@my-deja.com
    Re: Writing info into a file on server side nobull@mail.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 22 Sep 2000 20:15:53 +0000
From: "CJ Llewellyn" <darryl@work-thicker.co.uk>
Subject: Re: Question to the wise - Reading From File
Message-Id: <aiegq8.ht.ln@paulweller>

In article <8qg2ck$8he$1@nnrp1.deja.com>, desertedge@my-deja.com burped:
> I know this is a very easy question, but either my lack of patience (3
> hours of searching through doc's), or my lack of intelligence has
> prohibited me from figuring this simple step out.

got the t-shirt thanx ;-)

> I simply want to open a file, and print the contents.
> 
> Here is my attempt code:
> 
> open(FILE,"test.txt") or &dienice ; while (<FILE>) {
>    print"$FILE\n";
> }
> close(FILE) ;

One way, read line by line

open (FILE,"test.txt") or die "Arrrrrrggggg ! ;-)\n";
while($line = <FILE>){
    print "$line";
}

Second way, read the file then, print line by line

open(FILE,"test.txt") or die "Arrrrrgggg ! :-)\n";
@file = <FILE>;
close(FILE);

foreach my $line (@file){
	print "$line";
}

-- 
Regards,
CJ Llewellyn
http://www.cjll.uklinux.net/


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

Date: Fri, 22 Sep 2000 13:37:45 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: Question to the wise - Reading From File
Message-Id: <MPG.143562f1a31ad25098adb7@nntp.hpl.hp.com>

In article <aiegq8.ht.ln@paulweller> on Fri, 22 Sep 2000 20:15:53 +0000, 
CJ Llewellyn <darryl@work-thicker.co.uk> says...
> In article <8qg2ck$8he$1@nnrp1.deja.com>, desertedge@my-deja.com burped:

 ...

> > I simply want to open a file, and print the contents.

 ...

> One way, read line by line
> 
> open (FILE,"test.txt") or die "Arrrrrrggggg ! ;-)\n";

Including $! in the diagnostic would be more useful than all those 
funnies.

> while($line = <FILE>){
>     print "$line";

The quotes are superfluous and misleading.  Why make an extra copy of 
the variable before printing it?

More succinctly:

  print while <FILE>;

> }
> 
> Second way, read the file then, print line by line
> 
> open(FILE,"test.txt") or die "Arrrrrgggg ! :-)\n";
> @file = <FILE>;
> close(FILE);
> 
> foreach my $line (@file){
> 	print "$line";
> }

More succinctly:

  print <FILE>;

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


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

Date: Fri, 22 Sep 2000 21:10:08 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Question to the wise - Reading From File
Message-Id: <ssnilgh5m1n88f@corp.supernews.com>

desertedge@my-deja.com wrote:
: I simply want to open a file, and print the contents.
: Here is my attempt code:
: 
: open(FILE,"test.txt") or &dienice ;

Good job, you're checking the result (I snipe at people who don't often
enough I've decided to praise those who do now and then).

: while (<FILE>) {
:    print"$FILE\n";

You really need to read the docs more; I suggest _Learning Perl_ or an
equivalent.  The filehandle FILE has nothing to do with the scalar
variable $FILE; the latter is undefined in your code fragment, and thus
its value will be undef.  In fact, you probably saw warnings about your
use of an undefined value when you ran this script (you *are* setting -w,
right?).

The magic "while (<FILE>)" construct reads each line into $_, the
general-purpose Perl utility scalar (I think of it as being to Perl what
the accumulator is to a CPU, but I'm an old assembly fogie so that may
just be my eccentricity showing).  Also, the lines you read in will have
newlines at their ends, so there's no need to append an extra one (unless
your goal is double-spaced output).  This removes the excuse for double
quote interpolation.  Finally, you can take advantage of the fact that
print's default argument is $_, and the postfix while-loop construct, to
reduce this all the way down to

  print while <FILE>;

If the file is small enough to comfortably fit in memory (which most files
a beginner will be playing with are), you can compress this still further.
Consider that print takes a list of arguments, and that <FILE> in a list
context returns a list containing all lines in the file.  Voila:

  print <FILE>;

One of the things you'll notice about Perl is that common stuff can be
expressed *very* compactly.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "Quidquid latine dictum sit, altum viditur."
   |


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

Date: Fri, 22 Sep 2000 21:24:12 GMT
From: SomeWhat <registered12345@hotmail.com>
Subject: Re: Question to the wise - Reading From File
Message-Id: <tvjnssgsbc1ggbshkeq8g20tnqtpjjnbcq@4ax.com>

Yes, can you please tell me how to do this then. I am also very
new to perl programming. And that's why I asked this.

Thanx

On Fri, 22 Sep 2000 20:15:53 +0000, "CJ Llewellyn"
<darryl@work-thicker.co.uk> wrote:

>In article <8qg2ck$8he$1@nnrp1.deja.com>, desertedge@my-deja.com burped:
>> I know this is a very easy question, but either my lack of patience (3
>> hours of searching through doc's), or my lack of intelligence has
>> prohibited me from figuring this simple step out.
>
>got the t-shirt thanx ;-)
>
>> I simply want to open a file, and print the contents.
>> 
>> Here is my attempt code:
>> 
>> open(FILE,"test.txt") or &dienice ; while (<FILE>) {
>>    print"$FILE\n";
>> }
>> close(FILE) ;
>
>One way, read line by line
>
>open (FILE,"test.txt") or die "Arrrrrrggggg ! ;-)\n";
>while($line = <FILE>){
>    print "$line";
>}
>
>Second way, read the file then, print line by line
>
>open(FILE,"test.txt") or die "Arrrrrgggg ! :-)\n";
>@file = <FILE>;
>close(FILE);
>
>foreach my $line (@file){
>	print "$line";
>}



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

Date: Fri, 22 Sep 2000 18:17:53 GMT
From: oloryn@mindspring.com (Ben Coleman)
Subject: Re: Re-learn Perl
Message-Id: <39cba21f.14616056@news.mindspring.com>

On Sun, 10 Sep 2000 03:38:50 -0500, "Juan M. Courcoul"
<courcoul@campus.qro.itesm.mx> wrote:

>Johan Vroman's Perl 5 Reference, which you can buy from O'Reilly or you
>can download from CPAN and print yourself is certainly the most concise
>Quick Reference  you can get

Has the online package been updated since the 5.004 version?

Ben


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

Date: Fri, 22 Sep 2000 19:51:35 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Regex standards: ranges
Message-Id: <atdnss06ch2fqnpckmtbbb6gedetaf0877@4ax.com>

Larry Rosler wrote:

>Any 'R' (or even 'r'), followed somehow by 
>two sequences of digits (unanchored):
>
>   /[Rr].*(\d+).+(\d+)/

I think you want nongreedy matching.

	$_ = "Range from 10 till 20  (101)";
	/[Rr].*(\d+).+(\d+)/ and print "Got a range: from $1 to $2\n";
-->
	Got a range: from 1 to 1

I bet this isn't what users would hope to get.

-- 
	Bart.


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

Date: Fri, 22 Sep 2000 19:53:00 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Regex standards: ranges
Message-Id: <a3ensssrr1nqi5ig1230oo0mn87m29ht05@4ax.com>

Todd Gillespie wrote:

>It's not hard to write the program, it's hard to design a system that
>won't turn away 90% of the users with "I don't understand $_". 

What I would do, is give some help text telling them how to specify a
range. Having to make wild guesses is enough to turn everybody off.

-- 
	Bart.


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

Date: 22 Sep 2000 14:49:19 -0500
From: John Hunter <jdhunter@nitace.bsd.uchicago.edu>
Subject: regexp woes w/ Text-BibTeX
Message-Id: <1ru2b82on4.fsf@video.bsd.uchicago.edu>

I have a function called texsafe which I use to quote special LaTeX
charaters that are not already quoted.  I use this in conjuction with
Text-BibTeX like so:

      my ($title) = $entry -> get('title');
      $title = texsafe($title);

where texsafe is
sub texsafe {
  my $arg = shift;
  #quote any nonquoted special chars
  my $special_chars = '%$#&_';
  $arg =~s/([^\\])([$special_chars])/$1\\$2/g;  #this is the problematic line
  $arg =~ s/([^\\])\"([^"]*)([^\\])\"/$1``$2$3''/g; #fix double quotes
  return $arg;
}

The problem is that for certain characters like '%' even the quoted %
are quoted, leading to double \\ characters in the output which are
wrong.  Stranglely, this behavior doesn't happen for other characters
like $ or #.  Also, when I tried to simplify the example into a script
which operated on the STDIN (and not via Text-BibTeX strings) the
probkem no longer occurred.

Mystified,
John Hunter


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

Date: Fri, 22 Sep 2000 19:11:05 GMT
From: SomeWhat <registered12345@hotmail.com>
Subject: REQ how to create one line of text
Message-Id: <s6cnss87l0sssqorbv890uafg59cl5b3ks@4ax.com>

I have a text file which contains the following



21-9-2000 | dat1 | data2
data5 | data 6
data7 | data 8 | data 9 | data 10

21-9-2000 | data1 | data2
data5 | data 6
data7 | data 8 | data 9 | data 10


How is it possible to put each block on one line.
Is this possible with perl (preffered and exe file)

Thanx



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

Date: Fri, 22 Sep 2000 19:58:26 GMT
From: stdenton@my-deja.com
Subject: Re: REQ how to create one line of text
Message-Id: <8qgdkm$mqn$1@nnrp1.deja.com>

In article <s6cnss87l0sssqorbv890uafg59cl5b3ks@4ax.com>,
  SomeWhat <registered12345@hotmail.com> wrote:
> I have a text file which contains the following
[...]
> How is it possible to put each block on one line.
> Is this possible with perl (preffered and exe file)


Hoo-boy, this is almost too simple...

Are you sure that you aren't looking for help with your homework?

Here's a hint:  read about $/ and $\


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Fri, 22 Sep 2000 20:40:56 GMT
From: cfedde@u.i.sl3d.com (Chris Fedde)
Subject: Re: REQ how to create one line of text
Message-Id: <stPy5.346$W3.189189632@news.frii.net>

In article <s6cnss87l0sssqorbv890uafg59cl5b3ks@4ax.com>,
SomeWhat  <registered12345@hotmail.com> wrote:
>I have a text file which contains the following
>
>
>
>21-9-2000 | dat1 | data2
>data5 | data 6
>data7 | data 8 | data 9 | data 10
>
>21-9-2000 | data1 | data2
>data5 | data 6
>data7 | data 8 | data 9 | data 10
>
>
>How is it possible to put each block on one line.
>Is this possible with perl (preffered and exe file)
>
>Thanx
>

Golf anyone?
perl -lpe 'BEGIN{$/=""}s/\n/ | /g'
-- 
    This space intentionally left blank


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

Date: Fri, 22 Sep 2000 21:24:48 GMT
From: SomeWhat <registered12345@hotmail.com>
Subject: Re: REQ how to create one line of text
Message-Id: <42knssc8kmpgre9of21r3q7g236501ks57@4ax.com>

Yes, can you please tell me how to do this then. I am also very
new to perl programming. And that's why I asked this.

Thanx

On Fri, 22 Sep 2000 19:58:26 GMT, stdenton@my-deja.com wrote:

>In article <s6cnss87l0sssqorbv890uafg59cl5b3ks@4ax.com>,
>  SomeWhat <registered12345@hotmail.com> wrote:
>> I have a text file which contains the following
>[...]
>> How is it possible to put each block on one line.
>> Is this possible with perl (preffered and exe file)
>
>
>Hoo-boy, this is almost too simple...
>
>Are you sure that you aren't looking for help with your homework?
>
>Here's a hint:  read about $/ and $\
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.



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

Date: Fri, 22 Sep 2000 21:39:45 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: REQ how to create one line of text
Message-Id: <x74s38cdi6.fsf@home.sysarch.com>

>>>>> "CF" == Chris Fedde <cfedde@u.i.sl3d.com> writes:

  CF> Golf anyone?
  CF> perl -lpe 'BEGIN{$/=""}s/\n/ | /g'

      perl -00l12pe 'y/\n//d'

this also works and is 2 chars shorter.

      perl -00l12pey/\\n//d

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Fri, 22 Sep 2000 15:46:25 -0400
From: John Crowley <crowj@aol.com>
Subject: Re: Run C-Program from Perl
Message-Id: <39CBB711.9FF4C1AC@aol.com>

first, don't ever make an a.out executable, at least do:
  gcc(or cc) -o my_prog my_prog.c
or 
  make my_prog

second, look for the system function, open function and backtics in
the perl documentation.

Support wrote:
> 
> Hi All,
> 
> I write a C program then compile it, it creates a output file of "a.out".
> Now I would like to run "a.out" from perl. Does anyone know the way or other
> ways? Please tell me.
> Thanks


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

Date: Fri, 22 Sep 2000 11:52:03 -0700
From: Andy Cantrell <cantrela@agcs.com>
To: mike@mld.com
Subject: Re: Setting all variables to null
Message-Id: <39CBAA53.4EE59AE7@agcs.com>

mike@mld.com wrote:
> 
> Is there a simple way to set all variables in an executing perl script
> to null without actually listing them?

 Check out the 'reset' and 'undef' functions.

-- 
Andy Cantrell  - cantrela@agcs.com
AG Communication Systems
Office (AZ) (623) 582-7495 (Voice mail)
Office (WI) (262) 249-0215
Modem  (WI) (262) 249-0239


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

Date: Fri, 22 Sep 2000 20:51:26 GMT
From: "RGA" <rga@io.com>
Subject: sorting a hash - quick answers
Message-Id: <iDPy5.9144$A4.265432@news1.giganews.com>

Quick answers for those searching:
First example is from perlfunc ..


 %CouponsNotAmt = (
  200931445,13.30,
  10010101,177.29,
  200412912,4.50,
  20022315,9.50,
  2004147212,5.70
  );


# sort decending on hash values return keys to list
# reverse $a <=> $b for ascending

@CouponsFinalSort = sort { $CouponsNotAmt{$b} <=> $CouponsNotAmt{$a} } keys
%CouponsNotAmt;

# sort on hash keys return keys to list

@CouponsFinalSort = sort { $a <=> $b } (keys %CouponsNotAmt);

# sort on hash values return values to list

@CouponsFinalSort = sort { $b <=> $a } (values %CouponsNotAmt);











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

Date: Fri, 22 Sep 2000 20:56:57 +0200
From: "Seiberdragan" <rpolzer@web.de>
Subject: Re: sprintf() rounding problem
Message-Id: <8qgdcn$nh6$2@riker.addcom.de>


"David Hugh-Jones" <davidhj@mail.com> schrieb im Newsbeitrag
news:969375053.788717053@news.uklinux.net...
>
> Thanks to all who answered this: for future reference for anyone with my
> problem:
>
> if you need to round the result of a floating point calculation, with 0.5
> always being rounded up - e.g. tax calculations etc.
>  - round your result to 4 sig figs, to avoid evil 0.49999999s
>  - multiply by 100 to put things into cents/pennies
>  - if ($result - int($result) >= 0.5) { $result = int($result+1)} else
{$result
> = int($result)}

HEY, whats that? One-line blocks???
$result = int ($result) + (($result - int($result) >= 0.5) ? 1 : 0);
$result = int ($result) + ($result - int($result) >= 0.5);
$result = int ($result + 0.5)

Choose!

>  - divide by 100 again

$result = int (100 * $result + 0.5001) / 100
should be enough... if you do not have to calculate with 0.0001 pence. If,
add as many 0s as long as it still worx. A standard function...

>
> wfm
>
> dave
>
>
> On Fri, 15 Sep 2000, Chris Fedde wrote:
> >In article <969030633.490324812@news.uklinux.net>,
> >David Hugh-Jones  <davidhj@mail.com> wrote:
> >>
> >>The user input actually comes in the form of a text config file which
gets
> >>read. But, anyway, I don't think the multiply by 100 idea solves it: I
> >>still have to add 17.5% Value Added Tax, which is going to give floating
point
> >>results even with integer input.
> >>
> >>dave
> >
> >It's possible to do fixed place math in Perl.  One way is to use
> >Math::BigInt.  Multiply incoming values by the right adjuster, Do
> >what you want, then stuff a decimal in on output.  For rounding
> >money you need to pick a method that preserves pennies. One method
> >that is common is round up if thousandths is 5 or greater and down
> >otherwise.  Since half of the transactions are credits and half
> >are debits the pennies will balance out.
> >
> >    #!/usr/bin/perl
> >
> >    use warnings;
> >    use strict;
> >    use Math::BigInt;
> >    use constant Places=>3;
> >
> >    my $balance = Math::BigInt->new( '123456784'.'0'x Places );
> >    my $rate = Math::BigInt->new( 17.5 * 10**Places );
> >
> >    my $newbal = $balance + $balance*$rate/12;
> >    my $dist   = $newbal/45;
> >    my $other  = $newbal/7;
> >
> >    print join(" ", $newbal, $dist, $other), "\n";
> >    print join(" ", map {displaycents($_)} $newbal, $dist, $other), "\n";
> >
> >    sub displaycents
> >    {
> > my $amt = shift;
> >
> > $amt += substr($amt, -1, 1) < 5 ? 0 : 10;
> >
> > $amt = $amt->bnorm;
> > substr($amt, -1*Places, 0) = ".";
> > substr($amt, -1, 1) = '';
> > return $amt;
> >    }
> >
> >chris
> >--
> >    This space intentionally left blank




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

Date: Fri, 22 Sep 2000 18:25:22 GMT
From: oloryn@mindspring.com (Ben Coleman)
Subject: Re: The Heartbreak of Inscrutable Perl Code
Message-Id: <39cba3fe.15094975@news.mindspring.com>

On Fri, 08 Sep 2000 04:41:50 GMT, tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
wrote:

>Wouldn't that be I = IncrementANumber(I);

No, that's the COBOL idiom.

Ben


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

Date: Fri, 22 Sep 2000 20:00:23 GMT
From: alphazerozero@my-deja.com
Subject: Thnaks to the Gurus!
Message-Id: <8qgdoa$n4e$1@nnrp1.deja.com>

I just wanted to thank the general PERL comunity for all of their
efforts in producing a first class language that has made my
programming day much more interesting and fun.

Also thanks to those of you who have answered my pesky questions and to
those of you who no doubt will answer the ones to come.

It is much appreciated by this programmer and to be honest by many who
I know.

Thanks to all.

alphazerozero
ps (Especial thanks to Larry Wall, and to the many who wrote some of
the funniest docs ive ever read.)




Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 22 Sep 2000 20:13:48 GMT
From: "Josiah" <jdb@wcoil.com>
Subject: Re: Threads are broken in ActiveState Perl v5.6.
Message-Id: <8qgehs$kd2$0@206.230.71.39>

I quote from my original posting.
The output of 'perl -V' included in my original posting included this line
near the end:

Characteristics of this binary (from libperl):
  Compile-time options: MULTIPLICITY ****USE_ITHREADS****
PERL_IMPLICIT_CONTEXT
PERL_IMPLICIT_SYS

*emphasis added*

That indicates that this acitvestate build SHOULD work with threads, right?
I mean, it says THIS binary, not some binaries. It says that THIS binary,
the one I use, was compile with the USE_THREADS option. Correct me if im
wrong, but it appears that this indicates that the interpreter shoudl suppor
threads, right?



regards,
--
Josiah <jdb@wcoil.com>

eval' use"  signed by Josiah  "',################
$J='#!0^^9&&7J046J0107J099J108J0112J0114J110J116J
0101J121J032J58J104J97J0105J0115J0111J074',$j='0X
OI2Q3IL69N390J01J2J3J04J05J6J7J8J9J10J7J04J011J1J
010J5J9J12J7J13J09J12J14J7J5J4J15J16J9J12J',print
map{chr((reverse split/J/,$J)[$_])}split/J/,$j#J#

Helgi Briem <helgi@NOSPAMdecode.is> wrote in message
news:39cb8b25.603689519@news.itn.is...
> On 21 Sep 2000 08:41:24 GMT, "Josiah Bryan" <jdb@wcoil.com>
> wrote:
>
> >I have this test script:
> >
> >use Thread;
> >$a = new Thread \&sub1;
> >$b = new Thread \&sub2;
> >
> >sub sub1 {
> >print "in thread 1\n";
> >}
> >
> >sub sub1 {
> >print "in thread 2\n";
> >}
> >__END__
> >
> >And it immediatly prints the error message (when run):
> >
> >"No threads in this perl at threads.test line 2." (no quotes)
> >
> >Any clues/hints/pointers/etc? It obviously says it is threads-enabled,
> >(see output of perl -v  and perl -V, below), and it is ActiveState build
> >613.
> >It is very troubling. Latest release of perl and latest release of perl
from
> >AS,
> >and threads STILL dont work! Argggggggggg. Any suggestions?
>
> Well, it says in the docs:
>
> NAME
> Thread - manipulate threads in Perl (EXPERIMENTAL, subject
> to change)
>
> --------------------------------------------------------------------------
------
>
> SUPPORTED PLATFORMS
> NOTE: The Thread extension requires Perl to be built in a
> particular way to enable the older 5.005 threading model.
> ActivePerl is not built this way, which means this extension
> will not work under ActivePerl. If you wish to use the 5.005
> threading model, you will need to compile Perl from the
> sources to enable this feature.
>
> and
>
> DESCRIPTION
>     WARNING: Threading is an experimental feature.
> Both the interface and implementation are subject
> to change drastically.  In fact, this documentation
> describes the flavor of threads that was in version
> 5.005.  Perl 5.6.0 and later have the beginnings of
> support for interpreter threads, which (when finished) is
> expected to be significantly different from what is
> described here.  The information contained here may
> therefore soon be obsolete.  Use at your own risk!
> The Thread module provides multithreading support
> for perl.
>
> and
>
> Basic Thread Support
> Thread support is a Perl compile-time option-it's something
> that's turned on or off when Perl is built at your site,
> rather than when your programs are compiled. If your Perl
> wasn't compiled with thread support enabled, then any
> attempt to use threads will fail.
>
> So the upshot is, recompile perl.exe with the
> command line option that allows threads.
> What that is I don't know.
>
> Regards,
> Helgi Briem




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

Date: Fri, 22 Sep 2000 20:33:40 GMT
From: oloryn@mindspring.com (Ben Coleman)
Subject: Re: Threads are broken in ActiveState Perl v5.6.
Message-Id: <39cbc188.22656648@news.mindspring.com>

On 22 Sep 2000 20:13:48 GMT, "Josiah" <jdb@wcoil.com> wrote:

>Characteristics of this binary (from libperl):
>  Compile-time options: MULTIPLICITY ****USE_ITHREADS****
>PERL_IMPLICIT_CONTEXT
>PERL_IMPLICIT_SYS
>
>*emphasis added*
>
>That indicates that this acitvestate build SHOULD work with threads, right?
>I mean, it says THIS binary, not some binaries. It says that THIS binary,
>the one I use, was compile with the USE_THREADS option. Correct me if im
>wrong, but it appears that this indicates that the interpreter shoudl suppor
>threads, right?

That's USE_ITHREADS, not USE_THREADS.  IIRC, ITHREADS is the mechanism
whereby fork() is implemented on Win32, not the experimental threads
feature.

"These are not the droids you're looking for"

Ben


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

Date: Fri, 22 Sep 2000 19:24:28 GMT
From: mark@artwarren.comNOSPAM (Mark Dressel)
Subject: Re: Tutorial Perl?
Message-Id: <39cbb1a0.40609724@news.screaming.net>

On Tue, 19 Sep 2000 19:06:30 +0200, "carma" <gamer@freegates.be>
wrote:

>Where can I find one? For Free and in English or Dutch?
>Plz help me
>
>
www.webmonkey.com have one, plus tutorials on other things too.

Also look at www.perl.com, they have a list of tutorials. 

Happy scripting,

Mark


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

Date: Fri, 22 Sep 2000 21:51:59 GMT
From: bdesany@my-deja.com
Subject: use vs. @ISA
Message-Id: <8qgk9o$v19$1@nnrp1.deja.com>

What's the difference? Is it that subroutines in packages that are
being "used" are not accessible as object methods, and those in
packages in @ISA are?

If you have some general-purpose methods stored in a package that you
want to use on the objects from various (otherwise unrelated) classes,
do you "use" that module or do you "ISA" it? (Because these classes
don't have the is-a relationship you normally see illustrated). Thanks,

-Brian.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 22 Sep 2000 20:44:39 +0100
From: nobull@mail.com
Subject: Re: Writing info into a file on server side
Message-Id: <u9zol0dxeg.fsf@wcl-l.bham.ac.uk>

circuit_board@my-deja.com writes:

> Here, I'm opening a file for appending. This is in a cgi script,
> uploaded to the server. When I run it, it gives an error message and
> nothing is written to the file.

_What_ error message?

> Hope you can help.

Random-shot-in-the-dark: The user what the script is running as does
not have write access to the file, or the current directory is not
what you think it is.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

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 4407
**************************************


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