[23886] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6089 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 6 18:05:40 2004

Date: Fri, 6 Feb 2004 15:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 6 Feb 2004     Volume: 10 Number: 6089

Today's topics:
        ANSI(?) characters from perl debug are unwanted (Alan)
    Re: Clarifications <bik.mido@tiscalinet.it>
    Re: Clarifications <bik.mido@tiscalinet.it>
    Re: Clarifications <bik.mido@tiscalinet.it>
    Re: Clarifications <matthew.garrish@sympatico.ca>
        Command Lines unmap/ map local partitions (Dave)
    Re: Command Lines unmap/ map local partitions <matthew.garrish@sympatico.ca>
    Re: Copy Constructor Craziness (Aaron Sherman)
        CPAN cc vs. gcc <mhunter@uclink.berkeley.edu>
    Re: CPAN cc vs. gcc <mothra@nowhereatall.com>
    Re: CPAN cc vs. gcc <jwillmore@remove.adelphia.net>
    Re: CPAN cc vs. gcc <tony_curtis32@_SPAMTRAP_yahoo.com>
    Re: CPAN cc vs. gcc <jwillmore@remove.adelphia.net>
    Re: CPAN cc vs. gcc <tony_curtis32@_SPAMTRAP_yahoo.com>
    Re: CPAN cc vs. gcc (James Willmore)
    Re: CPAN cc vs. gcc <tony_curtis32@_SPAMTRAP_yahoo.com>
    Re: CPAN cc vs. gcc <mhunter@uclink.berkeley.edu>
    Re: filter a string in perl <jurgenex@hotmail.com>
        Forgetting how to use vec (Aaron Sherman)
    Re: Forgetting how to use vec (Walter Roberson)
    Re: How to use select (select(2)) in Perl? (Kenny McCormack)
        including files in perl (brad)
    Re: including files in perl (Walter Roberson)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 6 Feb 2004 09:00:43 -0800
From: alan_santacruz@yahoo.com (Alan)
Subject: ANSI(?) characters from perl debug are unwanted
Message-Id: <b7784f4d.0402060900.6d625a70@posting.google.com>

The display from perl -d is showing what i guess are ANSI display
control sequences in an Windows XP Command Prompt window.

E.g. the command line  
    perl -d -e 42
