[6575] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 200 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Mar 29 06:07:17 1997

Date: Sat, 29 Mar 97 03:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 29 Mar 1997     Volume: 8 Number: 200

Today's topics:
     Re: [Q]: Pattern matching quandry... <rootbeer@teleport.com>
     Re: Accessing the WWW via Perl (Andrew Gruskin)
     Re: Date-Time Conversion:  backwards <rootbeer@teleport.com>
     FAQ? Where do I install modules? (Ceolas)
     ftp.pl and Comm.pl -- help with adaptation to Solaris 2 <dmgf@foto.infi.net>
     Re: ftp.pl and Comm.pl -- help with adaptation to Solar (Nathan V. Patwardhan)
     Re: ftplib.pl for Perl 5 (Solaris compatible)? <dmgf@foto.infi.net>
     Re: How run Perl locally? <rootbeer@teleport.com>
     Re: Learning Perl and need some help. <rootbeer@teleport.com>
     make .so from perl <jiewang@leland.stanford.edu>
     Needed in LA: artists, perl coders, html designers (Ron Robinson)
     New Module List Posted (Andreas Koenig)
     Re: NewbieQ: pass file handle to sub <rootbeer@teleport.com>
     Numeric / bitwise 'and' problem stirra@wwc.edu
     Re: passing variables using SSI problem <rootbeer@teleport.com>
     Re: Perl hourly fees? <rootbeer@teleport.com>
     Question on bit-wise and operator stirra@wwc.edu
     Sending Control- characters (Jim Hribnak)
     Re: Sending Control- characters (Tad McClellan)
     Re: SourceSafe for PERL <rootbeer@teleport.com>
     Re: use and if test <rootbeer@teleport.com>
     Webfax scripts in Perl? <annalisa@mkt2mkt.com>
     Webfax scripts or mods in Perl? <annalisa@mkt2mkt.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 28 Mar 1997 21:31:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Prince Mystery <mystery@itis.com>
Subject: Re: [Q]: Pattern matching quandry...
Message-Id: <Pine.GSO.3.96.970328212605.15565H-100000@kelly.teleport.com>

On Fri, 28 Mar 1997, Prince Mystery wrote:

> I have a variable that contains a pattern match string.  When placed in
> a search, it should return values for $1, $2, and $3. 

> The problem that I'm encountering is that this variable will, on
> occasion, change the order upon which $1, $2, and $3 should be
> examined.  Is there a way to hard code in the pattern string which
> specific substring values correspond with the predefined variables ($1,
> et al)?

You mean, sometimes you want to match /(foo)(bar)/ and have bar end up in
$1? That's not going to happen. The opening parens are always numbered
from left to right.

On the other hand, there's no reason you can't use a flag to determine the
order. 

    ($foo, $bar) = $reversed ? ($2, $1) : ($1, $2);

This gets trickier with n! possible orderings, of course. Hope this helps! 

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Sat, 29 Mar 1997 06:56:39 GMT
From: agruskin@melbpc.org.au (Andrew Gruskin)
Subject: Re: Accessing the WWW via Perl
Message-Id: <333cbc25.2345741@news.melbpc.org.au>

On 25 Mar 1997 18:06:53 GMT, daniel@aksi.net (Daniel Freeman) wrote:

>I've got this handy little package called getwww that allows me to access 
>the WWW via Perl.  Now I have a need to access a password protected web site
>(server directory protection; not a cgi-bin style password.)
>
>I can't figure out how to do this.  GetWWW simply returns an error "not 
>authorized" like the server would return if you tried to access the 
>directory with the wrong password.
>
>I'm starting to think that maybe there is a complex form of an URL which 
>contains the username and password?  If this is the case, I could give 
>getWWW that URL instead of the normal one.
>
It isn't a complex form but rather the HTTP protocol allows a
Authorisation line.  

What you need is a perl script called webcopy.  This does it all for
you.  You can find it at:
	http://www.inf.utfsm.cl/~vparada/webcopy.html

Have fun!


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

Date: Fri, 28 Mar 1997 22:00:12 -0800
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Date-Time Conversion:  backwards
Message-Id: <Pine.GSO.3.96.970328215557.15565M-100000@kelly.teleport.com>

On Fri, 28 Mar 1997, Lee wrote:

