[26308] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8485 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 4 18:05:38 2005

Date: Tue, 4 Oct 2005 15:05:05 -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 Oct 2005     Volume: 10 Number: 8485

Today's topics:
        frok & exec <who@where.org>
    Re: frok & exec xhoster@gmail.com
    Re: frok & exec <abigail@abigail.nl>
    Re: Regex: Matching Characters NOT in a Certain Range <tadmc@augustmail.com>
    Re: Simple pattern matching negation <uctraing@ultranet.com>
    Re: Simple pattern matching negation <rvtol+news@isolution.nl>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 04 Oct 2005 14:18:46 -0400
From: tuxfan <who@where.org>
Subject: frok & exec
Message-Id: <pan.2005.10.04.18.18.44.988116@where.org>

I have been asked to develop a program that has the
ability to send in 5, 10 minutes from now. It looks 
like I should use threads and some type of timer, but
I not sure were to start, and what modules to use.


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

Date: 04 Oct 2005 18:56:11 GMT
From: xhoster@gmail.com
Subject: Re: frok & exec
Message-Id: <20051004145611.783$K3@newsreader.com>

tuxfan <who@where.org> wrote:
> I have been asked to develop a program that has the
> ability to send in 5, 10 minutes from now.

sleep 300; send();

or

sleep 600; send();

These might wake up early under certain circumstances, so if it matters you
may want to check with time() to make sure you slept the full amount.

my $then=time()+300;
do {sleep $then - time()} until time()>=$then;
send();

> It looks
> like I should use threads and some type of timer,

From your description, threads appear unnecessary.  You didn't say that the
program needed to go about other business while also waiting to send.  Or
is your suggestion of threads supposed to be a round-about way of telling
us that the program needed to go about other business while also waiting to
send? If so, please don't be coy.  Come out and say what you need.

> but
> I not sure were to start, and what modules to use.

I'd start by coming up with a better description of the problem.  Is there
only going to be one pending "send" at a time?  2?  100?  1_000_000?  What
are you sending to?  screen? file? socket? database handle?  HTTP?  Where
are you getting the stuff to send?

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: 04 Oct 2005 20:15:38 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: frok & exec
Message-Id: <slrndk5ona.vaf.abigail@alexandra.abigail.nl>

xhoster@gmail.com (xhoster@gmail.com) wrote on MMMMCDXVII September
MCMXCIII in <URL:news:20051004145611.783$K3@newsreader.com>:
[]  
[]  my $then=time()+300;
[]  do {sleep $then - time()} until time()>=$then;
[]  send();


Or:

    use POSIX;
    my $sleep = 300;
    1 while $sleep = POSIX::sleep $sleep;


Abigail
-- 
perl -wlne '}print$.;{' file  # Count the number of lines.


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

Date: Tue, 4 Oct 2005 13:39:10 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Regex: Matching Characters NOT in a Certain Range
Message-Id: <slrndk5j2e.nv4.tadmc@magna.augustmail.com>

Hal Vaughan <hal@thresholddigital.com> wrote:
> A. Sinan Unur wrote:
> 
>> Hal Vaughan <hal@thresholddigital.com> wrote in
>> news:NqmdnbZHArRErd_enZ2dnUVZ_tOdnZ2d@comcast.com:
>> 
>>> Anno Siegel wrote:
>> 
>> ...
>> 
>>>> Have you looked at perlre?
>> 
>> ...
>> 
>>> I can never remember all the terms to search for.
>> 
>> perldoc perltoc
> 
> Thanks.  I never knew that!  (Seriously -- I was used to searching for
> terms, but never new there was a toc!)


Then you must have not even tried the somewhat obvious:

   perldoc perl

which also lists the std docs, including the ToC.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Tue, 04 Oct 2005 19:36:06 GMT
From: Bob <uctraing@ultranet.com>
Subject: Re: Simple pattern matching negation
Message-Id: <hem5k1d76em2ohmnh15ei6781bc7ccbl9b@4ax.com>

