[24328] in Perl-Users-Digest
Perl-Users Digest, Issue: 6517 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 4 18:05:59 2004
Date: Tue, 4 May 2004 15:05:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 4 May 2004 Volume: 10 Number: 6517
Today's topics:
Re: Authen::NTLM and MS04-011 (Kevin Collins)
Re: Authen::NTLM and MS04-011 (Kevin Collins)
calculate date 4 days ago (joe shaboo)
Re: calculate date 4 days ago <ittyspam@yahoo.com>
Re: calculate date 4 days ago <usenet@morrow.me.uk>
Re: calculate date 4 days ago <Jon.Ericson@jpl.nasa.gov>
Chat Server and Time Delay <brian@nrwp.co.uk>
forking an independent process <bxb7668@somewhere.nocom>
Help -- Code attached - db2buildts.pl (0/1) <tdyboc@insight.rr.com>
Help -- Code attached - db2buildts.pl (1/1) <tdyboc@insight.rr.com>
Re: How to hide "if $DEBUG" code? <emschwar@pobox.com>
Re: MSSQL 2000 Connect Success <domenico_discepola@quadrachemicals.com>
Re: need help with security <bik.mido@tiscalinet.it>
stdin - flushing buffer - this should be an easy one <tj@getlostspammer.com>
Re: stdin - flushing buffer - this should be an easy on <jwillmore@remove.adelphia.net>
Re: stdin - flushing buffer - this should be an easy on (Walter Roberson)
Re: Win32::API and SetEnvironmentVariable <usenet@morrow.me.uk>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 04 May 2004 21:12:02 GMT
From: spamtotrash@toomuchfiction.com (Kevin Collins)
Subject: Re: Authen::NTLM and MS04-011
Message-Id: <slrnc9g1p2.f1i.spamtotrash@doom.unix-guy.com>
In article <967a9d2.0405040355.a94beb5@posting.google.com>, Andrew Speer wrote:
> Kevin,
>
> I recently came across this same problem. The challenge format looks to have
> changed, and as a result Authen::NTLM seems to sends a "broken" NT domain
> string to the server.
>
> The fix (for me) was to alter the code (v1.02 in my case). In the "ntlm"
> subroutine change the line:
>
> $domain = substr($c_info->{buffer}, 0, $c_info->{domain}{len});
>
> to
>
> $domain = substr($challenge, $c_info->{domain}{offset},
> $c_info->{domain}{len});
>
> which fixed the problem for me. I hope it is also backwards compatible with
> pre MS04-11 patched server, but have been unable to test.
>
> I have sent a private email to Mark with similar information, so hopefully
> the module will be updated sometime.
>
> Thank <deity> for Ethereal - without it this would have been nigh impossible
> to debug.
>
> Andrew
Andrew,
thanks a bunch! We actually got hit hard with the Sasser.D virus yesterday
because we couldn't install the patch. I found out just minutes ago that
Microsoft (via our escalated Premiere Support call) had found a solution by
searching Google - quite possibly they found your response!
Thanks for the info - it appears that the fix they suggested is working. I'm
off to confirm that it is the same as what yours is. I'll post back with my
findings.
Thanks,
Kevin
------------------------------
Date: Tue, 04 May 2004 21:24:05 GMT
From: spamtotrash@toomuchfiction.com (Kevin Collins)
Subject: Re: Authen::NTLM and MS04-011
Message-Id: <slrnc9g2fl.f1i.spamtotrash@doom.unix-guy.com>
In article <967a9d2.0405040355.a94beb5@posting.google.com>, Andrew Speer wrote:
> Kevin,
>
> I recently came across this same problem. The challenge format looks to have
> changed, and as a result Authen::NTLM seems to sends a "broken" NT domain
> string to the server.
>
> The fix (for me) was to alter the code (v1.02 in my case). In the "ntlm"
> subroutine change the line:
>
> $domain = substr($c_info->{buffer}, 0, $c_info->{domain}{len});
>
> to
>
> $domain = substr($challenge, $c_info->{domain}{offset},
> $c_info->{domain}{len});
>
> which fixed the problem for me. I hope it is also backwards compatible with
> pre MS04-11 patched server, but have been unable to test.
>
> I have sent a private email to Mark with similar information, so hopefully
> the module will be updated sometime.
>
> Thank <deity> for Ethereal - without it this would have been nigh impossible
> to debug.
>
> Andrew
Andrew,
per my previous followup, it turns out that they (MS) did in fact find your
response to my post! Amazing that I posted a couple weeks ago and had no
response until today and I had not yet checked for responses :)
Small world...
Thanks again,
Kevin
------------------------------
Date: 4 May 2004 12:47:17 -0700
From: jshaboo@hotmail.com (joe shaboo)
Subject: calculate date 4 days ago
Message-Id: <f6d34657.0405041147.7e44b77d@posting.google.com>
Hi,
I'm trying to list files that are 4 days old, and then perform an
action on them. I don't care about any files that are newer (have been
edited or touched in the last 4 days), only 4 days or older.
I can do this either through SHELL or perl, which ever is easier.
For example
ls -lt d.* | awk '{print $6 $7}' Provides a list of just of the date
of the files. What I would like to do is, if a file has been touched
in the last 4 days, grep for a certain term, and if it exists, pipe to
a file.
I was thinking of doing something like subtracting the day of the
month from system date, but then I run into problems in the first 4
days of the month.
If someone can think of a way to do this, I would be grateful.
Many Thanks,
Joe
------------------------------
Date: Tue, 4 May 2004 15:58:29 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: calculate date 4 days ago
Message-Id: <20040504155634.R20459@dishwasher.cs.rpi.edu>
On Tue, 4 May 2004, joe shaboo wrote:
> Hi,
>
> I'm trying to list files that are 4 days old, and then perform an
> action on them. I don't care about any files that are newer (have been
> edited or touched in the last 4 days), only 4 days or older.
>
perldoc -f -X
opendir (DIR, "/home/") or die "Cannot open directory: $!";
my @files = grep { -M < 4 } readdir(DIR);
#perform your task on each member of @files;
Paul Lalli
> I can do this either through SHELL or perl, which ever is easier.
>
> For example
>
> ls -lt d.* | awk '{print $6 $7}' Provides a list of just of the date
> of the files. What I would like to do is, if a file has been touched
> in the last 4 days, grep for a certain term, and if it exists, pipe to
> a file.
>
> I was thinking of doing something like subtracting the day of the
> month from system date, but then I run into problems in the first 4
> days of the month.
>
> If someone can think of a way to do this, I would be grateful.
>
> Many Thanks,
>
> Joe
>
------------------------------
Date: Tue, 4 May 2004 21:29:53 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: calculate date 4 days ago
Message-Id: <c7920h$5gm$2@wisteria.csv.warwick.ac.uk>
Quoth Paul Lalli <ittyspam@yahoo.com>:
> On Tue, 4 May 2004, joe shaboo wrote:
>
> > Hi,
> >
> > I'm trying to list files that are 4 days old, and then perform an
> > action on them. I don't care about any files that are newer (have been
> > edited or touched in the last 4 days), only 4 days or older.
> >
>
> perldoc -f -X
>
> opendir (DIR, "/home/") or die "Cannot open directory: $!";
> my @files = grep { -M < 4 } readdir(DIR);
BZZT! You are checking the wrong files.
my $dir = '/home';
opendir my $DIR, $dir or die ...;
my @files = grep { -M "$dir/$_" < 4 } readdir DIR;
Ben
--
I've seen things you people wouldn't believe: attack ships on fire off
the shoulder of Orion; I watched C-beams glitter in the dark near the
Tannhauser Gate. All these moments will be lost, in time, like tears in rain.
Time to die. ben@morrow.me.uk
------------------------------
Date: Tue, 04 May 2004 14:05:14 -0700
From: Jon Ericson <Jon.Ericson@jpl.nasa.gov>
Subject: Re: calculate date 4 days ago
Message-Id: <rcgisfbvr79.fsf@Jon-Ericson.sdsio.prv>
jshaboo@hotmail.com (joe shaboo) writes:
> I'm trying to list files that are 4 days old, and then perform an
> action on them. I don't care about any files that are newer (have been
> edited or touched in the last 4 days), only 4 days or older.
>
> I can do this either through SHELL or perl, which ever is easier.
Using option 1:
$ find . -mtime -4
Option 2 can be autogenerated with the find2perl script:
$ find2perl . -mtime -4 -print | perl
(Instead of piping to perl, you could redirect to a file to read and
edit.)
Jon
------------------------------
Date: Tue, 4 May 2004 22:37:27 +0100
From: "Brian" <brian@nrwp.co.uk>
Subject: Chat Server and Time Delay
Message-Id: <32Ulc.151$zX5.96@newsfe3-win.server.ntli.net>
Hi All
It's been a little while since I did some Perl coding
and the questions I have are a little over my head.
I need to write 2 scripts..........
First one sits on a server and runs without being called
from a browser. It's job is to check the time, and if
the time = X then do Y. basically I want a script that
is going to clear a MySQL Db at 4 am every day
The second is way over my head, in short I need
what is going to work like a chat server. The idea
is I have a windows based program (witting in Delphi)
that talks to a script, other uses of this program will
also will also log on. The program will create messages
and send them to the server script and in turn the
script will send that message to all the other programs
As I say just like a chat server except the messages are
done via the program and not the user
I have found a script on the net at
http://hotwired.lycos.com/webmonkey/97/18/index2a.html?tw=programming
but can't get it to work and don't really understand it.
Can anybody point me in the right direction or have
some example code?
Brian
------------------------------
Date: Tue, 4 May 2004 21:43:54 GMT
From: "bxb7668" <bxb7668@somewhere.nocom>
Subject: forking an independent process
Message-Id: <Hx7Lp4.Enp@news.boeing.com>
From my perl script I need to be able to launch (fork?) an editor
(notepad on Windows and nedit on UNIX). (Easy so far.) I need the
script to processing and the editor to keep editing totally
independent of each other. The script can end and the editor will stay
open. The editor can be closed and the script will keep running.
Reading up on fork gave me this:
#!/usr/bin/perl
FORK: {
if ($pid = fork) {
$I = 1;
while ( 1 ) {
print "hi $I\n";
sleep 1;
$I++;
}
}elsif (defined $pid) {
exec "nedit junk.txt";
}elsif ( $! =~ /no more process/) {
sleep 5;
redo FORK;
}else {
die "Can't fork";
}
}
When I close the child nedit process, the parent keeps going. But when
I close the parent with a Ctrl+C, it also kills the nedit window. Is
what I'm trying for possible? If so, how?
Thank you,
Brian
------------------------------
Date: Tue, 04 May 2004 21:44:19 GMT
From: Mulder <tdyboc@insight.rr.com>
Subject: Help -- Code attached - db2buildts.pl (0/1)
Message-Id: <oi3g90dg37oc20uioho3eoie2ahunfkd48@4ax.com>
I am new to perl and am having trouble converting an old korn shell
script into perl. The attached script when executed simply displays a
statement to stdout. My problem is that I cannot figure out how to
resolve an embedded variable. The variable in question is
$container_path and the two variables I want resolved are
$nbr_data_path and $nbr_partition.
What I ultimately want to do is to allow a dynamic file-system path to
be specified that can also include these two varaibles. Not sure how
to approach this in perl. In korn shell I simply did an 'eval' to
send the contents back to the shell and then echo them out and they
would be resolved into a valid file-system path but 'eval' in perl
isn't the same.
Any help and/or pointers appreciated.
Thanks
------------------------------
Date: Tue, 04 May 2004 21:44:20 GMT
From: Mulder <tdyboc@insight.rr.com>
Subject: Help -- Code attached - db2buildts.pl (1/1)
Message-Id: <qv3g901h1oipu1p3nrm5viiiuuu347ls8v@4ax.com>
begin 644 db2buildts.pl
M(R$O9W!F<R]C<W0O=71I;"]P<F0O8FEN+W!E<FP-"B,-"B,@+2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!]#0IE;'-E('L@)&YO9&5?9W)O=7`@/2`B:6)M9&5F875L=&=R
M;W5P(CL@?0T*#0II9B`H(&1E9FEN960@)&]P=%]P86=E7W-I>F4@*2![("1P
M86=E7W-I>F4@/2`D;W!T7W!A9V5?<VEZ93L@?0T*96QS92![("1P86=E7W-I
M>F4@/2`Q-C,X-#L@?0T*#0II9B`H(&1E9FEN960@)&]P=%]T86)L97-P86-E
M("D@>R`D=&%B;&5S<&%C92`]("1O<'1?=&%B;&5S<&%C93L@?0T*96QS92![
M("1T86)L97-P86-E(#T@(G1E<W1T<R([('T-"@T*:68@*"!D969I;F5D("1O
M<'1?8V]N=&%I;F5R7W!A=&@@*2&-O;G1A:6YE<E]P871H(#T@(B1D8C)&4R\B("X-"B`@("`@
M("`@("`@("`@("`@("`@("`@("`B)&EN<W1A;F-E+R(@+@T*("`@("`@("`@
M("`@("`@("`@("`@("`@("(D9&%T86)A<V4O(B`N#0H@("`@("`@("`@("`@
M("`@("`@("`@("`@(F1B,F1A=&%<)&YB<E]D871A7W!A=&@O(B`N#0H@("`@
M("`@("`@("`@("`@("`@("`@("`@(DY/1$5<)&YB<E]P87)T:71I;VXO(B`N
M#0H@("`@("`@("`@("`@("`@("`@("`@("`@(B1T86)L97-P86-E(@T*?0T*
M#0II9B`H(&1E9FEN960@)&]P=%]E>'1E;G1?<VEZ92`I('L@)&5X=&5N=%]S
M:7IE(#T@)&]P=%]E>'1E;G1?<VEZ93L@?0T*96QS92&]P=%]P<F5F971C:%]S
M:7IE("D@>R`D<')E9F5T8VA?<VEZ92`]("1O<'1?<')E9F5T8VA?<VEZ93L@
M?0T*96QS92![("1P<F5F971C:%]S:7IE(#T@(C!P9G,B.R!]#0H-"FEF("@@
M9&5F:6YE9"`D;W!T7V1R;W!P961?=&%B;&5?<F5C;W9E<GD@*2![("1D<F]P
M<&5D7W1A8FQE7W)E8V]V97)Y(#T@(F]N(CL@?0T*96QS92![("1D<F]P<&5D
M7W1A8FQE7W)E8V]V97)Y(#T@(F]F9B([('T-"@T*:68@*"!D969I;F5D("1O
M<'1?=&%B;&5S<&%C95]T>7!E("D@>R`D=&%B;&5S<&%C95]T>7!E(#T@)&]P
M=%]T86)L97-P86-E7W1Y<&4[('T-"F5L<V4@>R`D=&%B;&5S<&%C95]T>7!E
M(#T@(G)E9W5L87(B.R!]#0H-"B,-"B,@14Y$("TM($=L;V)A;"!D969A=6QT
M('9A<FEA8FQE(&1E8VQA<F%T:6]N<PT*(PT*#0HC#0HC($=E;F5R871E('1H
M92!T86)L97-P86-E('-T871E;65N="!B87-E9"!O;B!N96-E<W-A<GD@<&%R
M86UE=&5R<PT*(PT*7W!R:6YT7W1A8FQE<W!A8V5?<W1A=&5M96YT*"`B8F5G
M:6XB("D[#0I?<')I;G1?=&%B;&5S<&%C95]S=&%T96UE;G0H(")C;VYT86EN
M97)S(BP@)&-O;G1A:6YE<E]P871H("D[#0I?<')I;G1?=&%B;&5S<&%C95]S
M=&%T96UE;G0H(")E;F0B("D[#0H-"F5X:70@,#L-"@T*(PT*(R!03T0@9&]C
M=6UE;G1A=&EO;G,-"B,-"E]?14Y$7U\-"CUH96%D,2!.04U%#0H-"B!D8C)B
M=6EL9'1S+G!L#0H-"CUH96%D,2!364Y/4%-)4PT*#0H@9&(R8G5I;&1T<RYP
M;"`@("`@0G5I;&0@1$(R($-R96%T92!486)L97-P86-E(%-T871E;65N=',-
M"@T*/6AE860Q($1%4T-225!424].#0H-"B!!(&1E<V-R:7!T:6]N#0H-"CUH
M96%D,2!!4D=5345.5%,-"@T*("TM:&5L<"`@("`@4')I;G0@;W!T:6]N<R]A
M<F=U;65N=',@*&)R:65F*0T*("TM;6%N("`@("`@4')I;G0@8V]M<&QE=&4@
M;6%N('!A9V4-"@T*/6AE860Q($]05$E/3E,-"@T*("TM:&5L<`T*("TM;6%N
M#0H@+2UV97)S:6]N<PT*#0H]:&5A9#$@05542$]2#0H-"CUH96%D,2!,24-%
-3E-%#0H-"CUC=70-"@T*
`
end
------------------------------
Date: Tue, 04 May 2004 12:13:59 -0600
From: Eric Schwartz <emschwar@pobox.com>
Subject: Re: How to hide "if $DEBUG" code?
Message-Id: <etoisfc5ac8.fsf@fc.hp.com>
Salvador Fandiņo <salvafg@terra.es> writes:
> As every debugging sentence begins whit "dbg_" they are easier to
> recognize and ignore, and less intrusive than using...
>
> print "whatever" if $DEBUG;
>
> ... that only says it is a debugging sentence at the end.
I use a similar convention, developed in a shop I worked in a few
years ago:
DebugMsg($msg); # prints "$0: DEBUG: $msg" if $opt_debug is defined
InfoMsg($msg); # prints "$0: INFO: $msg"
ErrorMsg($msg); # prints "$0: ERROR: $msg"
ProgressMsg($msg); # unusual; prints "$0: $msg"; mostly for semantics
FatalMsg($msg); # same as ErrorMessage, then exit()s
VerboseMsg($msg); # like ProgressMsg, but only prints when $opt_verbose
# is defined.
Offhand, I can't recall why we used FatalMsg instead of die();
probably it was for consistency in both code and printed output
between messages that indicated fatal conditions and those that were
less so.
Anyway, the "nice" thing about DebugMsg($) is that it used a global
variable, $opt_debug, that was set by Getopt::Std, so you could put
all the DebugMsg()s you wanted in the code, and you wouldn't see the
results until you ran "prog -d". Later on, we extended our
conventions to enable -d to take a numeric argument, indicating the
level of debug desired; "prog -d" would give ordinary debug output,
but "prog -d 9" would give you far more than you ever wanted to know
about the internals.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Tue, 4 May 2004 14:07:57 -0400
From: "Domenico Discepola" <domenico_discepola@quadrachemicals.com>
Subject: Re: MSSQL 2000 Connect Success
Message-Id: <CYQlc.36416$kc2.532522@nnrp1.uunet.ca>
"Henry Williams" <***************> wrote in message
news:725b901jh8kb9k6rvhmi8dg2aj5im79hqu@4ax.com...
>
> >
> >There is a Win32::ODBC because Dave Roth decided to write it. Same deal
> >with DBI, DBD::ODBC and DBD::ADO, and the other 4000+ modules. As to
> >why Dave decided to write Win32::ODBC, I can only speculate. Perhaps he
> >liked Micro$loth's way of accessing databases? Maybe it predated DBI
> >and DBD::ODBC?
>
> Thank you for your reply Mr. Walton. It sheds some light on the
> matter.
> I'm sure an analysis of each would be interesting , however I'll be
> sticking with WIN32::ODBC as it does seem to work well and I'm stuck
> with MS SQL 2k
>
> Regards,
> Henry
>
Does your data contain embedded quotes? I use Win32::ODBC to retrieve and
insert data into MSSQL2K extensively and found that I had to basically
create code to process embedded quotes and null values... I think this is
automatically handled by the "prepare" function of DBI... At the time, I
could not have completed my work without Dave Roth's Win32::ODBC module but
I know I am delaying the inevitable - switching to DBI & its related
modules...
------------------------------
Date: Tue, 04 May 2004 21:15:54 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: need help with security
Message-Id: <v4qf909bgcthpsaj62cg7jtpq26k9q7s38@4ax.com>
On Tue, 04 May 2004 09:08:30 +0200, Michele Dondi
<bik.mido@tiscalinet.it> wrote:
>[important missing line here - my fault!]
>>>>>> $rootfile =~ s/.+\///;
>[snip]
>>> '=~' ne '=';
>>
>>Never snip code that is needed for context. :)
To be fair, what the OP was actually doing was so utterly nonsensical
that I misread his two lines of code myself thus:
OP:
| my $rootfile =
| $rootfile =~ s/.+\///;
I read:
| my $rootfile;
| $rootfile =~ s/.+\///;
and somebody using one of those ESP::* modules my have well written
this to me:
'=' ne ';'
Michele
--
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
"perl bug File::Basename and Perl's nature"
------------------------------
Date: Tue, 04 May 2004 18:22:54 GMT
From: tj <tj@getlostspammer.com>
Subject: stdin - flushing buffer - this should be an easy one
Message-Id: <2cRlc.12$qn6.6@twister.socal.rr.com>
Hi,
I apologize if this is not the correct forum for my question. Please
redirect if necessary.
I have a perl program which is communicating with a modem. I am obtaining
response codes from the modem by defining <MODEM> (/dev/ttyS3).
Think of this program as a clone of minicom. When using minicom, I submit
an "AT" code, and I know exactly what response codes I get from the modem,
and the response is displayed on the terminal.
However, using the perl program, I have to fetch the contents of the buffer.
system "stty 19200 < $modem";
open MODEM, "+<$modem" or die "Can't open $modem: $!";
select MODEM;
$|=1;
select STDOUT;
print MODEM $strData."\r";
print "Echoline: ".<MODEM>;
In minicom, I expect the echoline to be "OK\n\r".
In perl, fetching the results of <MODEM> are not consistent. Sometimes I
need to fetch one or two more <MODEM> calls to empty the buffer before I
can proceed. I assume I am making a very basic mistake, in how I am
calling <MODEM>, flushing the buffer, etc. Its hard to make a smart
looping subroutine, when Im not expecting a value in subsequent calls
anyway. ??
print MODEM $strData."\r";
print "Echoline: ".<MODEM>; #may or may not really be empty yet
print "Echoline: ".<MODEM>; #may or may not really be empty yet
print "Echoline: ".<MODEM>; #is probably empty by now.
--
TJ
------------------------------
Date: Tue, 04 May 2004 15:30:14 -0400
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: stdin - flushing buffer - this should be an easy one
Message-Id: <pan.2004.05.04.19.30.12.284367@remove.adelphia.net>
On Tue, 04 May 2004 18:22:54 +0000, tj wrote:
[ ... ]
> I have a perl program which is communicating with a modem. I am
> obtaining response codes from the modem by defining <MODEM>
> (/dev/ttyS3).
[ ... ]
I know this doesn't address the issue directly, but have you considered
using the Device::Modem module
(http://search.cpan.org/~cosimo/Device-Modem-1.36/docs/Modem.pod) ?
I make this suggestion because it looks like someone else already went
through this pain ... so you don't have to ;-)
HTH
--
Jim
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
a fortune quote ...
Schizophrenia beats being alone.
------------------------------
Date: 4 May 2004 20:55:02 GMT
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Subject: Re: stdin - flushing buffer - this should be an easy one
Message-Id: <c78vv6$2j4$1@canopus.cc.umanitoba.ca>
In article <2cRlc.12$qn6.6@twister.socal.rr.com>,
tj <tj@getlostspammer.com> wrote:
:Think of this program as a clone of minicom.
: system "stty 19200 < $modem";
: open MODEM, "+<$modem" or die "Can't open $modem: $!";
You need to reverse those two lines. stty settings only hold as long
as some process has the device open, and are reset each time the
last process closes the device. Your perl script does not have the
device open at the time you stty the device, and "system" will start
a new process to execute the stty command in. That new process will
die when stty is finished doing its work, leaving no processes holding
the port open, so the OS will reset the parameters. If you do the perl
open first, then your perl script will still have the device open
when the stty command finishes its job, so the OS will leave the parameters
as set by stty.
: select MODEM;
: $|=1;
:In perl, fetching the results of <MODEM> are not consistent. Sometimes I
:need to fetch one or two more <MODEM> calls to empty the buffer before I
:can proceed. I assume I am making a very basic mistake, in how I am
:calling <MODEM>, flushing the buffer, etc.
You should use additional parameters to stty to tell the system
the circumstances under which it should consider the input line
to be complete and thus release it to your buffer when you <MODEM>.
What you are encountering is that the default parameters are likely
based upon either timeouts or else whatever was available in the
buffer at the time of the interrupt.
However -- if you are trying to do anything at all interactive,
in which you might not be getting a complete line of output back,
then you really need to do single-character I/O, and you should
probably be using sysread() and select(). For example, if you need
to be able to detect that the remote system has sent you a
login: prompt and is sitting waiting for your username, then
you can't reliably handle that situation by reading a line at a time.
As another poster pointed out: people have already put a lot of this
functionality into modules available via CPAN, and it doesn't pay
to reimpliment it [not unless you know UNIX I/O at least as well
as the module author did.]
--
100% of all human deaths occur within 100 miles of Earth.
------------------------------
Date: Tue, 4 May 2004 21:24:52 +0000 (UTC)
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: Win32::API and SetEnvironmentVariable
Message-Id: <c791n4$5gm$1@wisteria.csv.warwick.ac.uk>
Quoth smc0862.usa@mindspring.com (Shawn Campbell):
> I'm having a problem setting environment variables with a large
> string. According to the MSDN documentation, an environment variable
> can be up to 32k. I'm well under this value, but it's not being set.
>
> Following is the code I'm using.
<snip Win32::API SetEnvironmentVar>
Why do you not just use %ENV? (Is there something I'm missing?)
Ben
--
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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.
#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 V10 Issue 6517
***************************************