[9152] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2770 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 30 19:07:30 1998

Date: Sat, 30 May 98 16:00:26 -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           Sat, 30 May 1998     Volume: 8 Number: 2770

Today's topics:
    Re: Beginner problems with Win32 Perl <andrew@boothman.easynet.co.uk>
    Re: Beginner problems with Win32 Perl <camerond@mail.uca.edu>
        Calling form fields with Variables? <rayr@accessus.net>
    Re: Calling form fields with Variables? <lr@hpl.hp.com>
    Re: Calling form fields with Variables? <danboo@negia.net>
    Re: Calling form fields with Variables? <danboo@negia.net>
    Re: children processes (Charles DeRykus)
    Re: children processes (Charles DeRykus)
    Re: DB_File database load corrupting records---help? (Leslie Mikesell)
        Dereferencing SV** <jimmyoh@pacific.net.sg>
    Re: Don't Know how to decrypt using PERL <lr@hpl.hp.com>
    Re: Don't Know how to decrypt using PERL (John Moreno)
        Fork() - functionality in NT Perl? (Jeff Winchester)
    Re: i need help...much!!!...anyone, please... (Gary M. Greenberg)
    Re: Leap Year Script... <lr@hpl.hp.com>
        matching a zero+ length string with a definite end? empires@ivillage.com
    Re: matching a zero+ length string with a definite end? <danboo@negia.net>
    Re: matching a zero+ length string with a definite end? (Craig Berry)
        Net::Telnet problems (Jesse Kempa)
        Problems with select(). (Tuomas Toivonen)
    Re: seek advice on simple first program (Andre L.)
    Re: seek advice on simple first program <lr@hpl.hp.com>
        Translating first letter of sentence into a capital (malgosia askanas)
        Whois lookup <raqua@t-online.de>
        X marks the spot, was Re: Best tool? <flavell@mail.cern.ch>
    Re: X marks the spot, was Re: Best tool? <merlyn@stonehenge.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Sat, 30 May 1998 21:23:24 +0100
From: Andrew Boothman <andrew@boothman.easynet.co.uk>
To: holy-ghost@nwu.edu
Subject: Re: Beginner problems with Win32 Perl
Message-Id: <35706ABC.E4BC78A8@boothman.easynet.co.uk>

James S Kang wrote:
> 
> Ok, I'm just starting to mess with perl, and I don't have a book right now.
> 
> I'm running a very simple hello world type script that's called by a form
> that has this script as its ACTION and uses the POST method.
> 
> Now, the first line of the script is supposed to have the location of the
> perl interpreter, right? Every example I've seen uses the regular unix
> interpreter, so the line looks something like "#! usr/bin/perl".
> 
> On this machine, the interpreter is located at C:\apps\Perl5\bin\perl.exe,
> so I put in "#! C:\apps\Perl5\bin\perl.exe". Is this right?

#!\apps\perl5\bin\perl.exe is probably better as a doubt that perl
expects to see colons in the path.

> 
> I never seem to be able to get it to run. Netscape keeps popping up a window
> that says it's going to download it as a file of type application/x-perl.
> 
> Does this mean I'm not pointing to the interpreter correctly? If so, how do
> I do it?

This might seem like an obvious question, but you are running this
through a web server right?

Check the documentation that comes with your web server for details on
how it likes to set up CGI.

Feel free to mail me with any problems.

--
Andrew Boothman : andrew@boothman.easynet.co.uk 
(http://easyweb.easynet.co.uk/~boothman/andrew/)
"Yahoo is a search engine.
 Netanyahoo is an Israeli search engine"
            -Robin Williams



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

Date: Sat, 30 May 1998 16:08:27 -0500
From: Cameron Dorey <camerond@mail.uca.edu>
Subject: Re: Beginner problems with Win32 Perl
Message-Id: <3570754B.E75FE42F@mail.uca.edu>

James S Kang wrote:
> 
> Ok, I'm just starting to mess with perl, and I don't have a book right now.

RUN, do not walk, to the nearest bookstore and purchase a copy of
"Learning Perl on Win32 Systems," by Schwartz, Olsen, and Christiansen.
You're going to have to do it sometime, and now's the best time. You
will actually have all your questions answered _much_ faster in that
book (because you will have a lot of them) than in this forum (or any
other online forum, for that matter).

Actually, that's the best advice anyone on this newsgroup will give you,
because it's the best thing anyone in your situation right now can do
(IMHO, of course), otherwise you'll be nickle-and-dimeing yourself
through one microproblem after another for way too long.

> 
> [all the specific stuff snipped]

BTW, there is a chapter on CGI in the book, that's what you are trying
to do here.
> 
> Please reply through e-mail (jkang@nwu.edu) if you can help.

If I reply through email, it's *always* to the "Reply-to:" address (why
should I have to work harder - type - to give someone free help), and
yours is screwed up, so I hope you read the newsgroup.