Thanks folks. Lots of good info. I didn't realize (obviously) 
that the binding operation could use !~ in addition to =~. 
That solves my basic issue. The other suggestions are also 
helpful.

Bob 


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

Date: Tue, 4 Oct 2005 21:34:00 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Simple pattern matching negation
Message-Id: <dhusig.1ik.1@news.isolution.nl>

John W. Krahn:
> Dr.Ruud:
>> Todd de Gruyl:

>>> [You'll also note that I used \d instead of [0-9], same thing... a
>>> couple of characters shorter.]
>>
>> \d is not always the same as [0-9]. See \p{IsDigit} in `man perlre`.
>
> Where in the man page does it say that "\d is not always the same as
> [0-9]"?

I just did. Even \d and \p{IsDigit} aren't always the same test.

Demonstration:

  use warnings;
  use strict;
  use charnames ':full';

  my $text = "\x{00030}"
           . "\x{00660}\x{006F0}"
           . "\x{02460}\x{02474}\x{02488}\x{024F5}"
           . "\x{02673}\x{02680}"
           . "\x{02776}\x{02780}\x{0278A}"
           . "\x{1D7CE}\x{1D7D8}\x{1D7E2}\x{1D7EC}\x{1D7F6}"
           . "\x{E0030}";

  my $n = length($text);

  print '-'x $n, "\n";

  for (my $i=0; $i<$n; $i++) {
    my $c = substr($text, $i, 1);
    printf "\\x\{%5.5X} %s\n", ord($c), charnames::viacode ord $c;
    print '  [0-9]'       , "\n" if $c =~ /[0-9]/;
    print '  \d'          , "\n" if $c =~ /\d/;
    print '  \p{IsNumber}', "\n" if $c =~ /\p{IsNumber}/;
    print '-'x $n, "\n";
  }


Output:

------------------
\x{00030} DIGIT ZERO
  [0-9]
  \d
  \p{IsNumber}
------------------
\x{00660} ARABIC-INDIC DIGIT ZERO
  \d
  \p{IsNumber}
------------------
\x{006F0} EXTENDED ARABIC-INDIC DIGIT ZERO
  \d
  \p{IsNumber}
------------------
\x{02460} CIRCLED DIGIT ONE
  \p{IsNumber}
------------------
\x{02474} PARENTHESIZED DIGIT ONE
  \p{IsNumber}
------------------
\x{02488} DIGIT ONE FULL STOP
  \p{IsNumber}
------------------
\x{024F5} DOUBLE CIRCLED DIGIT ONE
  \p{IsNumber}
------------------
\x{02673} RECYCLING SYMBOL FOR TYPE-1 PLASTICS
------------------
\x{02680} DIE FACE-1
------------------
\x{02776} DINGBAT NEGATIVE CIRCLED DIGIT ONE
  \p{IsNumber}
------------------
\x{02780} DINGBAT CIRCLED SANS-SERIF DIGIT ONE
  \p{IsNumber}
------------------
\x{0278A} DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE
  \p{IsNumber}
------------------
\x{1D7CE} MATHEMATICAL BOLD DIGIT ZERO
  \d
  \p{IsNumber}
------------------
\x{1D7D8} MATHEMATICAL DOUBLE-STRUCK DIGIT ZERO
  \d
  \p{IsNumber}
------------------
\x{1D7E2} MATHEMATICAL SANS-SERIF DIGIT ZERO
  \d
  \p{IsNumber}
------------------
\x{1D7EC} MATHEMATICAL SANS-SERIF BOLD DIGIT ZERO
  \d
  \p{IsNumber}
------------------
\x{1D7F6} MATHEMATICAL MONOSPACE DIGIT ZERO
  \d
  \p{IsNumber}
------------------
\x{E0030} TAG DIGIT ZERO
------------------

perl, v5.8.6 built for i386-freebsd-64int


-- 
Affijn, Ruud

"Gewoon is een tijger."




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

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


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