[10118] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3711 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 14 14:08:02 1998

Date: Mon, 14 Sep 98 11:00:43 -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           Mon, 14 Sep 1998     Volume: 8 Number: 3711

Today's topics:
        Catching signals in subroutines and living... <chris.hinds@arm.com>
    Re: CGI Editng and posting on the fly (Jacqui Caren) (Jacqui Caren)
    Re: COBOL and Perl (Craig Berry)
    Re: Comments on my Code? <upsetter@ziplink.net>
    Re: Easy solution but cant seem to find it??? <jdporter@min.net>
    Re: Help me... <camerond@mail.uca.edu>
        HELP REQ: NET::SMTP For NT, Please fix this script. letterman@my-dejanews.com
    Re: Insert SQL in Perl script (Jacqui Caren) (Jacqui Caren)
        IO::Pipe and select() <ets@egnetz.uebemc.siemens.de>
        NET::SMTP For NT, Please fix this script. letterman@my-dejanews.com
    Re: New PERL user looking for sites running PERL5 on an (Jacqui Caren) (Jacqui Caren)
    Re: Perl & Java - differences and uses <jdporter@min.net>
    Re: Perl & Java - differences and uses <borg@imaginary.com>
        Perl om DOS??? <jmd@digex.net>
    Re: PERL routine using wtmp? <eashton@bbnplanet.com>
    Re: Possible Perl memory problem <markem@flash.net>
        Raleigh/Durham/RTP Perl Mongers? (John Klassa)
        regex help <eglamkowski@angelfire.com>
    Re: Seeking Perl program to transfer files between mach <markem@flash.net>
    Re: Seeking Perl program to transfer files between mach <eashton@bbnplanet.com>
        Socket performance problems under Win 32 billy_gronk@my-dejanews.com
    Re: Suidperl is obstructed, but by what? <eashton@bbnplanet.com>
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Mon, 14 Sep 1998 10:47:28 -0500
From: "Chris N. Hinds" <chris.hinds@arm.com>
Subject: Catching signals in subroutines and living...
Message-Id: <35FD3A90.B2FA3385@arm.com>

I need to know how to catch a signal (in this case, SIGPIPE)
from within a subroutine and exit this routine *and* its
caller back to a loop construct, then exit that to another
loop.  

Here it is graphically:

A: for(...) {
	B: while(...) {
		/.../ && do {&C; next B; }
	}
}

sub C {
	&D ;
}
sub D {
	caught the SIGPIPE
}

In the SIGPIPE handler, I want to return from D, return from
C, last B, and next A.

I have so far:

$SIG{PIPE} = \&Pipe_Handler ;

sub Pipe_Handler {
	print "Caught SIGPIPE... cleaning up\n" ;
	last B ;
}

or, for the 'last B' try 'next A' ... but none of these labels
are visible inside D (D is the scope of the handler, is it not?)
I have tried moving the handler inside C, but the 'return' applies
to the trap handler, not to C. 

How does one do this?

Thanks!

chris

-- 
*********************************************************
* Chris N. Hinds     <><                  512-314-1055
* ARM Austin Design Center           FAX  512-314-1078
* ARM INC                          chris.hinds@arm.com
*********************************************************


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

Date: Mon, 14 Sep 1998 16:15:56 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui Caren) (Jacqui Caren)
Subject: Re: CGI Editng and posting on the fly
Message-Id: <EzA7uL.71G@ig.co.uk>

In article <6rf6mg$554$1@nnrp1.dejanews.com>,
 <stabor548@my-dejanews.com> wrote:
>Hello, Let me start by saying That I am making a web site for concert hall,
>What I want to happen is, That a user can input there Ticket #, than it iwll
>look it up and give back y and x cordiates on a picture, The picture being
>the seating chat of the hall, and the cordinates being where the seat is
>located on that picture...  Than I red dot to be placed on the cordinates..
>Than the image regenerated and displayed showing the users exect seat
>location..  I hope I explained my self enough....  Please help me out, I
>would very much apreachate it...

