[10570] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4162 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 5 20:07:25 1998

Date: Thu, 5 Nov 98 17:00:27 -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           Thu, 5 Nov 1998     Volume: 8 Number: 4162

Today's topics:
        Backward japanesque@my-dejanews.com
    Re: Backward (Matthew Bafford)
        BIZARRE -- Perl vs C for Y2K <tterry@pbi.net>
    Re: Can a Perl program effect the parent process?? (Joe McMahon)
    Re: delete a file under win95 (!) ()
    Re: DELL Computers Knowingly Installs Malfunctioning Mc (Bbirthisel)
        generating binary equivalent ()
        HELP !!! ASAP answer please! <yt@cs.purdue.edu>
    Re: HELP !!! ASAP answer please! (Larry Rosler)
    Re: Heterogeneous Data Structures: possible?  If so, ho <croten@bigger.aa.net>
        initializing large list of variables with similar names <rbush@up.net>
    Re: Need perl socket programming help <dean2@mail.biol.sc.edu>
    Re: Not to start a language war but.. <mhc@Eng.Sun.COM>
    Re: Not to start a language war but.. <mhc@Eng.Sun.COM>
        Odd number of elements? <vandiver@tiac.net>
    Re: Odd number of elements? <uri@fastengines.com>
    Re: Odd number of elements? <thelma@alpha2.csd.uwm.edu>
    Re: Odd number of elements? (Larry Rosler)
        Perl Accessing a 3270 Session <dscott@ctp.com>
    Re: PLEASE HELP! (Troy Denkinger)
    Re: post from perl to html <mjd@sgi.net>
    Re: problem with file test -e <ramune@zarathustra.calstatela.edu>
        Script calling Remote Script <matt@godzilla.tamu.edu>
        Trouble building latest version... <sfoley@cisco.com>
    Re: uninstalling modules <Alan.Burlison@uk.sun.com>
        Weird problem compiling Perl on HP-Ux (Reinoud van Leeuwen)
    Re: why use do BLOCK? (Chris Sherman)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Thu, 05 Nov 1998 21:58:43 GMT
From: japanesque@my-dejanews.com
Subject: Backward
Message-Id: <71t72j$gko$1@nnrp1.dejanews.com>

I am wondering if someone can help me to use backward command.	If someone
fill in a blank as "ABC", then print as "CBA" as result.  Please help.	Thank
you.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Thu, 5 Nov 1998 17:28:35 -0500
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: Backward
Message-Id: <MPG.10abf09e9e1775fa9896fd@news.scescape.net>

In article <<71t72j$gko$1@nnrp1.dejanews.com>>, japanesque@my-
dejanews.com (japanesque@my-dejanews.com) pounded the following:
=> I am wondering if someone can help me to use backward command.	If someone
=> fill in a blank as "ABC", then print as "CBA" as result.  Please help.	Thank
=> you.

$back = reverse $forw;

HTH,

--Matthew


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

Date: Thu, 05 Nov 1998 15:18:45 -0800
From: Troy Terry <tterry@pbi.net>
Subject: BIZARRE -- Perl vs C for Y2K
Message-Id: <36423255.830DF16@pbi.net>

Hi...

I have run some tests and get results that I have trouble 
explaining.  Look at this Perl script, "tiempo.pl":
---------------------------------------------
#!/usr/local/bin/perl
 
require 'timelocal.pl';
 
@yearArray = (70,71,98,99,100,0,101,102,137,138,139);
 
$second = 0;
$minute = 0;
$hour = 0;
$dayofmonth = 1;
$month = 0;             # months SINCE January
foreach $yr (@yearArray)
{
        $epoch = timelocal($second, $minute, $hour, $dayofmonth, $month,
$yr);
        printf("Year %4d (%4d) -- Epoch: %12ld\n", $yr, (1900+$yr),
$epoch);
}
---------------------------------------------
This gives the following output (note that for year 70
we get 28800 instead of 0, because we are factoring in
PST time zone(28800=8*3600)):
rhino [322] tiempo.pl
Year   70 (1970) -- Epoch:        28800
Year   71 (1971) -- Epoch:     31564800
Year   98 (1998) -- Epoch:    883641600
Year   99 (1999) -- Epoch:    915177600
Year  100 (2000) -- Epoch:    946713600
Year    0 (1900) -- Epoch:    946713600     # Surprising (and wrong)
Year  101 (2001) -- Epoch:    978336000
Year  102 (2002) -- Epoch:   1009872000
Year  137 (2037) -- Epoch:   2114409600
Year  138 (2038) -- Epoch:           -1     # Surprising (and wrong?)
Year  139 (2039) -- Epoch:           -1

