[8731] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2349 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 17 12:07:29 1998

Date: Fri, 17 Apr 98 09:01:37 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 17 Apr 1998     Volume: 8 Number: 2349

Today's topics:
    Re: Perl vs. Java (Jason Taylor)
        Problem executing without using: Perl foo.pl <ssante@concentric.net>
        Problem optimizing sendmail perl routine! (Mick Knutson)
    Re: Reading from an already-open file (Jason Taylor)
        reading values from multi-select list <Glenn.J.Schworak@state.or.us>
        running system command <dturley@ravine.binary.net>
    Re: Searching PERL for SCO 3.2.v4 (Matthew H. Gerlach)
    Re: Wanna laugh?  (My First cgi.pm Script) (Mark-Jason Dominus)
    Re: Wanna laugh?  (My First cgi.pm Script) (Will Smith)
    Re: Wanna laugh?  (My First cgi.pm Script) (Mark-Jason Dominus)
        wine32::registry::load() (Michael)
    Re: wine32::registry::load() <sowmaster@juicepigs.com>
    Re: x3270 emulator scripts using perl <cmargoli@world.northgrum.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 17 Apr 1998 15:43:27 GMT
From: jtaylor@ala.net (Jason Taylor)
Subject: Re: Perl vs. Java
Message-Id: <353777d0.356007149@news.ala.net>

Remember that comparing Java with Perl is like comparing Apples and
Coffee :)  Each has its place. I can't get Perl to scroll text across
my screen warning my visitors that my page is still underconstruction,
and I can't get down and Java doesn't do the CGI stuff that Perl can
do. I've even had to employ Expect for somethings Perl won't do (at
least as easily as I want).

On Sat, 11 Oct 1997 22:11:33 -0500, Patrick O'Lone
<polone@acc.mcrest.edu> wrote:

>>
>
>Don't think that Java is better than Perl just yet! Consider the fact
>that Java has not yet been STANDARDIZED.  That is apparent in the Java
>v1.0 to v1.1 upgrade in which almost everyone's older applets didn't
>work without much headache of adjusting them.  Perl can be an OOP
>language, supporting objects, polymorphism, inheritance, multiple
>inheritance, and overlays...
>
>Patrick O'Lone
>polone@sanasys.com
>polone@mcrest.edu
>"The edge is everything..."
>
>



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

Date: 17 Apr 1998 10:34:11 EDT
From: Stephanie Sante' <ssante@concentric.net>
Subject: Problem executing without using: Perl foo.pl
Message-Id: <353768A2.4F28C027@concentric.net>

We are running perl on Solaris 2.5.1. Although my 1st line in the script
is: #!/usr/local/bin/perl5.00 -w

The system will not find perl5 when I issue the command: foo.pl ..
However, when I use: perl foo.pl things execute just fine.

The script is a perl5 only script and inforces this, as it uses many of
the perl5 only feature. We also have perl 4 on the same box. Any ideas
why we can't just execute as: foo or foo.pl?

Thanks,

Stephanie Sante'



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

Date: Fri, 17 Apr 1998 08:54:51 -0700
From: mknutson@websolution.com (Mick Knutson)
Subject: Problem optimizing sendmail perl routine!
Message-Id: <MPG.fa11b2195446d109896d3@news.greatbasin.net>

I only get a limited amount of time to run a cgi script.  I need help 
making this routine run faster.  I only have 250 address on it right now 
and it times out!
Help :