>Please e-mail stabor@gfn.org

 On the assumption that the above does not infer that you are not
prepared to look for responses then download and install GD and GD.pm.
This should (easily) do what you are trying to achieve. One of the
supplied examples (the last time I looked) did exactly this...

I did something (years ago) where we had to take address info and draw
a location dot on a map.

Jacqui

-- 
Email: Jacqui.Caren@ig.co.uk  http://www.ig.co.uk/
Fax  : +44 1483 419 419       http://www.perlclinic.com/
Phone: +44 1483 424 424       http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom



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

Date: 14 Sep 1998 15:57:19 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: COBOL and Perl
Message-Id: <6tjecv$8jn$1@marina.cinenet.net>

Nick Spalding (spalding@iol.ie) wrote:
: The fun with 'proper casing' begins when you deal with personal names,
: MacAdam, FitzWilliam, O'Reilly etc.

Oh, of course!  But that's outside the spec of the original problem.

---------------------------------------------------------------------
   |   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: Mon, 14 Sep 1998 16:18:49 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Comments on my Code?
Message-Id: <JlbL1.62$7C3.843048@news.shore.net>

Russ Allbery <rra@stanford.edu> wrote:

: If you're sending mail to local users, it's pretty much always better to
: write a script that does local delivery rather than going through an MTA
: and then run it on your mail server.  It's much less load on your system.
: If you're sending bulk mail but *not* to local users, you've got a mailing
: list and want to use the various tools already available to run mailing
: lists (opening a separate sendmail process for each message is not a good
: one).

Thanks for the practical suggestions.

: If you aren't sending mail to local users and you don't have a mailing
: list... well, I really can't think of too many other reasons for doing
: this that I wouldn't consider spam.  But they may exist.

Just to set everybody's mind at ease, here is the scenario:

The business has a bunch of business contacts that are being stored in a
custom-built intranet (not Perl) app. We needed to send out a form letter
to ~50-60 of them. These are people who we already have a business
relationship with, so it's not spam. However, we're unlikely to want to
send out more than a few of these mass-mailings a year, so it's really not
worth setting up a full-featured mailing list manager like majordomo. 
Since the names and addresses are being stored in a non-perl app that I
didn't write, the easiest thing to do was to export a list of email
addresses into a text file and run it through my mailgun app.  This may
have not been the most elegant solution, but seemed to be the quickest and
most practical for our purposes. 

--Art

--------------------------------------------------------------------------
                    National Ska & Reggae Calendar
                  http://www.agitators.com/calendar/
--------------------------------------------------------------------------


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

Date: Sun, 13 Sep 1998 12:40:10 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Easy solution but cant seem to find it???
Message-Id: <35FBF56A.F2AA44B0@min.net>

MercuryZ wrote:
> 
> I wish to use LYNX to help automate some shareware downloads.
> When you are in your telnet shell, and you type:
> 
> lynx www.shareware.com/directory/filename.zip
> 
> a message will come up asking you to select d for download
> or c for cancel.  In perl, I am having trouble pressing the
> d automatically.  In other words, I am able to system "lynx..."
> but when the message comes up to select D or C I simply
> can't figure out how to get perl to select D or C for me.

So you're using lynx from within a perl program?
That means you want to use lynx non-interactively.
Have you read the lynx man page?
Typing 'lynx -help' also gives you an overview of the
command line options for using lynx in non-interactive mode
(among other things).
You probably want lynx -dump or lynx -source.

hth,
John Porter


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

Date: Mon, 14 Sep 1998 11:13:43 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Help me...
Message-Id: <35FD40B7.9A7DC82E@mail.uca.edu>