> From: Lee <DeathToSpam@dev.null.com>

Uh huh.

> What I need is a script-snip that will convert a date-time entry into
> perl time format, i.e.  convert 03/28/96 into the number of seconds
> since January 1 1970 (the exact opposite of the time function).

Can you please let us know which part of the Perl documentation should but
does not carry this information? Thanks! 

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 28 Mar 1997 23:40:07 -0700
From: ceolas@celtic.stanford.edu (Ceolas)
Subject: FAQ? Where do I install modules?
Message-Id: <ceolas-2803972340070001@b461-powmac7500.stanford.edu>

I'm sure this is a Really Dumb Question, but after two hours of searching
I still can't figure it out, so it might be worth posting as a possible
FAQ:

         How do I find modules and where do I put them?

OK, so I'm not quite that dumb, I've read the FAQ and INSTALL docs a few
times and trawled around CPAN sites, but I'm still not sure what to do.
I'm trying to install libwww-perl; the README tells me that I need:

IO::Socket   (or IO/Socket.pm)
Net::FTP     (or NET/FTP.pm)
MD5          (or MD5.pm)

and the installation procedure confirms that it can't find any of those
modules on my computer. I was confused by the :: nomenclature, and whether
to go looking for A::B or A/B.pm in each case, but I did manage to find
A.tar.gz at CPAN (though Net had disappeared and was now appartently part
of libnet, which I'm not sure if it's a library or a module or what... The
nearest documentation I can find on what the nomenclature should mean is
at:
            /CPAN/modules/00modlist.long.html#1)Perl5ModuleTe
which I find utterly confusing. I'm sure I'll understand it fine once I'm
up and running as a perl hacker, but I suggest that a lot of people
install perl and modules first to run a few scripts and then to hack them,
so it would be really nice to have some completely unassuming instructions
somewhere (please!)

OK, at this stage I have all three files.... Looking at the readme's I see
that IO should be part of the standard distribution; the closest file I
can find is /perl5/ext/Socket/Socket.pm, but the install script for libwww
couldn't find that.  When I try to follow installation instructions to
install the modules from a random directory, I run into trouble in the
Makefile.PL: For IO, it tells me that /perl5/ExtUtils/MM_Unix.pm can't
find IO/Handle.pm and when I try to install Net, it tells me that it can't
locate IO/File.pm.

I'm running a newly installed perl5.003 on an SGI Indigo R3000, running
IRIX 4.05F. I had previously installed perl 4.036; the main installation
of the new perl is in /usr/bin/perl5/ with aliases pointing to it from
/usr/sbin, /bin and /usr/local/bin. The libraries appear to be in
/usr/local/lib/perl5.

To summarise my long-winded description:

1. Clueless newbies may not understand the distinction between libraries and
   modules, or the :: and *.pm notations and how they link to directory names
   in the CPAN directories. A quick little help file or FAQ would really help
   us in starting up.

2. I have no idea where to put new modules, or if they automatically install
   somewhere. If the latter, I'm in trouble, since mine won't install
   automatically. Anyone interested in writing a very quick guide to where
   everything goes when perl is installed (the INSTALL doc isn't *all* that
   helpful).


   Thanks a million!!

      Gerard Manning.

-- 
Ceolas - Celtic music on the internet:   IrishNet: directory of Irish-related
http://celtic.stanford.edu/ceolas.html   resources in America:
FTP: celtic.stanford.edu                 http://celtic.stanford.edu/IrishNet/


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

Date: Fri, 28 Mar 1997 06:11:09 -0500
From: George Frink <dmgf@foto.infi.net>
Subject: ftp.pl and Comm.pl -- help with adaptation to Solaris 2.5
Message-Id: <333BA74B.4654@foto.infi.net>

My goal is to develop an automated ftp script for Solaris.
    I have attempted to integrate Comm.pl into ftp.pl. I did this this
by replacing every call to chat2.pl in ftp.pl with Comm.pl. Thus far,
however, the result does not appear to "work." I have plainly missed
something.
    Has anyone else successfully undertaken this adaptation?
    Has anyone else used Comm.pl to write an ftp script that runs on a
Solaris box?
    Any and all advice would be appreciated.
    Thank you.

George Frink
Fayetteville, N.C.



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

Date: 29 Mar 1997 07:25:47 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: ftp.pl and Comm.pl -- help with adaptation to Solaris 2.5
Message-Id: <5hig5r$spt@fridge-nf0.shore.net>

George Frink (dmgf@foto.infi.net) wrote:
: My goal is to develop an automated ftp script for Solaris.
:     I have attempted to integrate Comm.pl into ftp.pl. I did this this
: by replacing every call to chat2.pl in ftp.pl with Comm.pl. Thus far,
: however, the result does not appear to "work." I have plainly missed
: something.

Why not (just) use Net::FTP?  Sure, it doesn't work "like Expect," but
it does what you want.  There's at least one nice pod example in the
module.

--
Nathan V. Patwardhan
nvp@shore.net



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

Date: Fri, 28 Mar 1997 06:53:07 -0500
From: George Frink <dmgf@foto.infi.net>
To: Jeff Dubis <dubis@nortel.com>
Subject: Re: ftplib.pl for Perl 5 (Solaris compatible)?
Message-Id: <333BB122.E96@foto.infi.net>

My apologies for piggybacking on you question, Mr. Dubis. I am looking
for a Solaris 2.5-compatible version of ftp.pl. I have attempted to
create such a creature using Comm.pl and the available ftp.pl and that
effort has come to frustration and dismay.
    Any help from any Solaris ftp wizards would be greatly appreciated.
    Thank you for bearing with me, Jeff.

George Frink
Fayetteville, N.C.

Jeff Dubis wrote:

  Does anyone have the ftplib.pl library for Perl5?

  Thanks,
  Jeff





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

Date: Fri, 28 Mar 1997 21:49:00 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Kjetil Palmquist <kjetilpa@a.sol.no>
Subject: Re: How run Perl locally?
Message-Id: <Pine.GSO.3.96.970328214617.15565J-100000@kelly.teleport.com>

On Fri, 28 Mar 1997, Kjetil Palmquist wrote:

> I have installed Perl on my Win95 computer, and wonder how I run the
> example scripts included.

Method number one: If the document 'perlrun.pod' (or some variation of it) 
came with your distribution of Perl, see whether it has any helpful
suggestions. There may be other files near that one which will also help.

Method number two: If those documents did not come with your distribution
of Perl, contact the person who gave you Perl and ask him or her to tell
you everything you need to know about Perl. :-)

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 28 Mar 1997 21:54:08 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Sergio Loscialo <sloscialo@chubb.com>
Subject: Re: Learning Perl and need some help.
Message-Id: <Pine.GSO.3.96.970328215001.15565K-100000@kelly.teleport.com>

