[11464] in Perl-Users-Digest
Perl-Users Digest, Issue: 5064 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 5 09:07:26 1999
Date: Fri, 5 Mar 99 06:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 5 Mar 1999 Volume: 8 Number: 5064
Today's topics:
Re: $1 gets clobbered (Bart Lateur)
Re: $1 gets clobbered (Jonathan Stowe)
Re: Case of missing cc and re -- a repost asking the co (Richard Clamp)
Re: Case of missing cc and re -- a repost asking the co (Jonathan Stowe)
deletion problem <anb5@aber.ac.uk>
deletion problem <anb5@aber.ac.uk>
deletion problem <anb5@aber.ac.uk>
deletion problem <anb5@aber.ac.uk>
deletion problem <anb5@aber.ac.uk>
deletion problem <anb5@aber.ac.uk>
deletion problem <anb5@aber.ac.uk>
Re: Editing 2,000 lines of someone else's code <ghealton@hiway1.exit109.com>
FAQ 1.6: How stable is Perl? <perlfaq-suggestions@perl.com>
FAQ 1.7: Is Perl difficult to learn? <perlfaq-suggestions@perl.com>
Re: help using system() (Jonathan Stowe)
Re: help using system() (Bart Lateur)
Re: help using system() (Jonathan Stowe)
Re: Image upload (Jonathan Stowe)
Killing a users connection? <horizon@internetexpress.com.au>
long lines in data file being cut <23_skidoo@geocities.com>
Re: PERL and mySQL <fty@utk.edu>
Re: Perl script to emulate communications program <ghealton@hiway1.exit109.com>
Re: Unix to NT conversion (Jonathan Stowe)
Re: warning: unquoted string...... <Allan@due.net>
Re: warning: unquoted string...... (Bart Lateur)
Where can I get NT Resourse Kit? <buga@ipm.lviv.ua>
Re: Where can I get NT Resourse Kit? (Jonathan Stowe)
Re: y2k and 4-digit dates (was Re: foreach and while) <tobias@shark.td.org.uit.no>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 05 Mar 1999 11:27:37 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: $1 gets clobbered
Message-Id: <36dfbec0.12982073@news.skynet.be>
Jim and Paula wrote:
>Can someone please explain to me why $1 is getting clobbered in the
>last line below?
>
>It becomes uninitialized and I get an undefined warning when I try to
>print it even though I'm not using pattern memory.
>$string = "this is not good";
>$string =~ /(not)/;
>print $1 , "\n"; # prints "not"
>if ($1 =~ /not/){ print "Say what?";}
>print $1 , "\n";
Of course it gets clobbered. $1 etc. are only garanteed to maintain
their value until the next pattern match. You're using another pattern
match, where $1 means nothing, so it is now undef.
Try this instead. Because the next pattern match is inside a block, the
matches are restored when the block is exited. (behaviour as with
local()).
#! perl -w
$string = "this is not good";
$string =~ /(not)/;
print $1 , "\n"; # prints "not"
{
if ($1 =~ /not/){ print "Say what?\n";}
}
print $1 , "\n";
__END__
not
Say what?
not
Bart.
------------------------------
Date: Fri, 05 Mar 1999 11:25:15 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: $1 gets clobbered
Message-Id: <36dfbda2.8848497@news.dircon.co.uk>
On Fri, 05 Mar 1999 06:45:11 GMT, gemhound@gemhound.com (Jim and
Paula) wrote:
>Can someone please explain to me why $1 is getting clobbered in the
>last line below?
>
>It becomes uninitialized and I get an undefined warning when I try to
>print it even though I'm not using pattern memory. I thought you
>could use $# just like any other variable as long as you didn't fill
>it up again with pattern memory or go out of the block.
>
>use diagnostics;
>
>$string = "this is not good";
>
>$string =~ /(not)/;
>
>print $1 , "\n"; # prints "not"
>
>if ($1 =~ /not/){ print "Say what?";}
>
>print $1 , "\n";
>
>
Just to demonstrate what is going on here you might change your second
match to:
if($1 =~ /blah/ ) { ...
I am sure someone will explain technically what is going on here but
suffice it to say that after a *succesful* match $1 is set if
capturing is in force or undef'd if not.
/J\
------------------------------
Date: Fri, 05 Mar 1999 11:06:28 GMT
From: richardc@tw2.com (Richard Clamp)
Subject: Re: Case of missing cc and re -- a repost asking the correct question.
Message-Id: <36dfb9e3.5304790@news.cis.dfn.de>
On Thu, 04 Mar 1999 16:58:01 -0600, Michael Fuerst
<m-fuerst@cecer.army.mil> wrote:
>*******Question 1
>Can someone show me (a new PERL convert)
>HOW to RECOGNIZE a a string of comma separated words
> with intervening
>spaces, tabs and new lines, form w/i a longer string
>(eg a function call or variable declaration)
It goes something like this.
Programmer (Looking at data)
Aren't you a string of comma seperated words with whitespace?
Data:
Damnit, you recognised me.
As easy as that
Richard (being dragged back to his rubber room)
------------------------------
Date: Fri, 05 Mar 1999 12:47:16 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Case of missing cc and re -- a repost asking the correct question.
Message-Id: <36dfd1f4.14050533@news.dircon.co.uk>
On Thu, 04 Mar 1999 16:58:01 -0600, Michael Fuerst
<m-fuerst@cecer.army.mil> wrote:
>*******Question 1
>Can someone show me (a new PERL convert)
>HOW to RECOGNIZE a a string of comma separated words
> with intervening
>spaces, tabs and new lines, form w/i a longer string
>(eg a function call or variable declaration)
>and put the resulting words into an array?
>My interest is learning the intracies of regular expressions.
>
>
I've got to say I couldnt quite get my head round what you were trying
to do but does this look like it should fit the bill:
#!/usr/local/bin/perl -w
use strict;
my $string =<<EIEIO;
This, is ,string
,that, has,got, tabs, newlines, 910,
and, sundry,6got,rubbish,_like_,
this
EIEIO
my @words = $string =~ /\b([_a-zA-Z]+)\b/gm;
print join "\n",@words;
/J\
------------------------------
Date: Fri, 05 Mar 1999 12:50:18 +0000
From: anthony belsey <anb5@aber.ac.uk>
Subject: deletion problem
Message-Id: <36DFD30A.EAFF58EF@aber.ac.uk>
Can any one help?
I have a text file with data in.
my program accesses this file and searches for a key to a line.
if the search is successfull, I then want to delete that line off the
text file.
every thing I do fails to delete that line.
Many thanks
anthony
------------------------------
Date: Fri, 05 Mar 1999 12:50:28 +0000
From: anthony belsey <anb5@aber.ac.uk>
Subject: deletion problem
Message-Id: <36DFD314.DF21E360@aber.ac.uk>
Can any one help?
I have a text file with data in.
my program accesses this file and searches for a key to a line.
if the search is successfull, I then want to delete that line off the
text file.
every thing I do fails to delete that line.
Many thanks
anthony
------------------------------
Date: Fri, 05 Mar 1999 12:51:07 +0000
From: anthony belsey <anb5@aber.ac.uk>
Subject: deletion problem
Message-Id: <36DFD33B.77CDA084@aber.ac.uk>
Can any one help?
I have a text file with data in.
my program accesses this file and searches for a key to a line.
if the search is successfull, I then want to delete that line off the
text file.
every thing I do fails to delete that line.
Many thanks
anthony
------------------------------
Date: Fri, 05 Mar 1999 12:57:11 +0000
From: anthony belsey <anb5@aber.ac.uk>
Subject: deletion problem
Message-Id: <36DFD4A7.79454A9D@aber.ac.uk>
can any one help?
I have a text file with data in.
My program reads that file and searches for a key word.
If that key word is found, then that line is deleted from the
file.
Every thing that I try has failed.
Can any one help?
many thanks.
Anthony
------------------------------
Date: Fri, 05 Mar 1999 12:59:08 +0000
From: anthony belsey <anb5@aber.ac.uk>
Subject: deletion problem
Message-Id: <36DFD51C.3B87027C@aber.ac.uk>
can any one help?
I have a text file with data in.
My program reads that file and searches for a key word.
If that key word is found, then that line is deleted from the
file.
Every thing that I try has failed.
Can any one help?
many thanks.
Anthony
------------------------------
Date: Fri, 05 Mar 1999 12:59:04 +0000
From: anthony belsey <anb5@aber.ac.uk>
Subject: deletion problem
Message-Id: <36DFD518.F3B30BE3@aber.ac.uk>
can any one help?
I have a text file with data in.
My program reads that file and searches for a key word.
If that key word is found, then that line is deleted from the
file.
Every thing that I try has failed.
Can any one help?
many thanks.
Anthony
------------------------------
Date: Fri, 05 Mar 1999 12:59:23 +0000
From: anthony belsey <anb5@aber.ac.uk>
Subject: deletion problem
Message-Id: <36DFD52B.1BEE6AA@aber.ac.uk>
can any one help?
I have a text file with data in.
My program reads that file and searches for a key word.
If that key word is found, then that line is deleted from the
file.
Every thing that I try has failed.
Can any one help?
many thanks.
Anthony
------------------------------
Date: 5 Mar 1999 11:49:49 GMT
From: Gilbert C Healton <ghealton@hiway1.exit109.com>
Subject: Re: Editing 2,000 lines of someone else's code
Message-Id: <7bogct$908$1@news1.exit109.com>
Andrew M. Langmead <aml@world.std.com> wrote:
: Halley Lin <revjack@radix.net> writes:
:>Why do you suppose someone would call the sub this way:
:> eval '&printWah';
:>instead of this way:
:> &printWah;
: There is one reason I can think of doing that, for particular
: circumstances. Since perl4 only had the eval EXPR form of eval, this
: would be a way of trapping fatal errors.
Could the &printWAH function in the file you are looking at be a
default definition to scribble an error messge if a "require" file
does not redefine it? Adding the ability to trap fatal errors (at
least most of them in perl 4) would then make a LOT of sense in
applications that need to stay up instead of crashing.
------------------------------
Date: 5 Mar 1999 04:10:00 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 1.6: How stable is Perl?
Message-Id: <36dfbb88@csnews>
(This excerpt from perlfaq1 - General Questions About Perl
($Revision: 1.21 $, $Date: 1999/01/26 09:55:05 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq1.html
if your negligent system adminstrator has been remiss in his duties.)
How stable is Perl?
Production releases, which incorporate bug fixes and new
functionality, are widely tested before release. Since the 5.000
release, we have averaged only about one production release per
year.
Larry and the Perl development team occasionally make changes to
the internal core of the language, but all possible efforts are
made toward backward compatibility. While not quite all perl4
scripts run flawlessly under perl5, an update to perl should
nearly never invalidate a program written for an earlier version
of perl (barring accidental bug fixes and the rare new keyword).
--
Let us be charitable, and call it a misleading feature :-)
--Larry Wall in <2609@jato.Jpl.Nasa.Gov>
------------------------------
Date: 5 Mar 1999 06:40:03 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 1.7: Is Perl difficult to learn?
Message-Id: <36dfdeb3@csnews>
(This excerpt from perlfaq1 - General Questions About Perl
($Revision: 1.21 $, $Date: 1999/01/26 09:55:05 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq1.html
if your negligent system adminstrator has been remiss in his duties.)
Is Perl difficult to learn?
No, Perl is easy to start learning -- and easy to keep learning.
It looks like most programming languages you're likely to have
experience with, so if you've ever written an C program, an awk
script, a shell script, or even BASIC program, you're already
part way there.
Most tasks only require a small subset of the Perl language. One
of the guiding mottos for Perl development is "there's more than
one way to do it" (TMTOWTDI, sometimes pronounced "tim toady").
Perl's learning curve is therefore shallow (easy to learn) and
long (there's a whole lot you can do if you really want).
Finally, because Perl is frequently (but not always, and
certainly not by definition) an interpreted language, you can
write your programs and test them without an intermediate
compilation step, allowing you to experiment and test/debug
quickly and easily. This ease of experimentation flattens the
learning curve even more.
Things that make Perl easier to learn: Unix experience, almost
any kind of programming experience, an understanding of regular
expressions, and the ability to understand other people's code.
If there's something you need to do, then it's probably already
been done, and a working example is usually available for free.
Don't forget the new perl modules, either. They're discussed in
Part 3 of this FAQ, along with CPAN, which is discussed in Part
2.
--
There is a need to keep from being locked into Open Systems. --IBM sales rep
------------------------------
Date: Fri, 05 Mar 1999 10:48:18 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: help using system()
Message-Id: <36dfb621.6926617@news.dircon.co.uk>
On Thu, 04 Mar 1999 20:14:14 GMT, cindy_conway@my-dejanews.com wrote:
>Hi All,
>
>I am trying to use system() on a Perl script running on an NT system. I need
>to invoke a windows application called Bar Tender.I've written it like this:
>
>system("bartend") #bartend.exe is the program file
>
>When I run the script, nothing happens. If I write the same line of code, and
>I try to invoke an application that is located under the winnt directory
>(like, say, notepad or pblush), it runs no problemo.
>
Have you tried putting the full path to your program in the system() -
notepad etc work because they are in the PATH.
/J\
------------------------------
Date: Fri, 05 Mar 1999 11:41:10 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: help using system()
Message-Id: <36e0c11a.13584819@news.skynet.be>
cindy_conway@my-dejanews.com wrote:
>system("bartend") #bartend.exe is the program file
Help! Help! I don't want to end! Not yet, anyway!
Maybe you should try to do a chdir() first.
Bart.
------------------------------
Date: Fri, 05 Mar 1999 12:54:46 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: help using system()
Message-Id: <36dfd3f3.14562142@news.dircon.co.uk>
On Fri, 05 Mar 1999 11:41:10 GMT, bart.lateur@skynet.be (Bart Lateur)
wrote:
>cindy_conway@my-dejanews.com wrote:
>
>>system("bartend") #bartend.exe is the program file
>
>Help! Help! I don't want to end! Not yet, anyway!
>
You'd better avoid bartenders then ;-}
/J\
------------------------------
Date: Fri, 05 Mar 1999 11:04:12 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Image upload
Message-Id: <36dfb74b.7224862@news.dircon.co.uk>
On Thu, 04 Mar 1999 20:02:10 GMT, nabil@umit.maine.edu wrote:
>Hi I am writing a program to upload an image from Netscape using CGI-lib.pl
>Once my file is uploaded from the hard drive to the server it's in Ascii
>format not binary Can any one tell me how i can upload an image from the hard
>drive to the server using CGI program in Perl
>
A) use CGI.pm - file uploads are well documented in its POD.
B) binmode the filehandles if your server is Win32
C) check out the article by Brent Michalski on this subject at
<http://webreview.com/wr/pub/98/08/14/perl/index.html>
/J\
------------------------------
Date: Sat, 06 Mar 1999 00:00:42 +1100
From: Mick <horizon@internetexpress.com.au>
Subject: Killing a users connection?
Message-Id: <36DFD57A.8A7EEE78@internetexpress.com.au>
Hi everyone...
On a WinNT Back Office server, we have x amount of users (Modem log on).
The users are allowed unlimited hours, but, the amount of users allowed
connection at one time is 75, so if another user tries to log on, the
user currently
logged on that has been logged on for the greatest amount of time, is
kicked off.
I want to be able to write this in Perl -
- Is it possible?
- if not, what other alternatives are there?
- If it is, can you please give some information on how to go about it?
Hope someone can help!
thanks,
Mick
--
HORIZON
Software
Solutions
Developers /
Consultants
-= Integrated Systems / Internet / Unix /
Windows / Linux =-
------------------------------
Date: Fri, 05 Mar 1999 11:37:39 +0000
From: 23_skidoo <23_skidoo@geocities.com>
Subject: long lines in data file being cut
Message-Id: <36DFC1FB.7182@geocities.com>
hi, i've just looked through perlfaq4 - Data Manipulation ($Revision:
1.15 $) and perlfaq5 - Files and Formats ($Revision: 1.19 $) and
dejanews for the answer to this question. no luck so far.
i have a cgi script which reads from an html form and creates a data
file like this, adding new entries onto the end of the file:
Tues 2rd Mar - 108 Club
19990302
eric
foo@bar.com
a review of a gig which could be any length
=====
Tues 2rd Mar - 108 Club
19990302
eric2
foo2@bar.com
another review of a gig which again could be any length
=====
my problem is that the final line, the review of a gig can be any length
and when they get over 1833 characters, that's all that gets stored, the
rest is lost somewhere.
can anyone tell me why this might be happening and if there's any way i
can stop this? i thought perl didn't have any limits so i'm assuming
that the limit must be elsewhere, any suggestions where i could look?
because this is being formatted for html, any \n or \r is converted into
a <br> before it's stored in the datafile, this ensures that each entry
is 6 lines long including the trailing '=====' it would be perfect if i
could keep them at 6 lines but it's more important that people can enter
as big a review as they want so if i have to re-write, i guess i'll
re-write.
thanks for any advice
-23
------------------------------
Date: Fri, 05 Mar 1999 08:11:29 -0500
From: Jay Flaherty <fty@utk.edu>
Subject: Re: PERL and mySQL
Message-Id: <36DFD801.41EEB6AC@utk.edu>
Steve Linberg wrote:
>
> In article <36DE837C.54842FC6@utk.edu>, Jay Flaherty <fty@utk.edu> wrote:
>
> A couple of questions about this, just because the way I do it with
> DBI/MySQL differs from yours a little:
>
> $dbh->prepare can fail too, so you should check for errors here as well.
I don't think prepare does anything in mySQL but it doesn't hurt to
check. I usually
set RaiseError and PrintError in the connect statement like so:
$dbh = DBI->connect("DBI:mysql:database", "user", "password",
{RaiseError=>1, PrintError=>1}) or die blah, blah, blah...
This turns on error trapping for the whole application (life of $dbh). I
also use
eval{} sometimes to trap errors in $@
> > $sth->execute or die "unable to execute $query: $dbh->errstr\n";
>
> What's the difference between $dbh->errstr and $DBI::errstr? I use the
> latter everywhere.
$DBI::* attributes are dynamic and therefore have a short lifespan since
they are
only associated with the last handle used. Usually not a big deal if you
use it right
after the calling method that set them. I only use $DBI::errstr to test
the connect method
and use $dbh->errstr for everything else. It is just safer, especially
if your running perl
in multi-threading mode.
> > my $name = $sth->{NAME};
>
> Don't you have to fetch data first? As in:
>
> while (my @sql_data = $sth->fetchrow_array) {
> print join(", ", @sql_data); # or whatever
> }
No, $sth->{NAME} only gets column names you specified in the SELECT
statement. fetching
data returns one row of data at a time "only". Getting the column names
attribute (array reference) can be done anytime after the execute
statement.
> ...and you can use fetchrow_hashref as well, to allow the
> $sth->{$fieldname} access, but it is documented to be much slower in
> mysql.info.
right. I also usually use $sth->fetchrow_arrayref as it is faster using
array references
than passing whole arrays. This is why I use the NAME attribute. to
avoid using the fetchrow_hashref method when I want column names *and*
speed.
> > print "@$name\n";
>
> Why the @?
Because $name is a reference to an array of column names specified in
your query. An other way to do the above is:
print "Field names: @{ $sth->{NAME} }\n";
Usually you step through the array references to print out each row with
column headers. I usually slap this into a table with the column names
as table headers and the row info as
table rows.
Take care of your shoes...jay
------------------------------
Date: 5 Mar 1999 11:59:24 GMT
From: Gilbert C Healton <ghealton@hiway1.exit109.com>
Subject: Re: Perl script to emulate communications program
Message-Id: <7bogus$908$2@news1.exit109.com>
mr_potato_head@my-dejanews.com wrote:
: hi, I need to write a perl scripts that will run in a cron or term window,
: send commands to the screen, wait for a response, if response is not received
: in x seconds timeout, and capture all responses from the screen to a file. I
: need this script to run at night so a cron would be the prefered way to go.
: I'm not really sure how to send output to the screen and wait for a response
: like crosstalk or procomm pluse for windows can. I've tried using the print
: command to send out commands but it didn't work. Any help would be
: appreciated. Thanks in advance...
: -----------== Posted via Deja News, The Discussion Network ==----------
: http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
cron.... sounds like a UNIX environment, so...
You will need to explicitly open the "terminal" you want to write to.
open( CONSOLE, "/dev/console" ) || die "CONSOLE $!";
The trouble is , on many systems, /dev/console (may have different
name... for the operator console) often do not let anyone just open the
file to write to it. So you must do something like one of the following:
1. Run as user root.
2. Logon to /dev/console with the same user ID the cron job will use
and leave the terminal logged on overnight. I expect most UNIX
systems to change the ownership of the console to the login users
*during the duration of the login*.
3. Read the /etc/utmp file to find who is current logged in, look
for the LAST matching user name timewise, then send the message
to that user's terminal. This will direct the messages to the last
login for that user.
NOTE: If you send to /dev/console while no one is logged onto it, you
may find that the \n codes only move down a line and not return to the
left marging of the screen. In such cases you need to end lines with
\r\n rather than just \n.
------------------------------
Date: Fri, 05 Mar 1999 12:58:30 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Unix to NT conversion
Message-Id: <36dfd4a8.14742767@news.dircon.co.uk>
On Fri, 05 Mar 1999 11:28:03 GMT, info@gadnet.com wrote:
>I have written some banner exchange freeware (see URL below) and it
>works fine on unix. I have had several requests to convert it to run
>on NT, but I don't know anything about NT. Is there somewhere that
>explains the unix/NT perl conversion issues
check out the perlport manpage
>(or someone who wants to do it for me ;-))
I dont think anyone would want to encourage you to use NT ;-}
/J\
------------------------------
Date: Fri, 5 Mar 1999 08:17:09 -0500
From: "Allan M. Due" <Allan@due.net>
Subject: Re: warning: unquoted string......
Message-Id: <7bol41$fi$1@samsara0.mindspring.com>
mrnobody wrote in message <7bo44a$luk@fstgal00.tu-graz.ac.at>...
:Hi there,
:
:I want to open a file and put the content of the file (html-file) into the
:array $formulardaten which will be
:changed by another part of the script.
:for opening and reading out the file I use the following code:
:open (offenedatei, "<$tempdatei");
You really want to get in the habit of checking the return value open, you
really do.
Also, the cause of your error message is how you named your file handle.
The perl convention is for file handles to be upper case. Change that to:
open (OFFENEDATEI, "<$tempdatei") or die "Autopsy reveals death due to $!";
and all will be well .
:close (offenedatei);
You probably want to check the close as well.
[email copy per author's request]
HTH
AmD
--
$email{'Allan M. Due'} = ' All@n.Due.net ';
--random quote --
echo 'Congratulations. You aren't running Eunice.'
- Larry Wall in Configure from the perl distribution
------------------------------
Date: Fri, 05 Mar 1999 13:54:11 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: warning: unquoted string......
Message-Id: <36e0e0d9.2972980@news.skynet.be>
mrnobody wrote:
>I want to open a file and put the content of the file (html-file) into the
>array $formulardaten which will be
>changed by another part of the script.
That's not an array.
>for opening and reading out the file I use the following code:
>
>open (offenedatei, "<$tempdatei");
>$formulardaten=<offenedatei>;
>close (offenedatei);
Congratulations. You've now succesfully read the first line.
Unless if you had undef'ed $/ , after which you would have read in the
whole file as one string.
Oh, BTW, uppercase your filehandle. No more warning.
Bart.
------------------------------
Date: Fri, 5 Mar 1999 13:17:37 +0200
From: "Yaroslav Buga" <buga@ipm.lviv.ua>
Subject: Where can I get NT Resourse Kit?
Message-Id: <7boe8c$s2j$1@MU.icmp.lviv.ua>
I want to run program as a service. And I want to be able to start /stop it
from remote computer.
I have read that NT Resourse Kit allows to do so.
Where can I get it or is there another way to solve this problem?
Thank you.
------------------------------
Date: Fri, 05 Mar 1999 12:48:52 GMT
From: gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Where can I get NT Resourse Kit?
Message-Id: <36dfd2a2.14224627@news.dircon.co.uk>
On Fri, 5 Mar 1999 13:17:37 +0200, "Yaroslav Buga" <buga@ipm.lviv.ua>
wrote:
>I want to run program as a service. And I want to be able to start /stop it
>from remote computer.
>I have read that NT Resourse Kit allows to do so.
>Where can I get it or is there another way to solve this problem?
>
>From a bookshop.
/J\
------------------------------
Date: 05 Mar 1999 13:37:58 +0100
From: Tobias Brox <tobias@shark.td.org.uit.no>
Subject: Re: y2k and 4-digit dates (was Re: foreach and while)
Message-Id: <xn690dci02h.fsf@shark.td.org.uit.no>
Staffan Liljas <staffan@ngb.se> writes:
> How do you store a date unambiguously as a non-string? 1999? Well, is
> that the christian, muslim or hebrew calendar? You may say context is
> obvious, but I don't think it is...
If you're picky, you can say all data is ambigious. It's, for
instance, not "obvious" that the ASCII character set should be used
for text files. And what character set should be used for the eight
bit characters? Conventions _always_ have to be made of how the data
is to be interpreted.
When handling "ordinary" dates, I personally preffer the time_t
format. It's unambigous for still some time - and it doesn't cost much
geniousity to ensure it's easy to switch to 64 bits when out-of-range
dates are beeing needed.
> _implicit_ context whatever seems too obvious to you to mention. In
> 1970, the '19' seemed to obvious to mention. Today it seems obvious that
> we don't mean 11999, but one day it might not be so... (OK, that _was_
> farfetched).
No, I don't think so. For scientific purposes I might see the need of
date formats extending our "human lifetime scope" of time. Just as
both time_t and 2-digit string representation of the year is
inadequate for storing birth dates, because the birth dates may be out
of the "now"-scope represented by those formats.
> assuming about the context. Even for financial programs, there is
> usually no problem with two digit dates, if the program was written to
> handle the situation of the turn of a century,
Agree, agree. For most application, it _could_ be just like any
counter wrapping around. However, I guess it's more complicated,
because the real problem is, as you mention, not the limitation
itself, but that the programmers never thought of the problem (for
instance, I guess some programs might crash trying to write 1. january
as "1000101" when only 6 bytes of memory is allocated).
--
TobiX In a world without fences, who needs gates?
http://www.td.org.uit.no/~tobias/
------------------------------
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 5064
**************************************