[cc'd to mk]

Can you get this to compile? I can't even get it started because you are
missing a curly brace down at the bottom. Please get something to check
your (Perl) grammar. (perl actually does a good job itself).

Cameron
camerond@mail.uca.edu 

Mattias Kristoffersen wrote:
> 
> Soon im going nuts!
> Whats wrong, this scrip doesn4t work as it should.
> The allready voted function dosent work...
> 
> Mattias
> 
> #!/usr/bin/perl
> #
> $ip = $ENV{REMOTE_ADDR};
> $filen = "resultat.dat";
> if ($ENV{'REQUEST_METHOD'} eq 'GET') {
> $buffer = $ENV{'QUERY_STRING'};
> }
> else {
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> }
> @pairs = split(/&/, $buffer);
> foreach $pair (@pairs) {
> ($name, $value) = split(/=/, $pair);
> # Un-Webify plus signs and %-encoding
> $value =~ tr/+/ /;
> $value =~ tr/\|/ /;
> $value =~ s/\r//g;
> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
> $value =~ s/<!--(.|\n)*-->//g;
> $value =~ s/<([^>]|\n)*>//g;
> $value =~ s/\n/\\n/g;
> $FORM{$name} = $value;
> }
> &error unless $FORM{'name'};
> # Vppna filen
> $i =0;
> open(FILE, ">>resultat.dat") || die "Can't open resultat.dat: $!\n";
> $i+=s/$ip//g;
> # Stdng filen
> close (FIL);
> if ($i ==0) {
> open(FILE, ">>resultat.dat") || die "Can't open resultat.dat: $!\n";
> flock(FILE, 2);
> print FILE "$ip|$FORM{'name'}|$FORM{'vote'}|\n";
> flock(FILE, 8);
> close(FILE);
> 
> # Startvdrde 0
> $rader = 0;
> $ja = 0;
> $nej = 0;
> # Vppna filen
> open (FIL,"$filen");
> # Lds en rad i taget
> while (<FIL>) {
> # Rdkna upp antalet rader
> $rader++;
> $ja++ if /Ja/;
> $nej ++ if /Nej/;
> }
> # Stdng filen
> close (FIL);
> print "Content-type: text/html\n\n";
> print "Thanks for voting<br>";
> print "$rader har rvstat<br>";
> print "$ja har rvstat ja<br>";
> print "$nej har rvstat Nej<br>";
> }
> else
> 
> print "Content-type: text/html\n\n";
> print "You have allready voted!<br>"; }
> exit;
> sub error {
> print "Content-type: text/html\n\n";
> print "ERROR<br>";
> exit;}


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

Date: Mon, 14 Sep 1998 17:15:25 GMT
From: letterman@my-dejanews.com
Subject: HELP REQ: NET::SMTP For NT, Please fix this script.
Message-Id: <6tjivc$8nu$1@nnrp1.dejanews.com>

I wrote this script to work under unix, and I need to convert it to work in
NT, however I couldn't find anything on net::smtp on cpan nor do I have a ref
anymore. Can someone plz fix this small section of script so it will work
under nt.

Begin Attached Script --- >8 #!/usr/bin/perl #!/usr/bin/perl $mailprog =
'/usr/bin/sendmail'; $me = 'admin@actsoft.com'; local($sec, $min, $hour,
$mday, $mon, $year, $wday, $yday, $isdst) = localtime; local($mmon) =
("01","02","03","04","05","06","07","08","09","10","11","12") [$mon];
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @datas = split(/&/, $buffer);
foreach $data (@datas){  ($name, $value) = split(/=/, $data);  $value =~
tr/+/ /;  $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; 
$FORM{$name} = $value;}

if ($FORM{'mail'} ne '')

{open(echo1,"|$mailprog $me");}
{print echo1 "From:    $FORM{'semail'} \n";}
{print echo1 "         $FORM{'sname'} \n\n";}
{print echo1 "Company: $FORM{'company'} \n";}
{print echo1 "         $FORM{'address'} \n";}
{print echo1 "         $FORM{'city'}, $FORM{'state'} $FORM{'zip'} \n";}
{print echo1 "Phone:   $FORM{'phone'}\n\n";}
{print echo1 "Comments on $FORM{'product'}: \n";}
{print echo1 "    $FORM{'comment'}\n";}
close(echo1);