sub printmail {

    local($email, $prev, @email, $mail_count);
    $mail_count = '0';

    &lock_file($member_file); #lock file

    open (EMAIL, $member_file) || &die_error ("Can't open $member_file");
    EMAIL: while (<EMAIL>) {
        $email = $_;
        chop($email);
        if ($email ne ""){
            if ($email ne $address){
            	if ($prev ne $email) {
                	$prev = $email;
                	push(@email, $email);
                	$mail_count++;
                }
            }
        }
    }
    close(EMAIL);

    &unlock_file($member_file); #unlock file

	open (MAIL, "|$mailpgm $address")         		# Open 
sendmail
        || &die_error ("Can't open $mailpgm!\n"); 	#

	  print MAIL "";
	  &print_email_header($address, "BASE MAIL: $subject", $heading); 
# from, subject, message title.

      foreach $email (@email){        					# 
New Bcc: routine.
	      print MAIL "Bcc: $email \n";  				#
	  }                               					#

	  print MAIL "Precedence: bulk\n";
      print MAIL "";

	  print MAIL "$body\n";                           	# Message
		&print_email_footer($heading);                  	# 
Footer.
	close (MAIL);                                   	# Close 
sendmail.

    &success("Your E-Mail messages where sent!",
        "You Sent $mail_count of the following messages: ",
        "Subject: ",
        "$subject",
        "",
        "Body of the E-Mail: ",
        "",
        "$body");
    return(1);
}


-- 

Please E-Mail directly =:)>
Thanks ...

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~  Mick Knutson					     ~
~  B.A.S.E. #454				     ~
~  mknutson@websolution.com			     ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~  Support Legal B.A.S.E. Jumping!    		     ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~  The BASE Board				     ~
~  http://www.websolution.com/base/board/index.shtml ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~  Add yourself to The B.A.S.E. Mailer at:	     ~
~  http://www.websolution.com/base/mail/index.shtml  ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: Fri, 17 Apr 1998 15:46:02 GMT
From: jtaylor@ala.net (Jason Taylor)
Subject: Re: Reading from an already-open file
Message-Id: <353778fe.356309381@news.ala.net>

You may want to read your file into an array, operate on that array,
then re-write the file.

On 19 Oct 1997 03:43:05 -0500, nem@abattoir.cc.ndsu.nodak.edu (Nem W
Schlecht) wrote:

>[courtesy copy e-mailed to author(s)]
>
>In comp.lang.perl.misc, John Goerzen  <jgoerzen+usenet@complete.org> wrote:
>>
>>I have a situation where a program will invoke my script with file
>>descripter 3 pre-opened to a certain file that I need to write to.
>>Under C, I could simply do write(3, ....) and it would work.
>[deletia]
>>already open.  Is there a way to assign an already-open file
>>descriptor to a Perl file handle?  Or, is there a way to read from and
>>write to a file descriptor without using a Perl file handle?
>
>Well, you still have to open() it, but you *can* still use the file
>descriptor.
>
>$perldoc -f open
>....
>
>   If you specify "<&=N", where N is a number, then Perl will do an
>   equivalent of C's fdopen() of that file descriptor; this is more
>   parsimonious of file descriptors. For example:
>
>       open(FILEHANDLE, "<&=$fd")
>
>....
>
>then after this, you could do:
>
>print FILEHANDLE "blah\n";
>
>etc.
>
>-- 
>Nem W Schlecht                  nem@plains.nodak.edu
>NDUS UNIX SysAdmin         http://www.nodak.edu/~nem
>"Perl did the magic.  I just waved the wand."



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

Date: Fri, 17 Apr 1998 08:35:06 -0700
From: Glenn Schworak <Glenn.J.Schworak@state.or.us>
Subject: reading values from multi-select list
Message-Id: <353776A9.BDDA0545@state.or.us>

I have used the cgi.pl to read in parameters passed from a form for some
time now. But just ran in to a small problem. I can't figure out how to
read a list of results when there is a multi-select list on my form.

$mypage->param('listbox')   will hold the entire list of all selected
items.
@mylist = $mypage->param('listbox') only copies out the 1st item in the
list

How do I copy the other items in the list. If i use
print $mypage->param('listbox');
All the items show up with no spaces or seperators of any type. But
print length($mypage->param('listbox'));
only returns the length of the first item not the entire list.

Thanks in advance for any help. This one is really important so I will
keep looking for the answer.



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

Date: 17 Apr 1998 14:54:25 GMT
From: David Turley <dturley@ravine.binary.net>
Subject: running system command
Message-Id: <6h7qf1$sqk$1@oksennus.binary.net>