Cameron
camerond@mail.uca.edu

(To reply by email, replace "@" with "@".) - I love that, wish I could
remember whose note I saw it on first.


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

Date: Sat, 30 May 1998 16:20:42 -0500
From: Ray Rarey <rayr@accessus.net>
Subject: Calling form fields with Variables?
Message-Id: <3570782A.49B6085A@accessus.net>

Can someone help me on this one:
I'm creating a survey for my company, and I've got it to where I need to
use a for next loop from 1 to 30 to read the form fields named 1 through
30. The only problem is, when I have the number stored in the variable
$num, and I try to call the form field using the command $response =
"$FORM{'$num'}";
the script actually looks for a field named $num, instead of the
variable value. Is there any way to fix this?
Any help would be greatly appreciated.
Please e-mail me at rayr@accessus.net if you can help.

                            Thanks in advance,

                                Ray Rarey



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

Date: Sat, 30 May 1998 14:45:36 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Calling form fields with Variables?
Message-Id: <6kpumu$seq@hplntx.hpl.hp.com>

[posted and emailed]

Ray Rarey wrote in message <3570782A.49B6085A@accessus.net>...
>Can someone help me on this one:
>I'm creating a survey for my company, and I've got it to where I need
to
>use a for next loop from 1 to 30 to read the form fields named 1
through
>30. The only problem is, when I have the number stored in the variable
>$num, and I try to call the form field using the command $response =
>"$FORM{'$num'}";
>the script actually looks for a field named $num, instead of the
>variable value. Is there any way to fix this?
>Any help would be greatly appreciated.
>Please e-mail me at rayr@accessus.net if you can help.
>
>                            Thanks in advance,
>
>                                Ray Rarey

Leave out the single quotes, which suppress interpolation of the value
of the variable $num.  Within single quotes, $ is nothing but a dollar
sign.  Don't replace the single quotes with double quotes, though -- it
would still work, but would lead you into bad habits.

--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com





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

Date: Sat, 30 May 1998 17:47:00 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: Calling form fields with Variables?
Message-Id: <35707E54.6B70F9C3@negia.net>

Ray Rarey wrote:
> 
> Can someone help me on this one:
> I'm creating a survey for my company, and I've got it to where I need to
> use a for next loop from 1 to 30 to read the form fields named 1 through
> 30. The only problem is, when I have the number stored in the variable
> $num, and I try to call the form field using the command $response =
> "$FORM{'$num'}";
> the script actually looks for a field named $num, instead of the
> variable value. Is there any way to fix this?

$response = "$FORM{'$num'}";

wrong type of quotes: definitely a problem

first off, to get this working you need to remove the single quotes
surrounding $num. the single quotes do not interpolate the variable's
value, instead it is used as a literal string. that is why you're seeing
it try to find the field named '$num'. you could also change the single
quotes to some other syntactically valid interpolative quoting
mechanism, and have functional code, but i would not (see below).

$response = "$FORM{$num}";
$response = "$FORM{qq|$num|}";

too many quotes: not necessarily a problem

at this point things should work. however, the double quotes around
your hash lookup are not needed, and for me just add unnecessary line
noise. it is up to you of course.

$response = $FORM{$num};

clean and functional:

hope this helps,

-- 
Dan Boorstein   home: danboo@negia.net  work: danboo@y-dna.com

 "THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
                         - Cosmic AC


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

Date: Sat, 30 May 1998 18:24:22 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: Calling form fields with Variables?
Message-Id: <35708716.12654258@negia.net>