{open(echo2,"|$mailprog -t");}
{print echo2 "To: $FORM{'semail'}\n";}
{print echo2 "From: $me\n";}
{print echo2 "Subject: Thank you for contacting us. \n\n";}
{print echo2 "Thank You for your feedback $FORM{'sname'},\n";}
{print echo2 "This is an automated return letter to acknowledge your email was
recieved on $mmon/$mday/19$year at $hour:$min. \n";}
{print echo2 "Thank you for your comments, and We hope you found our Website
useful and easy to navigate.\n\n\n";}
close(echo2);

print "Content-type: text/html\n\n";
print "<html>\n";
print "<head><title>Thank You for Your Comments</title></head>\n";
print "<BODY background=actback.gif BGColor=#FFFFF Text=#00000 Link=#0000FF
VLink=#FF00FF ALink=#FF0000>\n";
print "<CENTER><FONT SIZE=4 COLOR=#00000><B>$FORM{'name'}, Your Feedback was
recieved.\n";
print "<BLOCKQUOTE>\n";
print "$mmon/$mday/19$year, $hour:$min<BR>\n";
print "From:    $FORM{'semail'} \n";
print "         $FORM{'sname'} \n\n";
print "Company: $FORM{'company'} \n";
print "         $FORM{'address'} \n";
print "         $FORM{'city'}, $FORM{'state'} $FORM{'zip'} \n";
print "Phone:   $FORM{'phone'} \n\n";
print "Comments on $FORM{'product'}: \n";
print "Message Body Intentionally excluded \n";
print "</BLOCKQUOTE> \n";
print "</BODY> \n";
print "</html> \n";
End of Attached Script ---- >8

Please reply to letterman@actsoft.com as well. Thank you in advance for your
help.

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


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

Date: Mon, 14 Sep 1998 14:44:00 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui Caren) (Jacqui Caren)
Subject: Re: Insert SQL in Perl script
Message-Id: <EzA3LC.6GG@ig.co.uk>

In article <35D48649.588D@digi-q.com>, Alex Guberman  <alex@digi-q.com> wrote:
>Hi,
>
>Does anybody know how to embed SQL in Perl, so I can work with mSQL?  A
>sample would be great.  All I have so far is:
>

see DBI under CPAN.

 see perldoc DBI (after installation to get an overview of the interface)

http://www.arcarna.com/technologia/DBI/

Jacqui
-- 
Email: Jacqui.Caren@ig.co.uk  http://www.ig.co.uk/
Fax  : +44 1483 419 419       http://www.perlclinic.com/
Phone: +44 1483 424 424       http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom



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

Date: Mon, 14 Sep 1998 18:29:51 +0200
From: "Hr. Jochen Stenzel" <ets@egnetz.uebemc.siemens.de>
Subject: IO::Pipe and select()
Message-Id: <35FD447F.5BBB8D1C@egnetz.uebemc.siemens.de>

Hello,

as I understood select(<descriptors>), it lets the process sleep until a
certain handle is ready. In case of reading, this means that select()
returns if there is anything to read, am I right? This works as awaited
with STDIN:

- snip ---

use IO::Handle;

STDIN->autoflush;
($rin, $rout)=fhbits(qw(STDIN));
$found=select($rout=$rin, undef, undef, 70);
warn "[DBG] Here!\n";

- snip ---

(The fhbits() function comes from the Camel-Book select() examples.)

However, if I try the same with an IO::Pipe object (which is an
IO::Handle object), select() returns IMMEDIATELY, even if there was
nothing written to the pipe:

- snip ---

 # open pipe
 my $pipePaCh=new IO::Pipe; # parent -> child;

 ...

 # fork
  FORK:
    if ($pid=fork)
   {
    # parent

    # transform the parents pipe handle
    $pipePaCh->writer; $pipePaCh->autoflush;
   }
    elsif (defined $pid)
   {
    # transform the childs pipe handle
    $pipePaCh->reader; $pipePaCh->autoflush;

    # wait for a message
    my ($rin, $rout)=fhbits($pipePaCh);
    my ($found)=select($rout=$rin, undef, undef, 100);
    warn "[DBG] $found\n";
   }
   ...

- snip ---

Is it possible to use select() here the same way as for another handle,
to sleep until anything is written to the pipe?

Thanks in advance

                        Jochen



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

Date: Mon, 14 Sep 1998 17:14:37 GMT
From: letterman@my-dejanews.com
Subject: NET::SMTP For NT, Please fix this script.
Message-Id: <6tjitt$8k1$1@nnrp1.dejanews.com>

I wrote this script to work under unix, and I need to convert it to work in
NT, however I couldn't find anything on net::smtp on cpan nor do I have a ref
anymore. Can someone plz fix this small section of script so it will work
under nt.

Begin Attached Script --- >8 #!/usr/bin/perl #!/usr/bin/perl $mailprog =
'/usr/bin/sendmail'; $me = 'admin@actsoft.com'; local($sec, $min, $hour,
$mday, $mon, $year, $wday, $yday, $isdst) = localtime; local($mmon) =
("01","02","03","04","05","06","07","08","09","10","11","12") [$mon];
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @datas = split(/&/, $buffer);
foreach $data (@datas){  ($name, $value) = split(/=/, $data);  $value =~
tr/+/ /;  $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; 
$FORM{$name} = $value;}

if ($FORM{'mail'} ne '')

{open(echo1,"|$mailprog $me");}
{print echo1 "From:    $FORM{'semail'} \n";}
{print echo1 "         $FORM{'sname'} \n\n";}
{print echo1 "Company: $FORM{'company'} \n";}
{print echo1 "         $FORM{'address'} \n";}
{print echo1 "         $FORM{'city'}, $FORM{'state'} $FORM{'zip'} \n";}
{print echo1 "Phone:   $FORM{'phone'}\n\n";}
{print echo1 "Comments on $FORM{'product'}: \n";}
{print echo1 "    $FORM{'comment'}\n";}
close(echo1);

{open(echo2,"|$mailprog -t");}
{print echo2 "To: $FORM{'semail'}\n";}
{print echo2 "From: $me\n";}
{print echo2 "Subject: Thank you for contacting us. \n\n";}
{print echo2 "Thank You for your feedback $FORM{'sname'},\n";}
{print echo2 "This is an automated return letter to acknowledge your email was
recieved on $mmon/$mday/19$year at $hour:$min. \n";}
{print echo2 "Thank you for your comments, and We hope you found our Website
useful and easy to navigate.\n\n\n";}
close(echo2);

print "Content-type: text/html\n\n";
print "<html>\n";
print "<head><title>Thank You for Your Comments</title></head>\n";
print "<BODY background=actback.gif BGColor=#FFFFF Text=#00000 Link=#0000FF
VLink=#FF00FF ALink=#FF0000>\n";
print "<CENTER><FONT SIZE=4 COLOR=#00000><B>$FORM{'name'}, Your Feedback was
recieved.\n";
print "<BLOCKQUOTE>\n";
print "$mmon/$mday/19$year, $hour:$min<BR>\n";
print "From:    $FORM{'semail'} \n";
print "         $FORM{'sname'} \n\n";
print "Company: $FORM{'company'} \n";
print "         $FORM{'address'} \n";
print "         $FORM{'city'}, $FORM{'state'} $FORM{'zip'} \n";
print "Phone:   $FORM{'phone'} \n\n";
print "Comments on $FORM{'product'}: \n";
print "Message Body Intentionally excluded \n";
print "</BLOCKQUOTE> \n";
print "</BODY> \n";
print "</html> \n";
End of Attached Script ---- >8

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


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

Date: Mon, 14 Sep 1998 16:10:52 GMT
From: Jacqui.Caren@ig.co.uk (Jacqui Caren) (Jacqui Caren)
Subject: Re: New PERL user looking for sites running PERL5 on an NT server with  oracle DB
Message-Id: <EzA7M4.6z8@ig.co.uk>

In article <35db4e4a.16748115@news.btinternet.com>,
Jonathan Stowe <Gellyfish@btinternet.com> wrote:
>On Wed, 19 Aug 1998 08:20:21 -0600, Debra Ruch wrote :
>
>>Hi,
>>
><snip>
>>
>>Firstly, is it possible to run PERL5 on an NT server connecting to an oracle
>>dB (v7.2 and v7.3).  Our clients are running both windows 95 and NT.
>>
>Absolutely given Win32::ODBC and the appropriate odbc driver or some
>such device.

DBI and DBD:;Oracle is a much better choice in most scenarios
it is lighter, faster and more flexible for Oracle.

>>Secondly, does PERL require its own listener on the server...do you use
>>tcp-srv ?

If you have configured TNS to use IPC then no, If you are using a remote
oracle server (of a different box) then yes you will need to run a
TNS listener on the remote platform.

Jacqui

-- 
Email: Jacqui.Caren@ig.co.uk  http://www.ig.co.uk/
Fax  : +44 1483 419 419       http://www.perlclinic.com/
Phone: +44 1483 424 424       http://www.perl.co.uk/
Paul Ingram Group Ltd,140A High Street,Godalming GU7 1AB United Kingdom



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

Date: Sun, 13 Sep 1998 12:07:07 -0400
From: John Porter <jdporter@min.net>
Subject: Re: Perl & Java - differences and uses
Message-Id: <35FBEDAB.BF88758C@min.net>

George Reese wrote:
> 
> :>(and perl still has memory
> :>issues, as does python or Java--just with perl it takes more talent to
> :>construct your apps so that the memory issues are not so important).

You obviously don't know what you're talking about.
It is VERY hard in Perl to program dangerously wrt memory issues.


> You also have to make sure you are
> not allocating a ton of memory and retaining references to it without
> nulling those references.

Yes, you can have that problem if you have circular references.
But those actually are rather rare in practice.
And they're very easy to take care of -- as long as you remember
to do it.


> David Formosa wrote:
> : 
> : Since peaple can never aggry on which is the best way to do something,
> : why should we forcably limmit them to one model or anthour?
> 
> That is a fallacy.

Well, it was actually a question; but the implicit statement -- "We
should not forcibly limit programmers to one model" -- is not a truth
statement, so can not be called a "fallacy".  It is an opinion, and
many people -- OO purists perhaps not among them -- share it.

-- 
John Porter


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

Date: Mon, 14 Sep 1998 17:23:35 GMT
From: George Reese <borg@imaginary.com>
Subject: Re: Perl & Java - differences and uses
Message-Id: <ricL1.1549$E9.5322015@ptah.visi.com>

In comp.lang.java.programmer John Porter <jdporter@min.net> wrote:
: George Reese wrote:
:> 
:> Natural language is a superset of any computer language I certainly
:> have ever programmed in.  That would include both perl and python.  I
:> honestly do not know how a computer language could express something
:> that you could not express in English--how would you even talk about
:> such a thing?

: You are saying that all rational human thought can be efficiently
: expressed in (say) English.  This is absurd.  Just like much of
: what you say.  Take a hike.  Better yet, go brush up on your
: lambda calculus, first-order logic, and chaos theory.

Well, I think after this I will just ignore your contributions to this
thread.

-- 
George Reese (borg@imaginary.com)       http://www.imaginary.com/~borg
PGP Key: http://www.imaginary.com/servlet/Finger?user=borg&verbose=yes
   "Keep Ted Turner and his goddamned Crayolas away from my movie."
			    -Orson Welles


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

Date: Mon, 14 Sep 1998 13:25:11 -0400
From: "James M. Darlack" <jmd@digex.net>
Subject: Perl om DOS???
Message-Id: <Pine.SUN.3.96.980914132128.13772D-100000@access2.digex.net>


Hi,

I need to do some testing of a DOS applicatio, that is ruinning with a
tcp/ip connection.  We would like to control it with a perl script. DOes
anyone know of a perl that runs under DOS?

Note. Since it is a DOS application, and we donot need windows, we are
trying to run on a stripped down group of PCs, that donot have Windows of
any flavor... only DOS. So Im also looking for a tcp/ip tht will run on
DOS only, and have telnet and ftp clients available.

Thanks in advance for your help!

Please respond to jmd@access.digex.net

Jim




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

Date: Mon, 14 Sep 1998 16:15:02 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: PERL routine using wtmp?
Message-Id: <35FD3EA5.D3DFC5AE@bbnplanet.com>

photuris wrote:

> Does something like that already exist?

This isn't a Perl question, but you might try Big Brother. 
http://maclawran.ca/bb-dnld/

e.


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

Date: Mon, 14 Sep 1998 10:56:36 -0500
From: "Mark Manning/Muniz Eng." <markem@flash.net>
Subject: Re: Possible Perl memory problem
Message-Id: <35FD3CB4.167E@flash.net>

Jonathan Stowe wrote:
> 
> It is possible that the amount of data you describe could prove to be
> too much when handled as per your code.
> 
> It might behove you to make a test version of your code that does:
> 
>    open( THEFILE, "myfile.dat" ) || die $!;
>    while (<THEFILE>)
>      {
>         print $amount += length($_),"\n";
>         push @oldInfo,$_;
>      }
>      close( THEFILE );
> 
> to see if it is the reading in of the data that causes the problem.
> 
> You have to bear in mind that you are making at least two copies of
> your data into @oldinfo and @theinfo and manipulating the data therein
> so given the amount of memory you have available you might have some
> problems.
> 

Tried it.  The above works.  I can load in the entire set of data.  It
comes to a little more than 1.5 times the size of the original data
(approximately 80MB of memory are used).

Even at 80MB, if I have 160MB of ram and a 200MB swap partition - should
not 360MB of memory be more than enough to perform a sort?

What I've done:

I've given up on Perl being able to handle this and I have now switched
over to using the system sort routine to sort the information.  The
system sort routine takes about a meg (1MB) of memory to do the sort and
it doesn't take much more time than Perl would under normal
circumstances.

Hopefully all of the shorts currently residing within Perl will be
removed soon.  Presently there are about 1059 (if I remember correctly)
locations within the Perl code where the word "short" appears.  Some are
just comments but there were one or two which looked like they dealt
with stack information.  These are the ones which I feel are causing
this problem.  I'm tempted to mess around with the version of the code I
have at home to see if this will alleviate the problems.  However, like
many people, I've not got a lot of spare time (working on six projects
at once tends to do that to a person.  :-) ).  Anyway, at least I
brought this to everyone's attention.


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

Date: 14 Sep 1998 17:13:25 GMT
From: klassa@aur.alcatel.com (John Klassa)
Subject: Raleigh/Durham/RTP Perl Mongers?
Message-Id: <6tjirl$kto$1@aurwww.aur.alcatel.com>

There was a sign-up sheet for an RTP, NC Perl Mongers group at the
perl conference.  As I recall, my signature was #2 -- Jeff Layton (or
J-something Layton, anyway :-)) was #1.  Is there interest in forming a
group?  Is anyone leading the effort?

