[9401] in Perl-Users-Digest
Perl-Users Digest, Issue: 2996 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 26 17:07:21 1998
Date: Fri, 26 Jun 98 14:00:29 -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 Fri, 26 Jun 1998 Volume: 8 Number: 2996
Today's topics:
Re: [Q] Hash set in recursion, lost in caller <jdf@pobox.com>
\c@ in Perl, perl & perl + modules (Alan Barclay)
Re: \c@ in Perl, perl & perl + modules (Ilya Zakharevich)
flame everyone on sight (was Re: Perl and Delphi) <Russell_Schulz@locutus.ofB.ORG>
Re: Flames.... birgitt@my-dejanews.com
Re: Flames.... (John Moreno)
Re: Help with Programming <none@spam.com>
Re: Help with sorting <none@spam.com>
Increasing page block size for Perl DBMs (Tom O'Neil)
Re: Linked list and a code challenge (Craig Berry)
Re: NEED HELP !!!!!! <mahmed@dkl.com>
regex efficiency alawishus@my-dejanews.com
Re: regex efficiency (Ilya Zakharevich)
Re: Replacing "stuff" via Regex... HELP! <quednauf@nortel.co.uk>
Re: Strip carriage return from cgi? <mahmed@dkl.com>
Re: Subroutine Variables <svetleva@cs.purdue.edu>
Re: use of crypt to encrypt password <mdc0788@fugue.ca.boeing.com>
Re: Wait Command in Perl (Craig Berry)
Re: want a better way to split string <jdporter@min.net>
Web-board vs private newsservers (was: Flames....) (John Moreno)
Re: Y2K Problem <quednauf@nortel.co.uk>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Jun 1998 16:51:45 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: kissel@kissel.spicerack.ibm.com
Subject: Re: [Q] Hash set in recursion, lost in caller
Message-Id: <vhpn7rwu.fsf@mailhost.panix.com>
kissel@kissel.spicerack.ibm.com writes:
> Thank you for your comment--if the query continues unclear, I'll try to
> write a small toy script to isolate the behavior I'm asking about.
Please do.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: 26 Jun 1998 19:54:17 GMT
From: gorilla@elaine.drink.com (Alan Barclay)
Subject: \c@ in Perl, perl & perl + modules
Message-Id: <898890854.721254@elaine.drink.com>
I'm writing a program which is going to do some binary data manipulation,
including some embeded NUL (\c@ or 0x00) characters.
As we know, C uses NUL as a string terminator, and because of this
sometimes it's difficult to manipulate such data with C.
>From reading various man pages, bits of source & some testing, I think
I've come up with the following rules:
1) perl has no problems storing, copying or manipulating using it's
own functions, eg $a=pack("cc",65,0), $b=unpack("cc",$a), $a=$b, etc.
2) perl may have problems when interacting with OS or library calls
not provided with perl, eg
if(defined(gethostbyname(pack("a*cc","localhost",0,66)))){
die "lookup should have failed but succeeded\n"
}
Matches "localhost" and succeeds when it should in an ideal world
attempt to match "localhost\c@B" and fail.
Most problems will be relativly benign like this example.
3) When calling dynamically linked modules, either 1) or 2) may be true,
depending on the module - a module should use Perl's string handling
routines, and be able to handle embedded nulls, other modules will use
C library routines and not be able to handle them.
I've got these answers through reading pod's, source and a bit of
experimentation.
Any perl guru's want to confirm that these are the correct rules
and that they are applicable to both Perl & perl.
------------------------------
Date: 26 Jun 1998 20:14:32 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: \c@ in Perl, perl & perl + modules
Message-Id: <6n0vf8$4p$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Alan Barclay
<gorilla@elaine.drink.com>],
who wrote in article <898890854.721254@elaine.drink.com>:
> I'm writing a program which is going to do some binary data manipulation,
> including some embeded NUL (\c@ or 0x00) characters.
> 1) perl has no problems storing, copying or manipulating using it's
> own functions, eg $a=pack("cc",65,0), $b=unpack("cc",$a), $a=$b, etc.
Correct.
> 2) perl may have problems when interacting with OS or library calls
> not provided with perl, eg
>
> if(defined(gethostbyname(pack("a*cc","localhost",0,66)))){
> die "lookup should have failed but succeeded\n"
> }
>
> Matches "localhost" and succeeds when it should in an ideal world
> attempt to match "localhost\c@B" and fail.
Do not like your wording. "Some Perl functions/builtins (those which
are interfaces to C functions expecting \0-terminated strings) will
ignore anything after the first embedded \0 in Perl strings".
> 3) When calling dynamically linked modules, either 1) or 2) may be true,
This is already covered by my description.
Care for a patch for PODs? (Start with _68's PODs, please.)
Ilya
P.S. A pleasure to see so good a post in this mugbox. ;-)
------------------------------
Date: Fri, 26 Jun 1998 12:46:56 +0100
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: flame everyone on sight (was Re: Perl and Delphi)
Message-Id: <19980626.124656.8g2.rnr.w164w_-_@locutus.ofB.ORG>
Dan Nguyen <nguyend7@egr.msu.edu> writes:
>> Is the a library for Perl that can be run under Delphi?
>
> Why would you want to program in Delphi?
now, was there any reason for this? or was it just incredibly poorly
stated? did you mean:
whatever you can do in Delphi you can do in Perl, and easier
or did you mean:
I want to start an advocacy flamefest in the wrong group
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: Fri, 26 Jun 1998 20:24:16 GMT
From: birgitt@my-dejanews.com
Subject: Re: Flames....
Message-Id: <6n101g$u6o$1@nnrp1.dejanews.com>
In article <8ciulqzpq2.fsf@gadget.cscaper.com>,
Randal Schwartz <merlyn@stonehenge.com> wrote:
> Are you saying that you expect the same level of "the customer is
> always right" service that I constantly give my paying clients as when
> I'm answering Usenet posts for free (and actually at a cost of my
> time)?
>
> Have you gone mad?
>
> This is a completely invalid comparison.
>
> As a volunteer answer person, I have every right to request that the
> people that ask questions go through a certain minimum amount of work
> on their own. As a *paid* lecturer or consultant, I'm not afforded
> that privilege. I commit to producing a result, and I produce that
> result regardless of where the customer's experience is at, or the
> format in which they ask the questions.
>
> But I do think you've hit the nail on the head. Some posters here in
> clpm expect 1-900-support-line level service for FREE. Duh! Not
> gonna happen, folks. These are *volunteers* answering the questions.
> They have every right to be snippy when the 47th posting of the day in
> the wrong group shows up in the unread window, when a few days reading
> of the same group would have shown them the error of their ways. "You
> must be THIS tall to post to Usenet." Get a grip.
>
I really can only wholeheartedly support what Mr. Schwartz has said.
As a paying customer for a project using a GPL'ed software package,
a non-programmer and novice web- and usenet user myself,
one of the most confusing and most important clarifications needed,
was the one, that using a "free" software package, doesn't
mean getting "free" support for it, neither on mailing-lists nor
through quicky visits and posts in c.l.p.m, nor from the author
of the package himself.
I would like to see that developers of free software packages,
which are designed to be used by thousands of real or wannabe
programmers and ISPs to earn money in producing web applications
for non-programming paying customers, made it
_UNAMBIGUOUSLY CLEAR_
that ANY support for free software, be it through a news group
like c.l.p.m., be it through a mailing-list for the package, is a
_VOLUNTEER_
act.
Too many non-programming endusers and self-taught web-authors are
lured into believing through the relative ease by which 'a bit of
cgi and html' can be learned, that groups like c.l.p.m and mailing-lists
are the place where they can go for a quicky question, a shortcut or
a handout, revealing nothing more than that the task they try to
accomplish is above their heads and below the amount of work they have
put into learning to become a professional.
That is why I am all for being _aggressive_ to hammer this into
potential auto-posts of User's Guides, FAQs etc. It can't be
made clear enough!
I would wish though that programmers would be more realistic and
foreseeing that this behaviour from non-programmers is to be
expected.
When can a non-programmer be able to judge what it means to be a
programmer and be able to judge the degree of difficulty of a
programming task? I guess only when he has turned himself into
being one.
Birgitt Funk
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 26 Jun 1998 20:47:28 GMT
From: phenix@interpath.com (John Moreno)
Subject: Re: Flames....
Message-Id: <1db8npb.7s0bqzwnp8gvN@roxboro0-044.dyn.interpath.net>
Leslie Mikesell <les@MCS.COM> wrote:
> I R A Aggie <fl_aggie@thepentagon.com> wrote:
>
> >+ In my earlier post I questioned why CGI related topics were often
> >+ roasted as inappropriate for c.l.p.m, yet they are clearly going
> >+ to be a large part of the perl conference.
> >
> >Ummm...because the "perl conference" != "clpm"?
>
> And the difference in the appropriate topics is....?
The conference can have something titled something like "Perl and CGI"
and those who want to attend can, while any question in clpm which has
as part of it "I'm having a problem with my server|browser" is
automatically off topic?
> >because there is a seperate newsgroup devoted to all things CGI, and that
> >CGI questions stand a much better chance of being answered there where
> >there are occasional CGI experts,
>
> The answer to most perl/CGI questions is to use code or examples
> that someone else has already done. You aren't going to find
> people who know where all the perl code lives over in the
> generic CGI/asp/nsapi groups.
If you can define your question in such a way that it doesn't involve
CGI then it's appropriate here (or at least it may be), if you can't
then it's not.
> >...than here where there are occasional perl
> >experts who may or may not understand CGI?
>
> errr.. You seem to have missed the point that these are the very same
> experts who are going to devote much of the perl conference to tutorials
> on CGI programming. Note that I am not suggesting that anyone expert or
> otherwise is ever obligated in any way to answer any usenet question.
> However the rude brush-offs and references to consulting fees and
> commercial products are just out of place.
But perl programming and CGI programming are two different things, and
asking almost any CGI questions is much closer to asking somebody to do
your job for you than asking about syntax or precedence or using map in
a void context or any other strictly perl question could possibly be.
And for doing that kind of stuff some of us expect to be paid, and some
of us just don't want to be bothered with it, and some of us don't mind,
but want to do so in comp.infosystems.www.authoring.cgi.
> I'm convinced that the reason that new perl users don't read the newsgroup
> to learn about the common problems before posting is that it is just too
> painful.
This seems absurd - what evidence or even hint do you base this on?
> >If you want to mix-n-match, why not just have _one_ newsgroup.
> >James - for all of UseNet, that is...
>
> You need two: one for topics where a perl program is the solution
> and a second for everything else. And only a few years ago
> you would have found perl advocates in the 2nd group pointing
> out the error of their ways.
If I'm wrong I apologize, but I believe he meant - ONE newsgroup for
everything from alt.sex.bestiality discussions to
zer.z-netz.wissenschaft.technik, why have more than one after all
they'll have some points in common...
--
John Moreno
------------------------------
Date: Fri, 26 Jun 1998 10:46:56 -1000
From: "Locke" <none@spam.com>
Subject: Re: Help with Programming
Message-Id: <3593df0a.0@news.hawaii.rr.com>
Learn perl. goto www.cgi-resources.com and borrow code and learn from it.
Bruno Pisano wrote in message <6n0rb1$83q@nntp02.primenet.com>...
>I develop web sites, and trying to get into more complex
>programming.
>Searching through CGI/Perl, ASP and Cold Fusion.
>To build sites that need search capabilities and
>shopping cart, what would you recommend I learn, which
>is the easiest and most practical?
>(I bought a book which is supposed to be the best,
>called CGI/Perl Cookbook, and I'm having a hard time
>even on the very first application...)
>
>Please, reply to
>
>Bruno Pisano
>chiherbs@primenet.com
------------------------------
Date: Fri, 26 Jun 1998 10:44:29 -1000
From: "Locke" <none@spam.com>
Subject: Re: Help with sorting
Message-Id: <3593de77.0@news.hawaii.rr.com>
1) make an assoc array with key as age
2) foreach sort keys %array
3) $_ is the record
make sure you use some sub with sort so it sorts as numbers, not text
George Kassyousef wrote in message <3593F948.735F767@newbridge.com>...
>My perl script reads a file and insert some specific info into several
>text variables such as
>
>var1 var2 var3 var4.
>
>var1 is a string that holds a persons name.
>var2 is an integer that holds the persons age.
>var3 is a string of the persons address.
>var4 is an integer of the persons number.
>
>How can I sort on this persons age if I have a list of people.
>
>eg.
>jack 23 100 huntly cres. 555-1233
>mike 25 200 hunly cres. 555-2332
>.
>.
>.etc.
>
>any help is appreciated.
>
>THX..
>
>
>
>
------------------------------
Date: Fri, 26 Jun 1998 20:09:45 GMT
From: tom@netoutfit.com (Tom O'Neil)
Subject: Increasing page block size for Perl DBMs
Message-Id: <3593ff41.3597828@news.keyway.net>
I have a program that uses DBMs extensively. I have run into a problem
in that one of the key/value pairs has gotten too large, and an error
results when I try to add more data to this value. In
/usr/include/ndbm.h, PBLKSIZ is 1024, and the size of my key and
value combined is now exceeding 1024 bytes, thus returning an error.
My sysadmin is reluctant to change ndbm.h to increase the page block
size. Is there a way that I can increase the page block size for just
this DBM or program?
Tom O'Neil
tom@netoutfit.com
------------------------------
Date: 26 Jun 1998 20:31:05 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Linked list and a code challenge
Message-Id: <6n10e9$kn1$2@marina.cinenet.net>
Snowhare (snowhare@devilbunnies.org) wrote:
: Ah. Here is a code challenge for everyone:
:
: Given a finite linked list similiar the one I drew above, determine
: if a *loop* exists in the linked list with the smallest possible
: use of memory (scratch variables) and CPU (in other words the
: lowest order computational complexity). You should return the
: list element where the loop occurs ('b' in the example above) or
: null if no loop is present. The linked list is in the form
: of a hash ($hsh{'1022'} => '3421'; $hsh{'3421'} => '54532';, and
: so on). The loop may be any size up to and including the entire
: linked list or as small as 2 elements linked together at the tail.
Assuming we're also given the 'head' element value, and that an element
value of 0 terminates a nonlooping list:
#!/usr/bin/perl -w
# findloop: Find loops in a hash-based linked list
# Craig Berry (19980626)
use strict;
# findloop returns the element at which a loop was detected,
# or undef is none was found. A hash value of 0 terminates the
# linked list.
sub findloop
{
my ($hr, $key) = @_;
my %visited;
do {
return $key if $visited{$key}++;
} while ($key = $hr->{$key});
undef;
}
# Test code:
my %h1 = ( 1 => 2,
2 => 3,
3 => 4,
4 => 2 );
my %h2 = ( 1 => 2,
2 => 3,
3 => 4,
4 => 0 );
my %h3 = ( 1 => 2,
2 => 1 );
print "1: ", findloop(\%h1, 1), "\n";
print "2: ", findloop(\%h2, 1), "\n";
print "3: ", findloop(\%h3, 1), "\n";
---------------------------------------------------------------------
| 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: Fri, 26 Jun 1998 16:18:38 -0400
From: Mahmoud Ahmed <mahmed@dkl.com>
To: delta <delta@netpage.tm.fr>
Subject: Re: NEED HELP !!!!!!
Message-Id: <3594021E.1E5E7FBB@dkl.com>
Use if statement
print FIC "$in{'titre1'}\n" if $in{'titre1'};
print FIC "--------------------------\n" if $in{'titre1'};
These two lines will be printed if $in{'titre1'} variable is set, otherwise
they won't be printed.
Good luck,
delta wrote:
> How could I avoid to get a "space line" type:
> ----------------------------------
> ---------------------------------
> ---------------------------------
> when nothing is drop in a FIC value
> Look at the PRINT FIC script
> and if nothing have been write in the titre3 field (or other field) , I get
> blank line in my FIC
> print FIC "$in{'lieu2'}\n";
> print FIC "$in{'titre1'}\n";
> print FIC "--------------------------\n";
> print FIC "$in{'texte1'}\n";
> print FIC "--------------------------\n";
> print FIC "$in{'titre2'}\n";
> print FIC "--------------------------\n";
> print FIC "$in{'texte2'}\n";
> print FIC "--------------------------\n";
> print FIC "$in{'titre3'}\n";
> print FIC "--------------------------\n";
> Thanks for your help
--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Mahmoud Ahmed
Data Kinetics Limited
http://www.dkl.com
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
------------------------------
Date: Fri, 26 Jun 1998 19:48:34 GMT
From: alawishus@my-dejanews.com
Subject: regex efficiency
Message-Id: <6n0tui$ret$1@nnrp1.dejanews.com>
the best way to match files that end in ".pl" or ".pl.whatever"
so say you have in
color.pl
color.pl.bak
color.plus
don't want to match the color.plus
don't want to use alternatives in the regex like, unless
it really is quicker
/\.pl$|\.pl\.$/
we could say
/\.pl(\..*?)*?$/
but, does anyone know of something more efficient
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 26 Jun 1998 20:08:31 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: regex efficiency
Message-Id: <6n0v3v$sk2$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to
<alawishus@my-dejanews.com>],
who wrote in article <6n0tui$ret$1@nnrp1.dejanews.com>:
>
>
> the best way to match files that end in ".pl" or ".pl.whatever"
> don't want to use alternatives in the regex like, unless
> it really is quicker
> /\.pl$|\.pl\.$/
Your assumption is correct, current Perl engine is too stupid to
optimize this.
> we could say
> /\.pl(\..*?)*?$/
This will be much quickier to reject non-'.pl' names. But I would use
m{\.pl($|\.)}
or
m{\.pl(?:$|\.)}
(assuming that .pl is much more frequent than .pl.rej).
Ilya
------------------------------
Date: Fri, 26 Jun 1998 21:10:57 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Replacing "stuff" via Regex... HELP!
Message-Id: <35940051.EBE9A540@nortel.co.uk>
> ie. if the input line was
> data,data,data,number,text,"string",data, stuff,"nuther",stuff,text,"two
> words",text
> the output would be
> data,data,data,number,text,,data, stuff,,stuff,text,,text
What about this?
$_ = 'data,data,data,number,text,"string",data, stuff,"nuther",stuff,text,"two
words",text';
s/".*",//;
print $_."\n";
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: Fri, 26 Jun 1998 15:15:18 -0400
From: Mahmoud Ahmed <mahmed@dkl.com>
To: deltac@gate.net
Subject: Re: Strip carriage return from cgi?
Message-Id: <3593F346.D8FB072F@dkl.com>
Use tr command to the carriage return
e.g.
$ tr -d "\r" < order_form.pl > order_form.pl.bak
$ mv order_form.pl.bak order_form.pl
Good luck.
Delta Charley wrote:
> Hi all, I am having problems getting a perl cgi script
> that I got from a web site to run on my Linux/Apache box.
>
> When I try and check it using perl -c I get this:
>
> [seegeeeye@localhost or_for]$ perl -c order_form.pl
> Illegal character \015 (carriage return) at order_form.pl line 11.
> (Maybe you didn't strip carriage returns after a network transfer?)
> [seegeeeye@localhost or_for]$
>
> Can anybody advise as to the best way to strip the carriage returns?
>
> I tried to use sed to strip them but I can't figure out how
> get sed to work on non printing characters.
>
> Thanks for any help,
>
> --
> Dale Coleman (alias Delta Charley)
> e-mail: deltac@gate.net
> My page: http://www.gate.net/~deltac/
--
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Mahmoud Ahmed
Data Kinetics Limited
http://www.dkl.com
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
------------------------------
Date: Fri, 26 Jun 1998 15:07:14 -0500
From: Alex Svetlev <svetleva@cs.purdue.edu>
Subject: Re: Subroutine Variables
Message-Id: <3593FF72.5920E22B@cs.purdue.edu>
Alex Svetlev wrote:
> Jonathan Feinberg wrote:
>
> > Alex Svetlev <svetlev@vmw3.ibm.com> writes:
> >
> > > I have a subroutine with variables that I declare with "my". Each time I
> > > call this subroutine, the variables still have the values they did in
> > > the previous call.
> >
> > You must be scoping those variables outside of the sub, yes? You must
> > use my() inside the scope you're interested in:
> >
> > sub foo {
> > my $bar;
> > }
> >
> > And *NOT*
> >
> > my $bar;
> > sub foo {
> > # use $bar
> > }
> >
> > Although that second construction has its uses.
> >
> > --
> > Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
> > http://pobox.com/~jdf/
>
> Unfortunately I'm not. I'm declaring the variable only in the sub with
> "my", yet the old $bar is remembered next time I call &foo. That's what's
> perplexing me. Any clue?
Testing.
------------------------------
Date: Fri, 26 Jun 1998 20:22:17 GMT
From: "Marty D. Cudmore" <mdc0788@fugue.ca.boeing.com>
To: Ric Alcazar <alcazar@netcomp.net>
Subject: Re: use of crypt to encrypt password
Message-Id: <359402F9.14FF@fugue.ca.boeing.com>
Ric Alcazar wrote:
>
> Hello all,
>
> I'm trying to encrypt a password to a file for use with htaccess.
> However, I do not understand its functionality nor syntax. What I'm trying
> to do is just write a simple script that prompts a user for a password, then
> takes that password and encrypts it to a htpasswd file allowing
> authorization. if someone could help me out, it would be greatly
> appreciated.
>
> Ric
Here's a little program that does encryption. You simply pass it the
word you wish to encrypt and optionally how many encryptions you would
like produced.
Example:
encrypt myword
encrypt myword 5
#!/usr/bin/perl5.004_04 -wT
$passwd = shift or die "Must pass in the password you wish to
encrypt.\n";
$iterations = shift || 1; # How many encryptions should we create
# generate a random seed (this is out of the camel book)
srand( time() ^ ($$ + ($$ << 15)) );
# Create list of 'legal' salt values
@array = ('46' .. '57','65' .. '90','97' .. '122');
# Generate $iterations encrypted passwords
for($cnt=1;$cnt<=$iterations;$cnt++) {
# Randomly generate two salt characters
$salt = chr($array[int(rand $#array+1)]) .
chr($array[int(rand $#array+1)]);
print crypt($passwd,$salt), "\n";
} # End of for
Hope this helps
-Marty
------------------------------
Date: 26 Jun 1998 20:08:28 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Wait Command in Perl
Message-Id: <6n0v3s$kn1$1@marina.cinenet.net>
Michael Harrison (hostmaster@hosttech.com) wrote:
: I need to get a script to wait about 10-12 seconds while a file is produced.
: The script writes a request file for ICVerify and the needs to stall for
: 10-12 secs while the answer file is produced. My questions is, is there any
: easy way to do this.
perldoc -f sleep
Be careful to make allowances for those times the file takes longer to
appear or to be written completely. Is there some way to test that the
answer-file write is done? If so, the code you want probably looks like
sleep 12 while ! answer_done();
If not, prepare to be hosed now and then.
---------------------------------------------------------------------
| 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: Fri, 26 Jun 1998 20:01:46 GMT
From: John Porter <jdporter@min.net>
Subject: Re: want a better way to split string
Message-Id: <3593FFBA.2FA0@min.net>
Al Degutis wrote:
>
> (am I a novice or hack: your call)
>
> I'm trying to break down a string to fit 60 characters per line. Rather
> than use a specific length of 60 characters, I'd like to break the string on
> the nearest space starting from the 50th position.
You may wish to check out the Text::Wrap module which does this
nicely.
If you do it yourself, a better approach would be the scan
*Backwards* from 60 until you find a space. And if you do that,
then you could start at your real screen width, like 80,
instead of 60.
--
John Porter
------------------------------
Date: Fri, 26 Jun 1998 20:00:32 GMT
From: phenix@interpath.com (John Moreno)
Subject: Web-board vs private newsservers (was: Flames....)
Message-Id: <1db8ccs.yoyyg4as0rnkN@roxboro0-044.dyn.interpath.net>
Cameron Dorey <camerond@mail.uca.edu> wrote:
> [cc'd to rs]
>
> Good morning, Randal,
>
> Randal Schwartz wrote:
> >
> > [snip]
> > One of the most significant events in the "dumbing down" of Usenet
> > was the day that Netscape added a "POST" button to their *web browser*
> > making it pretend to be a newsreader (which it STILL isn't).
> >
> > And that's why people still routinely killfile any postings from web
> > browsers. Ugh. (I don't, but I think about it very often.)
>
> I hope you don't. In the spirit of TIMTOWTDI, NS is the easiest tool I
> have for news, once I reconfigured the default to "plain text." BTW, I
> don't remember whether you or TC (or someone else) recommended to
> someone else abandoning "message boards" in favor of a private
> newsserver, but I want to thank you (him/her) for the suggestion. Much
> better than reinventing the wheel (especially for someone who can't draw
> a decent circle).
This doesn't have much to do with perl (other than it possibly being a
nice language to do part of it in), which is why I'm redirecting
followups, but a private nntp server which /also/ has a www interface
can be useful. Examples of this would be the tin.org
mailinglist/newsserver/weboard and the www based newsreader/newsserver
NewsReader.Com (which has the GNKSA). NewsReader.Com does it better,
but both show that having a www interface to a newsserver can be done
usefully (of course they do it for different reasons, but that's
unimportant except insofar as it explains why NewsReader.Com is more
sophisticated).
And for anybody looking into doing a web-board to provide for
discussions of particular things, I'd recommend that they do both, a www
interface for people just stumbling across it or who can't easily switch
servers in their newsreaders and a private nntp newsserver for the
people who participate more regularly and can take advantage of it.
--
John Moreno
------------------------------
Date: Fri, 26 Jun 1998 21:02:21 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Re: Y2K Problem
Message-Id: <3593FE4D.7A105E26@nortel.co.uk>
Carl Tipton wrote:
>
> ... IT professional, ... other professional IT manager's ... IT professional's perspective? ... IT manager's
> perspective.
I AM Sorry!! I couldn't resist it :) But then I'm a student, I am allowed to do
that!
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
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 2996
**************************************