[12250] in Perl-Users-Digest
Perl-Users Digest, Issue: 5850 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 1 14:07:19 1999
Date: Tue, 1 Jun 99 11:00:23 -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 Tue, 1 Jun 1999 Volume: 8 Number: 5850
Today's topics:
Re: $^O and all types? (Chris Nandor)
Re: Better solution ? <dhenders@cpsgroup.com>
Better than Perl <AnnonyMai1@nym.alias.net>
Re: Better than Perl (Randal L. Schwartz)
Re: Can I do this with an "if" statement? <aqumsieh@matrox.com>
Re: Can I execute a string? (Philip 'Yes, that's my address' Newton)
Re: Can PERL attach a file to a FORM that will get Emai <cassell@mail.cor.epa.gov>
Re: Extractingg a text in a file... (Larry Rosler)
Re: FAQ 2.3: I don't have a C compiler on my system. H <cassell@mail.cor.epa.gov>
GD, PPM, XML: Parser <news@medal.force9.net>
how to eliminate double counting for hit counter <lewie@leland.Stanford.EDU>
Re: how to eliminate double counting for hit counter <tchrist@mox.perl.com>
Re: how to eliminate double counting for hit counter (Michel Dalle)
Re: Is split (surprisingly, amazingly) slow? <jdf@pobox.com>
manipulating text file... <portboy@home.com>
Re: Opendir on the root of a NT Server <xrxoxtxhxdx@xrxoxtxhx.xnxextx>
Re: pattern matching (Larry Rosler)
Re: Perl "constructors" <emschwar@rmi.net>
Re: Predefined variable for array number? <aqumsieh@matrox.com>
Re: Secure join? <aqumsieh@matrox.com>
Re: Secure join? (M.J.T. Guy)
Re: Serial port question... <portboy@home.com>
Time Error <debot@xs4all.nl>
Re: Use binmode for binary files (Was: Re: PB writing a (Andrew Allen)
Re: Y2K infected Perl code (Chris Nandor)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 01 Jun 1999 17:18:15 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: $^O and all types?
Message-Id: <pudge-0106991318170001@192.168.0.77>
In article <374f6c0e.0@news1.starnetinc.com>, "$Richy Rich$"
<rich_guy@hotmail.com> wrote:
# i'm trying to make my scripts more portable, and also make it easier for
# people that use them and set them up. this of course, would involve
# knowing what OS they are using. i need to check it to know if (depending
# on the OS) i can use flock, do forking, etc. and what will and will not
# work with windows that will work with unix, and what will and will not
# work with certain versions of certain OS's. is the $^O the only thing i
# can check this with? i've found that more then a few hosts don't allow
# some type of commands to be executed, i.e., "ps", which makes it
# difficult to kill a process id that may be sitting around too long. i'm
# wondering if there's a site that lists the different OS's and how to
# find out if they support flock, fork, etc. and have the script react
# depending on what they do.
Mike Guy had some good things to say ... Config would be great if it were
reliable. :/ Anyway, see man perlport for more information on
portability, including notes about flock, calling external programs, etc.
It is in a perl5.004_05 or higher near you, and on CPAN. The best version
is the most recent, included with 5.005_57, or at
http://pudge.net/macperl/perlport.html. At the end is a reference
(incomplete, of course) that describes which functions don't work (or work
differently) on which platforms. If anyone has more information that is
not currently listed there, please let me know.
As a side note, on Unix, flock/fork shouldn't be a big problem for you,
but using ps will be, since its behavior is drastically different between
implementations (if it is available at all, of course).
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: 01 Jun 1999 11:35:34 -0500
From: Dale Henderson <dhenders@cpsgroup.com>
Subject: Re: Better solution ?
Message-Id: <87d7zf3mll.fsf@camel.cpsgroup.com>
>>>>> "Uri" == Uri Guttman <uri@sysarch.com> writes:
>>>>> "n" == nilrame <nilrame@my-deja.com> writes:
>>> perl -pe 'print "X" x 2000 if ( 1 .. 2000 )'
>>>
n> I never can remember those switches :)
Uri> you should know -p and -n and -e. then add -0, -l and a few
Uri> others. most of the others are not that commonly used.
Of the above I'm vaguely familiar with -n and -p. I know -e, -c, -d,
-w and -T. (constantly using those last two.)
>>> perl -pe 'BEGIN {$x = "X" x 2000} print $x if ( 1 .. 2000 )'
n> I thought of something like this (After I posted). However to
n> do the prepending (that my original does) you would need
n> something like.
n> perl -pe 'BEGIN {$x = "X" x 2000} print $x$_ if ( 1 .. 1000 )'
Uri> well, i beg to differ. in your case you have a syntax
Uri> error. you need to put $x$_ in "". but that is still wrong as
Uri> you would find out by trying both (with simpler prefixes and
Uri> fewer lines). remember -p means print the input line after
Uri> loop block. so mine prints $x and the -p loop prints $_. so
Uri> in your case $_ is printed twice. use a -n loop for your
Uri> version.
You're right here. I told you I could never remember those
switches. :)
n> (fixed the typo too)
Uri> 2000 => 1000? or what typo did you mean?
That was it.
Uri> uri
------------------------------
Date: 1 Jun 1999 17:21:57 -0000
From: Anony Mail <AnnonyMai1@nym.alias.net>
Subject: Better than Perl
Message-Id: <19990601172157.8497.qmail@nym.alias.net>
Try Unicon, its more powerful.
UNICON/Icon2
============
http//www.drones.com/unicon/
http//www.cs.arizona.edu/icon/index.htm
http//www.cs.arizona.edu/icon/oddsends/images/graphics/graphics.htm
------------------------------
Date: 01 Jun 1999 10:49:19 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Better than Perl
Message-Id: <m1ogiz6cbk.fsf@halfdome.holdit.com>
>>>>> "Anony" == Anony Mail <AnnonyMai1@nym.alias.net> writes:
Anony> Try Unicon, its more powerful.
Besides spamming this to at least a few newsgroups over the past week,
(like the hpux group? what does that have to do with icon?) which
already makes me wonder about you, I might even believe you better if
you'd come out from behind that anonymous mask.
So, reveal yourself, or be gone.
--
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: Tue, 1 Jun 1999 11:51:51 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Can I do this with an "if" statement?
Message-Id: <x3ybtez536w.fsf@tigre.matrox.com>
lr@hpl.hp.com (Larry Rosler) writes:
> if (1 <= $ans && $ans <= 60) {
> ...
>
> No shorthand available for that.
In cases like these, Python has a very useful, and intuitive
feature. It allows you to do something like:
if 1 <= ans <= 60:
# bla bla
Is this a tough thing to add to Perl? I'll try to investigate this
myself, but maybe someone else (more knowledgable with Perl's guts)
would be able to elaborate more on this.
Comments anyone?
Ala
------------------------------
Date: Tue, 01 Jun 1999 17:07:42 GMT
From: nospam.newton@gmx.net (Philip 'Yes, that's my address' Newton)
Subject: Re: Can I execute a string?
Message-Id: <37536879.195313683@news.nikoma.de>
On Mon, 31 May 1999 01:41:59 +0100, "TheHat"
<ng@thehat.free-online.co.uk> wrote:
>I'm just learning PERL and have a question.
>I want to store the name of a variable in a string, and then later set that
>variable to a value.
>Is there a way to do this?
Methinks he wanteth a hash....
#!/usr/bin/perl -w
use strict;
my($string, %hash);
$string = 'name-of-var';
# Later, back at the farm...
$hash{$string} = 'value'
Works like a charm, and no nasty eval's, either.
Cheers,
Philip
--
Philip Newton <pne@user.picon.de>
------------------------------
Date: Tue, 01 Jun 1999 10:29:13 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
To: "news.boeing.com" <jim.ray@west.boeing.com>
Subject: Re: Can PERL attach a file to a FORM that will get Emailed?
Message-Id: <37541869.CDB8F165@mail.cor.epa.gov>
[courtesy cc sent to poster]
news.boeing.com wrote:
>
> I need to create a FORM that will be emailed to me. I also need to have the
> user attach a file to the form. Can this be down with PERL? If so where
> can I purchase or download the file?
Jim, since you're using Microsoft Lookout! Express to send this,
I assume you're using ActiveState Perl on a win32 box. If so,
always look for modules first using PPM. If not, you'll want to
go to CPAN to get them.
That said, you probably want the MIME::Lite module. It either
comes with ActiveState Perl (modern versions), or else it is
available from ActiveState using only the PPM program to fetch
and install it for you. I'm being vague here because it's
on my win98 system, but I don't remember whether I installed it
using ppm, or if it came with the ActiveState build. (I do know
no one else added it surreptitiously.) MIME::Lite will let you
stick an attachment onto an e-mail. The CGI form part of
your question is easily done using the CGI.pm module, which
is likewise available.
In general, when you're lookiong for Perl scripts or modules,
you should think in terms of download, rather than purchase.
This is Perl. Think 'Artistic License'.
HTH,
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 1 Jun 1999 10:55:18 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Extractingg a text in a file...
Message-Id: <MPG.11bdbe5e5a82f95e989b4b@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <3754E19B.36CB95ED@forfree.at> on Tue, 01 Jun 1999 12:51:22
GMT, (BXTC) <bxtc@forfree.at> says...
> I am guessing this should be real easy to do as Perl is pretty much
> named for doing this...but i fail to see how. I don't expect exact
> answers to this question, as I can do the research myself, but I would
> appriciate it if someone could tell me what I should be researching, I
> am fairly new to perl, and perldoc is good if you already know what you
> are looking for(but I don't).
>
> My situation is that I have a config file that has entries like this:
>
> 209.195.11.
> $ftphostpigseye.kennesaw.edu
> $ftppasswd56ld562
> $pageindex.html
>
> And I need to be able to read the file and extract '56ld562' and assign
> it to the string $ftppasswd. And the same with the others besides the
> initial, partial IP. So when I ran my program I could make $ftppasswd =
> "56ld562" by reading from a config file. And if it maters I am using
> linux. I appriciate all the help that this NG has given me,
That is rather a rotten format for the configuration file, because of
lack of delimiters for the data, but let's take it as a given.
It is as easy to show you a (brute-force) approach as to tell you where
to look, which is mostly in perlre for regular expressions. I assume
that the syntax will not trouble you.
The main thing to avoid is trying to construct the names of the
variables from the data that you read. If you feel that you have to do
that, make the names entries in a hash.
#!/usr/local/bin/perl -w
use strict;
my ($ftphost, $ftppasswd, $page);
while (<DATA>) {
next unless /^\$/;
if (/^\$ftphost(.+)/) {
$ftphost = $1;
} elsif (/^\$ftppasswd(.+)/) {
$ftppasswd = $1;
} elsif (/^\$page(.+)/) {
$page = $1;
}
}
print
"\$ftphost = $ftphost, \$ftppasswd = $ftppasswd, \$page = $page\n";
__END__
209.195.11.
$ftphostpigseye.kennesaw.edu
$ftppasswd56ld562
$pageindex.html
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 01 Jun 1999 10:02:14 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: FAQ 2.3: I don't have a C compiler on my system. How can I compile perl?
Message-Id: <37541216.7CE56944@mail.cor.epa.gov>
Tom Christiansen wrote:
>
> [snip]
> Since you don't have a C compiler, you're doomed and your vendor
> should be sacrificed to the Sun gods. But that doesn't help you.
^^^^^^^^^^^^^^^^^^^^^^^^^^
Still one of my favorite lines from the FAQ.
Particularly now that 1.10 isn't "Should I program everything
in Perl?"
And 4.14 isn't "What's the fastest way to code up a given task
in Perl?"
And 5.19 no longer includes that e-mail address to access
the shell-to-Perl filter. :-) TomC, you know why I'm not
including the actual address...
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 1 Jun 1999 18:38:11 +0100
From: "David Cooper" <news@medal.force9.net>
Subject: GD, PPM, XML: Parser
Message-Id: <7SU43.148$Tw4.217@stones>
Hello
I've installed ActiveState build 517.
When I use PPM to install GD (or anything else for that matter) I get the
following error:
no element found at line 1, column 0, byte -1 at
C:/Perl/site/lib/XML/Parser.pm
line 153
I had no problems under a previous build.
Can anyone help?
Cheers
------------------------------
Date: Tue, 1 Jun 1999 10:01:35 -0700
From: Lewis Lin <lewie@leland.Stanford.EDU>
Subject: how to eliminate double counting for hit counter
Message-Id: <Pine.GSO.3.96.990601095949.3176A-100000@tree0.Stanford.EDU>
I'm creating a script for website hits. Everytime someone clicks on a
particular page, I want to register it as a hit. However, I don't want
the hit to double count (that is, if this person comes back and tries to
click again, it shouldn't register). What's the best way to do this? I
don't want to keep a long list of IP addresses storing exactly which pages
it has clicked on before...
------------------------------
Date: 1 Jun 1999 11:27:07 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: how to eliminate double counting for hit counter
Message-Id: <375417eb@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Lewis Lin <lewie@leland.Stanford.EDU> writes:
:I'm creating a script for website hits.
Don't do that.
:Everytime someone clicks on a
:particular page, I want to register it as a hit.
No, you don't.
:However, I don't want
:the hit to double count (that is, if this person comes back and tries to
:click again, it shouldn't register). What's the best way to do this?
It's impossible.
:I don't want to keep a long list of IP addresses storing exactly which
:pages it has clicked on before...
Give up. You just don't understand. See the related thread for why.
And this has nothing to do with Perl.
--tom
--
There's going to be no serious problem after this. --Ken Thompson
------------------------------
Date: Tue, 01 Jun 1999 17:38:04 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: how to eliminate double counting for hit counter
Message-Id: <7j15q6$adf$1@news.mch.sbs.de>
In article <Pine.GSO.3.96.990601095949.3176A-100000@tree0.Stanford.EDU>, Lewis Lin <lewie@leland.Stanford.EDU> wrote:
>I'm creating a script for website hits. Everytime someone clicks on a
>particular page, I want to register it as a hit. However, I don't want
>the hit to double count (that is, if this person comes back and tries to
>click again, it shouldn't register). What's the best way to do this? I
>don't want to keep a long list of IP addresses storing exactly which pages
>it has clicked on before...
>
Here we go again :o
You can't (at least not with 100% reliability, or even close to that).
How do you identify a 'person' ? With IP addresses, you get the
problem of proxies (both many people behind a single address,
and one person behind several addresses).
And would you count a 'person' coming back after 30 minutes
as a single hit, or as two hits ?
In addition, you have the caching problem, both by the browser
and by any intermediate proxy or cache server, and you have
the robots walking around the web, etc. so that hits can be
generated by non-persons too...
Anyway, having said all this, no need to reinvent the wheel,
since you'll find many of these things ready-made. For
instance, have a look at the CGI Resource Index, at :
http://cgi.resourceindex.com/Programs_and_Scripts/Perl/
Look under "Access Counters" and "Logging Accesses and
Statistics".
Have fun,
Michel.
--
aWebVisit - extracts visitor information from WWW logfiles and shows
the top entry, transit, exit and 'hit&run' pages, the links followed
inside your website, the time spent per page, the visit duration etc.
For more details, see http://gallery.uunet.be/Michel.Dalle/awv.html
------------------------------
Date: 01 Jun 1999 13:16:18 -0400
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Is split (surprisingly, amazingly) slow?
Message-Id: <m3wvxnaljx.fsf@joshua.panix.com>
"Jonathan" <jonathan@meanwhile.freeserve.co.uk> writes:
> 3/ I assumed that any reader who wanted more details would have the
> intelligence, wit, savvy etc to dejanews the original posts. That's
> why I quoted the exact subject line. Seems I was wrong. I apologize
> for over-estimating your resourcefulness.
*plonk*!
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: Tue, 01 Jun 1999 17:08:32 GMT
From: Mitch <portboy@home.com>
Subject: manipulating text file...
Message-Id: <3753A3BC.4F887AB8@home.com>
Okay, I am able to easily remove and edit fields in a text file,
however, I still have a quick question. I have a config file that looks
something like;
blah
blah blah
blah blah
blah
foo this you freak
foo me
foo bar
foo haha
blah
blah
blah
blah
What I would like to be able to do is, if a user enters an input of "foo
schnicken", I'd like to able to put that right after "foo haha" or the
last seen "foo" entry. How can I do this?
Thanks, Mitch
------------------------------
Date: Tue, 1 Jun 1999 10:12:27 -0700
From: "Dave Roth" <xrxoxtxhxdx@xrxoxtxhx.xnxextx>
Subject: Re: Opendir on the root of a NT Server
Message-Id: <nsU43.1640$4b.36630@news2.giganews.com>
David Cassell wrote in message <37530210.B6720D87@mail.cor.epa.gov>...
>Mike Mc Mahon wrote:
>>
>> I am trying to do an opendir() of the root of an NT server share and it
is
>> failing. I am not using UNC convention and the userid has full rights to
the
>> share. I can open a directory off the root but I cannot open the root.
Are you trying to do this from a cgi script or a web based .asp page?
If so there are tricky & odd security issues. They have to do with the
primary token attached to the process. If inheritance is incorrectly
performed
then some remote accesses will fail regardless of how many permissions you
place on the share and files.
Consider this to be a bug in some versions of IIS.
dave
--
=================================================================
Dave Roth ...glittering prizes and
Roth Consulting endless compromises, shatter
<rothd at roth dot net> the illusion of integrity
http://www.roth.net
Win32, Perl, C++, ODBC, Training
Our latest Perl book is now available:
"Win32 Perl Programming: The Standard Extensions"
http://www.roth.net/books/extensions/
------------------------------
Date: Tue, 1 Jun 1999 10:15:16 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: pattern matching
Message-Id: <MPG.11bdb4f9e3ef68bd989b4a@nntp.hpl.hp.com>
In article <7j124a$5bg$1@pegasus.csx.cam.ac.uk> on 1 Jun 1999 16:35:22
GMT, M.J.T. Guy <mjtg@cus.cam.ac.uk> says...
> Frank Hale <frankhale@yahoo.com> wrote:
> >How can I match newlines in patterns?
> >
> >for example:
> >
> >if ($token =~ /template{(\d\D)}/) {
> > print $token."\n";
> >}
> >
> >The pattern I am matching can have newlines in it but I can't seem to
> >match newlines in the pattern. How do you match newlines in patterns?
>
> I don't understand what you want to do - the regex you quote seems a
> very odd one. Did you mean to use a character class [\d\D],
> rather than capturing brackets (\d\D) ?
I doubt it. That character class seems rather inclusive. :-) Of
course, it also includes newlines...
> To match a newline, just include \n in your pattern.
>
> To match an arbitrary character which may be a newline, use . and
> add the /s modifier. See perldoc perlre.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 01 Jun 1999 11:00:13 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: Perl "constructors"
Message-Id: <xkf6757eu02.fsf@valdemar.col.hp.com>
abigail@delanet.com (Abigail) writes:
> No, that's a feature. If I call a library function and that function is
> supposed to open a file, but dies with a useful error message if it can't,
> why should I be forced to deal with it? I can't open the file, the program
> hence can't do anything useful, so dieing is fine.
No, my point was that if you raise an exception inside an eval block,
there's no mechanism for forcing the client to die if it doesn't catch
said exception.
sub openfile {
$filename = shift;
open FILE, $filename or die "couldn't open $filename: $!";
}
eval {
openfile();
# other stuff happens here
}
If openfile dies, then the eval provides no mechanism for propogating
that die outside its block.
After thinking about it, I'm less annoyed by this than I originally was--
after all, why put it in the eval if you don't want to deal with
exceptions yourself-- but I still think it would be useful to provide a
way of saying, "propogate all exceptions I didn't explicitly handle onto
the next enclosing eval block" that didn't reduce to "else { die $@; }".
But I'll concede that's probably me thinking Java in Perl.
> Why the extra work?
There shouldn't be any; that was my whole point.
-=Eric
------------------------------
Date: Tue, 1 Jun 1999 11:59:47 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Predefined variable for array number?
Message-Id: <x3yaeuj52to.fsf@tigre.matrox.com>
".." <none@none.ca> writes:
> Is there an array equivalent of the $. variable for files. i.e. A variable
> which tells you what array number you are currently at.
>
> ex: Pretending that this variable was named $array_num:
>
> @array = (a b c d);
>
> foreach $x (@array) {
> print $array_num\n;
> }
>
> This would print:
>
> 0
> 1
> 2
> 3
Why would you need such a special variable? I don't think it is
special enough to warrant such an action. Perl's namespace shouldn't
be any more cluttered than it is now. Besides, what's so hard about
doing:
for my $index (0..$#array) {
print $index;
}
??
Ala
------------------------------
Date: Tue, 1 Jun 1999 11:15:22 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Secure join?
Message-Id: <x3yd7zg3qba.fsf@tigre.matrox.com>
"Pavel Kotala" <pkotala@logis.cz> writes:
> I use DBD - oracle. Sometimes I receive rows with NULL (in Perl undefined)
> values.
>
> Then in this line:
>
> print RR join( ",", @$row) . "\n";
>
> I receive message:
>
> Use of uninitialized value at ...
>
> When I try to print initialized fields print $$row[1], everything is OK.
>
> Where is an error? I using join bad (then exists any secure join function,
> that replaces undefined to "")?
There is no error. You said that some of the fields might be
undefined. Perl is just alerting you to this fact. By default, all
uninitialized variables are set to either "" or 0 (depending on their
context), but Perl will let you know (if you use the -w switch, that
is).
I can give you two solutions. The first is to disable warnings just
for your print() statement:
{ local $^W = 0;
print RR join( ",", @$row) . "\n";
}
The second solution is to substitute all undefined values with the
empty string before printing, as you note above:
map { $_ = "" unless defined $_ } @$row;
HTH,
Ala
------------------------------
Date: 1 Jun 1999 17:51:49 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Secure join?
Message-Id: <7j16jl$a0h$1@pegasus.csx.cam.ac.uk>
Ala Qumsieh <aqumsieh@matrox.com> wrote:
>
>There is no error. You said that some of the fields might be
>undefined. Perl is just alerting you to this fact. By default, all
>uninitialized variables are set to either "" or 0 (depending on their
>context), but Perl will let you know (if you use the -w switch, that
>is).
Not quite accurate. The undefined value is *treated as if it were
either "" or 0*. The variable remains set to 'undef'.
Mike Guy
------------------------------
Date: Tue, 01 Jun 1999 17:13:53 GMT
From: Mitch <portboy@home.com>
Subject: Re: Serial port question...
Message-Id: <3753A4FE.8F9418D2@home.com>
That's fair enough...I'm using BSD 4.0, and need to be able to set the baud
rate, data bits (7 or 8), stop bits (1 or 2), and parity (even, odd, none)
(although for practical purposes, the only thing anyone will ever use is baud
rate and 8N1 at either 115200 or 9600). The default should be 9600 8N1.
Thanks, Mitch
Bbirthisel wrote:
> Hi Mitch:
>
> >I'm writing a script right now, that should allow the user to change the
> >baud rate on the serial port, how do I do this?
>
> Depends on which Operating System you are running.
> Is baud rate the only parameter of interest? There are
> usually others you need as well. If you provide a few
> details it will be easier to give useful answers.
>
> -bill
>
> Making computers work in Manufacturing for over 25 years (inquiries welcome)
------------------------------
Date: Tue, 01 Jun 1999 19:33:22 +0200
From: Frank de Bot <debot@xs4all.nl>
Subject: Time Error
Message-Id: <37541961.81458F7A@xs4all.nl>
I've some little trouble with the time. Today it's 1 june . But my
script thinks it's 2 june. It has the same problem with other dates at
the start of each month. Here's the script I use. If you have a better
one, I would love to hear from it.
($sec,$min,$hour,$mday,$mon,$year,$wday) =
(gmtime(time))[0,1,2,3,4,5,6];
@months = ('January','February','March','April','May','June',
'July','August','September','October','November','December');
@days =
('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturdat');
if ($sec < 10) { $sec = "0$sec"; }
if ($min < 10) { $min = "0$min"; }
if ($hour < 10) { $hour = "0$hour"; }
if ($mday <10) { $mday = "0$wday"; }
if ($mon <10) { $mon = "0$mon"; }
--
\\\|///
\\ - - //
( @ @ )
/----------------------oOOo-(_)-oOOo--------------------\
| |
| |
| My Email: debot@xs4all.nl |
| Homepages: http://www.debot.nl/ppi/ |
| http://www.searchy.net/ |
| |
\-------------------------------Oooo--------------------/
oooO ( )
( ) ) /
\ ( (_/
\_)
------------------------------
Date: 1 Jun 1999 17:49:30 GMT
From: ada@fc.hp.com (Andrew Allen)
Subject: Re: Use binmode for binary files (Was: Re: PB writing an uploaded file in perl (size changes!))
Message-Id: <7j16fa$nf4$2@fcnews.fc.hp.com>
Larry Rosler (lr@hpl.hp.com) wrote:
: 2. On some legacy systems, records ('lines') are defined by structures
: imposed by the file system, rather than by embedded characters in a byte
: stream. On such systems, the binmode() distinctions become critical.
Cool. Where can I get perl for the IBM S/34? (remembering
less-than-fond days from my RPG II class).
But seriously, which systems are these? (for humorous purposes, if
nothing else.) Are the perl programs also line-records?
Andrew
------------------------------
Date: Tue, 01 Jun 1999 17:11:55 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Y2K infected Perl code
Message-Id: <pudge-0106991311570001@192.168.0.77>
In article <37540ca0.20254634@news.insnet.net>, NukeEmUp@ThePentagon.com
(David Cantrell) wrote:
# good way of notifying you without using a header. I am not aware of
# any way of inserting that header into all my messages using my current
# newsreader but if someone cares to enlighten me how, I'll do it. And
# no, I'm not even going to consider changing newsreaders.
Well, if you can't put headers into it, it's broken. If you want to
continue using a broken newsreader, that's your business, I guess.
# And it goes without saying that making a point
# of CCing me against my expressed wishes is EXCEEDINGLY rude.
I don't know about rude, but it made me laugh, so it was well worth it. :D
--
Chris Nandor mailto:pudge@pobox.com http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10 1FF77F13 8180B6B6'])
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5850
**************************************