Thanks,
John

-- 
John Klassa / Alcatel Telecom / Raleigh, NC, USA <><


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

Date: Mon, 14 Sep 1998 17:37:16 GMT
From: Edward Glamkowski <eglamkowski@angelfire.com>
Subject: regex help
Message-Id: <35FD540C.196@angelfire.com>

I am processing a file containing addresses, and need to remove all
periods in the file, EXCEPT for those associated with P.O. or U.S.
I have the following:
    if ($addr1 =~ /(\w+\.)+/)  { $addr1 =~ s/(\w+)\./$1 /g; }

But that obviously doesn't take into account the U.S. or P.O.
The problem I have is what happens when you run into a line containing
both U.S. AND a period somewhere else in the line.  How do I remove the
periods from one 'word' and not another?

For example, if I have a line of address which reads:
U.S. Rte. 22
(most addresses span more than one line, but that really shouldn't 
cause any difficulties in and of itself).

What I want in the end is 'U.S. Rte 22', not 'US Rte 22'

Any pointers would be much appreciated :)

-- 
               "Have you no sense of decency, sir?
        At long last, have you left no sense of decency?"

http://www.angelfire.com/nj/eglamkowski/null.html <-- Null webring
http://www.angelfire.com/nj/eglamkowski/eia.html  <-- Eia webring


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