gives
    main::(-e:1):   42
    ?[4;m  DB<1> ?[1mq
    ?[0m    
 
<I've snipped the banner lines>
 
This is using perl, v5.8.0 built for MSWin32-x86-multi-thread
(ActiveState build 806)
 
How can the ANSI output be turned off, or alternatively XP be told to
handle the ANSI correctly?
 
thanks
Alan


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

Date: Sat, 07 Feb 2004 21:33:50 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Clarifications
Message-Id: <ae1a20lbuh25ajc2gqostbbuob6oi6lfl0@4ax.com>

On Thu, 05 Feb 2004 07:15:14 GMT, Joe Smith <Joe.Smith@inwap.com>
wrote:

>Real programmers use EDIT or vi or emacs or TECO.    :-)
>	-Joe

No, both vi and emacs are better than joe...


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


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

Date: Sat, 07 Feb 2004 21:33:51 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Clarifications
Message-Id: <eh1a201etma5pkq52vqsagb9j03684d5kh@4ax.com>

On Wed, 4 Feb 2004 22:36:37 -0500, "Matt Garrish"
<matthew.garrish@sympatico.ca> wrote:

>> simple. don't use a word processor to edit code. use a text
>> editor. people who use word to edit code are stupid twice over.
>
>If you've got an easier way to get a binary from your code than by using
>Word I'd like to hear it. Sometimes I wonder what you're smoking...

This must be some sort of sarcasm, but I don't get it...


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


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

Date: Sat, 07 Feb 2004 21:33:51 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Clarifications
Message-Id: <4mia20h4odh1au0qormruvbfejig8dq01v@4ax.com>

On Thu, 05 Feb 2004 06:24:29 GMT, "edgrsprj" <edgrsprj@ix.netcom.com>
wrote:

>> A Real Programmer would not blame the language for OS features
>> as edgrsprj does:
>
>I am not blaming Perl for anything.  My code examples simply say to people
>who are not experts, if you do "this" then the result will be "that."  It

As a result those people who are not experts will *think* that if you
do "this" then the result will be "that".

Only, you really have that if you do "this" then the result will be
"that other".

Only, in the particular situation you're examining, "that" *seems*
"that other".

But when those people who are not experts will be trying to do "that"
by doing "this", they may find out that "this" doesn't do "that" and
won't understand what's going on. (And when they will understand it,
they will blame you!)

I JUST CAN'T EXPLAIN THE CONCEPT IN SIMPLER WORDS. PLEASE TELL ME IF
THERE'S ANYTHING THAT YOU CAN'T UNDERSTAND!

As an example, IIRC you wrote that "\n" causes the print() statement
to immediately print its output whereas not including it at the end of
the list of arguments causes the actual printing to be delayed. But
consider this:

  $|++; # Here for some reason...
  # ...
  # Some code
  # ...
  print 'foo'; # D'Oh, it prints immediately!


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


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

Date: Fri, 6 Feb 2004 16:45:45 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Clarifications
Message-Id: <9WTUb.20347$bp1.735936@news20.bellglobal.com>


"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:eh1a201etma5pkq52vqsagb9j03684d5kh@4ax.com...
> On Wed, 4 Feb 2004 22:36:37 -0500, "Matt Garrish"
> <matthew.garrish@sympatico.ca> wrote:
>
> >> simple. don't use a word processor to edit code. use a text
> >> editor. people who use word to edit code are stupid twice over.
> >
> >If you've got an easier way to get a binary from your code than by using
> >Word I'd like to hear it. Sometimes I wonder what you're smoking...
>
> This must be some sort of sarcasm, but I don't get it...
>

No, sarcasm would be: "Oh gee look, Michele wants to play golf again. That
*never* gets tiresome!"

The question of whether I'm being serious or just making an example with you
as the target is more to the heart of the above.

Matt




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

Date: 6 Feb 2004 11:35:21 -0800
From: dong.35@sociology.ohio-state.edu (Dave)
Subject: Command Lines unmap/ map local partitions
Message-Id: <8282654b.0402061135.1bcc65cb@posting.google.com>

Under local disk manager which is located under Control Panel >
Administrative Tools > Computer Management, it's possible to choose
whether a partition is mapped to a local drive letter or not.  I'm
trying to find a way to script this using DOS batch scripting,
vbscript, or perl.  What I want to do is load a disk image to a local
partition on a laptop, then unmap the drive letter from the partition
so that regular users can't see it.  Also, the 'net use' command
that's used for mapping network shares to a drive letter won't work
for this application, as far as I know.  Can anybody help me out?

-Dave


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

Date: Fri, 6 Feb 2004 16:07:11 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Command Lines unmap/ map local partitions
Message-Id: <1mTUb.18809$bp1.732189@news20.bellglobal.com>


"Dave" <dong.35@sociology.ohio-state.edu> wrote in message
news:8282654b.0402061135.1bcc65cb@posting.google.com...
> Under local disk manager which is located under Control Panel >
> Administrative Tools > Computer Management, it's possible to choose
> whether a partition is mapped to a local drive letter or not.  I'm
> trying to find a way to script this using DOS batch scripting,
> vbscript, or perl.  What I want to do is load a disk image to a local
> partition on a laptop, then unmap the drive letter from the partition
> so that regular users can't see it.  Also, the 'net use' command
> that's used for mapping network shares to a drive letter won't work
> for this application, as far as I know.  Can anybody help me out?
>

You can hide drives from the My Computer windows via the registry (at least
it sounds like that's what you're trying to accomplish).

HKEY_LOCAL_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

Just add a dword value NoDrives with the appropriate value for the drive you
want to hide ( a=1, b=2, c=4, d=8, etc.). Of course, this setting will only
take effect the next time the person logs on. If you want the drive to be
hidden as soon as your script is executed, well you've got me there...

Matt




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

Date: 6 Feb 2004 10:52:51 -0800
From: ajs@ajs.com (Aaron Sherman)
Subject: Re: Copy Constructor Craziness
Message-Id: <eaa2c627.0402061052.29f69a86@posting.google.com>

use63net@yahoo.com (Unknown Poster) wrote in message news:<c62e93ec.0402051034.27e4d2d0@posting.google.com>...

> use Rational;
> use warnings;
> use strict;
> 
> my $f = Rational->new(1, 7) ;
> my $g = $f;
> print "\$g = $g, ";
> ++$g;
> print "after ++, \$g = $g, \$f = $f\n";
> 
> ------------------------------------------
> 
> output is:
> $g = 1/7, after ++, $g = 8/7, $f = 1/7

That does, indeed look wrong, but without seeing the code for
Rational, it's hard to tell. Clearly you must be overloading
stringification and ++, but if you're not overloading = as well, then
I'm confused.


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

Date: Fri, 6 Feb 2004 16:25:43 +0000 (UTC)
From: Mike Hunter <mhunter@uclink.berkeley.edu>
Subject: CPAN cc vs. gcc
Message-Id: <slrnc27fsp.gt.mhunter@celeste.net.berkeley.edu>

I have a sun box I'd like to build cpan packages on.  Uname -a tells me it is
using solaris "5.9"....I have gcc installed on the machine, but `cc` seems
to be just a shell script that does nothing.

For whatever reason, cpan seems to want to try to build c files with cc
instead of gcc.  I tried symlinking cc to gcc, but that didn't work.  Where
can I tell cpan to use gcc instead of cc?

Thanks,

Mike


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

Date: Fri, 6 Feb 2004 08:51:13 -0800
From: "Mothra" <mothra@nowhereatall.com>
Subject: Re: CPAN cc vs. gcc
Message-Id: <4023c48b$1@usenet.ugs.com>

Mike Hunter wrote:
> For whatever reason, cpan seems to want to try to build c files with
> cc instead of gcc.  I tried symlinking cc to gcc, but that didn't
> work.  Where can I tell cpan to use gcc instead of cc?
>
export CC=gcc

Hope this helps

Mothra




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

Date: Fri, 06 Feb 2004 11:50:33 -0500
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: CPAN cc vs. gcc
Message-Id: <pan.2004.02.06.16.50.31.527704@remove.adelphia.net>

On Fri, 06 Feb 2004 16:25:43 +0000, Mike Hunter wrote:

> I have a sun box I'd like to build cpan packages on.  Uname -a tells me it is
> using solaris "5.9"....I have gcc installed on the machine, but `cc` seems
> to be just a shell script that does nothing.
> 
> For whatever reason, cpan seems to want to try to build c files with cc
> instead of gcc.  I tried symlinking cc to gcc, but that didn't work.  Where
> can I tell cpan to use gcc instead of cc?

Just a stab in the dark ....
the issue isn't with what compiler you're using - it's the 'make' you're
using.  On the Sun boxes at work, I have to use gmake versus make (for
us, it's under /opt/sfw/bin, but it may be different for you).

I found out that the GNU make will use the GNU compiler - and the 'make'
setting is in 'o conf' in CPAN.  A simpile 'which gmake' and 'gmake
--version' will verify this for you.

I'm hoping that does it for you.

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
November, n.:  The eleventh twelfth of a weariness.   -- Ambrose 
Bierce, "The Devil's Dictionary" 



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

Date: Fri, 06 Feb 2004 11:07:59 -0600
From: Tony Curtis <tony_curtis32@_SPAMTRAP_yahoo.com>
Subject: Re: CPAN cc vs. gcc
Message-Id: <87ptcscf0w.fsf@limey.hpcc.uh.edu>

>> On Fri, 06 Feb 2004 11:50:33 -0500,
>> James Willmore <jwillmore@remove.adelphia.net> said:

> Just a stab in the dark ....  the issue isn't with what
> compiler you're using - it's the 'make' you're using.  On
> the Sun boxes at work, I have to use gmake versus make (for
> us, it's under /opt/sfw/bin, but it may be different for
> you).

> I found out that the GNU make will use the GNU compiler -
> and the 'make' setting is in 'o conf' in CPAN.  A simpile
> 'which gmake' and 'gmake --version' will verify this for
> you.

I think you're conflating experiences where gcc is the default
compiler available with how make invokes commands.

The OP has discovered that

a) Solaris comes with no compiler

    http://www.science.uva.nl/pub/solaris/solaris2.html#q6.1

b) the perl that comes with Solaris was compiled with Forte cc
   ("perldoc Config").

Some people have reported that building modules with gcc for
the pre-installed perl works fine, but since that perl tends
to be a bit behind the curve, others prefer to install their
own up-to-date perl, with whatever compiler suite they have
locally (so that CPAN and perl agree on the compiler
settings).  You also don't run the risk of breaking how
Solaris uses its /usr/perl5 version.

    http://www.science.uva.nl/pub/solaris/solaris2.html#q3.75

hth
t


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

Date: Fri, 06 Feb 2004 12:31:07 -0500
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: CPAN cc vs. gcc
Message-Id: <pan.2004.02.06.17.30.56.580877@remove.adelphia.net>

On Fri, 06 Feb 2004 11:07:59 -0600, Tony Curtis wrote:

>>> On Fri, 06 Feb 2004 11:50:33 -0500,
>>> James Willmore <jwillmore@remove.adelphia.net> said:
> 
>> Just a stab in the dark ....  the issue isn't with what compiler you're
>> using - it's the 'make' you're using.  On the Sun boxes at work, I have
>> to use gmake versus make (for us, it's under /opt/sfw/bin, but it may
>> be different for you).
> 
>> I found out that the GNU make will use the GNU compiler - and the
>> 'make' setting is in 'o conf' in CPAN.  A simpile 'which gmake' and
>> 'gmake --version' will verify this for you.
> 
> I think you're conflating experiences where gcc is the default compiler
> available with how make invokes commands.
> 
> The OP has discovered that
> 
> a) Solaris comes with no compiler
> 
>     http://www.science.uva.nl/pub/solaris/solaris2.html#q6.1