On 28 Mar 1997, Sergio Loscialo wrote:

> I want to test a variable to see if it is null or filled only with
> whitespace.

    print "It's null!\n" if $variable eq '';
    print "It's still null!\n" if length($variable) == 0;

    print "Nothing but whitespace!\n" if $variable =~ /^\s*$/;
    print "There's more than one way...\n" if $variable !~ /\S/;
    print "...to do it!\n" unless $variable =~ m#\S#;

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 28 Mar 1997 23:13:13 -0800
From: Jie Wang <jiewang@leland.stanford.edu>
Subject: make .so from perl
Message-Id: <333CC109.7268@leland.stanford.edu>

Hi,

Does anyone know how to make .so(share object) from Perl(OraPerl4
specifically)?

Thanks in advance,

Yuxi


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

Date: 29 Mar 1997 03:10:25 GMT
From: rogue@oaklnd.com (Ron Robinson)
Subject: Needed in LA: artists, perl coders, html designers
Message-Id: <5hi171$l9m@news5.snfc21.pacbell.net>
Keywords: jobs, art, perl, html, design

Needed in LA:

Mac artists, perl programmers, and html designers needed for small website 
production firm.  You can work from home or your own site, and deliver to us by 
email.

We're Oakland Group, Inc., a small presigious firm in South Pasadena, CA.  
Check us out at www.oaklnd.com.  We do our best work with virtual teams we 
assemble from all over the world.  The fact you're reading this proves you may 
qualify to join one of our teams.

Please email your resume to rogue@oaklnd.com Place your resume in the body of 
your email (no attachments, please) along with URLs to your previous work.  
Follow up your email with a mailed resume to Ron Robinson, Oakland Group, Inc., 
1742C Grevelia, South Pasadena, CA 91030.  We are not a recruiter or employment 
agency.  We pay for work in US funds immediately upon delivery.

