[10046] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3640 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 4 20:06:03 1998

Date: Fri, 4 Sep 98 17:01:27 -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, 4 Sep 1998     Volume: 8 Number: 3640

Today's topics:
    Re: If/Then Statement <garry@america.net>
    Re: my lousy syntax (Larry Rosler)
    Re: my lousy syntax (Matthew Bafford)
    Re: my lousy syntax (Craig Berry)
        Perl HTML file transfer djcampbell@my-dejanews.com
    Re: Perl Module for URL hiding <khera@kciLink.com>
    Re: Precompiled perl for solaris 2.5? <gregory.t.white@lmco.com>
    Re: Problem installing perl 5.004_04 (Jonathan Stowe)
    Re: SSL encryption <khera@kciLink.com>
    Re: Use Perl to sendmail: open once, send multiple time (Kevin hawkins)
    Re: Why is 5.005* a pain to switch to safely? (Malcolm Hoar)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Fri, 04 Sep 1998 22:47:01 GMT
From: Garry Williams <garry@america.net>
Subject: Re: If/Then Statement
Message-Id: <35F06E2C.EF609B23@america.net>

Let me give this a try: 

	$ perl -de 42

	Loading DB routines from perl5db.pl version 1.01
	Emacs support available.

	Enter h or `h h' for help.

	main::(-e:1):   42
	  DB<1>  $job_id = '';

	  DB<2>  open(D, "tmp/$job_id") || print "open failed, $!";

	  DB<3> q
	$

Hmmm.  Maybe the open didn't fail, eh?  I'd check the value of '$job_id'
in the case you're wondering about.  

-Garry Williams

Jonathan M. Hartman wrote:
> 
> if (!open(MESSAGE, "/export/home/CAM/cam/rm/logs/$job_id"))
>         {$error = 'Couldn\'t open file log file!';}
> 
> Why won't the previous statement set the variable, when the file doesn't
> exist?
> 
> -Jon
> 
> ==============================================================================
> ||||||||"If you can't take the heat, STAY OUT OF THE FIREWALL!" -Me ||||||||||
> ==============================================================================
> ||Out the Token Ring, through the router, down the fiber, off another router,|
> ||||||||||| down the T1, past the firewall...nothing but Net.|||||||||||||||||
> ==============================================================================


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

Date: Fri, 4 Sep 1998 15:28:07 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: my lousy syntax
Message-Id: <MPG.105a0956927d23ba989795@nntp.hpl.hp.com>

[Posted to comp.lang.perl.misc and a copy mailed.]

In article <6spmm2$u99$1@nnrp1.dejanews.com> on Fri, 04 Sep 1998 21:39:14 
GMT, mmesmer@yahoo.com <mmesmer@yahoo.com> says...
> Someone please help me with the following snippet!  I cannot figure out what's
> wrong with it.
 ... 
> $waiting == 1;

$waiting = 1;

This is the only thing that's really *wrong* with it.  The '-w' flag 
would have given you a useful diagnostic: 'Useless use of numeric eq in 
void context at foo line 000.".  Get into the habit of using it!

As for the rest, you should learn how to indent for legibility, and the 
quotes aroung "$filepath" are superfluous and misleading.

> while (! -e "$filepath") {
> print '.';
> $waiting++;
> if ($waiting > 100) {
> die;
> }
> 
> }

I find this easier to read, but functionally identical:

  until (-e $filepath) {
     print '.';
     die if ++$waiting > 100;
  }

Don't forget to include '$| = 1;' earlier, if you want to see these dots 
when you expect to.

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


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

Date: Fri, 4 Sep 1998 18:43:19 -0400
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: my lousy syntax
Message-Id: <MPG.105a3711a13bcfd698968d@news.south-carolina.net>

In article <6spmm2$u99$1@nnrp1.dejanews.com> on Fri, 04 Sep 1998 
21:39:14 GMT, mmesmer@yahoo.com (mmesmer@yahoo.com) pounded in 
the following text:
=> Someone please help me with the following snippet!  I cannot figure out what's
=> wrong with it.
=> 
=> Thanks,
=> Mike
=> 

=> $waiting == 1;

You aren't running perl -w, are you?

% perl -we '$_ = 2; $_ == 1'
Useless use of numeric eq in void context at -e line 1
%

Run with -w _ALWAYS_ (at least while developing your script).

=> while (! -e "$filepath") {

until(-e $filepath) {

=> print '.';
=> $waiting++;
=> if ($waiting > 100) {
=> die;
=> }
=> 
=> }

Other than what I pointed out, your script looks fine.  What 
error messages is Perl giving you?  What does $filepath contain 
at that line?

Are you hoping for this to wait for very long?  On my system this 
takes slightly less than a flash to execute.  Look into the sleep 
function while your at it.

Hope This Helps!

--Matthew


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

Date: 4 Sep 1998 22:58:59 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: my lousy syntax
Message-Id: <6sprbj$d4v$2@marina.cinenet.net>

mmesmer@yahoo.com wrote:
: Someone please help me with the following snippet!  I cannot figure
: out what's wrong with it.

First, you should learn to use indentation to show off your code's block
structure better.  Second, it's touch to determine what's wrong without
your telling us what you expect it to do.  Third, I'll bet that first line
isn't actually doing what you think it is.

: $waiting == 1;
: while (! -e "$filepath") {
: print '.';
: $waiting++;
: if ($waiting > 100) {
: die;
: }
: }

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      "Ripple in still water, when there is no pebble tossed,
       nor wind to blow..."


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

Date: Fri, 04 Sep 1998 21:52:18 GMT
From: djcampbell@my-dejanews.com
Subject: Perl HTML file transfer
Message-Id: <6spnei$vho$1@nnrp1.dejanews.com>

  I'm trying to get a Perl script to send a binary file to a browser.  I've
successfully made the browser open the "save file" dialog, but after choosing
a location I receive a "document contains no data" error.  The code works
great from a command prompt.

  This is running on an NT system with IIS web server.  Here's some test code
that I've been using to experiment:

use CGI qw(:standard);
use CGI::Carp;
use Fcntl;

$files = "tpclogo.gif";

open XFER, "$files";
binmode XFER;

$xfsize = (stat XFER)[7];

print "MIME-Version: 1.0\n";
print "Content-Type: application/octet-stream;";
print "name=\"$files\"\n";
print "Content-Disposition: attachment; filename=\"$files\"\n";
print "Content-Length: $xfsize\n";
print "\n";

while (<XFER>) { print ; }
close XFER;
exit;

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: 04 Sep 1998 18:32:31 -0400
From: Vivek Khera <khera@kciLink.com>
Subject: Re: Perl Module for URL hiding
Message-Id: <x790jzh5kw.fsf@kci.kciLink.com>

>>>>> "MJG" == Michael J Gebis <gebis@welsh.ecn.purdue.edu> writes:

MJG> Assuming you can use perl to generate the URL, you could do something
MJG> like:  FreeThaw your data, then gzip it, then Base64 it. Then pass
MJG> that big honking string as part of the query.  To decode, un-base-64
MJG> it, gunzip it, unFreeThaw it.  Depending on what sort of data you
MJG> have, you might be able to skip FreeThawing or gzipping.

MJG> And yes, that's a pretty ugly solution.

Not really.  I've used this exact approach (but using DES instead of
FreeThaw, whatever that is) in a production environment where I needed 
to pass some data that was created  in the first step of the process
by one CGI, and used by the next CGI.  This method prevented altering
of it.

Of course, you have to be able to tell when you decode the thing that
it is valid and came from where you expected it to have come.  That's
the tricky part!

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD       +1-301-258-8292
PGP/MIME spoken here              http://www.kciLink.com/home/khera/


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

Date: Fri, 04 Sep 1998 15:40:14 -0700
From: Gregory White <gregory.t.white@lmco.com>
Subject: Re: Precompiled perl for solaris 2.5?
Message-Id: <35F06C4E.1DC9@lmco.com>

Jonathan Stowe wrote:
> 
> On 4 Sep 1998 14:32:02 GMT, Philip Le Riche wrote :
> 
> >Can anyone point me to (or send me) a precompiled version of Perl5 for
> >Solaris 2.5 please? I don't seem to have a dev system.
> >
> 
> Better might be to obtain a precompiled gcc development system for
> your platform with which you can build Perl - the advantage  of this
> is that you can take advantage of binary Perl extensions which you
> might need at a later date (and supplement other utilities that you
> might want for that matter - just replaced "more" with "less" on two
> Solaris machines today because that Solaris "more" was pissing me
> off).  I cant remember the URL but there is a freeware link from Sun's
> Solaris pages.
> 
> /J\
> --
> Jonathan Stowe
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>

The place to go for pre-compiled Solaris programs is at

	http://sunfreeware.com/

Gregory White
Lockheed Martin
Sunnyvale, CA
408-756-4562


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

Date: Fri, 04 Sep 1998 23:05:42 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Problem installing perl 5.004_04
Message-Id: <35f05e6a.3267488@news.btinternet.com>

On Fri, 04 Sep 1998 14:57:21 -0700, Art DeBuigny wrote :

>Greetings;
>
>I am having trouble installing perl 5.004_04 on AIX 4.1 using gcc
>2.7.2.2
>as my C compiler.
>
>Here is the error message I get when I run the make command.
>
>Writing Makefile for DynaLoader
>mkdir ../../lib/auto/DynaLoader
>The Unsupported function umask function is unimplemented at
>../../lib/ExtUtils/Install.pm line 247.
>make: 1254-004 The error code from the last command is 2.
>
>make 1254-004 The error code from the last command is 2.
>
A quick glimpse at Extutils::Install.pm seems to indicate that the
only platform that is not supposed to support umask() is VMS.  

It might be that Configure incorrectly guessed whether umask() was
available on your system.  Have a look at config.sh and see what it
says about umask (there will be a line like "d_umask='') if you think
it is wrong then edit it and run Configure -S to remake all the
Makefiles and so on then "make depend" "make" etc.  Alternatively if
you are unsure about this then you could just do "make distclean"
(remove config.sh if it is still there) and start again - this time
paying special attention to what it is being said when it checks what
library functions are available.

/J\
-- 
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: 04 Sep 1998 19:01:43 -0400
From: Vivek Khera <khera@kciLink.com>
Subject: Re: SSL encryption
Message-Id: <x74sunh488.fsf@kci.kciLink.com>

>>>>> "KB" == Kevin Bynum <dunz@tingley.net> writes:

KB> Does anyone know how to add support for SSL encryption.  I need to
KB> automate a SSL encrypted site for datebase queries.  I am currently
KB> using the LWP library and need to add support for SSL or any info about
KB> accessing a site that is at 'https://dps1.easysabre.com/ezsabre.ctl'
KB> with perl.

Look around the same place you found the LWP library (aka CPAN) for an
SSL library.  Chances are you'll find one.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD       +1-301-258-8292
PGP/MIME spoken here              http://www.kciLink.com/home/khera/


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

Date: Fri, 04 Sep 1998 23:05:22 GMT
From: jedihawk@mail.com (Kevin hawkins)
Subject: Re: Use Perl to sendmail: open once, send multiple times?
Message-Id: <35f0717c.8058621@nntp.best.com>

I do believe you'll need to open a pipe to sendmail ONCE per message.
Even if you telnet directly to the mail server and use SMTP commands,
you can only send one email per session.

On 4 Sep 1998 18:42:57 GMT, mwang@tech.cicg.ml.com (Michael Wang)
wrote:

>How do I use Perl to sendmail but I want to open once, send multiple times?
>The following example does not work. Should I directly connect to the 
>sendmail port, or do mutilple open/close? Thanks.
>
>  open(SENDMAIL, "|/usr/lib/sendmail -oi -t") 
>      print SENDMAIL "From: <me\@me.com>\n";
>      print SENDMAIL "To: <$someone\@some.site>\n";
>      print SENDMAIL "$some_message\n";
>      print SENDMAIL ".\n";
>#
>      print SENDMAIL "From: <me\@me.com>\n";
>      print SENDMAIL "To: <$someoneELSE\@some.site.ELSE>\n";
>      print SENDMAIL "$some_message_ELSE\n";
>      print SENDMAIL ".\n";
>  close(SENDMAIL) or warn "sendmail didn't close nicely";
>-- 
>unix programs: niftp (non-interactive recursive ftp), hide (hide command args), 
>submit (replace nohup), etc from ftp://ftp.mindspring.com/users/mwang/unix-prog
>Michael Wang, mwang@ml.com, Merrill Lynch, World Financial Center, 212-449-4414

Kevin Hawkins
jedihawk@mail.com
http://www.jedihawk.com/


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

Date: Fri, 04 Sep 1998 21:59:33 GMT
From: malch@malch.com (Malcolm Hoar)
Subject: Re: Why is 5.005* a pain to switch to safely?
Message-Id: <6spns5$32k$1@nntp1.ba.best.com>

In article <35F05B57.1411164C@fmr.com>, steve.tolkin@fmr.com wrote:
>Zenin (zenin@archive.rhps.org) wrote (and will receive this as email)
>>         5.005* being such a major pain to switch to safely (in large
>>         systems at least), 5.004 will be with us longer then 4*... :-(
>
>Can you and/or other people provide some details about this.
>I was planning on upgrading once the last revision digit dstopped
>changing.  What bad things might happen if I do?

I found the Perl 5.005_01 install a major pain (under FreeBSD).

Today, I upgraded to 5.005_02 and it was the breeze to which I
have become accustomed. Kudos to those who cleaned it up.

[I didn't try to make a version with threads - accepted the
defaults right the way through Configure]. Clean as a whistle;
'make test' passed 100% :-)

I'm seeing significant (~20%) performance improvements on one
major application as well (RegExp engine?).

-- 
|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
| Malcolm Hoar           "The more I practice, the luckier I get". |
| malch@malch.com                                     Gary Player. |
| http://www.malch.com/               Shpx gur PQN.                |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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

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