[7851] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1476 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 15 12:07:20 1997

Date: Mon, 15 Dec 97 09: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           Mon, 15 Dec 1997     Volume: 8 Number: 1476

Today's topics:
     Re: "sh.exe: syntax error" But I don't even use sh.exe! (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     'inportb' and 'outportb' missing from Perl? (greg aiken)
     Re: 001 + 1 = 002; 002 - 1 = 1 ARGH <jack_h_ostroff@groton.pfizer.com>
     ANNOUNCE: binary Digital UNIX perl 5.004_04 kit (setld  (Robert L. Urban)
     ANNOUNCE: Term::ANSIColor v1.00 (stable) <rra@stanford.edu>
     ANNOUNCING: Xforms4Perl Version 0.8.4 <martin@nitram.demon.co.uk>
     Re: delete file in perl <barnett@houston.Geco-Prakla.slb.com>
     Re: Help with VERY simple problem <jack_h_ostroff@groton.pfizer.com>
     HTTP/1.0 500 Server Error (/cgi-bin/multiple_forms.cgi  (Poul Kornmod)
     mod_perl question... webmaster@heaven.nl
     More Perl Please <75762.2332@CompuServe.COM>
     NEED:  Fast, Fast string trim() <cchkxh@ARCO.com>
     Re: NEED:  Fast, Fast string trim() (Mike Stok)
     Re: Newbie Help: Removing or ReDimensioning an Array <reibert@mystech.com>
     Perl and Microsoft IIS 4.0 <simon@hslc.org>
     Perl for Oracle NT? <ken.chesak@mail.txt.net>
     Re: pgp encrypion via perl script (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
     Re: Please advise. Fastest way to line-count files <tchrist@mox.perl.com>
     Problem with ODBC.pm (on WinNT) <henry@DotRose.com>
     Re: Socket Programming Sample in Perl: Telnet.pl (John Moreno)
     Re: Sorting an array in PERL 4 (Andrew M. Langmead)
     Re: Teaching programing (Will Morse)
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 15 Dec 97 10:15:04 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: "sh.exe: syntax error" But I don't even use sh.exe!
Message-Id: <34954a41$3$ofn$mr2ice@speaker>

In <3494E558.FEC@bigfoot.com>, on 12/15/97 at 09:07 AM,
   Koos Pol <koos_pol@bigfoot.com> said:
+-----
|  > | c:/utils/sh.exe: syntax error: `(' unexpected
|  > | c:/utils/sh.exe: syntax error: `(' unexpected
+--->8

Woo.  It's been years since I last saw that one....

Perl is trying to run an external program for some reason (globbing?); it uses
sh.exe to start it, due to a decision by the porters.  But the external
program isn't valid for some reason, so sh.exe tries to interpret it as a
shell script --- hence the error, as executables aren't quite meaningful when
read as scripts.

-- 
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)


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

Date: Mon, 15 Dec 1997 07:55:07 -0800
From: grega9@mail.idt.net (greg aiken)
Subject: 'inportb' and 'outportb' missing from Perl?
Message-Id: <grega9-1512970755070001@acs-center21.ucsd.edu>

On the PC platform, most all installed peripherals can have their
registers programmed via memory mapped I/O.  An example of this is the
PC's parallel port #1.  In PC memory, three bytes of memory are mapped to
the hardware ports register;

   0x278 = Data Register
   0x279 = Status Register
   0x27A = Control Register

In C, you can READ the contents of the Status Register by doing;

   #define status 0x279
   variable_read = inportb(Status);

and you can WRITE to the Data Register (which will send a byte out of the
port) by doing;

   #define data 0x278
   outportb(data,variable_to_output);

How does one do this in Perl?   I really like Perl, and I use it for most
all tasks that I need to do, however, I now find that I need to write
programs to access installed hardware on my PC (specifically an Intel
8255A programmable peripheral interface chip), and I can't figure out how
to specifically read and/or write to a SPECIFIC address location in
memory.  Certainly, a Perl guru out there must know how this can be done.

PS - ALL languages for the PC allow this functionality; C (inport,
inportb, outport, outportb), Pascal (Port, Portw), even Basic can do this
(although I can't immediately find the mneumonics for the command).  I
can't believe Perl can't handle this task.


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

Date: Mon, 15 Dec 1997 10:59:16 -0500
From: "Jack H. Ostroff" <jack_h_ostroff@groton.pfizer.com>
Subject: Re: 001 + 1 = 002; 002 - 1 = 1 ARGH
Message-Id: <349553D4.3806@groton.pfizer.com>

Jim Littlefield wrote:
> 
> On Fri, 05 Dec 1997 10:56:46 GMT, Bart Lateur <bart.mediamind@tornado.be> wrote:
> >
> >Ok. So what comes after "a999"?
> 
> That's an easy one. It is "b000".
> 
> --
> Jim Littlefield                  "How do you tell when you run out of
>                                   invisible ink?" - Steven Wright

Why not "a99a"?


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

Date: 15 Dec 1997 16:26:09 GMT
From: urban@rto.dec.com (Robert L. Urban)
Subject: ANNOUNCE: binary Digital UNIX perl 5.004_04 kit (setld format)
Message-Id: <673ln1$ir$1@news1.teleport.com>

Hello Digital UNIX fans,

I have made the newest (5.004_04) version of perl available as a setld
kit, along with Tk and various other extensions that seemed reasonable
to include.  This kit can _ONLY_ be installed on V4.0B or greater.

The kit can be found on

	ftp://ftp.digital.com/pub/DEC/PERL5004SETLD.tar

with an accompanying .readme file, which follows.

Please let me know if you have problems with the kit.

Rob Urban (urban@rto.dec.co)

----------------  readme -----------------

INTRODUCTION
============

This is a binary, setld format kit of Perl 5.004_04 for Digital UNIX.

This kit is _ONLY_ for Digital UNIX V4.0B or greater.  It will _NOT_
install on V3.X.  Sorry, but I don't have time to support all versions
of Digital UNIX.  If you want a binary perl kit for V3.X, get my
PERL5003SETLD.tar kit.

The kit comprises three subsets:
	1. the Perl base kit itself
	2. the Tk extension
	3. some miscellaneous extensions that you may find useful.

See below for more information about the components.

INSTALLATION
============

create a temporary directory somewhere

	cd /var/tmp
	mkdir perl
	cd perl

untar the archive

	tar xvf /path/to/archive/PERL5004SETLD.tar

run setld

	setld -l .

select whatever subsets are desired.

cleanup

	rm -rf /var/tmp/perl

KIT LOCATION
============

	external:	ftp://ftp.digital.com/pub/DEC/PERL5004SETLD.tar


MORE INFO ON THE KIT COMPONENTS (SUBSETS)
=========================================

The tk and misc subsets are optional, and only depend on the base subset.
Either one or both can be installed.  The sizes are as follows (uncompressed):

PRLBASE504	12,504,952
PRLTK504	 7,540,417
PRLMISC504	 2,871,751
		----------
total		22,917,120  (yup, 22 MB! sorry, but that's the way it is).

Perl Base Subset:

	built on V4.0B of Digital UNIX, optimized with -O4, no -tune
	done (non architecture specific) includes h2ph'd versions of
	/usr/include/*.h, /usr/include/sys/*.h, and any others
	necessary for a "require 'sys/ioctl.ph';" to work.
	
Tk:
	This is the complete Perl/Tk release (V400.202) with two additional
	utilities for which there are manpages:
		Tk-WaitBox-1.2
		Tk-ProgressBar-1.0

	The README files for these extensions can be found in
		/usr/opt/PERL5004/doc
	
	The full documentation (manpages & html) has also been included.
	See the release notes for hints on setting the MANPATH variable.

Misc:
	This is a collection of extensions which you may find useful.
	The latest release was copied from the CPAN at the time this
	kit was produced (November, '97). Any dependencies of an
	extension on other extensions were satisfied.  All extensions
	have _not_ been tested.

	CGI-modules-2.76	- possibly useful for writing CGI scripts
	Data-Dumper-2.07	- automatically dump data structures
	HTML-Stream-1.40	- automates writing HTML docs
	MD5-1.7			- cryptographic checksums
	MIME-Base64-2.03	- MIME equiv of uuencode
	MIME-parser-1.13	- aids parsing MIME messages
	MIME-tools-3.204	- tools for parsing and creating MIME entities
	MailTools-1.09		- related to mail (e.g., RFC822 header parsing)
	POP3Client-1_15		- act as POP client
	Time-HiRes-01.14	- access to usec kernel routines (gettimeofday)
	TimeDate-1.07		- time/date parsing routines
	libnet-1.0601		- client API to various IP protocols
	libwww-perl-5.15	- client (and other) API to WWW

	The README files for these extensions can be found in
		/usr/opt/PERL5004/doc

Please let me know if there are problems,

Rob Urban (urban@rto.dec.com)

-- 
Rob Urban
Digital Equipment GmbH
Freischuetzstr. 91
81927 Muenchen
Germany




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

Date: 15 Dec 1997 16:23:04 GMT
From: Russ Allbery <rra@stanford.edu>
Subject: ANNOUNCE: Term::ANSIColor v1.00 (stable)
Message-Id: <673lh8$fs$1@news1.teleport.com>

I've just uploaded version 1.00 of Zenin's and my Term::ANSIColor module
to PAUSE, and it should be showing up at a CPAN mirror near you shortly.
Version 0.9 has been in production use for the past ten months with no
problems, and this release fixes the only bug that turned up (problems
with EACHLINE and repeated trailing line delimiters).

I consider this release to be stable code.  This module is no longer in
beta test.

>From the README:

  While ANSI color escape codes are fairly simple, it can be hard to
  remember the codes for all of the attributes and the code resulting from
  hard-coding them into your script is definitely difficult to read.  This
  module is designed to fix those problems, as well as provide a
  convenient interface to do a few things for you automatically (like
  resetting attributes after the text you print out so that you don't
  accidentally leave attributes set).

  Despite its name, this module can also handle non-color ANSI text
  attributes (bold, underline, reverse video, and blink).  It uses either
  of two interfaces, one of which uses "constants" for each different
  attribute and the other of which uses two subs which take strings of
  attributes as arguments.

>From the ChangeLog:

Sat Nov 29 01:58:44 1997  Russ Allbery  <rra@Stanford.EDU>

        * ANSIColor.pm: Version 1.0 released.

        * Makefile.PL: Now gets version information from the module, has
        the correct rules to build a distribution.

        * test.pl: Comments trimmed, minor test modifications.

        * ANSIColor.pm: Changed my e-mail address, fixed to deal correctly
        with trailing delimiters when EACHLINE is being used, die()
        changed to croak() if the caller uses an invalid attribute name,
        getting $VERSION from RCS updated to my current method, source
        detabified.

        * test.pl: Added test for EACHLINE with trailing delimiters.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print




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

Date: 15 Dec 1997 16:24:19 GMT
From: Martin Bartlett <martin@nitram.demon.co.uk>
Subject: ANNOUNCING: Xforms4Perl Version 0.8.4
Message-Id: <673ljj$gk$1@news1.teleport.com>

ANNOUNCING: Xforms4Perl Version 0.8.4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Announcing the 0.8.4 version of Xforms4Perl, the extension to Perl that 
allows you to call the Xforms GUI api from a standard Perl script. 

This new version fully supports the recent Xforms 0.88 public release,
while still supporting release 0.86.

It also contains two MAJOR NEW VALUE ADDED FEATURES (for both 0.86 and
0.88):

    . The Class Initialization Callback which allows you to 
      register a callback for an object type which gets invoked 
      whenever an object of that type is created.

    . The Global Initialization Script, which allows you to write Xforms 
      initialization procedures that get automatically invoked for all
      scripts that use Xforsm4Perl.

The release also contains some new DEMOs, a large number of bug-fixes,
and enhanced (and corrected!) documentation.

It will work with Perl 5.003 and Perl 5.004 on most UNIX systems.

You have two options for installation:

    . Tarball:

	from: 
    	    ftp://einstein.phys.uwm.edu/pub/xforms/Contrib

	or:
  	    http://franz.ww.TU-Berlin.DE/pub/authors/Martin_Bartlett
	    or Any CPAN mirror under authors/Martin_Bartlett

	named:
	    Xforms4Perl-0.8.4.tgz

    . RPM

	from 
	    ftp://ftp.redhat.com/pub/xforms/Contrib
	    (In a few days)

	or:
  	    http://franz.ww.TU-Berlin.DE/pub/authors/Martin_Bartlett
	    or Any CPAN mirror under authors/Martin_Bartlett

	named:
	    Xforms4Perl-0.8.4-1.i386.rpm 
		(Linux 2.0.29, Perl 5.004, Xforms 0.88)
	    Xforms4Perl-0.8.4-1.src.rpm
		(Other configurations)

Questions, support, etc is mainly via e-mail to 

	martin@nitram.demon.co.uk

but also via the Xforms mailing list (details from the Xforms site at 
http://bragg.phys.uwm.edu/xforms) and the comp.lang.perl.modules
newsgroup.	
 
-- 
===========================================================
    _/      _/_/_/_/
   _/_/  _/_/     _/
  _/ _/_/ _/_/_/_/      Martin John Bartlett
 _/  _/  _/     _/      (martin@nitram.demon.co.uk)
_/      _/_/_/_/
       _/
_/    _/
 _/_/
===========================================================




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

Date: Mon, 15 Dec 1997 09:44:25 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
Subject: Re: delete file in perl
Message-Id: <34955056.4F0ED142@houston.Geco-Prakla.slb.com>

Kelly Horstmann wrote:

> I want to write a perl program to delete a specified kind of file, (for
> example *.o file)in the current directory (say, /usr/bin/perl) and also
> delete all the *.o files in all other subdirectories (eg.
> /usr/bin/perl/dir1, /usr/bin/perl/dir2, /usr/perl/dir3 ? etc). I
> have been working on that for couple hours, and I just don't know how to
> call perl
> to search all the *.o files in all the subdirectories. Just let me know,
> if you can code
> up this problem.

 You don't specifically state this, but I will assume you are on unix
because you are dealing with /usr/bin/perl/* files.

Look at the "File::Find" module.  It should be part of the standard Perl
distribution.  Also have a look at the find2perl command.  find2perl should
be an executable in the same directory as your perl interpreter.
/usr/local/bin/ in my case.

When invoked from a command line, with unix find(1) parameters, find2perl
generates the Perl equivalent code.

find2perl /usr/bin/perl -name \*.o -type f -exec rm {} \; > script.perl

The above will create a file called script.perl which has the Perl code to
find files, staring in /usr/bin/perl, with names that have *.o, and remove
them.  Be sure to read up on find, and examine script.perl to make sure it
does what you intend.

NOTE:  There MUST be a space between {} and \ in the above command line for
the script.perl script to be created correctly.  You've been warned.

HTH.

Dave

--
"Security through obscurity is no security at all."
                -comp.lang.perl.misc newsgroup posting

------------------------------------------------------------------------
* Dave Barnett               U.S.: barnett@houston.Geco-Prakla.slb.com *
* DAPD Software Support Eng  U.K.: barnett@gatwick.Geco-Prakla.slb.com *
------------------------------------------------------------------------





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

Date: Mon, 15 Dec 1997 11:05:04 -0500
From: "Jack H. Ostroff" <jack_h_ostroff@groton.pfizer.com>
Subject: Re: Help with VERY simple problem
Message-Id: <34955530.44C7@groton.pfizer.com>

Jason Thomas Hitesman wrote:
> 
> while (<PFILE>) {
>         $rows[$i] = <PFILE>;
>         $i++;
>         }
> 
> However when I try to read in a three line text file I only get two lines
> read in.
> 
And are you getting the second line of the file in $rows[0] and a blank
line
in $rows[1]?  Perhaps you want the second line above to be $rows[$i] =
$_;


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

Date: Mon, 15 Dec 1997 15:17:10 GMT
From: pbk@sasintern.com (Poul Kornmod)
Subject: HTTP/1.0 500 Server Error (/cgi-bin/multiple_forms.cgi is not a valid Windows NTapplication. )
Message-Id: <3495490e.25383727@news.dknet.dk>

Dear All,

I know that this has been posted before - but I didn't read the
thread. Could somebody please forward me some of the reply's?

Thanks in advance.

Brgds

Poul Kornmod  -  pbk@rdsas.com


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

Date: Mon, 15 Dec 1997 09:41:57 -0600
From: webmaster@heaven.nl
To: webmaster@heaven.nl
Subject: mod_perl question...
Message-Id: <882200026.1876885515@dejanews.com>

Hi All,

I'm having problems with mod_perl. I install the package from
perl.apache.org and everything goes fine. After installation i add the
following code to the httpd.conf file:

<Files *.pl>
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
</Files>

When i try to run a script from the browser the server don't execute it
but like to send it to me, the following message in Netscape:

You have started to download a file of the Application/x-perl.....

I have install only: Apache, Mod_perl and Perl

Script run fine without mod_perl...

Please reply to: webmaster@heaven.nl

Thanks in advance

Marcel

-------------------==== Posted via Deja News ====-----------------------
      http://www.dejanews.com/     Search, Read, Post to Usenet


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

Date: Mon, 15 Dec 1997 09:02:41 -0500
From: Ruben Safir <75762.2332@CompuServe.COM>
Subject: More Perl Please
Message-Id: <utZ#cIWC9GA.234@nih2naab.prod2.compuserve.com>

expereinced PERL scripter with previous CGI apps under his belt using database tools is looking
for contract or permanent work.  Fluent in C, HTML, Oracle, SQL, and
the Appache Web server.  Capable of setting up Intranet stations, using TCP and interfacing Unix and Novell

Please don't be too upset with this intrussion on the news group.  We have
many mouths to feed here :)

Also - I would be happy to take on any consignment projects at home.  I have a
complete work station and ***working*** Web Server in the house.


See my Resume
htttp://www.wynn.com/jewish/resume.html


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

Date: Mon, 15 Dec 1997 14:10:03 GMT
From: Kevin Hawley <cchkxh@ARCO.com>
Subject: NEED:  Fast, Fast string trim()
Message-Id: <34953A3A.AB94BA73@ARCO.com>

Hi, I need a trim() function that will take a string and remove the
  white space from the front and the rear of the string, but preserve
  white space within the string. I will be processing lots of strings,
  so I need something efficient, anybody have a good suggestion?
TIA

Here is what I have so far: (I'm hoping for a one line solution)

$string="     White Space   ";
printf ("Before++%s++ After++%s++\n",$string, &trim ($string));

$string="NO_White_Space";
printf ("Before++%s++ After++%s++\n",$string, &trim ($string));

sub trim {
   local ($s = @_[0]);
   $s = &rtrim($s);
   $s = &ltrim($s);
   return $s;
}

sub ltrim {
   local ($str = @_[0]);
   if($str =~ /\s+(.*)/) {
      return $1;
   }else {
      return $str;
   }
}

sub rtrim {
   local ($str = @_[0]);
   local ($ret = @_[0]);
   $str = reverse($str);
   if($str =~ /\s+(.*)/) {
      $ret = reverse ($1);
   }
   return ($ret);
}




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

Date: 15 Dec 1997 11:00:13 -0500
From: mike@stok.co.uk (Mike Stok)
Subject: Re: NEED:  Fast, Fast string trim()
Message-Id: <673k6d$tn$1@stok.co.uk>

In article <34953A3A.AB94BA73@ARCO.com>, Kevin Hawley  <cchkxh@ARCO.com> wrote:
>Hi, I need a trim() function that will take a string and remove the
>  white space from the front and the rear of the string, but preserve
>  white space within the string. I will be processing lots of strings,
>  so I need something efficient, anybody have a good suggestion?

You might want to look at the FAQ at http://www.perl.com and find the
appropriate Q & A.

If you're really interested in finding out where time's going then you can
use the Benchmark module which comes with recent distributions to time
various solutions.  I usually consider

  $string =~ s/^\s+//;
  $string =~ s/\s+$//;

to be short enough to use inline and avoid the overhead of subroutine
calls, and clear enough to mean something to a maintainer in the future
(assuming they know perl basics.)

Hope this helps,

Mike
-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |   PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/    |                   65 F3 3F 1D 27 22 B7 41
stok@colltech.com                  |            Collective Technologies (work)


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

Date: Mon, 15 Dec 1997 09:24:33 -0700
From: "Mark S. Reibert" <reibert@mystech.com>
Subject: Re: Newbie Help: Removing or ReDimensioning an Array
Message-Id: <349559C1.CB760B86@mystech.com>

Howard Hull wrote:

> Is there an easy way to completely destroy or at least remove all
> elements of an array. I've tried a couple of things but haven't gotten
> anything to work correctly.

Three possibilities:

undef @array;
@array = ();
$#array = -1;

-----------------------------
   Mark S. Reibert, Ph.D.

  Mystech Associates, Inc.
  3233 East Brookwood Court
   Phoenix, Arizona 85044

    Tel: (602) 732-3752
    Fax: (602) 706-5120
 E-mail: reibert@mystech.com
-----------------------------




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

Date: Mon, 15 Dec 1997 11:14:56 -0500
From: "Alan Simon" <simon@hslc.org>
Subject: Perl and Microsoft IIS 4.0
Message-Id: <673kov$rrk$1@usenet89.supernews.com>

I cannot get Perl to work properly under IIS 4.0.  When I run the scripts
from the MS-DOS prompt or Windows NT Explorer, they run properly.  When I
try to run them from the browser, the scripts time out.  Does anyone have
any suggestions?





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

Date: Mon, 15 Dec 1997 09:24:08 -0600
From: Kenneth Chesak <ken.chesak@mail.txt.net>
Subject: Perl for Oracle NT?
Message-Id: <34954B97.F74D873D@mail.txt.net>

I am going to be converting an application from HP Unix, SybPerl and
Sybase
11 to  NT 4.0 Server running Oracle 7.3.  Does OraPerl for NT exist?  If

so where can I get a copy?  Does NT have something like Unix cron?
Thanks



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

Date: Mon, 15 Dec 97 10:21:08 -0500
From: bsa@void.apk.net (Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh")
Subject: Re: pgp encrypion via perl script
Message-Id: <34954d0d$4$ofn$mr2ice@speaker>

In <349435f5.0@news.one.net>, on 12/14/97 at 07:39 PM,
   nospam@minivend.com said:
+-----
| > 1.  This script does not necessarily store anything to disk.
| >     Is uses "echo", not "cat".  $unencrypted_data is not a filename.
| >     It might prompt the user to enter data, and then echo it
| >     to pgp directly.  
| Thereby placing part of the unencrypted data in the process table for anyone
| to see.
+--->8

Hate to say it, folks, but this is correct:  there will be a "sh -c echo ..."
visible briefly.  Yuck.

-- 
use 5.004;sub AUTOLOAD{print$_{$_.++$x{$_}}}sub new{my%x;%_=map{++$a%2?$_.++$x{
$_}:$_}split(//,pack('N*',unpack('w*',unpack('u*','M@H*HP\'2"@\C`88+SE/!EA(F!'.
"A'6\$LZV0+(3;C9QRA9NAPG2&D\\G(88:KL=A0\n4AN.5W\"\"&\\[W>;H>3S>0\@A\\N\@PB\$`")
)));bless{}}$b=(new main);map{$b->_}split(//,' Brandon S. Allbery KF8NH') # :-)


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

Date: 15 Dec 1997 16:30:08 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Please advise. Fastest way to line-count files
Message-Id: <673lug$3ja$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    mward@veelos.com (Michael Ward) writes:
:Good Lord, now we have proper and improper text files?  And when our
:wonderful users use vi to create files full of text and no final
:termination, we should tell them that it's not our fault, they should make
:proper text files?

First of all, it's rather difficult to make vi do that.  In fact, 
before the various rewrites and emulations, it was impossible.

And secondly, yes: you should certainly tell your users that. :-)

--tom
-- 
	Tom Christiansen	tchrist@jhereg.perl.com
    "The effect of his affected accent affected her,
     and effected a change in her affections."
				--Steve Chapin 


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

Date: Mon, 15 Dec 1997 11:33:24 -0500
From: Henry Hartley <henry@DotRose.com>
Subject: Problem with ODBC.pm (on WinNT)
Message-Id: <34955BD3.80A235B3@DotRose.com>

I have a Perl script that, among other things, writes a record to a MS
Access table.  The line that sets up the SQL statement is as follows:

$sql = qq(insert into WesPRESSAccessInfo (UserID, AccessTime, DocType,
DocName, DocCount, Query, ProposalID) values ('$username', $logintime,
'$doctype', '$docname', 1, '$queryzip', '$propid'));

If I include the -w parameter (i.e. #!/usr/local/bin/perl -w), I get the
following error messages:

Use of uninitialized value at c:\Perl\lib/Win32/ODBC.pm line 256.
Use of uninitialized value at c:\Perl\lib/Win32/ODBC.pm line 179.
Use of uninitialized value at c:\Perl\lib/Win32/ODBC.pm line 256.
Use of uninitialized value at c:\Perl\lib/Win32/ODBC.pm line 179.
Use of uninitialized value at e:/WesPress/ShellCGI/document-log.pl line
231.
Location: http://wespress.westat.com/WesPressData/Res/EPA/GREEN.DOC

Where document-log.pl line 231 is the one listed above.  If I remove the
-w I get no error message but the record is not added to the table
either.  Is there really something wrong with ODBC.pm or is this likely
something I did wrong?  Is there a way to fix this problem?  Please
don't tell me to write a patch to ODBC.pm.  I'm really not that
expreienced.  ODBC.pm has $ODBCPackage::Version = 970208.  Should I
replace this file with a newer version or will that not help?

Henry





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

Date: Mon, 15 Dec 1997 10:17:36 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Socket Programming Sample in Perl: Telnet.pl
Message-Id: <1d1asig.1uufjb11diepejN@roxboro-180.interpath.net>

In comp.lang.perl.misc CHANG <hkchang@netsgo.com> wrote:

> This is a multi-part message in MIME format.

This is a BIG RED FLAG saying - I DON'T WANT A ANSWER.

-- 
John Moreno


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

Date: Mon, 15 Dec 1997 16:07:46 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Sorting an array in PERL 4
Message-Id: <EL8nGy.Grt@world.std.com>

Yann <ycueff@club-internet.fr> writes:

>I use PERL 4 and I don't know how to sort the following arry by the 2nd
>field. Could someone help me

The first (good) solution in the FAQ uses no constructs that weren't
available before perl 5. (The first good one meaning not the one it
tells you is super inefficient)

<URL:http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq4/
How_do_I_sort_an_aray_by_anyth.html>

Which describes something like:

while(<>) {
  push @field, (split /:/)[1];
  push @data,  $_;
}

@sorted = @data[ sort { $field[$a] cmp $field[$b] } 0 .. $#data; ];
-- 
Andrew Langmead


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

Date: 15 Dec 1997 10:05:14 -0600
From: will@Starbase.NeoSoft.COM (Will Morse)
Subject: Re: Teaching programing
Message-Id: <673kfq$6nk$1@Starbase.NeoSoft.COM>


I teach perl to 40-year-olds.  They are supposed to have had some programming
before they take the course, but none of them ever do.  A lot depends on how 
much time you have to teach them (I have 24 contact hours).  I wind up
spending a lot of time just explaining what an if statement in English is
let alone in perl and the same for loops.

I recently taught a group of 14-year-olds the Computer Merit Badge for Boy 
Scouts.  There is not really a programming requirement in this, It is really
the "Microsoft Merit Badge", but there is an optional programming problem and
I tried to teach them a little perl.  Only one of the boys came anywhere near
being able to write a program, and in fact, he was the only one who got the
badge although another boy has only one thing left to do that is not programming
related.

I really think that any computer language is okay.  perl, or any other 
interpretted language, is better for this purpose than, say, C or any other 
compiled language, for the simple reason that the turnaround to fix a problem 
or try an alternative is less.  Tcl/Tk would also be a good alternative
because they could get graphics, which kids all like.  It is available on PC's,
although I don't have it on my wife's PC upon which we ran the class.
(The Doctor doesn't take home the patients, the butcher doesn't take home
the cows, and I don't take home computers).  Tcl/Tk would also give you the
opportunity to teach event driven programming (which perl would to, but it
is just a little harder because you need to understand the pointers better).

Anyway, the main thing you need to do is get them to understand the concepts
of a procedure, whether in English, perl, C, or whatever.  Once they get
that, most languages are variations on a theme.

Hope this helps.

Will




In article <67082l$jb5@news1.citylink.de>,
Janos Blazi <jblazi@wuerzburg.netsurf.de> wrote:
>I have to teach programing to 15-years old pupils. Is PERL a good language
>to start with? Our "authorities" seem to prefer PASCAL, but PASCAL seems to
>be absolutely dead and the first steps in PERL are perhaps easier than the
>first steps in C. Or should I take BASIC (oh horror!)?
>
>THIS IS NOT A JOKE!
>
>Janos Blazi
>(jblazi@wuerzburg.netsurf.de)
>
>
>
>


-- 
# Copyright 1997 Will Morse.  Internet repost/archive freely permitted.
# Hardcopy newspaper, magazine, etc. quoting requires permission.
# 
#      Gravity,                    #    Will Morse
#      not just a good idea,       #    Houston, Texas
#              it's the law.       #    will@starbase.neosoft.com
#
#   These are my views and do not necessarly reflect anyone else/
 =========================================================================
      By US Code Title 47, Sec.227(a)(2)(B), a computer/modem/printer
      meets the definition of a telephone fax machine. By Sec.227(b)
      (1)(C), it is unlawful to send any unsolicited advertisement to
      such equipment, punishable by action to recover actual monetary
      loss, or $500, whichever is greater, for EACH violation.
 =========================================================================



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

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

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