Ron Robinson
rogue@oaklnd.com, www.oaklnd.com
800 448-2772 Fax: 818 577-7808
1742C Grevelia, South Pasadena, CA 91030 USA




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

Date: 29 Mar 1997 08:09:45 GMT
From: andreas.koenig@franz.ww.tu-berlin.de (Andreas Koenig)
Subject: New Module List Posted
Message-Id: <5hiio9$aih$1@brachio.zrz.TU-Berlin.DE>
Keywords: FAQ, Perl, Module, Software, Reuse, Development, Free


Last night I posted a new revision (2.40) of the Perl 5 Module List to
comp.lang.perl.modules. See the header of this posting for a reference. The
HTML version is uploaded to CPAN as modules/00modlist.long.html. Try

    <URL:http://www.perl.com/CPAN/modules/00modlist.long.html>

or your nearest CPAN site.

As usual, comments, corrections and suggestions are more than
welcome. Please don't hesitate, mail them to modules@perl.com.

Thank you,
andreas


Recent Changes in the modules database
--------------------------------------

2) Perl Core Modules, Perl Language Extensions and Documentation Tools
----------------------------------------------------------------------
constant       adpf  Define compile-time constants                PHOENIX +


4) Operating System Interfaces
 ------------------------------
MSDOS::
::Anarchie     cdpO  Interface to Anarchie with AppleEvents       CNANDOR +


5) Networking, Device Control (modems) and InterProcess Communication
---------------------------------------------------------------------
Net::
::LDAP         adpO  Interface to LDAP Protocol (RFC1777)         PLDAP +
::Telnet       adpO  Interact with TELNET port or other TCP ports JROGERS !


6) Data Types and Data Type Utilities (see also Database Interfaces)
--------------------------------------------------------------------
Bit::
::ShiftReg     Rdcf  Rotate/shift registers (all C integer types) STBEY +
::Vector       RdcO  Arbitrary length bit vectors (base class)    STBEY +

Date::
::Convert      cdpO  Conversion between Gregorian, Hebrew, more?  MORTY +

Math::
::Fraction     adpO  Fraction Manipulation                        KEVINA +

PDL::
::NetCDF       adcr  Reads/Writes NetCDF files from/to PDL objs   DHUNT +


7) Database Interfaces (see also Data Types)
--------------------------------------------
CDB_File       adc   Tie to CDB (Bernstein's constant DB) files   TIMPX !


8) User Interfaces (Character and Graphical)
--------------------------------------------
PerlMenu       Mdpf  Curses-based menu and template system        SKUNZ +
Qt             ad+O  Interface to the Qt toolkit                  AWIN !

Tk::
::Getopt       adpO  User configuration interface to Getopt::Long SREZIC +

X11::
::Fvwm         adcO  interface to the FVWM window manager API     RJRAY !
::XEvent       bdcO  provides perl OO acess to XEvent structures  MARTINB +
::XFontStruct  bdcO  provides perl OO access to XFontStruct       MARTINB +
::Xforms       bdcO  provides the binding to the xforms library   MARTINB +

Xforms         bdcO  See X11::Xforms; namespace will move to X11  MARTINB +


11) Text Processing, Parsing and Searching
------------------------------------------
Font::
::TFM          adpO  Read info from TeX font metric files         JANPAZ +

TeX::
::DVI          adpO  Methods for writing DVI (Device INdependent) JANPAZ +
::Hyphen       adpO  Hyphenate words using TeX's patterns         JANPAZ +

Text::
::Vpp          adpO  Versatile text pre-processor                 DDUMONT +


15) World Wide Web, HTML, HTTP, CGI, MIME etc (see Text Processing)
-------------------------------------------------------------------
HTML::
::Embperl      bdcf  Embed Perl in HTML                           GRICHTER +
::Stream       RdpO  HTML output stream                           ERYQ !

MIME::
::Lite         adpO  Single module for composing simple MIME msgs ERYQ !
::Words        cdpf  Encode/decode RFC1522-escaped header strings ERYQ +

Netscape::
::Cache        bdpO  Access Netscape cache files                  SREZIC +