The OP just got done saying he had an issue with the compiler he wanted to
use.  So, he *does* have a compiler.  He have two flavors on the boxes at
work - Sun's development kit has one and so do the GNU freeware packages. 
Looks like he does as well - otherwise, he would not have posted to begin
with :-)


> b) the perl that comes with Solaris was compiled with Forte cc
>    ("perldoc Config").
> 
> Some people have reported that building modules with gcc for the
> pre-installed perl works fine, but since that perl tends to be a bit
> behind the curve, others prefer to install their own up-to-date perl,
> with whatever compiler suite they have locally (so that CPAN and perl
> agree on the compiler settings).  You also don't run the risk of
> breaking how Solaris uses its /usr/perl5 version.
> 
>     http://www.science.uva.nl/pub/solaris/solaris2.html#q3.75

I agree that the OP *should* check to see which compiler was used to
install Perl.  I presume he used the GNU compiler and built his own (since
he *does* have a compiler).

In any event - I have installed modules on Sun boxes using the GNU
compiler.  And I have not seen any adverse side effects in doing so.  And
using GNU's make solved the compiler issue - since the deveolpment kit's
make will want to use the development kit's compiler by default.

What was your point of your post?

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
Sauron is alive in Argentina! 




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

Date: Fri, 06 Feb 2004 12:48:56 -0600
From: Tony Curtis <tony_curtis32@_SPAMTRAP_yahoo.com>
Subject: Re: CPAN cc vs. gcc
Message-Id: <87isikcacn.fsf@limey.hpcc.uh.edu>