I am stuck in what I thought would be simple process. I need to have my
script run a command to zip up  a file. From the shell I can do zip
fileout filein and it works. I've tried every combo of system and
backticks i can think of (the script needs to continue of afer the zip is
done).
 I've looked at the FAQ and tried
$cmd = "zip outfile infile";
system $cmd;

with and without backticks, etc. Nothing I try creates the zip file,
although the script runs. 

You can sense my desparation since I am opening myself up to flames, so
any help would be appreciated.

cheers,

david 
_____________________________________________________________________
David Turley
dturley@pobox.com
http://www.pobox.com/~dturley

"You don't want to be the only person sitting on a crocodile's back."
                                        -- heard on a PBS nature show
______________________________________________________________________


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

Date: Fri, 17 Apr 1998 14:24:46 GMT
From: gerlach@netcom.com (Matthew H. Gerlach)
Subject: Re: Searching PERL for SCO 3.2.v4
Message-Id: <gerlachErKApB.G9v@netcom.com>

In article <3536F3D0.4F32@mail.pf> mdegouttes@mail.pf writes:
>I can't find, on SCO's web, PERL for UNIX SCO 3.2.v4 but only for latest
>version of SCO (OpenServer V5). Does anyone know where I could find this
>?
>Thanks for helping.
>Marc de Gouttes

I had no problem building perl 5.004 for SCO 3.2.v4.

Matthew


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

Date: 17 Apr 1998 10:48:16 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Wanna laugh?  (My First cgi.pm Script)
Message-Id: <6h7q3g$pau$1@monet.op.net>

In article <35374099.1124699@news.tornado.be>,
Bart Lateur <bart.mediamind@tornado.be> wrote:
>
>>Mark-Jason Dominus (mjd@op.net) wrote:
>>: 	print while <HEADER>;
>
>Does it? I thought the "assign to $_" magic ONLY works in 
>
>	while(<HANDLE>) { ...}
>
>(HANDLE optional).

You're right.  But

	X while Y  

and 

	while (Y) { X } 

are *identical*, so it works in both places.



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

Date: Fri, 17 Apr 1998 14:35:40 GMT
From: wsmith@NOSPAM.ctron.com (Will Smith)
Subject: Re: Wanna laugh?  (My First cgi.pm Script)
Message-Id: <35376850.772492839@roch-news>

On Fri, 17 Apr 1998 12:12:58 GMT, John Porter <jdporter@min.net>
wrote:

|>> TANSTAAFL.  FNORD. :)
|>
|>What do these stand for?

(T)here (A)in't (N)o (S)uch (T)hing (A)s (A) (F)ree (L)unch.

i don't know what "FNORD" means.

|>TINGRFCALIAS!

i don't know that one, either...
---
William Smith
#include <disclaimer.h>
Remove the obvious when sending e-mail...


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

Date: 17 Apr 1998 10:57:41 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Wanna laugh?  (My First cgi.pm Script)
Message-Id: <6h7ql5$pbn$1@monet.op.net>
Keywords: benign Bergstrom rang trendy


In article <6h6qvp$sam$1@marina.cinenet.net>,
Craig Berry <cberry@cinenet.net> wrote:
>> >That can be written as:  print <HEADER>;
>M-J. Dominus:
>> Maybe you meant
>> 
>> 	print while <HEADER>;
>
>That works too, but is (a little bit) slower.  

Is that an `I think' or `I know'?  Because I was surprised to hear you
say it, and when I tried it, the one you said would be slower was
about 10% faster:

% time perl -e 'print while <>' /tmp/qq  >> /dev/null
3.66user 0.19system 0:04.30elapsed 89%CPU
3.64user 0.14system 0:04.63elapsed 81%CPU
3.63user 0.14system 0:04.17elapsed 90%CPU

