[11729] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5330 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 8 13:07:31 1999

Date: Thu, 8 Apr 99 10:01:30 -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           Thu, 8 Apr 1999     Volume: 8 Number: 5330

Today's topics:
        Newbie question: Why does this loop only print three? jonnyb491@my-dejanews.com
    Re: Newbie question: Why does this loop only print thre (Jordan I. K. McClure)
    Re: Newbie question: Why does this loop only print thre (Larry Rosler)
    Re: Newbie question: Why does this loop only print thre (Jonathan Stowe)
    Re: Newbie question: Why does this loop only print thre (Jonathan Stowe)
    Re: Perl as a first programming language - suitability, (Randal L. Schwartz)
    Re: Perl calls PGP (brian d foy)
        Perl5 on AIX 4.3.2 <derek.butler@int-link.com>
    Re: perldoc and PAGER <Philip.Newton@datenrevision.de>
    Re: perldoc and PAGER <cassell@mail.cor.epa.gov>
        RA/RAM, Plugin Handling with PERL (newbie) <mattski_cd@yahoo.com>
        sorting array from database <geotrace@shentel.net>
    Re: sorting array from database (Larry Rosler)
    Re: Typeglobs broken by threaded perl??? (Bruce R Miller)
    Re: Validating Email addresses <edson@usa.net>
        Verifying existance of a file <ophir@saifun.com>
    Re: Verifying existance of a file (Randal L. Schwartz)
    Re: Verifying existance of a file (Jonathan Stowe)
    Re: Verifying existance of a file (Larry Rosler)
    Re: Verifying existance of a file (Bart Lateur)
    Re: wanted: elegant inverse operation for vec <Wm.Blasius@ks.sel.alcatel.de>
        zipped perlman <cyberjeff@sprintmail.com>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Thu, 08 Apr 1999 14:48:12 GMT
From: jonnyb491@my-dejanews.com
Subject: Newbie question: Why does this loop only print three?
Message-Id: <7eifj9$b1t$1@nnrp1.dejanews.com>

Hello. I am playing with activestate's perl on win32, I am trying to use a
for..loop just to get a feel of how these things work. This loop works in c++
but ony prints three "*"'s, no matter what the input is, even if its 0.