>> On Fri, 06 Feb 2004 12:31:07 -0500,
>> James Willmore <jwillmore@remove.adelphia.net> said:

> The OP just got done saying he had an issue with the
> compiler he wanted to use.  So, he *does* have a compiler.
> He have two flavors on the boxes at work - Sun's development
> kit has one and so do the GNU freeware packages.  Looks like
> he does as well - otherwise, he would not have posted to
> begin with :-)

No he doesn't, he said cc was a dummy shell script.  Solaris
does not come with a compiler.

> effects in doing so.  And using GNU's make solved the
> compiler issue - since the deveolpment kit's make will want
> to use the development kit's compiler by default.

make doesn't care what the compiler is.


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

Date: 6 Feb 2004 14:41:45 -0800
From: jwillmore@myrealbox.com (James Willmore)
Subject: Re: CPAN cc vs. gcc
Message-Id: <d61170e5.0402061441.33000cc9@posting.google.com>

Tony Curtis <tony_curtis32@_SPAMTRAP_yahoo.com> wrote in message news:<87isikcacn.fsf@limey.hpcc.uh.edu>...
> >> On Fri, 06 Feb 2004 12:31:07 -0500,
> >> James Willmore <jwillmore@remove.adelphia.net> said:
>  
> > The OP just got done saying he had an issue with the
> > compiler he wanted to use.  So, he *does* have a compiler.
> > He have two flavors on the boxes at work - Sun's development
> > kit has one and so do the GNU freeware packages.  Looks like
> > he does as well - otherwise, he would not have posted to
> > begin with :-)
> 
> No he doesn't, he said cc was a dummy shell script.  Solaris
> does not come with a compiler.