Larry Rosler wrote:
> 
> [posted and emailed]
>
> sign.  Don't replace the single quotes with double quotes, though -- it
> would still work, but would lead you into bad habits.

good idea, but it's actually not syntactically valid to do:

$foo = "$ENV{"$bar"}";

you're right though, it's definitely a bad habit. ;-)

-- 
Dan Boorstein   home: danboo@negia.net  work: danboo@y-dna.com

 "THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
                         - Cosmic AC


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

Date: Sat, 30 May 1998 21:30:52 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: children processes
Message-Id: <EtsH3G.3Hw@news.boeing.com>

In article <6kotlc$2or$1@lyra.csx.cam.ac.uk>,
M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
 > Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
  >>Have each child set a hari-kari alarm, e.g,
  >>
  >> # child process
  >>   eval {
  >>      local $SIG{__DIE__} = 'DEFAULT'; 
  >>      local $SIG{ALRM} = sub { die "timed out" };
  >>      alarm 60;      # 1 minute time out
  >>      ....
  >>   };
  >>   alarm 0;
>
> Reverse the order of those last two lines, else you'll leave a window
> in which the alarm isn't trapped.
>

Yes, that's true if that's a single statement. (However, I 
presumed there'll probably be multiple since the entire 
child process is being rigged up for the alarm.) 


--
Charles DeRykus 


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

Date: Sat, 30 May 1998 21:52:26 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: children processes
Message-Id: <EtsI3E.54C@news.boeing.com>

In article <EtsH3G.3Hw@news.boeing.com>,
Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
>In article <6kotlc$2or$1@lyra.csx.cam.ac.uk>,
>M.J.T. Guy <mjtg@cus.cam.ac.uk> wrote:
> > Charles DeRykus <ced@bcstec.ca.boeing.com> wrote:
>  >>Have each child set a hari-kari alarm, e.g,
>  >>
>  >> # child process
>  >>   eval {
>  >>      local $SIG{__DIE__} = 'DEFAULT'; 
>  >>      local $SIG{ALRM} = sub { die "timed out" };
>  >>      alarm 60;      # 1 minute time out
>  >>      ....
>  >>   };
>  >>   alarm 0;
>>
>> Reverse the order of those last two lines, else you'll leave a window
>> in which the alarm isn't trapped.
>>
>
>Yes, that's true if that's a single statement. (However, I 
>presumed there'll probably be multiple since the entire 
>child process is being rigged up for the alarm.) 
>

Whoops, non sequitur. 

--
Charles DeRykus


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

Date: 30 May 1998 15:58:47 -0500
From: les@MCS.COM (Leslie Mikesell)
Subject: Re: DB_File database load corrupting records---help?
Message-Id: <6kpru7$ddl$1@Jupiter.Mcs.Net>