Date: Mon, 14 Sep 1998 11:01:33 -0500
From: "Mark Manning/Muniz Eng." <markem@flash.net>
Subject: Re: Seeking Perl program to transfer files between machines (sort of like TFTP)
Message-Id: <35FD3DDD.2781@flash.net>

Have you looked at libwww which has a built in FTP protocol?  Using
libwww you should be able to set up multiple FTP logins (by putting
everything in an array) and then just let it log in to each site, check
the file dates, and then upload the updates one after the other.

Just a thought.  :-)


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

Date: Mon, 14 Sep 1998 16:43:05 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Seeking Perl program to transfer files between machines (sort of like TFTP)
Message-Id: <35FD4537.970B9B1D@bbnplanet.com>

Jeremy Mathers wrote:

> Thanks for the tip.  I checked it out, and it looks impressive (haven't
> downloaded it yet) - but it isn't really what I am looking for.  It is
> close, in that primarily what I am doing is syncing up directories, but,
> from looking at the description of how to set it up, it looks like it is
> oriented towards a small number of known machines (like 2 or 3).  I need
> something I can install on many different machines - and I'd rather not have
> to maintain config files all over the place.

Have you tried rsync? You can get it at http://samba.anu.edu.au/rsync.

DESCRIPTION
     rsync is a program that behaves in much the  same  way  that
     rcp  does,  but  has  many  more  options and uses the rsync
     remote-update protocol to  greatly  speedup  file  transfers
     when the destination file already exists.

     The rsync remote-update protocol allows  rsync  to  transfer
     just  the  differences  between two sets of files across the
     network link, using an efficient  checksum-search  algorithm
     described  in  the  technical  report  that accompanies this
     package.

     Some of the additional features of rsync are:

     o    support for copying links, devices, owners, groups  and
          permissions

     o    exclude and exclude-from options similar to GNU tar

     o    a CVS exclude mode for ignoring the same files that CVS
          would ignore

     o    can use any transparent remote shell, including rsh  or
          ssh

     o    does not require root privileges

     o    pipelining of file transfers to minimize latency costs

     o    support for anonymous or  authenticated  rsync  servers
          (ideal for mirroring)