Opps!  You're right.  Reading *is* fundemental - and something I
should have done more of.  Sorry :-(

Jim
jwillmore _at_ adelphia _dot_ net


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

Date: Fri, 06 Feb 2004 16:56:09 -0600
From: Tony Curtis <tony_curtis32@_SPAMTRAP_yahoo.com>
Subject: Re: CPAN cc vs. gcc
Message-Id: <877jyzu8ae.fsf@limey.hpcc.uh.edu>

>> On 6 Feb 2004 14:41:45 -0800,
>> jwillmore@myrealbox.com (James Willmore) said:

> Tony Curtis <tony_curtis32@_SPAMTRAP_yahoo.com> wrote in
> message news:<87isikcacn.fsf@limey.hpcc.uh.edu>...
>> >> On Fri, 06 Feb 2004 12:31:07 -0500, >> James Willmore
>> <jwillmore@remove.adelphia.net> said:
>> 
>> > The OP just got done saying he had an issue with the >
>> compiler he wanted to use.  So, he *does* have a compiler.
>> > He have two flavors on the boxes at work - Sun's
>> development > kit has one and so do the GNU freeware
>> packages.  Looks like > he does as well - otherwise, he
>> would not have posted to > begin with :-)
>> 
>> No he doesn't, he said cc was a dummy shell script.
>> Solaris does not come with a compiler.

> Opps!  You're right.  Reading *is* fundemental - and
> something I should have done more of.  Sorry :-(

Fridays, eh?  :-)

Anyway, this whole thing is drifting inexorably away from
being on-topic...

t


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

Date: Fri, 6 Feb 2004 23:01:03 +0000 (UTC)
From: Mike Hunter <mhunter@uclink.berkeley.edu>
Subject: Re: CPAN cc vs. gcc
Message-Id: <slrnc28721.105.mhunter@celeste.net.berkeley.edu>

On Fri, 6 Feb 2004 08:51:13 -0800, Mothra wrote:
>  Mike Hunter wrote:
> > For whatever reason, cpan seems to want to try to build c files with
> > cc instead of gcc.  I tried symlinking cc to gcc, but that didn't
> > work.  Where can I tell cpan to use gcc instead of cc?
> >
>  export CC=gcc
>  

Unfortunately, that won't work:

perl -MCPAN -e 'install Digest::MD5'
 .
 .
 .