Do you know why :(

#Fun with Perl

print "Welcome, this program will draw a triangle for you.\n";
print "---------------------------------------------------\n";

print "How big should the base be?\n";
$tri = <STDIN>;

#The for loop draws the base.

for ($i=0, $i < $tri, $i++){
	print "*";
}
$tri = 0;
print "\n\nThank you very much!";

Thanks for any help.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 8 Apr 1999 15:16:36 GMT
From: jimcclur@ews.uiuc.edu (Jordan I. K. McClure)
Subject: Re: Newbie question: Why does this loop only print three?
Message-Id: <7eih8k$cm5$1@vixen.cso.uiuc.edu>

jonnyb491@my-dejanews.com wrote:
:
: print "Welcome, this program will draw a triangle for you.\n";
: print "---------------------------------------------------\n";
: 
: print "How big should the base be?\n";
: $tri = <STDIN>;
: 
: #The for loop draws the base.
: 
: for ($i=0, $i < $tri, $i++){
: 	print "*";
: }

The delimiter for the three parts of a for loop in perl is the
semicolon, not the comma.  

jordan

--
This statement is false.


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

Date: Thu, 8 Apr 1999 08:24:42 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Newbie question: Why does this loop only print three?
Message-Id: <MPG.11766a0ea64fe071989869@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <7eifj9$b1t$1@nnrp1.dejanews.com> on Thu, 08 Apr 1999 
14:48:12 GMT, jonnyb491@my-dejanews.com <jonnyb491@my-dejanews.com 
>says...
> Hello. I am playing with activestate's perl on win32, I am trying to use a
> for..loop just to get a feel of how these things work. This loop works in c++
> but ony prints three "*"'s, no matter what the input is, even if its 0.
> 
> Do you know why :(

Yes.  But it wouldn't work in C++ either!

 ...
> for ($i=0, $i < $tri, $i++){
> 	print "*";
> }

Those commas should be semicolons (in C++ also).  You don't have a 'for' 
loop here -- you have a list with three members, so the loop runs three 
times.

By the way, in Perl that can be written as:

      print '*' x $tri;

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


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

Date: Thu, 08 Apr 1999 15:55:26 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: Newbie question: Why does this loop only print three?
Message-Id: <370ccfed.28680382@news.dircon.co.uk>

On Thu, 08 Apr 1999 14:48:12 GMT, jonnyb491@my-dejanews.com wrote:

>Hello. I am playing with activestate's perl on win32, I am trying to use a
>for..loop just to get a feel of how these things work. This loop works in c++
>but ony prints three "*"'s, no matter what the input is, even if its 0.
>
>Do you know why :(
>

Of course ;-p

>#Fun with Perl
>
>print "Welcome, this program will draw a triangle for you.\n";
>print "---------------------------------------------------\n";
>
>print "How big should the base be?\n";
>$tri = <STDIN>;
>

You should chomp($tri) in order to remove the newline 

>#The for loop draws the base.
>
>for ($i=0, $i < $tri, $i++){

What does the perlsyn manpage say should be separating the expressions
in a C-style 'for' loop ? Commas it sure aint.

>	print "*";
>}
>$tri = 0;
>print "\n\nThank you very much!";
>

Although it wouldnt necessarily have helped in this case you should
always use Perls '-w' switch and almost always use 'use strict;'.

In debugging a problem like this one generally would print out the
value of $i in the body of the loop which would (I hope) have led to
the cause of the problem.

/J\


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

Date: Thu, 08 Apr 1999 16:07:03 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: Newbie question: Why does this loop only print three?
Message-Id: <370cd3ca.29669550@news.dircon.co.uk>

On Thu, 8 Apr 1999 08:24:42 -0700, lr@hpl.hp.com (Larry Rosler) wrote:

>[Posted and a courtesy copy sent.]
>
>In article <7eifj9$b1t$1@nnrp1.dejanews.com> on Thu, 08 Apr 1999 
>14:48:12 GMT, jonnyb491@my-dejanews.com <jonnyb491@my-dejanews.com 
>>says...
>> Hello. I am playing with activestate's perl on win32, I am trying to use a
>> for..loop just to get a feel of how these things work. This loop works in c++
>> but ony prints three "*"'s, no matter what the input is, even if its 0.
>> 
>> Do you know why :(
>
>Yes.  But it wouldn't work in C++ either!
>
>...
>> for ($i=0, $i < $tri, $i++){
>> 	print "*";
>> }
>
>Those commas should be semicolons (in C++ also).  You don't have a 'for' 
>loop here -- you have a list with three members, so the loop runs three 
>times.
>
>

I was fooled for a second that the value of $i was 1 in all three
cases until I realized that the $i++ had been evaluated when the list
was being built for 'for'

/J\


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

Date: 08 Apr 1999 08:39:34 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Perl as a first programming language - suitability, good books ?
Message-Id: <m1yak315qh.fsf@halfdome.holdit.com>

>>>>> "David" == David L Cassell <cassell@mail.cor.epa.gov> writes:

David> If you look more closely at it, you'll discover why no one recommended
David> it.  You asked for a *good* book.  If you travel to www.perl.org and
David> check out the book reviews, you'll see why it's not recommended.
David> 'Learn Perl in 21 Days' is better rated.. and has fewer tawdry errors.

There's no book by that title.  That's a common morph between "Teach
Yourself Perl in 21 Days" from SAMS (a book that I've found too many
errors in to recommend except as something to prop up your terminal)
and "Learning Perl" from ORA (which I had something to do with :).

print "Just another Perl hacker,"

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Thu, 08 Apr 1999 12:48:30 -0400
From: brian@pm.org (brian d foy)
Subject: Re: Perl calls PGP
Message-Id: <brian-ya02408000R0804991248300001@news.panix.com>

In article <370BC24C.15FB@protix.com>, David Delikat <ddelikat@protix.com> posted:

> PGP is probably purging STDIN (or something like that) before 
> it waits for the keystroke.  in which case your program has 
> to wait until PGP prints out the prompt before it sends the CR.

it's no sense waiting.  PGP is waiting too.  something has to
read the data that PGP is trying to write.

-- 
brian d foy                    
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Monger Hats! <URL:http://www.pm.org/clothing.shtml>


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

Date: Thu, 08 Apr 1999 16:34:16 +0100
From: Derek Butler <derek.butler@int-link.com>
Subject: Perl5 on AIX 4.3.2
Message-Id: <370CCC77.2F5341A1@int-link.com>

Has anyone managed to install and compile the source Perl5.004 code onto
an AIX 4.3.2 system ?

We are having problems compiling on this version of AIX.

Regards, Derek.
--
_____________________________________
  Interlink Consultancy Services Ltd
_____________________________________

  Email:   derek.butler@int-link.com
  Tel:     (044) 1625 521 222
  Fax:    (044) 1625 521 333
_____________________________________
  Systems . Software . Consultancy
_____________________________________




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

Date: Thu, 08 Apr 1999 17:01:52 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: perldoc and PAGER
Message-Id: <370CC4E0.C394CBA6@datenrevision.de>

Ilya Zakharevich wrote:
> 
> [A complimentary Cc of this posting was sent to Bill Moseley
> <moseley@best.com>],
> who wrote in article <MPG.11759ae04d3a9284989719@206.184.139.132>:
> > I'm running:
> > This is perl, version 5.005_02 built for MSWin32-x86-object
> >
> > Copyright 1987-1998, Larry Wall
> >
> > Binary build 507 provided by ActiveState Tool Corp.
> > http://www.ActiveState.com
> > Built 15:08:32 Nov 14 1998
> >
> > perdoc Version 1.14: Wed Jul 15 01:50:20 EST 1998
> >
> > It pages fine when I do a perldoc module, but -f and -q just scroll away.
> >
> > Anyone know how to get perldoc -f  and -q to page?
> 
> Upgrade.  I think I put this on circa _54.

Or, as a workaround, you can fiddle around with perldoc.bat . I did that
at home because I was annoyed by the scrolling bit. I use Vern Buerg's
LIST.COM and fitted that into the list of pagers manually.

Cheers,
Philip.


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

Date: Thu, 08 Apr 1999 09:38:55 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: perldoc and PAGER
Message-Id: <370CDB9F.E01699A8@mail.cor.epa.gov>

Ilya Zakharevich wrote:
> 
> [A complimentary Cc of this posting was sent to Bill Moseley
> <moseley@best.com>],
> who wrote in article <MPG.11759ae04d3a9284989719@206.184.139.132>:
> > I'm running:
> > This is perl, version 5.005_02 built for MSWin32-x86-object
> >
> > Copyright 1987-1998, Larry Wall
> >
> > Binary build 507 provided by ActiveState Tool Corp.
> > http://www.ActiveState.com
> > Built 15:08:32 Nov 14 1998
> >
> > perdoc Version 1.14: Wed Jul 15 01:50:20 EST 1998
> >
> > It pages fine when I do a perldoc module, but -f and -q just scroll away.
> >
> > Anyone know how to get perldoc -f  and -q to page?
> 
> Upgrade.  I think I put this on circa _54.
> 
> Ilya

Good plan.  But I have build 509 on win95, and it still scrolls madly
for the -q option.  -f now works just fine though.  I haven't bothered
to fiddle with perldoc.bat yet, like I ought to, since I haven't had a
need yet...

David
-- 
David Cassell, OAO                               
cassell@mail.cor.epa.gov
Senior Computing Specialist                          phone: (541)
754-4468
mathematical statistician                              fax: (541)
754-4716


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

Date: Thu, 08 Apr 1999 17:49:59 +0100
From: Matt Williams <mattski_cd@yahoo.com>
Subject: RA/RAM, Plugin Handling with PERL (newbie)
Message-Id: <370CDE36.A2A04455@yahoo.com>

Hi there!

I'm taking a first few tottering steps with Perl/CGI programming.

I attempting to write a script to mask the locations of real audio
files. It will take the information passed to it from a link (of the
tpye: href http://www.url.com/cgi-bin/mask.cgi?track=1>Track Title</a>),
and then send the relevant .ram file back to the browser, which will
then start the real audio player, which will then open up the right url
and play the media clip. I started off simple, with this:

#!/usr/local/bin/perl

print "Content-type: audio/x-pn-realaudio\n\n";
print "Location: http://www.url.com/clips/track1.ram\n\n";
exit;

Which quite happily opens the real audio player, but the player doesn't
load the clip (it is there).

Having fallen over at this stage, I figured I'd better understand where
I was going wrong before attempting to proceed any further

I've scoured the web for librarys, scripts, tutorials on handling
plugins with perl, scoured the perl documentation and faqs to no avail.
If there's a good tutorial out there for this kind of thing, please
point me in the write direction, or any help you can offer.

Many thanks,
Matt :)




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

Date: Thu, 08 Apr 1999 11:35:03 -0400
From: Diane Unger <geotrace@shentel.net>
Subject: sorting array from database
Message-Id: <370CCCA7.52B35503@shentel.net>

Hi,
I am extracting sets of data from a text file dependent on the users
prior selections.  I read the data into an array.  That part works
fine.  Now I want to sort this subset of the database based on one of
the data fields.  One line of data within this array contains multiple
values, and I break it up into pieces based on a unique character.  Now
I want to sort on just one of these values and then print out all of the
data in the sorted order.

I've searched all over, studied the Camel books and still I can't find
an example that uses more than 2 pieces of data at a time.  Here's an
example of my data:

state,county,name,location,ID,type

Generally there will be multiple lines like this in the array with the
actual values substituted for the names shown above.  How can I sort on
ID and then print all of the above to a table?
Thanks,
Diane



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

Date: Thu, 8 Apr 1999 09:27:04 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: sorting array from database
Message-Id: <MPG.117678ad2a639c9e98986b@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <370CCCA7.52B35503@shentel.net> on Thu, 08 Apr 1999 11:35:03 
-0400, Diane Unger <geotrace@shentel.net >says...
 ...
> ... I want to sort this subset of the database based on one of
> the data fields.  One line of data within this array contains multiple
> values, and I break it up into pieces based on a unique character.  Now
> I want to sort on just one of these values and then print out all of the
> data in the sorted order.
> 
> I've searched all over, studied the Camel books ...

This is a very standard sort, so standard that yours is a Frequently 
Asked Question.  So you might look for the answer in perlfaq4:  "How do 
I sort an array by (anything)?"

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


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

Date: 8 Apr 1999 15:17:28 GMT
From: miller@altaira.cam.nist.gov (Bruce R Miller)
Subject: Re: Typeglobs broken by threaded perl???
Message-Id: <7eiha8$3fq$1@news.nist.gov>

In article <7egmtg$e2p$3@fcnews.fc.hp.com>,
	ada@fc.hp.com (Andrew Allen) writes:
>Bruce R Miller (miller@altaira.cam.nist.gov) wrote:
>: Is there any workaround (other than recompiling perl w/o threads) to 
>: recover the local $_?
>: Wrapping a
>:  { local($_)=('');
>:   ... }
>: around everything doesn't seem to help.
>
>I don't have threaded perl to try this on, 

Now, I dont either... I gave up & recompiled w/o threading. sigh.

 ..but does pounding $_ into
>the namespace work?, i.e.
>
>  local *_=\$_;

It looks like it should; I tried a lot of similar variations, that didn't work.
I'm not sure if I tried that one.

>at the beginning of your code? Of course, only one thread's $_ would
>become the "global" $_, but it sounds like you're uni-thread anyways.

Yep, I was just running `normal' perl programs using a perl that
happened to support threads.

>$_ has always been semi-magical anyways, so I don't think lexicalizing
>it for threads is _that_ big of a deal, and _something_ was necessary
>for threads to get, say, two simultaneously-running greps to work
>properly.

But does it really need that? Dynamical binding $_, ie. local($_), in 
a thread should keep it separate from any other thread's $_.  Since
everything defaults to $_, the catch is people use it without realizing.
But any reusable piece of code that mungs with $_, either has to bind it, 
or advertise it, anyway... threads or no.

>
>Andrew

-- 
--
bruce.miller@nist.gov
http://math.nist.gov/~BMiller/



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

Date: Thu, 8 Apr 1999 17:16:28 +0100
From: "Edson Medina" <edson@usa.net>
Subject: Re: Validating Email addresses
Message-Id: <923588160.662415@nurn.esoterica.pt>

> if ($ToEmail=~/\@/)

maybe if you use /@/ instead of /\@/




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

Date: Thu, 08 Apr 1999 17:45:44 +0200
From: Ophir Marko <ophir@saifun.com>
Subject: Verifying existance of a file
Message-Id: <370CCF28.51C78F2E@saifun.com>

How can i verify that a file exists?



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

Date: 08 Apr 1999 08:49:20 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Verifying existance of a file
Message-Id: <m1n20j15a7.fsf@halfdome.holdit.com>

>>>>> "Ophir" == Ophir Marko <ophir@saifun.com> writes:

Ophir> How can i verify that a file exists?

Perhaps you want alt.philosophy.existential?

:)

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Thu, 08 Apr 1999 15:57:09 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: Verifying existance of a file
Message-Id: <370cd181.29084560@news.dircon.co.uk>

On Thu, 08 Apr 1999 17:45:44 +0200, Ophir Marko <ophir@saifun.com>
wrote:

>How can i verify that a file exists?
>

print "$file exists" if ( -f $file );
 

/J\


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

Date: Thu, 8 Apr 1999 08:51:56 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Verifying existance of a file
Message-Id: <MPG.1176706f4f4d342a98986a@nntp.hpl.hp.com>

[Posted and a courtesy copy sent.]

In article <370CCF28.51C78F2E@saifun.com> on Thu, 08 Apr 1999 17:45:44 
+0200, Ophir Marko <ophir@saifun.com >says...
> How can i verify that a file exists?

RTFM.  Look for 'filetest operators' in perlfunc.

Now there's a dilemma for a newbie, no?  Why are 'filetest operators' 
detailed in perlfunc (functions, right?) rather than in perlop 
(operators, right)?  Fortunately, there's a cross-reference from 'Named 
Unary Operators' in perlop, but nevertheless...

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


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

Date: Thu, 08 Apr 1999 16:52:46 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Verifying existance of a file
Message-Id: <370cdd65.890004@news.skynet.be>

Larry Rosler wrote:

>> How can i verify that a file exists?
>
>RTFM.  Look for 'filetest operators' in perlfunc.
>
>Now there's a dilemma for a newbie, no?

Actually, "perldoc -f -X" works too. But you have to know a bit of Perl
already before you'd even *think* of trying that.

You can always load "perlfunc.pod" into a text editor, and look up the
phrase "file exist". It will reveal this line:

                -e  File exists.

Not bad.

Still, I'm pondering on how to improve perldoc. How do you search stuff
when you don't know *exactly* what you're looking for? "grep" kinda
works, but isn't really in line with the rest of perldoc. "perldoc -g"?

Also: "-f" should look up stuff in perlop, too.

	Bart.


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

Date: Thu, 08 Apr 1999 17:38:03 +0200
From: William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de>
Subject: Re: wanted: elegant inverse operation for vec
Message-Id: <370CCD5B.446B9B3D@ks.sel.alcatel.de>

William Blasius #42722 wrote:
> 
> Tad McClellan wrote:
> >
> > William Blasius #42722 (Wm.Blasius@ks.sel.alcatel.de) wrote:
> >
> > : the Subject pretty much says it all. I'm trying to come up with an
> > : elegant way to turn a sparse bitfield into a set of "bit numbers".
> > : ie: 00100100 becomes 2 5
> > : I'd happily settle for an algorithm to get the number for a single
> > : bit, but I'm having a bit of a bad brain day. There must be a good
> > : popular idiom for this, iteration seems so...so...so...repetitive!
> >
> >    I dunno how to do it without iteration, so here it is with
> >    iteration.
> >
> >    It is not clear whether you want to manipulate a real bit vector,
> >    or a string of one and zero chars, so I did both.
> >
> >    Note that this destroys the vector, but hopefully it will
> >    get you past your bad day.
> >
> > ---------------------
> > #!/usr/bin/perl -w
> > use strict;
> >
> <string algorithm snipped>
> >
> > ### bits are real bits
> > $_ = 0x24;
> > for (my $pos=0;   $_;   $_>>=1, $pos++) {
> >    print "$pos " if $_ & 1;
> > }
> > print "\n";
> > ---------------------
> > --
> >     Tad McClellan                          SGML Consulting
> 
> Unfortunately, this doesn't work for real bit vectors. Perl
> doesn't seem to be smart enough to realize that bit vectors
> are subject to bitwise operations. Hence:
> 
> #!/tools/gnu/bin/perl5 -w
> use strict;
> 
> my $bits = "";
> vec($bits, 2, 1) = 1;  # set bits = '$'
> vec($bits, 5, 1) = 1;
> printf STDERR "\$bits=%s\n", $bits;
> 
> my @bits2;
> for (my $pos=0; $bits; $bits >>= 1, $pos++) {
>     push(@bits2,$pos) if $bits & 1;
> };
> __END__
> prints:
> $bits=$
> Argument "$" isn't numeric in bit_and at ...
> 
> I would have expected Perl to and them as either numbers or
> strings - not bail! Is this a known bug? Already fixed? Not
> having access to CPAN, I have no easy way to find out. FWIW
> I'm running perl version 5.004.
> 
> Wm Blasius

The shift also failed because the bitfield wasn't an integer.
This kludge works, though:
my @bits2;
my $digits = ord( $bits );
for (my $pos=0; $digits; $digits >>= 1, $pos++) {
   push(@bits2,$pos) if $digits & 1;
};

Wm
---

-- 
* I am Pentium of Borg. Division is futile. You will be approximated. *
 ...now I'm <wm.blasius@ks.sel.alcatel.de> - no matter what my mail
server says!


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

Date: Thu, 08 Apr 1999 11:26:17 -0400
From: Jeff Thies <cyberjeff@sprintmail.com>
Subject: zipped perlman
Message-Id: <370CCA98.4AB7EF81@sprintmail.com>

  I'm a windows user and would like to have the perl man local. Is there
a zipped version? I can find the tarred version.

Jeff




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

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

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