% time perl -e 'print <>' /tmp/qq  >> /dev/null
4.03user 0.55system 0:04.98elapsed 91%CPU
4.22user 0.39system 0:05.07elapsed 90%CPU
4.04user 0.42system 0:04.85elapsed 91%CPU

/tmp/qq is a 2.3MB file with about 63,000 lines.



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

Date: 17 Apr 1998 14:37:46 GMT
From: mike@paperclip.temple.edu (Michael)
Subject: wine32::registry::load()
Message-Id: <6h7pfq$1ig$1@cronkite.ocis.temple.edu>

Could someone show me an example of using
win32::registry::load()?  I can't seem
to get the thing to work.  I do not have
the Registry.pm patches, and i'm using (yuck) .
Any help with such little information is appreciated.

-M.

This is perl, version 5.003_07 Copyright 1987-1996, Larry Wall
        + suidperl security patch
        Win32 port Copyright (c) 1995-1996 Microsoft Corporation. 
                All rights reserved. 
        Developed by ActiveWare Internet Corp., http://www.ActiveWare.com
Perl for Win32 Build 315 - Built 09:33:08 Dec 31 1997





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

Date: Fri, 17 Apr 1998 10:53:55 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
To: Michael <mike@paperclip.temple.edu>
Subject: Re: wine32::registry::load()
Message-Id: <35376D03.7B07@juicepigs.com>

Michael wrote:
> 
> Could someone show me an example of using
> win32::registry::load()?  I can't seem
> to get the thing to work.  I do not have
> the Registry.pm patches, and i'm using (yuck) .
> Any help with such little information is appreciated.
> 
> -M.
> 
> This is perl, version 5.003_07 Copyright 1987-1996, Larry Wall
>         + suidperl security patch
>         Win32 port Copyright (c) 1995-1996 Microsoft Corporation.
>                 All rights reserved.
>         Developed by ActiveWare Internet Corp., http://www.ActiveWare.com
> Perl for Win32 Build 315 - Built 09:33:08 Dec 31 1997


You are using an outdated version of perl. You can get the standard
version (5.004_02) which includes the win32 modules and the
documentation on how to use them at your local CPAN.


-- 
Bob Trieger               |  Titanic: big boat, bigger
sowmaster@juicepigs.com   |           iceberg, big deal


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

Date: Fri, 17 Apr 1998 15:20:52 GMT
From: Charles Margolin <cmargoli@world.northgrum.com>
Subject: Re: x3270 emulator scripts using perl
Message-Id: <35377354.C8E@world.northgrum.com>

Lenny Bruce Lee wrote:
> 
> Has anyone used perl or a perl module with the x3270 terminal emulator.
> I'm running  x3270 v3.1.1.6 attaching to a mainframe Isanyone using the
> x3270for scripting to a mainframe? I have tried to reach Paul Mattes but
> the address x3270@cnt.com is undeliverable. Would love to find some
> example scripts.

Here are some fragments from a larger application:

use FileHandle;
use IPC::Open2;

my ($rdr, $wtr) = (FileHandle->new, FileHandle->new);

sub waitfor {
   my $ref = shift;
   my $reply = '';
   @$ref = ();
   while (1) {
      $reply = <$rdr>;
      die "empty reply from X3270" unless defined $reply;
      push @$ref, $reply;
      last if ($reply eq "ok\n" or $reply eq "error\n");
   }
}

my $pid = open2($rdr, $wtr, '/usr/contrib/mitX11R5/bin/x3270',
   qw/ -color -efont 3270-12 -extended -model 2 -script /);

die "open2 failed" unless $pid;

my @reply;

print $wtr "Connect($node)\n";
waitfor(\@reply);
print $wtr "Wait()\n";
waitfor(\@reply);

# Keep on printing x3270 script commands to $wtr and waiting for results
# to be captured into @reply.

-- 
Charles G. Margolin                   DSSD Internal Information Services
cmargoli@world.northgrum.com          Northrop Grumman Corp. 0624/23
margolin@acm.org                      Hawthorne, California 90250-3277


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

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

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