=============================================

The equivalent program, in C:
---------------------------------------------
#include <stdio.h>
#include <time.h>
 
int aYears[] = {70,71,98,99,100,0,101,102,137,138,139};
 
main(int argc, char *argv[])
{
        struct tm tiempo;
        int i;
        int iSize;
        time_t tmtEpoch;
 
        tiempo.tm_sec = 0;
        tiempo.tm_min = 0;
        tiempo.tm_hour = 0;
        tiempo.tm_mday = 1;
        tiempo.tm_mon = 0;      /*  Months SINCE January  */
        tiempo.tm_wday;
        tiempo.tm_yday;
        tiempo.tm_isdst = -1;   /*  Let system decide about daylight
savings */
 
        iSize = sizeof(aYears) / sizeof(aYears[0]);
 
        for (i=0; i<iSize; i++)
        {
                tiempo.tm_year = aYears[i];
                tmtEpoch = mktime(&tiempo);
                printf("Year %4d (%4d) -- Epoch: %12ld\n", aYears[i],
1900+aYear
s[i], (long)tmtEpoch);
        }
 
}
---------------------------------------------
It's output:
rhino [327] a.out
Year   70 (1970) -- Epoch:        28800
Year   71 (1971) -- Epoch:     31564800
Year   98 (1998) -- Epoch:    883641600
Year   99 (1999) -- Epoch:    915177600
Year  100 (2000) -- Epoch:    946713600
Year    0 (1900) -- Epoch:           -1
Year  101 (2001) -- Epoch:    978336000
Year  102 (2002) -- Epoch:   1009872000
Year  137 (2037) -- Epoch:   2114409600
Year  138 (2038) -- Epoch:   2145945600
Year  139 (2039) -- Epoch:           -1
---------------------------------------------

Interesting, no?  Can anyone explain why the difference?  I
am using what I believe to be perl 5.003 on SunOS 5.5.1.

Yours,
T. Terry
tterry@pbi.net


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

Date: Thu, 05 Nov 1998 18:08:42 -0500
From: joe.mcmahon@gsfc.nasa.gov (Joe McMahon)
Subject: Re: Can a Perl program effect the parent process??
Message-Id: <joe.mcmahon-0511981808420001@prtims.stx.com>

>On Thu, 22 Oct 1998 22:31:46 GMT, drgreer@qtiworld.com (Darren Greer)
>enlightened us thusly:
>
>>The subject explains it all....but here is my situation.  I have a
>>perl program that I want to set the DISPLAY env variable.
>>Unfortunatley from what I understand on a *nix system, a child process
>>(ie perl program) can not effect the parent process?)  Is there anyway
>>to do this.

> cd ~/bin:
> cat >borple
#!/usr/bin/perl -w
print "borple";
^D
> chmod +rx borple
>cd ~
> cat >>.cshrc
setenv GLORK `~/bin/borple`
^D
> source .cshrc
> printenv GLORK
borple
>

 --- Joe M.


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

Date: 5 Nov 1998 22:40:19 GMT
From: hdiwan@diwanh.stu.rpi.edu ()
Subject: Re: delete a file under win95 (!)
Message-Id: <slrn744ajq.591.hdiwan@diwanh.stu.rpi.edu>

On Tue, 3 Nov 1998 19:16:09 +0200, Avshi Avital <avitala@macs.biu.ac.il> wrote:
>unlink 'file_name'
Did you run with the -w switch by any chance? 
>system('del file_name');
This should not fail unless M$ has yet again, fucked up on backwards 
compatibility.
>exec('del file_name');
See above...
-- 
Hasan Diwan
Geek Code
GAT d- s-:- a--- C++++ UL++++ UX+ UA+ UH++++ P++++ L++++ E--- W-- N++ ?o ?K 
w--- O- M V PS+ PE Y+ PGP+++ t 5 X-- R* tv+ b+++ DI++ D G e>++ h-- r++ y+


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

Date: 5 Nov 1998 22:05:44 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: DELL Computers Knowingly Installs Malfunctioning McAfee VirusScan Software
Message-Id: <19981105170544.23339.00004364@ng-fd2.aol.com>