In article <6kjuik$8jm@lorne.stir.ac.uk>, Sam Nelson <sam@cs.stir.ac.uk> wrote:
>I'm working on rendering our local student records database accessible webwise
>via CGI stuff written around DB_File databases.  One segment, the `academic
>history' dataset, revolves around creating the DB_File form of a flat file
>300000-odd lines deep of the form
>
>    registration#<tab>course<tab>session-code<tab>semester<tab>grade
>
>which I split into separate per-semester DB_Files, but combine on a per-student
>basis, so that each of the per-semester files contains key-value pairs of the
>form
>
>    Key                     Value
>    registration#           `course(grade) course(grade) course(grade) ...'
>
>As I work my way down the flat file, I append the `course(grade)' entry to
>the relevant value in the relevant array with something like
>
> $AcademicHistory{$RegistrationNumber}.=sprintf(" %s(%s)",$CourseCode,$Grade);
>
>(having of course previously `tied' `%AcademicHistory' to the relevant file).
>The problem is that in a small fraction of cases (about 1/10000) this `append'
>is treated as `assign', with the result that previously-appended course/grade
>pairs are lost.  As you can imagine, I don't need this...
>
>There appears to be a workaround involving building the database entirely in
>memory, then tying up a DB_File and spitting the whole lot out into that file
>(because obviously that only uses `assign' on the DB_File array).
>
>I _was_ using plain old DB-1.85 against 5.004_04 (on Solaris 2.5.1/2.6) and
>against 5.002 on a couple of other platforms.  I've recently tried out
>DB-2.4.10 (built in 1.85 compatibility mode) and it seems to work better on
>S2.5.1, at least, but I can't seem to get it to go against 5.002 elsewhere at
>all.  Since I loaded the academic-history database up with 5.004_04/2.4.10,
>I've discovered another 22 records (another fraction of a percent) that were
>missing completely from the older database files.  I'm now working on methods
>to verify that what's in the database files is what was in the raw-data flat
>files...
>
>Is DB_File _meant_ to handle this sort of thing, or am I pushing it Just Too
>Far?

There are known bugs in the db-1.85 and earlier libraries as you probably
already found if you read the blurbs about the 2.x versions.  I've
run into this myself and think that the corruption I saw was caused
by updating existing records when the record grew past a page size
(4K, I think).  As you've noticed, writing the whole thing from
scratch works, even with bigger records.  It might also work if
you deleted records that were about to expand to the next page and
inserted them back instead of doing an update in place where the library
seems to miss the need to move to a larger spot.  This is supposed to
be fixed in 2.x and I think gdbm would get it right, but I am trying
to migrate to postgresql.  It has a recently updated ODBC driver
which might be handy if you ever need to yank data into excel or
use a MS-windows based report writer.  I thought I saw a DBI version
of tie() somewhere recently that might avoid the need for sql but
I haven't tried it yet.

  Les Mikesell
   les@mcs.com


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

Date: Sun, 31 May 1998 04:46:06 +0800
From: Jimmy <jimmyoh@pacific.net.sg>
Subject: Dereferencing SV**
Message-Id: <3570700E.90311E8F@pacific.net.sg>

Hi,
	I am trying to write my first XS program but I find trouble in
dereferencing SV** to SV*.  Can anyone tell me how to do that?

	Thanx in advance.

Jimmy


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

Date: Sat, 30 May 1998 13:12:24 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <6kppjf$r1d@hplntx.hpl.hp.com>

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

Tom Christiansen wrote in message
<6kpl1o$aef$1@csnews.cs.colorado.edu>...
> [courtesy cc of this posting sent to cited author via email]
>
>In comp.lang.perl.misc, "Larry Rosler" <lr@hpl.hp.com> writes:
>:Now just suppose one hadn't been born and bred with date(1) or
>:crypt(1) or crypt(3)?
>
>This is getting really tiresome, Larry.  Could you find
>some other axe to grind?
>
>--tom
>--
>    "That which does not kill me makes me stranger." --Larry Wall

Gladly.  Especially with the Mac users surfacing now, people are
beginning to catch on.

Of course, this thread is at least one decimal order of magnitude behind
the FSF threadS, but who would want to compete with that?

--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com





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

Date: Sat, 30 May 1998 22:56:09 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: Don't Know how to decrypt using PERL
Message-Id: <1d9uujp.1hduo2p1mc2j0bN@roxboro0-054.dyn.interpath.net>

[posted and emailed]

Larry Rosler <lr@hpl.hp.com> wrote:

> [posted and emailed]

In opposition to my stated request.
 
> John Moreno wrote in message
> <1d9ue1h.1634op11qi7iujN@roxboro0-054.dyn.interpath.net>...
> ...
> >Let's see,  Brian wrote:
> >> see the man page for crypt(3) which (definatively) explains all of
> >> this.
> >
> >So, Yahoo, "man page for crypt(3)" and click on the first match -
> >yahoo! that's it!
> 
> 
> There is wonderful juju here.  Instead of "man page for crypt(3)" try
> "man page for crypt (3)" or any variation thereof, with or without the
> parentheses.  One useless response!

The point I was making was that the all you needed to know was contained
in Brian's post - all you need to do is pick it out (which isn't that
hard) and do a search on it.

Pointing out that the answer is in a manual somewhere is ALWAYS a
acceptable answer to a question of this sort.  If they don't know where
the manual is or can't locate the particular section in the manual that
calls for another question and answer.

> The original c.l.p.m. response (remember way back when? :-) was `man 3
> crypt`.  Now just suppose one hadn't been born and bred with date(1) or
> crypt(1) or crypt(3)?

I QUOTED the original answer above - the question was asked by Kevin
Reid (a mac user) and answer by brian d foy (who I believe is ALSO a mac
user).  *I* am a Mac user and my perl programming experience is almost
totally in Macperl.  Your objection to the unix nature of the answer is
IMO inappropriate.

-- 
John Moreno


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

Date: Sat, 30 May 1998 16:26:04 -0400
From: winchest@babbage.csee.usf.edu (Jeff Winchester)
Subject: Fork() - functionality in NT Perl?
Message-Id: <MPG.fda35688caeb93f989680@news.gate.net>

I'm trying to accomplish what seems like a fairly simple task here (how many 
times have you heard that before?)...

We write many Perl utilities at work to make life simpler.  Simply put, Perl is 
the only language capable of what we need.  However some of the operations in 
the scripts take a good deal of time, so I'd like to do something totally cheezy 
but yet informative to the user to let him know that the program is actually 
doing something:

I'd like to spin a cursor or "walk" one back and forth as soon as the new 
process (operation) starts and until it exits.  I know that this might not be 
too hard under UNIX with a fork() command, but that doesn't seem to be 
implemented under Perl for NT.

Is there an equivalent coding method to allow a subprocess to be spawned (a 
child process, if you will) and have the "parent" do something until the "child" 
finishes?  I guess I'm looking at threads here.

Any input would be wonderfully appreciated...

---------------
Jeff Winchester
winchest@csee.usf.edu


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

Date: Sat, 30 May 1998 21:08:05 GMT
From: garyg@gator.net (Gary M. Greenberg)
Subject: Re: i need help...much!!!...anyone, please...
Message-Id: <Vy_b1.52$t5.288510@news.randori.com>

It sounds like you're simply double-clicking the perl.exe, or that 
you're just invoking perl.exe from a prompt.

Have you:
(a) added your install path for perl to your %path%?
(b) tried using a command console to invoke perl code?
        even something simple like "perl -e 'print "Hello World\n";'
        would let you know if things are installed properly.
(c) read the docs and readme.txt && install.txt files?

more details && self-instruction appear needed.
Cheers,
Gary

gary         -=-  The C Programmers' Reference  -=-
              http://www.gator.net/~garyg/C/c.html
        -=-  Avenue Programmers' Classes' Requests  -=-
             http://www.gator.net/~garyg/class.htm


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

Date: Sat, 30 May 1998 13:26:45 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: Leap Year Script...
Message-Id: <6kpq2g$r5c@hplntx.hpl.hp.com>

Michael Armstrong wrote in message <357153e0.74495999@news.visi.com>...
>On Sat, 30 May 1998 10:38:00 -0700, "Larry Rosler" <lr@hpl.hp.com>
>spake thusly:
>
>[snip]
>
>>Hmmm.  Then 20 months from now this will print "Date is 1-30-101"
>>(assuming you replace $month by $mon, as you intended).
>
>Doh!  (reminder to self: proofread twice, not just once.)


Doh!  Make that "Date is 1-30-100"
(reminder to self: proofread twice, not just once.)

--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com





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

Date: Sat, 30 May 1998 21:20:18 GMT
From: empires@ivillage.com
Subject: matching a zero+ length string with a definite end?
Message-Id: <6kpt6i$fok$1@nnrp1.dejanews.com>

I'm trying to write a regular expression which says:  match zero or more
characters, the last of which is not a backslash.  But I can't find an easy
way to say this.  The best I can come up with is:

       (|.*?[^\\])

Which divides it into two parts:  either the string is empty, or it is zero
or more characters followed by something that's not a backslash.  But this
seems overly complicated; is there a way to do this without the ( | )
construct?  Or am I being too picky?

Daniel

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


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

Date: Sat, 30 May 1998 18:18:46 -0400
From: Dan Boorstein <danboo@negia.net>
Subject: Re: matching a zero+ length string with a definite end?
Message-Id: <357085C6.F761EEFD@negia.net>

empires@ivillage.com wrote:
> 
> I'm trying to write a regular expression which says:  match zero or more
> characters, the last of which is not a backslash.  But I can't find an easy
> way to say this.  The best I can come up with is:
> 
>        (|.*?[^\\])

if i understand your desire correctly, you wish to test a string to
see if it has a backslash at its end. any string without a backslash
gets a certain treatment and those with get some other treatment. if
this is true then all you have to test is whether the string ends
with a backslash.

$_ = 'dd\\l';
print /\\$/ ? "has" : "has not";

your regex above, will always match immediatley, and never even make
it beyond the first attempt at the empty string.

hope this helps,

-- 
Dan Boorstein   home: danboo@negia.net  work: danboo@y-dna.com

 "THERE IS AS YET INSUFFICIENT DATA FOR A MEANINGFUL ANSWER."
                         - Cosmic AC


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

Date: 30 May 1998 22:32:46 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: matching a zero+ length string with a definite end?
Message-Id: <6kq1ee$ked$1@marina.cinenet.net>

empires@ivillage.com wrote:
: I'm trying to write a regular expression which says:  match zero or more
: characters, the last of which is not a backslash.

Your wording is a bit unclear; I presume 'xyz\abc' should match 'xyz', not
the entire string?  The entire-string-matches version is what your literal
wording would demand.

If I've guessed correctly, then /[^\\]*/ should meet your needs.  Note
that this would match '' (the initial nothingness) in '\\\abc\\\'; if you
really meant to match one or more such characters, change '*' to '+' and
it will match at 'abc'.  Note also that using capturing parens to grab the
match is better than $&, which I presume you're using now.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: Sat, 30 May 1998 22:44:45 GMT
From: jessek@cdsnet.net (Jesse Kempa)
Subject: Net::Telnet problems
Message-Id: <357088dc.6106290@news.meganews.com>

Hello,

I've been writing a script to print out a web page form, take in the
form, parse it, and use the info to connect to a telnet host and print
out the results. I'm using Net::Telnet 3.01 on Perl 5.004_04 on a DEC
Alpha internet server.

The problem is in connecting to the remote host, and more
specifically, logging in. From debugging, I believe the "login: "
prompt is reached, and the username sent, but after that nothing
works:

use Net::Telnet ();
$t = new Net::Telnet (Timeout => 30);
$t->open('duat.gtefsd.com');
$t->waitfor('/Enter DUAT access code  -or-  last name:  ?$/i');
$t->print($FORM{'uname'});

# OK to here

$t->waitfor('Enter your password: ?$/i');
$t->print($FORM{'uname'});
$t->waitfor('/ ... press RETURN to continue ?$/i');
$t->print(\n);
@lines = $t->print($wxstr);
$t->close;

At "# OK to here" I just had a simple print instruction to print out a
web page header, ideally if everything works, I would print out
@lines. However, if I try to print out anything after waiting for the
password prompt, the connection times out and I get the standard
error.

Here is the output of the actual telnet host when connecting with
Windows telnet.exe:

                GTE DUAT System

Session number: 23201


Enter DUAT access code  -or-  last name:
Enter your password: 

*** welcome messages ***

 ... press RETURN to continue

              DUAT Main Menu

    Weather Briefing                 1
    Flight Plan and Planner          2
    Encode                           3
    Decode                           4
    Modify Personal Data Profile     5
    Service Information              6
    Extended Decode                  7
    FAA/NWS Contractions             8

Select function (or 'Q' to quit): (command string would be sent here,
followed by the resulting data to be saved for printing) 


Any help with this would be greatly appreciated, thanks!!


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

Date: 30 May 1998 22:17:04 GMT
From: toivotuo@fishpool.com (Tuomas Toivonen)
Subject: Problems with select().
Message-Id: <slrn6n119g.ip1.toivotuo@gfanrend.fishpool.com>

To my understanding process executing to script below would 'sleep' for 10
seconds if there was no 'activity' on STDIN. However, it returns immediately
with $nfound == -1, $timeleft == 10.

Any info greatly appreciated!

$rin = $win = $ein = 0;
vec($rin, fileno(STDIN), 1) = 1;
vec($win, fileno(STDIN), 1) = 1;
$ein = $rin | $win;

my ($nfound, $timeleft) = select($rin, $win, $ein, 10) 
  or die "select: $!\n";

printf "nfound: %s\ntimeleft: %s\n", 
  $nfound, 
  $timeleft;

-- 
tuomas.toivonen@fishpool.com              fishpool creations ltd
http://www.fishpool.com/~toivotuo/        http://www.fishpool.com/


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

Date: Sat, 30 May 1998 15:56:31 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: seek advice on simple first program
Message-Id: <alecler-3005981556310001@dialup-929.hip.cam.org>

In article <35704765.4B99D853@negia.net>, Dan Boorstein <danboo@negia.net>
wrote:

> > ... and Larry Rosler <lr@hpl.hp.com> wrote:
> > 
> > > That's neat, and suggests Yet Another Way to Do It, using $\, the output
> > > record separator:
> > >
> > > $\ = "\n";
> > > ...
> > >    print F @content;
> > > ...
> > >

[...]

> i think larry was looking for '$,' which is the output *field* separator.
> sorry no benchmark comparisons.


Ah, yes, if we're talking about $, what Larry said makes more sense.

A.L.


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

Date: Sat, 30 May 1998 14:55:27 -0700
From: "Larry Rosler" <lr@hpl.hp.com>
Subject: Re: seek advice on simple first program
Message-Id: <6kpv90$sj5@hplntx.hpl.hp.com>

[posted and emailed]

Andre L. wrote in message ...
>In article <35704765.4B99D853@negia.net>, Dan Boorstein
<danboo@negia.net>
>wrote:
>
>> > ... and Larry Rosler <lr@hpl.hp.com> wrote:
>> >
>> > > That's neat, and suggests Yet Another Way to Do It, using $\, the
output
>> > > record separator:
>> > >
>> > > $\ = "\n";
>> > > ...
>> > >    print F @content;
>> > > ...
>> > >
>
>[...]
>
>> i think larry was looking for '$,' which is the output *field*
separator.
>> sorry no benchmark comparisons.
>
>
>Ah, yes, if we're talking about $, what Larry said makes more sense.
>
>A.L.

Yes, and it works:

$, = "\n";
 ...
    print F @content, "\n";

But the benchmark is some 10% *slower* than Andre's $LIST_SEPARATOR
approach.  In view of my earlier elaborate rationalization for why the
latter should be relatively slow, my intuition about perl performance
has failed yet again.  Perhaps someone will care to clarify this.

--
Larry Rosler
Hewlett-Packard Laboratories
lr@hpl.hp.com





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

Date: 30 May 1998 17:47:56 -0400
From: ma@panix.com (malgosia askanas)
Subject: Translating first letter of sentence into a capital
Message-Id: <6kpuqc$112@panix2.panix.com>

I have this abysmally stupid question.  I want to write a script that takes
as input a text file that's all in lower case, and produces as output the same
text but with the first character of each new sentence capitalized.  What's the
magic statement inside the loop???


Thanks in advance, and yes, I am thoroughly embarrassed.


-m


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

Date: Sun, 31 May 1998 00:18:39 +0200
From: "Rainer Quasten" <raqua@t-online.de>
Subject: Whois lookup
Message-Id: <6kq0bt$k1i@hades.rz.uni-sb.de>

hi guys !
I'am searching the script "whois lookup" from "cafe society".
Can someone send me this script or something like that?
Because the site from "cafe society" is not avaible at the moment.

thank you

rainer
email:raqua@t-online.de




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

Date: Sat, 30 May 1998 21:45:14 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: X marks the spot, was Re: Best tool?
Message-Id: <Pine.A41.3.95a.980530214342.49056D-100000@rsplus08.cern.ch>

On Sat, 30 May 1998, Randal Schwartz wrote:

> I've heard of "X", "X11", and "the X Window System".  But never "X Windows".

I hadn't expected this level of pedantry from you, of all people.




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

Date: Sat, 30 May 1998 21:59:57 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: X marks the spot, was Re: Best tool?
Message-Id: <8c90nj2ze1.fsf@gadget.cscaper.com>

>>>>> "Alan" == Alan J Flavell <flavell@mail.cern.ch> writes:

Alan> On Sat, 30 May 1998, Randal Schwartz wrote:
>> I've heard of "X", "X11", and "the X Window System".  But never "X Windows".

Alan> I hadn't expected this level of pedantry from you, of all people.

Alan... perhaps you weren't aware that my first salaried job was as a
technical writer.  Learning to call something by its real official
Marketing Approved Name is Very Important and Hammered In during the
early training.  And "X Windows" is wrong enough that it grinds every
time I hear it. :-)

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 93 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

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

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