17) Archiving, Compression and Conversion
-----------------------------------------
Convert::
::BER          adpO  Class for encoding/decoding BER messages     GBARR +
::BinHex       cdpO  Convert to/from RFC1741 HQX7 (Mac BinHex)    ERYQ +


18) Images, Pixmap and Bitmap Manipulation, Drawing and Graphing
----------------------------------------------------------------
Image::
::Magick       RdcO  Read, query, transform, and write images     JCRISTY +


21) File Handle, Directory Handle and Input/Output Stream Utilities
-------------------------------------------------------------------
IO::
::Scalar       idpO  An I/O handle on a scalar                    ERYQ +
::ScalarArray  idpO  An I/O handle on a ref to array of scalars   ERYQ +
::WrapHandle   idpO  Wrap old-style FHs in IO::-like interface    ERYQ +


23) Miscellaneous Modules
-------------------------
Bundle         i     Namespace reserved for modules collections   ANDK +


Recent Changes in the users database
------------------------------------

!  CHIPS    Chip Salzenberg <chip@pobox.com>
!  DHUNT    Douglas Hunt <dhunt@ucar.edu>
+  DVKLEIN  Daniel V. Klein <dan@klein.com>
+  JCRISTY  John Cristy <cristy@sympatico.org>
!  KJOHNSON Kevin Johnson <kjj@pobox.com>
!  MORTY    Mordechai Abzug <mabzug1@gl.umbc.edu>
+  PLDAP    Perl LDAP mailing list
+           Mail subscription requests to
+           perl-ldap-REQUEST@mail.med.cornell.edu with body
+           "subscribe"
!  PRYAN    Patrick Ryan <pgryan@geocities.com>
!  RJRAY    Randy J Ray <randy@byz.org>


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

Date: Fri, 28 Mar 1997 21:24:39 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: SUN TONG <ST@FS.com>
Subject: Re: NewbieQ: pass file handle to sub
Message-Id: <Pine.GSO.3.96.970328212154.15565G-100000@kelly.teleport.com>

On Thu, 27 Mar 1997, SUN TONG wrote:

> I've searched through "Perl Programmers Reference Guide" but still got
> confused how to pass a file handle to a sub.

I think you're looking for this, which I found in the new FAQ, section 5.
Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/


How can I make a filehandle local to a subroutine? How do I pass filehandles
between subroutines? How do I make an array of filehandles?

   You may have some success with typeglobs, as we always had to use in
   days of old:
   
    local(*FH);

   But while still supported, that wasn't the best to go about getting
   local filehandles. Typeglobs have their drawbacks. You may well want
   to use the FileHandle module, which creates new filehandles for you
   (see the FileHandle manpage):
   
    use FileHandle;
    sub findme {
        my $fh = FileHandle->new();
        open($fh, "</etc/hosts") or die "no /etc/hosts: $!";
        while (<$fh>) {
            print if /\b127\.(0\.0\.)?1\b/;
        }
        # $fh automatically closes/disappears here
    }

   Internally, Perl believes filehandles to be of class IO::Handle. You
   may use that module directly if you'd like (see Handle), or one of its
   more specific derived classes.



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

Date: 27 Mar 1997 02:10:19 GMT
From: stirra@wwc.edu
Subject: Numeric / bitwise 'and' problem
Message-Id: <5hckub$t59$1@bilbo.reference.com>

I'm tearing my hair out over a simple serial port
read problem.  I need to mask off the bottom four bits of
a character read in via sysread (or POSIX::read) to see if
a packet of data has been received completely.  The sysread
function seems to be automatically converting the byte to a
string or character context, so that '&' (bitwise and) doesn't
do the correct thing:

	sysread(S_IN, $rdbyte, 1);
	$rdtest = $rdbyte & 0x0f;

	last if ($rdtest == 0x0d);

I get the warning "Argument "D" isn't numeric for and"
when a 0x44 is read in, and $rdtest contains "0", not 0x04!
How can I force Perl to do the right thing in the absence of
a type cast operator?

Thanks in advance,
-- Ralph Stirling
stirra@wwc.edu


--

Posted using Reference.COM                         http://www.reference.com
Browse, Search and Post         Usenet and Mailing list Archive and Catalog.

InReference, Inc. accepts no responsibility for the content of this posting.


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