Hi Uri:

>and what does this have to do with perl? are there perl viruses on pc's?
>(interesting question: can you make a perl virus?) does mcaffee or dell
>even know what perl is? do we care if they do? does anyone care at all
>about this?
>
>just asking,

At one time (5.003 or 5.004 ?? A few months ago) there was an interaction
between the McAfee virus scan software and the way perl accessed the
file system. The symptoms were truly terrible performance whenever
perl did a file system access. In at least some cases, perl looked for files
on a floppy instead of/before checking the current filesystem. I haven't
heard this complaint recently - but I don't recall hearing about a fix
either. The conventional wisdom at that time was "dump McAfee if you
want to run perl".

You are certainly correct that Dell did not consider this. And should
not be blamed for overlookng it. As for perl viri, it did not appear any
particular perl construct was implicated in the problem.

-bill


Making computers work in Manufacturing for over 25 years (inquiries welcome)


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

Date: 3 Nov 1998 21:20:22 GMT
From: philchen@vza.Eng.Sun.COM ()
Subject: generating binary equivalent
Message-Id: <71ns2m$170$1@engnews2.Eng.Sun.COM>

Is there a way to get Perl5 to generate a binary executable
for my script?  The core dump method didn't really work for me.
Please copy me via email.  Thanks in advance.


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

Date: Thu, 05 Nov 1998 17:03:31 -0500
From: "Yulia. T" <yt@cs.purdue.edu>
Subject: HELP !!! ASAP answer please!
Message-Id: <364220B2.FD687E99@cs.purdue.edu>

Hi, I want to search a string in a certain file.
I use the following codes :

open (TEMP, "<$dir/output3");
  $error3 = 0;
  while (<TEMP>) {
   if (/= -(1 *(2 ** 32) + (0))/i) {
    $error3 = 1;
    last;
   }
  }
  close TEMP;

But it treats the above string as a regular expression so it generates
error when it reads 2 ** 32. I know that grep has -F function so that it
will treat the string as string only not as regular expression. My
question is how can we do this in Perl ?

Thanx so much
Naoise




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

Date: Thu, 5 Nov 1998 15:00:24 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: HELP !!! ASAP answer please!
Message-Id: <MPG.10abcdde252b4d16989863@nntp.hpl.hp.com>

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

In article <364220B2.FD687E99@cs.purdue.edu> on Thu, 05 Nov 1998 
17:03:31 -0500, Yulia. T <yt@cs.purdue.edu> says...
> Hi, I want to search a string in a certain file.
> I use the following codes :
> 
> open (TEMP, "<$dir/output3");