> And the server side receives the file(s), preserving mode (Unix permissions)
> and access time.  Xfer is a short (43 line) Perl program.

Shorter than your .sig :)

e.


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

Date: Mon, 14 Sep 1998 17:26:27 GMT
From: billy_gronk@my-dejanews.com
Subject: Socket performance problems under Win 32
Message-Id: <6tjjk2$9a9$1@nnrp1.dejanews.com>

Hi,

I am having performance problems when I try and run client server programs
between NT/95 and UNIX. When I run both client and server on UNIX there is no
problem and it runs very quickly (c. 3-4 secs) but is taking in the order of
minutes on Windows. I am using the IO::Socket Module with perl 5.004_02.

Any help or advice would be very gratefully appreciated,

B.

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


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

Date: Mon, 14 Sep 1998 17:42:54 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Suidperl is obstructed, but by what?
Message-Id: <35FD533B.5F963E3C@bbnplanet.com>

Ekenberg wrote:

> So that's not it.
> Anybody got any suggestions?

You might try 'truss' on Solaris, et. al., 'trace' on SunOS, or 'par' on
SGI. This will give you an idea of what the process is doing. It may be
that it is not located where it should be. You could also try the
debugger.

e.

"All of us, all of us, all of us trying to save our immortal souls, some 
ways seemingly more round-about and mysterious than others. We're having
a good time here. But hope all will be revealed soon." -=])R. Carver([=-


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

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

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