Date: Fri, 28 Mar 1997 22:01:21 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Bas van Reek <basvreek@channels.nl>
Subject: Re: passing variables using SSI problem
Message-Id: <Pine.GSO.3.96.970328220029.15565N-100000@kelly.teleport.com>

On 28 Mar 1997, Bas van Reek wrote:

> Newsgroups: comp.lang.perl.misc
> Subject: passing variables using SSI problem

> What setting needs to be changed ?

The "Newsgroups" line. :-)  Try a newsgroup about servers, or their FAQ.
Good luck!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 28 Mar 1997 22:09:36 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Patrick Poon <poon@sgi.com>
Subject: Re: Perl hourly fees?
Message-Id: <Pine.GSO.3.96.970328220719.15565P-100000@kelly.teleport.com>

On Fri, 28 Mar 1997, Patrick Poon wrote:

> I was just wondering...what's the going rate for a Perl programmer
> nowadays? 

$131,072 apiece, but you can get a great discount at Costco when you buy a
sixteen-pack.

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: 26 Mar 1997 19:11:47 GMT
From: stirra@wwc.edu
Subject: Question on bit-wise and operator
Message-Id: <5hbsdj$pnl$1@bilbo.reference.com>

I am trying to strip off bits from an integer to test for a
"stop" character in a packet received from a serial port.  I
am using the Posix module to set up the serial port.  When I
perform the bit-wise 'and', a *logical* result is returned ('0'
or '1') rather than the remaining bits:

	POSIX::read($s_in, $rdbyte, 1);
	$rdtest = ($rdbyte & 0x1f);

gives me back '0', when I was expecting 000xxxxx (binary).
Turning on warnings gives me warnings about $rdbyte not being
an integer.  How do I force $rdbyte to be an integer in the
absence of typecasting or otherwise get bit-wise operators to
work?

Thanks in advance,

-- Ralph Stirling
stirra@wwc.edu


--

Posted using Reference.COM                         http://www.reference.com
Browse, Search and Post         Usenet and Mailing list Archive and Catalog.

InReference, Inc. accepts no responsibility for the content of this posting.


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

Date: 29 Mar 97 04:18:03 GMT
From: hribnak@nucleus.com (Jim Hribnak)
Subject: Sending Control- characters
Message-Id: <333c97fb.0@news.nucleus.com>


I am trying to write a program that interacts with one of our terminal 
servers..  I have it actually logging on to the box, imputting 
commands..  I am stuck in one place where I MUST send a control-d 
character, to pull up a menu, once this menu is up I can issue the 
appropriate letter and drop to a prompt do what I need to do and then log 
off..

Can anyone tell me how to send a control-d character from a perl program?

Thanks loads


Jim



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

Date: Sat, 29 Mar 1997 01:50:36 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Sending Control- characters
Message-Id: <ckhih5.jm3.ln@localhost>

Jim Hribnak (hribnak@nucleus.com) wrote:

: I am trying to write a program that interacts with one of our terminal 
: servers..  I have it actually logging on to the box, imputting 
: commands..  I am stuck in one place where I MUST send a control-d 
                                                          ^^^^^^^
: character, to pull up a menu, once this menu is up I can issue the 
  ^^^^
: appropriate letter and drop to a prompt do what I need to do and then log 
: off..

: Can anyone tell me how to send a control-d character from a perl program?
      ^^^^^^

The free documentation included with the perl documentation can
tell you how to do this...


grep -i control *pod |grep -i char

finds these two lines (among a few others), 
which tell you how to do that:


perlre.pod:    \c[              control char
perlre.pod:ASCII character control-I<x>.  Finally, the "." metacharacter matches

Having a look at the larger context for that second 
one yields (my underlining):


-------------------------------------
Characters may be specified using a metacharacter syntax much like that
used in C: "\n" matches a newline, "\t" a tab, "\r" a carriage return,
"\f" a form feed, etc.  More generally, \I<nnn>, where I<nnn> is a string
of octal digits, matches the character whose ASCII value is I<nnn>.
Similarly, \xI<nn>, where I<nn> are hexidecimal digits, matches the
character whose ASCII value is I<nn>. The expression \cI<x> matches the
                                                     ^^^    ^^^^^^^
ASCII character control-I<x>.  Finally, the "." metacharacter matches any
^^^^^^^^^^^^^^^^^^^^^^^^^
character except "\n" (unless you use C</s>).
-------------------------------------


And there you go! 

Get your answer in _minutes_ instead of the hours/days/forever 
that it takes to get it answered via Usenet.



\cD



--
    Tad McClellan                          SGML Consulting
    Tag And Document Consulting            Perl programming
    tadmc@flash.net


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

Date: Fri, 28 Mar 1997 22:19:12 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Steve Wells <steve@prilnari.com>
Subject: Re: SourceSafe for PERL
Message-Id: <Pine.GSO.3.96.970328221047.15565Q-100000@kelly.teleport.com>

On Fri, 28 Mar 1997, Steve Wells wrote:

> Does anyone know of a program like SourceSafe that I can use on our
> BSDI or Linux machines with PERL?

I have one _kinda_ like it, but it's called /bin/rm. But maybe that's not
quite _enough_ like SourceSafe... :-) 

Okay, I did a little research and now I know a little about what
SourceSafe is. It seems to be like RCS, which may well already be
installed on your Linux and BSDI machines. The most important difference
that I can see from here is that using SourceSafe can easily move money
from your bank to Bill Gates's at irregular intervals. Oh, and I don't
think that you can get the source to SourceSafe. (Maybe that's where the
name comes from. Hmmmm...)

Hope this helps! 

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/



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

Date: Fri, 28 Mar 1997 21:00:52 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: bruce langlois <langlois@csn.net>
Subject: Re: use and if test
Message-Id: <Pine.GSO.3.96.970328203217.15565F-100000@kelly.teleport.com>

On Thu, 27 Mar 1997, bruce langlois wrote:

> use English;
> use strict if $PERL_VERSION >= 5.003;
> 
> All I get is a syntax error.  If I put it in a block:
> 
> if( $PERL_VERSION >= 5.003 ){use strict;}

Yes, that works, but there's a catch: Within that block, you're using
'strict'; outside of it, you're not!  :-)  (Remember, that 'strict' is
block-scoped. It doesn't affect anything compiled outside of its block.) 

C<use> is a compile-time directive. It can't be controlled by run-time
tests.

But don't give up hope. The docs tell us that C<use Module LIST> is
exactly equivalent to this:

    BEGIN { require 'Module.pm'; import Module LIST; }

So, maybe you could do something like this. 

    BEGIN {
        if ($PERL_VERSION >= 5.003) {
            require 'strict.pm';
            import strict;
        }
    }

What happened to the scoping problem? I wish I could tell you! :-)  Every
time I try to write what I _think_ is happening, I realize that I know
less than I thought I did. (Somebody who understands this will now, I
hope, enlighten us all as to just what's happening here.)

Hope this helps!

-- Tom Phoenix        http://www.teleport.com/~rootbeer/
rootbeer@teleport.com   PGP  Skribu al mi per Esperanto!
Randal Schwartz Case:     http://www.lightlink.com/fors/




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

Date: Fri, 28 Mar 1997 21:37:58 -0800
From: annalisa <annalisa@mkt2mkt.com>
To: Does, anyone, know, of, any, webfax, scripts, laying, around?, I'm, investigating, writing, a, program, for, an, order, form, to, be, sent, to, a, fax, rather, than, an, email, box., Then, I, thought..Gee, maybe, it's, been, done, already., Care, to, share?, Thanks, Annalisa
Subject: Webfax scripts in Perl?
Message-Id: <333CAA7F.65E4@mkt2mkt.com>

Does anyone know of any webfax scripts laying around?

I'm investigating writing a program for an order form to be sent to a
fax rather than an email box.

Then I thought..Gee maybe it's been done already.

Care to share?

Thanks,

Annalisa


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

Date: Fri, 28 Mar 1997 21:39:37 -0800
From: annalisa <annalisa@mkt2mkt.com>
Subject: Webfax scripts or mods in Perl?
Message-Id: <333CAAE2.6C0@mkt2mkt.com>

Does anyone know of any webfax scripts laying around?

I'm investigating writing a program for an order form to be sent to a
fax rather than an email box.

Then I thought..Gee maybe it's been done already.

Care to share?

Thanks,

Annalisa


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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 V8 Issue 200
*************************************

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