Test the result of 'open'.  Always!!!

  open (TEMP, "<$dir/output3") or
    die("Couldn't open $dir/output3. $!\n";

>    if (/= -(1 *(2 ** 32) + (0))/i) {

     if (/\Q= -(1 *(2 ** 32) + (0))/) {
          ^^                        ^
Treat the string literally.    Don't need 'i' -- no letters to match!

> But it treats the above string as a regular expression so it generates
> error when it reads 2 ** 32. I know that grep has -F function so that it
> will treat the string as string only not as regular expression. My
> question is how can we do this in Perl ?

If you are simply searching for a literal string, then you can do better 
with the 'index' function, not a regular expression:

     if (index($_, '= -(1 *(2 ** 32) + (0))') >= 0) {

BTW, your 'Subject:' stinks, and is a good way to get ignored in the 
future.

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


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

Date: 05 Nov 1998 14:41:48 -0800
From: Charles Roten <croten@bigger.aa.net>
Subject: Re: Heterogeneous Data Structures: possible?  If so, how?
Message-Id: <xfkhfwd92z7.fsf@bigger.aa.net>


Charles Roten <croten@bigger.aa.net>, in a state of some considerable 
confusion,  wrote:

> I want to do something more than a little odd ... I want to build a 
> structure $DataStructure such that sometimes 
> 
>     $DataStructure->[$index]->{$key}
> 
> refers to a scalar/string, and sometimes to a named hash or array.  
> 
> As in (string case)
> 
>     $FireWall_Rule->[7]->{"install"}->"firewall_box"
> 
> but (array case)
> 
>     $FireWall_Rule->[7]->{"services"}->[0]->"telnet"
>     $FireWall_Rule->[7]->{"services"}->[1]->"login"
>     $FireWall_Rule->[7]->{"services"}->[2]->"echo-request"
> 
> and (hash case)
> 
>     $FireWall_Rule->[7]->{"action"}->{"accept"}->{"type"}->"accept"
>     $FireWall_Rule->[7]->{"action"}->{"accept"}->{"color"}->"Dark green"
>     $FireWall_Rule->[7]->{"action"}->{"accept"}->{"icon-name"}->"icon-accept"
> 
> etc.  All in the _same_ $FireWall_Rule structure.  

Thanks, in particular, to Darrin Edwards <d-edwards@nospam.uchicago.edu> 
and Don Roby <droby@copyright.com> for clarifying my thinking about 
the original problem.  Not to mention "perldoc perltoot".

Actually, it's worse than my original post indicated.  

Sooner or later, I run into the need for something like _this_ ...

    $FireWall_Rule->[7]->{"services"}

has to point to the following wretched sordid _list_-_style_ mess ...

    A scalar:
            "IMAP"
    A scalar: 
            "pop-3"
    A hash key/value pair, where the key is a string and the value 
    is an array-like construct: 
            "smtp->In", [ "resource In", "service smtp", \
                          {"color", "firebrick}, {"type", "Tcp"}]

This is where matters get ugly.  These are three elements in a LIST.  
The first two are _SCALARS_.  The third is a _HASH_ key/value PAIR.  


At this point, I am not at all sure that something like this can be 
done cleanly in Perl.  I would _really_ appreciate being proven 
wrong !!  

-- 
croten@aa.0SPAM.net |Pursuant to US Code, Title 47, Chapter 5, Subchapter II,
(Charles D. Roten)  |227, any and all nonsolicited commercial E-mail sent to 
                    |this address is subject to a download and archival fee of 
                    |$500 US. E-mailing denotes acceptance of these terms.


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

Date: Thu, 05 Nov 1998 17:03:15 -0500
From: Ray Bush <rbush@up.net>
Subject: initializing large list of variables with similar names
Message-Id: <364220A3.60CE@up.net>

can i use something like this:

for $item ( "npdmm" "npddd" "npdyy" "lpmmm"){
  $($item."f")=$($item);	
}

instead of something like this:

		$totalfeesf=$totalfees;
		$npdmmf=$npdmm;
		$npdddf=$npddd;
		$npdyyf=$npdyy;
		$lpmmmf=$lpmmm;


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

Date: 05 Nov 1998 18:03:32 -0500
From: Dean Pentcheff <dean2@mail.biol.sc.edu>
To: Rob Conrad <rob@happy.com>
Subject: Re: Need perl socket programming help
Message-Id: <m390hprbcr.fsf@mail.biol.sc.edu>

Rob Conrad <rob@happy.com> writes:
> I have a, what I think would be fairly simple, programming request that
> we would be willing to negotiate some money for.
> 
> I have a piece of software that outputs some data (only around 350 bytes
> or so) to a particular port (tcp) on a particular machine. What I need
> to do is to have a perl program
> run to listen to a port and receive data from it. When it does it needs
> to transfer that
> data to another host/port and then receive a response. When it receieves
 ...
> I could probably figure it out myself but am a little weak in network
> programming. I need
> this done asap. If anyone thinks they can do it I would be glad to call
> and speak with them. If it works the way I would like we can negotiate
> some fee for doing this. Please email me with responses.

Buy the "Perl Cookbook" (Christiansen, Tom and Torkington, Nathan,
1998, O'Reilly & Associates, Inc., ISBN 1-56592-243-3
<http://www.ora.com>).  There are some examples in there that come
quite close to what you need.  I suspect you could cobble it together
from those.

Best of luck!

-Dean
-- 
N. Dean Pentcheff                                      <dean@mail.biol.sc.edu>
Biological Sciences, Univ. of South Carolina, Columbia SC 29208 (803-777-7068)


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

Date: 03 Nov 1998 09:30:17 -0800
From: Mike Coffin <mhc@Eng.Sun.COM>
Subject: Re: Not to start a language war but..
Message-Id: <8p6d8747kgm.fsf@Eng.Sun.COM>

Russ Allbery <rra@stanford.edu> writes:

> But regular variable access looks just like C; there's just this weird
> naming requirement on variables that's a little like Hungarian notation.
> $foo, @bar, %baz, $bar[2], and $baz{foo} seem very natural to me, and I
> don't see what's complicated about that syntax.  "$foo" is the name of the
> variable; the variable isn't "foo" and the $ something else.  Maybe the
> confusion comes from people not thinking about it that way?  If you do
> think of it that way, it then becomes obvious that "$foo" and "@foo" are
> two different variables.

It's not quite that simple.  If it were, then you would reference the
array "@a" by writing "@a[$i]".  But you don't, you write "$a[$i]".
The dollar sign is *not* part of the name.  It is really a way to
specify scalar context.

-mike


        


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

Date: 03 Nov 1998 09:36:34 -0800
From: Mike Coffin <mhc@Eng.Sun.COM>
Subject: Re: Not to start a language war but..
Message-Id: <8p6btmo7k65.fsf@Eng.Sun.COM>

Tom Christiansen <tchrist@mox.perl.com> writes:

> I beg your pardon?  Who told you this very silly thing?  It's
> so far from accurate that I cannot believe it's in an intentional lie.
> Therefore, I can only surmise that you don't understand pass-by-reference
> semantics.   Please consult perlsub.

He *said* you can pass scalars, which is what a reference to an array
is.  It *is* tricky to pass arrays themselves, because they are apt to
be coagulated with other arrays or values.  I can only surmise
that you... No; I'll stay out of the mud. 

-mike








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

Date: Thu, 05 Nov 1998 17:52:47 -0500
From: Alex Vandiver <vandiver@tiac.net>
Subject: Odd number of elements?
Message-Id: <36422C3E.914E8AA7@tiac.net>

I'm confoogled.  Why does perl choke about "Odd number of elements in
hash list" on the follwong lines of code?

@a = split(/[\s+=]/,$line);           # $line being "FOO=bar BAZ=zort"
print "Array:".(scalar @a)."\n";      # Prints 4
%h = {@a};                            # Dies
print "Hash:".(scalar keys %h)."\n";  # Prints 0

Any extra cluefulness for the clueless wandering around out there?
-Alex Vandiver

P.S.  I have yet to find anyplace what perl means by "chunk" in the
error message above.  Does perl find arrays/hashes to be "chunky"?  If
so, has anyone found a "smooth" one?

--
                        -=+<({[ Random Quote of the day ]})>+=-
Stupidity got us into this mess..
>Why can't it get us out?




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

Date: 05 Nov 1998 18:15:25 -0500
From: Uri Guttman <uri@fastengines.com>
To: Alex Vandiver <vandiver@tiac.net>
Subject: Re: Odd number of elements?
Message-Id: <sarlnlpbuk2.fsf@camel.fastserv.com>

>>>>> "AV" == Alex Vandiver <vandiver@tiac.net> writes:

  AV> I'm confoogled.  Why does perl choke about "Odd number of elements in
  AV> hash list" on the follwong lines of code?

  AV> @a = split(/[\s+=]/,$line);           # $line being "FOO=bar BAZ=zort"

this is wrong. + is a plain + in a char class. you want /\s+|=/ 

  AV> print "Array:".(scalar @a)."\n";      # Prints 4

  AV> %h = {@a};                            # Dies

and well it should. why do you have {} around @a? this makes a hash ref
which is a single value and assigns that to %h. so you have an odd
number of elements.

just do:

%h = @a ;

  AV> print "Hash:".(scalar keys %h)."\n";  # Prints 0

well, since it never assigned a key/value pair it will have 0 keys.

hth,

uri


-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: 5 Nov 1998 23:18:27 GMT
From: Thelma Lubkin <thelma@alpha2.csd.uwm.edu>
Subject: Re: Odd number of elements?
Message-Id: <71tbo3$r6a$1@uwm.edu>

Alex Vandiver <vandiver@tiac.net> wrote:
: I'm confoogled.  Why does perl choke about "Odd number of elements in
: hash list" on the follwong lines of code?

: @a = split(/[\s+=]/,$line);           # $line being "FOO=bar BAZ=zort"
: print "Array:".(scalar @a)."\n";      # Prints 4
: %h = {@a};                            # Dies

: print "Hash:".(scalar keys %h)."\n";  # Prints 0

    You'll get a 2 element hash (FOO=>bar, BAZ=>zort) if you
    remove the brackets around @a, i.e %h = @a.
                     --thelma
: -Alex Vandiver





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

Date: Thu, 5 Nov 1998 15:18:47 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Odd number of elements?
Message-Id: <MPG.10abd230b3d09c85989864@nntp.hpl.hp.com>

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

In article <36422C3E.914E8AA7@tiac.net> on Thu, 05 Nov 1998 17:52:47 -
0500, Alex Vandiver <vandiver@tiac.net> says...
> I'm confoogled.  Why does perl choke about "Odd number of elements in
> hash list" on the follwong lines of code?
> 
> @a = split(/[\s+=]/,$line);           # $line being "FOO=bar BAZ=zort"

I assume you understand that in the above the '+' stands literally for 
'+', not 'one or more space characters'.  If you mean 'one or more space 
characters or an equals sign, the regex should be

  /\s+|=/

But that is not your problem with the data shown in the comment.

> print "Array:".(scalar @a)."\n";      # Prints 4
> %h = {@a};                            # Dies

The curly braces create a *reference* to an anonymous hash -- one 
element -- which you initialize with the contents of @a, and then assign 
to %h.  You can use either parentheses, or nothing at all.

  %h = @a;

 ...
 
> P.S.  I have yet to find anyplace what perl means by "chunk" in the
> error message above.  Does perl find arrays/hashes to be "chunky"?  If
> so, has anyone found a "smooth" one?

You don't show 'the error message above.'  However...

A 'chunk' is a piece of a file that is read by an invocation of the 
<FILEHANDLE> operator.  By default, a chunk is a line; but if you mess 
with the input record separator $/, a chunk may be more or less than one 
line.  Perhaps a better term than 'chunk' would have been 'record', to 
relate it more closely with the 'input record separator'.

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


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

Date: Thu, 05 Nov 1998 19:00:00 -0500
From: "Damien S. Scott" <dscott@ctp.com>
Subject: Perl Accessing a 3270 Session
Message-Id: <36423BFF.C7058EAB@ctp.com>

This is a multi-part message in MIME format.
--------------1868839E1A9AA797D26C22C2
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I am looking for a method of using Perl to access a mainframe using a
3270 session and using EHLLAPI to scrape the mainframe screens.  Is
there such a library to using TN3270?

Regards,
Damien S. Scott

--------------1868839E1A9AA797D26C22C2
Content-Type: text/x-vcard; charset=us-ascii;
 name="dscott.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Damien S. Scott
Content-Disposition: attachment;
 filename="dscott.vcf"

begin:vcard
n:Scott;Damien
tel;fax:(212)539-7800
tel;work:(212)539-7816
x-mozilla-html:FALSE
org:Cambridge Technology Partners;Operations
adr:;;114 Fifth Avenue, 7th Floor;New York;NY;10011;USA
version:2.1
email;internet:dscott@ctp.com
title:Associate Director
fn:Damien Scott
end:vcard


--------------1868839E1A9AA797D26C22C2--



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

Date: Fri, 06 Nov 1998 00:14:08 GMT
From: troy@whadda.com (Troy Denkinger)
Subject: Re: PLEASE HELP!
Message-Id: <71tet5$csl$1@hirame.wwa.com>

In article <3641f78c.6373348@news.the-wire.com>, gpb@ppaolucci.com (Gord 
Barentsen) wrote:
>I am going through Erik Strom's _Perl CGI Programming - No Experience
>Required_ and using Sambar Server V4.1.  I am doing a very simple
>(don't laugh!) "Hellow World!" exercise that uses require statements

[snip]

Funny, you forgot to give any useful information.  I doubt anyone will be able 
to help much.  If this is really a perl issue, post your code.  If this is 
really a CGI problem, take a look at the CGI groups.

Regards,

Troy Denkinger


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

Date: Thu, 5 Nov 1998 19:39:55 -0500
From: "WareWolf" <mjd@sgi.net>
Subject: Re: post from perl to html
Message-Id: <xyr02.415$BK3.174228@news.sgi.net>

You can put the variable in the form field. When it is sent to the
Browser/client it will have the data of that variable in it.
Another showed you one way of sending back the html here's another:

#! /perl/perl5/

require ("cgi-lib.pl") || die "Can't load cgi-lib";
&ReadParse;  ##get the form arguments and chomps it good.

$EMAIL = "you\@yourdomain\.com";     ## Static, always there.
$CLIENTID = "SOmeThingHeRe ";        ## You Could autonumber here.
$PASSWORD = "$in{'PASSWORD'}";   ## Incoming form field named PASSWORD.

print "Content-type:text/html\n\n";
## Tells the server to serve a web page..

print <<WEB_PAGE;
## Pre formated so you don't need to "print" each line...

<html>
<head><title>Your Title</title></head>
<Body>
<form action="script.pl" method="post">
<input type="hidden" name="CLIENT_ID" value="$CLIENTID">
<input type="hidden" name="EMAIL_TO" value="$EMAIL">
<input type="hidden" name="PASSWORD" value="$PASSWORD">
Please Enter Your Name:
<input type="text" name="CLIENT_NAME" size="20" maxlength="20"><br>
<input type="submit" value="Submit" name="Submit">
</form>
</body></html>
WEB_PAGE
## Close
exit;


Billsterz wrote in message <71r8hu$hcn$1@nntp.erinet.com>...
>Hi,
>New perl user here.
>
>Does anyone know how to pass a variable from a cgi script to a form?
>
>Assuming the perl script opens the form_file and wants to pass $passme to a
>field in the form called "passto"
>The end result would be when the user calls the cgi, it opens an already
>prepared htm file,displays it to the user with one field that already has a
>pre-determined value in it.
>
>Any help?
>
>Thanx,
>Bill
>
>bill@sterzenbach.com
>
>
>




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

Date: 5 Nov 1998 15:52:27 -0800
From: Graffiti <ramune@zarathustra.calstatela.edu>
Subject: Re: problem with file test -e
Message-Id: <71tdnr$d42$1@zarathustra.calstatela.edu>

In article <MPG.10a14b97ff825e72989846@nntp.hpl.hp.com>,
Larry Rosler <lr@hpl.hp.com> wrote:
[snip]
>"always, always" is going too far.  In an application I wrote for an 
>environment in which atomic locking was not readily available (M$ VC++), 
>I used the sequential acquisition of *two* locks (directories, not 
>files, following a suggestion by Tom Christiansen) before accessing the 
>critical resource.

Why directories?

>With one lock the (CGI) program had been failing catastrophically on 
>about one in 10**4 invocations.  I estimate that it will now fail in 
>about one in 10**8 invocations.  Needless to say, this hasn't happened 
>yet.  But Murphy's Law may get me, and I will go to *three* locks, and 
>take my chances on one in 10**12!

If it fails, you're doing something wrong.  Are you grabbing the locks via
Decker's Algorithm?  With it, you can assure mutual exclusion, assuming you
can have some shared resources that the two processes can reference.

It works thus:

Process1                           Process2

p1.state = active                   p2.state = active
if(p2.state == active)              if(p1.state == active)
 if(turn == p2)                      if(turn == p1)
  p1.state = inactive                 p2.state = inactive
  while(p2.state == active) ;         while(p1.state == active) ;
  p1.state = active                   p2.state = active;
 fi                                  fi
fi                                  fi
execute code                        execute code
p1.state = inactive                 p2.state = inactive
turn = p2                           turn = p1

I think I got it right...

Of course, the while loop is a busy wait, so if you can make it a
spinlock (is there such a thing in Windows?), it'd be much nicer on
the CPU.

Under UNIX, you can have the while() loop changed into a spinlock.

And p1.state, p2.state, and turn should be "shared" in memory, assuming
Windows offers that functionality (I'd assume NT, at least, has it)

Under UNIX, they can be a shared memory region.

-- DN


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

Date: Thu, 05 Nov 1998 16:23:05 -0600
From: Matt Turner <matt@godzilla.tamu.edu>
Subject: Script calling Remote Script
Message-Id: <36422549.BBC6D35@godzilla.tamu.edu>

I understand how to get one perl cgi script to call another perl script
on the same machine, but how to you have one perl script call a remote
perl cgi script?

Here is what I am trying...I want to be able to send data to a cgi
script on my webserver/firwall and have that cgi script send the same
data to another cgi script running on a webserver behind the firewall.
I don't need a response or anything from the scripts, I just need to
data to get all the way to the internal machine.

Any ideas?

Thanks ahead of time,
Matt



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

Date: Thu, 05 Nov 1998 14:16:59 -0800
From: Steve Foley <sfoley@cisco.com>
Subject: Trouble building latest version...
Message-Id: <364223DB.6B52A24F@cisco.com>

I'm trying to build 5.005.50 on solaris using the multi-thread feature
and when I compile regcomp.c it blows up. The problem is that the perl
flags have been defined for the threaded case as thr->(whatever flag
field) and "thr" is not defined anywhere. Anyone have any experience
with this problem? Please forgive me if this is a really naive question
as this is the first time I've ever tried building Perl from scratch,
and certainly the first time I've invoked threading in Perl.

Steve Foley
Client/Server Technologies - CORBA/IIOP Java C++ NSAPI
Light Software - http://www.lightsw.com



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

Date: Wed, 04 Nov 1998 10:45:06 +0000
From: Alan Burlison <Alan.Burlison@uk.sun.com>
To: "Matthew O. Persico" <mpersico@erols.com>
Subject: Re: uninstalling modules
Message-Id: <36403032.ABA8992A@uk.sun.com>

"Matthew O. Persico" wrote:

> One teeny weeny shell scrip to find .packlist files.
> One unInstall.pl script to uninstall a module.
> 
> Flame away. If it's any good, I'll send it to p5p.

With recent Perls (5.005+) all the stuff needed to do this is provided
already - check out the documentation ExtUtils::Packlist and
ExtUtils::Installed.  The following even teenier script does the job
for me:

use strict;
use IO::Dir;
use ExtUtils::Packlist;
use ExtUtils::Installed;

sub emptydir($)
{
my ($dir) = @_;
my $dh = IO::Dir->new($dir) || return(0);
my @count = $dh->read();
$dh->close();
return(@count == 2 ? 1 : 0);
}

# Find all the installed packages
print("Finding all installed modules...\n");
my $installed = ExtUtils::Installed->new();

foreach my $module (grep(!/^Perl$/, $installed->modules()))
   {
   my $version = $installed->version($module) || "???";
   print("Found module $module Version $version\n");
   print("Do you want to delete $module? [n] ");
   my $r = <STDIN>; chomp($r);
   if ($r && $r =~ /^y/i)
      {
      # Remove all the files
      foreach my $file (sort($installed->files($module)))
         {
         print("rm $file\n");
         unlink($file);
         }
      my $pf = $installed->packlist($module)->packlist_file();
      print("rm $pf\n");
      unlink($pf);
      foreach my $dir (reverse(sort($installed->directory_tree($module))))
         {
         if (emptydir($dir))
            {
            print("rmdir $dir\n");
            rmdir($dir);
            }
         }
      }
   }


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

Date: Thu, 05 Nov 1998 23:55:48 GMT
From: reinoud@xs4all.nl (Reinoud van Leeuwen)
Subject: Weird problem compiling Perl on HP-Ux
Message-Id: <36433a6b.1009932@news.xs4all.nl>

Hi,

I experience a weird problem while trying to build Perl on a HP-Ux
10.20 system: during the build, the library directories are being made
recursively. When I killed the make I had directories like:

/opt/perl5.005_01/lib/perl5.005_01/perl5.005_01/perl5.005_01/perl5.005_01/perl5.005_01/perl5.005_01/perl5.005_01/perl5.005_01/

Has anyone experienced something like this and knows the answer?

TIA,


__________________________________________________
"Nothing is as subjective as reality"
Reinoud van Leeuwen       reinoud@xs4all.nl
http://www.xs4all.nl/~reinoud
__________________________________________________


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

Date: Thu, 5 Nov 1998 22:56:27 GMT
From: sherman@unx.sas.com (Chris Sherman)
Subject: Re: why use do BLOCK?
Message-Id: <F1z123.Fou@unx.sas.com>

In <3631f8ff.344938768@news.earthlink.net> boson@earthlink.net (Boson) writes:

>Hello,
>I have been looking for examples that shows the benefit of using the
>do BLOCK format. I could only find examples like this one:

>   $file = do {local $/; scalar <FILE>};
>versus
>   $/ = undef;
>   $file = <FILE>;

>But that merely looks like a question of style to me. It would be
>great if someone had a real nifty example of how to use do{...} that
>would convince me to use do more often.

I do stuff like this alot...  Tom doesn't like it, but oh well...

   open FIN, $filename or do {
      print "Blew it:  Could not open file $filename.  $!\n";
      return $error_code
   };

-- 
     ____/     /     /     __  /    _  _/    ____/
    /         /     /     /   /      /     /          Chris Sherman
   /         ___   /        _/      /          /
 _____/   __/   __/   __/ _\    _____/   _____/           sherman@unx.sas.com


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

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

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