cc: unrecognized option `-KPIC'
cc: language depend not recognized
cc: MD5.c: linker input file unused because linking not done

What's happening is that the config files are structured to build with cc, but
I need to change that to gcc.

I tried hacking cc to gcc in /usr/perl5/5.6.1/lib/sun4-solaris-64int/Config.pm, but that didn't work either.

Any other thoughts?  Rebuild perl from source?

The OT


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

Date: Fri, 06 Feb 2004 16:17:23 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: filter a string in perl
Message-Id: <n6PUb.14359$9a7.6943@nwrddc02.gnilink.net>

Dino wrote:
> need some help with a perlscript.

Which script? I don't see any.

> i have a guestbook written in perl and it gets overfilled with spam.
> but the spammers always use another IP, so i can't filter with that
> option.
> is there a possibility to check the entries and compare them with a
> string?
> lets say, if in the message body there is a string like:
> "hi guys, i really liked your page!blablabla...Buy Viagra..blabla"
> the message will not be moved to the guestbook.
> something like:
> if in message-body "blabla" then exit;

Yes.

But why do you want to reinvent the wheel instead of using one of the many
ready-made spam filters?

jue




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

Date: 6 Feb 2004 10:00:41 -0800
From: ajs@ajs.com (Aaron Sherman)
Subject: Forgetting how to use vec
Message-Id: <eaa2c627.0402061000.2c9dfe4c@posting.google.com>

Sorry, I posted this to comp.lang.perl by accident. Here's a repost:

I have a small piece of Perl code that does something like this:

  for($i=0;$i<length($x);$i++){
    vec($y,$i*7,8)=vec($x,$i*8,8);
  }

But it doesn't pack 7-bit data from $x into $y the way I thought it
would. Could someone enlighten me on how I'm mis-reading this? What I
really want is to pack the low 7 bits of $x into $y, with no
high-bit-padding.


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

Date: 6 Feb 2004 19:49:03 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: Forgetting how to use vec
Message-Id: <c00r3f$3f4$1@canopus.cc.umanitoba.ca>

In article <eaa2c627.0402061000.2c9dfe4c@posting.google.com>,
Aaron Sherman <ajs@ajs.com> wrote:
:I have a small piece of Perl code that does something like this:

:  for($i=0;$i<length($x);$i++){
:    vec($y,$i*7,8)=vec($x,$i*8,8);
:  }

:But it doesn't pack 7-bit data from $x into $y the way I thought it
:would. Could someone enlighten me on how I'm mis-reading this? What I
:really want is to pack the low 7 bits of $x into $y, with no
:high-bit-padding.

$i*7 and $i*8 are offsets. Your code does this if $x is 'PerlOneTwo'

sets byte #0  of y to byte #0 of x 'P'
sets byte #7  of y to byte #8 of x 'w'
sets byte #14 of y to 0 because byte #16 is outside x
extends y to 22 bytes and sets byte #21 to 0 because byte #24 is outside x
extends y to 29 bytes and sets byte #28 to 0 because byte #32 is outside x
 ...
extends y to 71 bytes and sets byte #70 to 0 because byte #80 is outside x


If you want to slice 7 bits from x into y, then you'd better
work with a BITS of 1 instead of 8.

Or you might find it easier to use unpack to convert the two into
binary strings, do the string manipulations, and pack the result back
together afterwards.
-- 
   Look out, there are llamas!


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

Date: Fri, 06 Feb 2004 17:06:58 GMT
From: gazelle@yin.interaccess.com (Kenny McCormack)
Subject: Re: How to use select (select(2)) in Perl?
Message-Id: <c00hvr$30k$1@yin.interaccess.com>

In article <vhhc101fugrdumi4mv312mt7usbt0v7sba@library.airnews.net>,
Bernie Cosell  <bernie@fantasyfarm.com> wrote:
>Ben Morrow <usenet@morrow.me.uk> wrote:
>} Bernie Cosell <bernie@fantasyfarm.com> wrote:
>} > Ben Morrow <usenet@morrow.me.uk> wrote:
>
>I notice that you skipped over the comment about your patronizing Lucy
>science lecture: indeed, I had done that same analysis (which is hardly
>difficult) and STILL couldn't figure out why use vars worked but the
>version I needed wouldn't.

This is such a funny thread (though I certainly didn't intend it as such
when I posted - I really had hoped for and expected a simple sensible
answer).  I don't want to say too much and get the natives any more riled
than necessary, other than to point out how amusing it is to see the
adherents of a language whose motto used to be "There's more than one way
to do it", become so catholic - that is, so obsessed with the notion that
there is only one way for things to be done.

But, anyway, the only reason I am taking time to post this is to ask what
you mean by "Lucy science".  It sounds so intriguing.  Does it have
anything to do with 7th Heaven?



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

Date: 6 Feb 2004 11:55:25 -0800
From: spaughbradley@hotmail.com (brad)
Subject: including files in perl
Message-Id: <9b99b7f2.0402061155.685e7685@posting.google.com>

I have a list of about 100 constants that I want to use in several
files.
I have made this list of constants into a file with extension .hpl as
in .h for perl.  anyways,  I can use do or require to include this
file, however, the constants are not avaliable to use as if i had
declared them in the calling perl file.  To use these constants, I
have to use the eval() function to so i say

KEY_PRESS(KEY_1) normally  where KEY_1 is a constant;

when defining KEY_1 in another file and and calling it in function
KEY_PRESS it looks like this:

KEY_PRESS(eval(KEY_1))

I do not want to have to use eval()

why is this happening.  This is not the case for variables.  This is
only happening for constants.  Is there a better way to include other
files into my perl programs.  I need to have a comment where the perl
program goes to the file i am calling executes and stores constants
and comes back to the calling file and resumes as normal, require and
do almost do this...
please help


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

Date: 6 Feb 2004 20:49:29 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: including files in perl
Message-Id: <c00ukp$4v7$1@canopus.cc.umanitoba.ca>

In article <9b99b7f2.0402061155.685e7685@posting.google.com>,
brad <spaughbradley@hotmail.com> wrote:
:I have a list of about 100 constants that I want to use in several
:files.
:I have made this list of constants into a file with extension .hpl as
:in .h for perl.  anyways,  I can use do or require to include this
:file, however, the constants are not avaliable to use as if i had
:declared them in the calling perl file.  To use these constants, I
:have to use the eval() function to so i say

:KEY_PRESS(KEY_1) normally  where KEY_1 is a constant;

:when defining KEY_1 in another file and and calling it in function
:KEY_PRESS it looks like this:

:KEY_PRESS(eval(KEY_1))

:I do not want to have to use eval()

How are you declaring the constants? Are you declaring them with
"use constant" ? If you are, then they are becoming subroutines and
you shouldn't have to eval() them, provided they are in the correct
namespace.
-- 
Rome was built one paycheck at a time.      -- Walter Roberson


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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V10 Issue 6089
***************************************


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