[18740] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 908 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 15 18:06:30 2001

Date: Tue, 15 May 2001 15:05:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <989964317-v10-i908@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 15 May 2001     Volume: 10 Number: 908

Today's topics:
    Re: Addition <Tim.Lauterborn@gmx.de>
    Re: Addition <tinamue@zedat.fu-berlin.de>
    Re: AND-connected search (Craig Berry)
    Re: AND-connected search nobull@mail.com
    Re: assigning a subroutine to a variable (Craig Berry)
    Re: assigning a subroutine to a variable <jurgenex@hotmail.com>
    Re: assigning a subroutine to a variable <ren@tivoli.com>
    Re: assigning a subroutine to a variable (Anno Siegel)
    Re: Can you build GUI's with perl? <dan@nospam_dtbakerprojects.com>
    Re: Existing Script To Add Time <dodger@necrosoft.net>
    Re: garbage collection in perl <ilya@math.ohio-state.edu>
    Re: Locking acces to files <karol@imm.org.pl>
    Re: Locking acces to files <karol@imm.org.pl>
    Re: Locking acces to files nobull@mail.com
    Re: Locking acces to files (Anno Siegel)
    Re: Pattern match headache <kirby@jamesk.freeserve.co.uk>
    Re: Pattern match headache <kirby@jamesk.freeserve.co.uk>
    Re: Pattern match headache <ren@tivoli.com>
    Re: perl prints asychronously - compiler/interpreter op <pne-news-20010515@newton.digitalspace.net>
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <newspost@coppit.org>
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi (Randal L. Schwartz)
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <godzilla@stomp.stomp.tokyo>
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <godzilla@stomp.stomp.tokyo>
    Re: Posting Guidelines for comp.lang.perl.misc ($Revisi <newspost@coppit.org>
        random ip-adress <Stephan_Heckmueller@public.uni-hamburg.de>
    Re: random ip-adress (Dave Bailey)
    Re: random ip-adress nobull@mail.com
    Re: Scrambling the source code <pne-news@newton.digitalspace.net>
        Socket: sysread <vadlapat@ecst.csuchico.edu>
    Re: sorting hash's <bobnet604@hotmail.com>
    Re: South Florida Job <dan@nospam_dtbakerprojects.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 15 May 2001 20:34:45 +0200
From: "Tim Lauterborn" <Tim.Lauterborn@gmx.de>
Subject: Re: Addition
Message-Id: <9drsu2$h7v$1@nets3.rz.RWTH-Aachen.DE>

Hi,

> > im not sure what it is you are trying to do, but if you are trying to
> > play a wav file in a webpage then u should use <embed> (for NS) and
> > <src> (for IE).
>
> make the last one for IE <bgsound>

I use the script as interface to a program wich processes audio data so that
I must send  the final wav-file through the script.

Did someone have a similar problem?

Greetings,
Tim




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

Date: 15 May 2001 20:29:49 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: Addition
Message-Id: <9ds3jt$jo3a1$2@fu-berlin.de>

hi,
Tim Lauterborn <Tim.Lauterborn@gmx.de> wrote:

> in addition to the text above this is the program I used:

>   binmode(STDOUT);
>   print "Content-type: audio/wav\n\n";

maybe audio/x-wav could do it (not sure)

hth,
tina

-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \ _,_\ __/\ __/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


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

Date: Tue, 15 May 2001 19:36:25 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: AND-connected search
Message-Id: <tg319pnu2ah5a3@corp.supernews.com>

nobull@mail.com wrote:
: > For example, for literal searches, you can use "/\Q$_/" for
: > the map expression.
: 
: You mean "/\Q$_\E/".

\E is not required if the \Q region extends to the end of the pattern.  Of
course, it's good practice to include it anyway, just to make your intent
clear to human readers.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "God becomes as we are that we may be as he is."
   |               - William Blake


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

Date: 15 May 2001 21:12:33 +0100
From: nobull@mail.com
Subject: Re: AND-connected search
Message-Id: <u9heymgymm.fsf@wcl-l.bham.ac.uk>

cberry@cinenet.net (Craig Berry) writes:

> nobull@mail.com wrote:
> : > For example, for literal searches, you can use "/\Q$_/" for
> : > the map expression.
> : 
> : You mean "/\Q$_\E/".
> 
> \E is not required if the \Q region extends to the end of the
> pattern. 

s/pattern/quoted construct/

Allowing the region of the \Q to the end of the quoted constuct in
this case will cause a syntax error.

$ perl -e ' $_="foo"; eval "/\Q$_/"; print $@ '
Search pattern not terminated at (eval 1) line 1.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 15 May 2001 18:26:32 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: assigning a subroutine to a variable
Message-Id: <tg2t6o6c4rjp7e@corp.supernews.com>

Andrew Yeretsky (ayeretsk@arm.com) wrote:
: I guess I didn't phrase that very well.  I am calling the subroutine and
: assigning its return value to a variable. Is there a way to keep $firstcard
: constant throughout the program?:

Yes; never assign to it again.  Further calls to GetCard will not change
it.  If you are seeing different behavior, please reduce to a simple
example case and post it.

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "God becomes as we are that we may be as he is."
   |               - William Blake


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

Date: Tue, 15 May 2001 12:38:24 -0700
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: assigning a subroutine to a variable
Message-Id: <3b0185b2$1@news.microsoft.com>

"Andrew Yeretsky" <ayeretsk@arm.com> wrote in message
news:3B015943.4E1695F6@arm.com...
> I have a subroutine that generates a random number.  I assigned the
> subroutine to a variable, however, everytime I use the variable it
> generates a new random number.  How do I keep the variable as the first
> random number throughout the program.

That's what random nubmer generators are for :-)
Maybe you can assigning the *result* of the first subroutine execution to
the variable (instead of the subroutine)?

jue




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

Date: 15 May 2001 14:20:03 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: assigning a subroutine to a variable
Message-Id: <m3ae4eju70.fsf@dhcp9-172.support.tivoli.com>

On 15 May 2001, anno4000@lublin.zrz.tu-berlin.de wrote:

> According to Andrew Yeretsky  <ayeretsk@arm.com>:
>> 
>> I guess I didn't phrase that very well.  I am calling the
>> subroutine and assigning its return value to a variable. Is there a
>> way to keep $firstcard constant throughout the program?:
>> 
>> 
>> my $firstcard = &GetCard();
>> 
>> sub GetCard {
>>   %dist = &weight_to_dist(%weights);
>>   $card = &weighted_rand(%dist);
>>   return $card;
>> }
> 
> Why yes.  Don't assign to it again.  If "my $firstcard =
> &GetCard();" happens in a loop, put it before the loop.  Whenever
> you use $firstcard later in the program, as in 'print
> "$firstcard\n"', it will have the same value[1].

My CGI-sense is tingling.... :)

-- 
Ren Maddox
ren@tivoli.com


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

Date: 15 May 2001 20:49:24 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: assigning a subroutine to a variable
Message-Id: <9ds4ok$qm0$2@mamenchi.zrz.TU-Berlin.DE>

According to Ren Maddox  <ren@tivoli.com>:
> On 15 May 2001, anno4000@lublin.zrz.tu-berlin.de wrote:
> 
> > According to Andrew Yeretsky  <ayeretsk@arm.com>:
> >> 
> >> I guess I didn't phrase that very well.  I am calling the
> >> subroutine and assigning its return value to a variable. Is there a
> >> way to keep $firstcard constant throughout the program?:
> >> 
> >> 
> >> my $firstcard = &GetCard();
> >> 
> >> sub GetCard {
> >>   %dist = &weight_to_dist(%weights);
> >>   $card = &weighted_rand(%dist);
> >>   return $card;
> >> }
> > 
> > Why yes.  Don't assign to it again.  If "my $firstcard =
> > &GetCard();" happens in a loop, put it before the loop.  Whenever
> > you use $firstcard later in the program, as in 'print
> > "$firstcard\n"', it will have the same value[1].
> 
> My CGI-sense is tingling.... :)

Oh, right, that could be it.  That would make it a CGI problem
entirely.  I seem to have heard about hidden variables in forms...
But that would be better discussed in a newsgroup with cgi in its
name.

Anno


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

Date: Tue, 15 May 2001 18:47:35 GMT
From: Dan Baker <dan@nospam_dtbakerprojects.com>
Subject: Re: Can you build GUI's with perl?
Message-Id: <3B017850.78811E20@nospam_dtbakerprojects.com>



Bernie wrote:
> 
> Is it possible to build GUI's with perl, under Linux and
> or Windows?   I checked CPAN, but didn't find any modules
> along these lines.
> 
> -Thanks
============================

besides TK, it is also possible to come up with a decent UI using html
forms... with all the advantages/limitations that implies. As long as
you have a local, intranet, or internet webserver available you can use
all the nice html interface widgets to drive perl scripts or whatever
other executables you want.

Managing state information is a challange, but with cookies, temp text
files, or database interfaces it is certainly possible. I have found
prototyping an interface with standard html tools to be faster than
learning TK.... 

D


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

Date: Tue, 15 May 2001 19:37:20 GMT
From: "Dodger" <dodger@necrosoft.net>
Subject: Re: Existing Script To Add Time
Message-Id: <QzfM6.4728$F46.1533312@news1.rdc2.pa.home.com>

"grasshopper" <grasshopper99[no-spam]@hotmail.com> wrote in message
news:0v%L6.38243$Hk4.583151@news1.rdc1.ab.home.com...
> Excuse my ignorance, but how does one use a function, be it mktime or any
> other one?

A POSIX function is used like any other function -- the module implicitly
exports them all, or explicitly those specified if some are specified.

use POSIX;
# now you can use strftime, mktime, etc.

or

use POSIX ('mktime');
# now you can use mktime

--
Dodger
www.dodger.org
www.necrosoft.net
www.gothic-classifieds.com





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

Date: 15 May 2001 19:54:33 GMT
From: Ilya Zakharevich <ilya@math.ohio-state.edu>
Subject: Re: garbage collection in perl
Message-Id: <9ds1hp$bov$1@agate.berkeley.edu>

I wrote in article <9dq3f5$2p1$1@agate.berkeley.edu>:
>   a1) *Nothing* is done to a lexical variable "when it goes from scope".
>       (HEURISTIC: Going out from scope is a "time-related issue").  
> 
>   a2) Exception: if the variable contains an object reference, the
>       variable is undef()ed on exit.
> 
>   b)  Runtime-effect of my() is the same as of undef().

As Nadav Popplewell carefully noted, this description can't be
complete. In fact, there is one more exception:

a3) Exception: if on exit from the scope the refcount is 2 or more
    (thus an external reference to the "value of this variable"
    exists), then the variable is "recycled": it is detached from the
    older value, and attached to a newly created undefined value.

a2/a3 and b taken together create a very stong *impression* that
"variable dies on exit".  Due to a3, you cannot "monitor" the variable
after it goes out of scope (Heisenberg principle); due to a2, you
cannot check for the destruction by defining DESTROY (same).

But b has a loophole: one can circumvent the runtime-effect, and leave
only the compile-time effect (creation of a "name") of my():

  my $var if 0;

WIth this code one can check that the old value is preserved between
exit/enter from/into the scope.

Moreover, to understand these matters one should also grok the
distinction between "names" and "values" of the variables.  Another
example of this distinction:

  $var = foo();	      # Modifies the value "referenced" by name "var"
  local $var = foo(); # Creates (temporary) new value for the name "var"

One can check this by inspecting the result of \$var.

Hope this helps,
Ilya


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

Date: Tue, 15 May 2001 22:48:54 +0200
From: "Karol Nowakowski" <karol@imm.org.pl>
Subject: Re: Locking acces to files
Message-Id: <3b0195aa$1@news.home.net.pl>

> Sorry, I didn't read your question right and overlooked a "not" there.
> In any case, Craig Berry has understood your question far better and
> written a good reply.  I may refer you to that.

I'm still learning english and I've probably created the sentence
incorrectly...
sorry




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

Date: Tue, 15 May 2001 22:57:56 +0200
From: "Karol Nowakowski" <karol@imm.org.pl>
Subject: Re: Locking acces to files
Message-Id: <3b0197c8$1@news.home.net.pl>


----- Original Message -----
From: "Craig Berry" <cberry@cinenet.net>
Newsgroups: comp.lang.perl.misc
Sent: Tuesday, May 15, 2001 6:53 PM
Subject: Re: Locking acces to files


> : 2) does use of flock command (as far as my server understands it) is ok
or I
> : need something more?
>
> If *all* processes accessing the file use flock properly, this is
> sufficient.  Note that flock is a voluntary, cooperative locking protocol.
> Unless the OS itself enforces exclusion (as e.g. VMS does, but Unix does
> not), a rogue process is free to access the file without flocking it.
>
> The best metaphor for how flock works is that of a traffic signal.  As
> long as all cars crossing an intersection rigorously obey the lights, no
> collisions will occur.  But nothing about the signal lights *prevents* a
> car from driving through a red light.  Sometimes it might even do so
> without hitting another car; it's a matter of luck.
my system is Unix (i.e. my provider has it)
what command should I use (I've already sent this question to my provider
also, but If you have some other opinions)?

My next question is also general.
There is program "one" which is actually doing some changes in the file and
locks it with LOCK_EX. And there is a program "two" which also want's to do
some changes in the same file. Will the program "two" wait for possibility
to write, or will it write the message, that he was unable to write because
of other lock. I don't think it is clearly written, but I hope You'll
understand.


Best regards,
Charles




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

Date: 15 May 2001 22:06:06 +0100
From: nobull@mail.com
Subject: Re: Locking acces to files
Message-Id: <u9ae4egw5d.fsf@wcl-l.bham.ac.uk>

"Karol Nowakowski" <karol@imm.org.pl> writes:

> My next question is also general.

"general" == "Not really to do with Perl".

> There is program "one" which is actually doing some changes in the file and
> locks it with LOCK_EX. And there is a program "two" which also want's to do
> some changes in the same file. Will the program "two" wait for possibility
> to write, or will it write the message, that he was unable to write because
> of other lock.

You will have to look at the source of program two.

If it looks like this...
  flock (FILE,LOCK_EX) or die "File does not support locking: $!";
 ...then it will wait.

If it looks like this...
  flock (FILE,LOCK_EX|LOCK_NB) or die "Unable to lock file: $!";
 ...then it will fail if the lock is not immediately available.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 15 May 2001 21:35:57 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Locking acces to files
Message-Id: <9ds7ft$s34$2@mamenchi.zrz.TU-Berlin.DE>

According to Karol Nowakowski <karol@imm.org.pl>:
> > Sorry, I didn't read your question right and overlooked a "not" there.
> > In any case, Craig Berry has understood your question far better and
> > written a good reply.  I may refer you to that.
> 
> I'm still learning english and I've probably created the sentence
> incorrectly...
> sorry

No, that was entirely my fault.  Your sentence is perfectly
understandable.

Anno, who is constantly learning English as well


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

Date: Tue, 15 May 2001 19:37:15 +0100
From: "Kirby James" <kirby@jamesk.freeserve.co.uk>
Subject: Re: Pattern match headache
Message-Id: <9drt9j$ipb$1@news5.svr.pol.co.uk>

if ($word =~  m/headache/) {

:-)

"P.Eftevik" <pef@trasra.noXX> wrote in message
news:3B013343.4443A0F8@trasra.noXX...
> I'm  searching for words starting with the plus ('+') character,
> like this :
>
> if ( $word  =~ / ^\+.* / )   { etc..}
>
> Shouldn't this do the trick ?
> What am I doing wrong here ?
>
>
> thanx 4 hints.
> Peftie
>
>




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

Date: Tue, 15 May 2001 20:17:24 +0100
From: "Kirby James" <kirby@jamesk.freeserve.co.uk>
Subject: Re: Pattern match headache
Message-Id: <9drvkr$6kt$1@newsg3.svr.pol.co.uk>

Your pattern .* will match characters within words AND anything else - in
your case it will match the whole of the string beyond the '+'.
You have to indicate what you mean by the 'end of a word' - For example if
the end of a word is defined as white-space or the end-of a-string try -

$string = "Once upon +a time +there +were three +bears";

while ( $string =~ m/(\+\w+)(\s|$)/g ) {
   $word = $1;
   print "$word\n";
}

this will match all the 'words' one-by-one (if your string consists of
multiple lines you'll need to add an 'm' after the g.

good luck, Kirby

"P.Eftevik" <pef@trasra.noXX> wrote in message
news:3B013343.4443A0F8@trasra.noXX...
> I'm  searching for words starting with the plus ('+') character,
> like this :
>
> if ( $word  =~ / ^\+.* / )   { etc..}
>
> Shouldn't this do the trick ?
> What am I doing wrong here ?
>
>
> thanx 4 hints.
> Peftie
>
>




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

Date: 15 May 2001 15:18:14 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Pattern match headache
Message-Id: <m3wv7iicxl.fsf@dhcp9-172.support.tivoli.com>

On Tue, 15 May 2001, kirby@jamesk.freeserve.co.uk wrote:

> $string = "Once upon +a time +there +were three +bears";
> 
> while ( $string =~ m/(\+\w+)(\s|$)/g ) {
>    $word = $1;
>    print "$word\n";
> }
> 
> this will match all the 'words' one-by-one (if your string consists
> of multiple lines you'll need to add an 'm' after the g.

Actually, your pattern handles multiple lines just fine as the "\s"
will match a newline.  Still, the OP may find that the "\b" assertion
is more convenient.  Of course, by restricting the match to "\+\w+",
it isn't really necessary to define the ending:

print "$1\n" while $string =~ /(\+\w+)/g;

or even:

print $string =~ /(\+\w+)/g;

though this loses the newlines.

-- 
Ren Maddox
ren@tivoli.com


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

Date: Tue, 15 May 2001 20:37:23 +0200
From: Philip Newton <pne-news-20010515@newton.digitalspace.net>
Subject: Re: perl prints asychronously - compiler/interpreter optimization?
Message-Id: <10s2gtsvnsm2slj3oqm2ibu13mi0bh2llh@4ax.com>

On Mon, 14 May 2001 14:20:24 -0500, Jesse James Jensen
<jesse@uchicago.edu> wrote:

> Is there a performance hit with autoflushing?

Benchmark it and see :)

In general, I would guess "yes", since I/O tends to be fairly slow
compared to other things. (Which is the main reason for buffering, after
all.)

But look on the positive side: if you flushed after every character, it
would be even slower! ;)

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: Tue, 15 May 2001 15:21:49 -0400
From: David Coppit <newspost@coppit.org>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <Pine.SUN.4.33.0105151459150.11726-100000@mamba.cs.Virginia.EDU>

On Sun, 13 May 2001, Godzilla! wrote:

[snip editorial stuff]

> >  ...I am just the secretary that writes down the consensus of the group.
>
> This is an outright lie. There is no concensus; there has been no request
> for comments, no voting and, this document has been constructed solely
> by you and no other.

Tad, let me add my voice to the consensus, lest Godzilla! think that
no one else supports what you've written so far. :)

BTW, all the posts I've seen (besides those of Godzilla!) are in favor
of the document, or suggest slight rewording. Assuming that the people
who haven't commented hold no strong opinion, doesn't that make a
consensus (as in "judgment arrived at by most of those concerned")?

--

David



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

Date: 15 May 2001 12:33:30 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <m1pudal851.fsf@halfdome.holdit.com>

>>>>> "David" == David Coppit <newspost@coppit.org> writes:

David> BTW, all the posts I've seen (besides those of Godzilla!) are in favor
David> of the document, or suggest slight rewording. Assuming that the people
David> who haven't commented hold no strong opinion, doesn't that make a
David> consensus (as in "judgment arrived at by most of those concerned")?

Maybe everyone disagreeing with Tad have already killfiled him.

:-)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Tue, 15 May 2001 12:42:38 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <3B0186AE.58CCCE4E@stomp.stomp.tokyo>

David Coppit wrote:
 
> Godzilla! wrote:
 
> [snip editorial stuff]
 
> > >  ...I am just the secretary that writes down the consensus of the group.

> > This is an outright lie. There is no concensus; there has been no request
> > for comments, no voting and, this document has been constructed solely
> > by you and no other.
 
> Tad, let me add my voice to the consensus, lest Godzilla! think that
> no one else supports what you've written so far. :)
 
> BTW, all the posts I've seen (besides those of Godzilla!) are in favor
> of the document, or suggest slight rewording. 

(snipped)


This is untrue. I am reading increasing amounts of strong
objection to this document. Possibly you face challenges
in reading comprehension or, are being masquer deceitful?


Godzilla!


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

Date: Tue, 15 May 2001 12:45:46 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <3B01876A.7C40E390@stomp.stomp.tokyo>

"Randal L. Schwartz" wrote:
 
> >>>>> "David" == David Coppit wrote:
 
> David> BTW, all the posts I've seen (besides those of Godzilla!) are in favor
> David> of the document, or suggest slight rewording. Assuming that the people
> David> who haven't commented hold no strong opinion, doesn't that make a
> David> consensus (as in "judgment arrived at by most of those concerned")?
 
> Maybe everyone disagreeing with Tad have already killfiled him.


Possibly "Tad" killfiles everyone whom disagrees with him?

* grins *

Wookie


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

Date: Tue, 15 May 2001 17:34:44 -0400
From: David Coppit <newspost@coppit.org>
Subject: Re: Posting Guidelines for comp.lang.perl.misc ($Revision: 1.1 $)
Message-Id: <Pine.SUN.4.33.0105151727180.18238-100000@mamba.cs.Virginia.EDU>

On Tue, 15 May 2001, Godzilla! wrote:

> > BTW, all the posts I've seen (besides those of Godzilla!) are in favor
> > of the document, or suggest slight rewording.
>
> This is untrue. I am reading increasing amounts of strong
> objection to this document.

Hm... I guess I missed that. Besides you, I didn't see anyone who
disagreed with the basic idea that some group of cplm regulars
could/should suggest/dictate how others should post to the group.

Admittedly, I probably don't read the newsgroup as closely as you do.
:)

> Possibly you face challenges in reading comprehension or, are being
> masquer deceitful?

Have I done something to deserve this comment? I try to treat other
people with respect, and would appreciate the same unless I
demonstrate myself unworthy of it.

--

David





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

Date: Wed, 16 May 2001 00:48:22 +0200
From: Stephan Heckmueller <Stephan_Heckmueller@public.uni-hamburg.de>
Subject: random ip-adress
Message-Id: <3B01B236.9130D895@public.uni-hamburg.de>

can anybody tell how to compute a random ip-adress that i can pass to
inet_aton()?
that address does not necessarily have to exist, i only need 4 number -
3 dots randomly.
(I don't know how to put the dots between the numbers.)

thanks,
stephan


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

Date: 15 May 2001 20:56:40 GMT
From: dave@sydney.daveb.net (Dave Bailey)
Subject: Re: random ip-adress
Message-Id: <slrn9g2rog.smq.dave@sydney.daveb.net>

On Wed, 16 May 2001 00:48:22 +0200, Stephan Heckmueller 
<Stephan_Heckmueller@public.uni-hamburg.de> wrote:
>can anybody tell how to compute a random ip-adress that i can pass to
>inet_aton()?
>that address does not necessarily have to exist, i only need 4 number -
>3 dots randomly.
>(I don't know how to put the dots between the numbers.)

my $ip = join '.', map { int rand 256 } (1..4);

--
Dave Bailey
davidb54@yahoo.com


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

Date: 15 May 2001 21:57:11 +0100
From: nobull@mail.com
Subject: Re: random ip-adress
Message-Id: <u9d79agwk8.fsf@wcl-l.bham.ac.uk>

Stephan Heckmueller <Stephan_Heckmueller@public.uni-hamburg.de> writes:

> can anybody tell how to compute a random ip-adress that i can pass to
> inet_aton()?
> that address does not necessarily have to exist, i only need 4 number -
> 3 dots randomly.
> (I don't know how to put the dots between the numbers.)

Have you considered string concatenation?

int ( rand * 256) . '.' . int ( rand * 256) . '.' . int ( rand * 256) . '.' . int ( rand * 256)

Of course you could also do something like:

join '.', map { int ( rand * 256) } 1..4

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Tue, 15 May 2001 20:37:26 +0200
From: Philip Newton <pne-news@newton.digitalspace.net>
Subject: Re: Scrambling the source code
Message-Id: <o7t2gtkj34smgesibh9vidn8h9h6ve7d60@4ax.com>

On Tue, 15 May 2001 18:13:33 +0800, "Alvin Yap" <jtalbain@kimochi3d.com>
wrote:

> Sorry 'bout the line length.

You can't be really sorry, because you did it again. (Besides
top-posting and full-quoting.)

> Searching through perldoc.com says I need to use the "Filter" module to
> encrypt it...

Yes? Please quote more exactly. I'd be surprised if it said something
like "Use the 'Filter' module to encrypt your source" just like that,
without qualifying it.

And besides, I wasn't talking about anything dot com. I said:

> > Have a look in the FAQ:   perldoc -q "hide the source"

That means: from the command line, type in  perldoc -q "hide the source"
and then read the output of that command. All of it; it's only five
paragraphs. That text does not recommend any "Filter" module.

> Guess I need to search around on info how to *use* this function :-)

If you want to use the function, it makes sense to know how it works.

Cheers,
Philip
-- 
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.


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

Date: Tue, 15 May 2001 14:40:34 -0700
From: Ramesh Vadlapatla <vadlapat@ecst.csuchico.edu>
Subject: Socket: sysread
Message-Id: <Pine.GHP.4.05.10105151417100.1066-100000@cancer.ecst.csuchico.edu>

Hello! 

I am using: IO::Socket::INET to read from a socket.

My problem is that when I do:

$dsize = sysread($socket, $input, 1024);
It sometimes just waits(blocks) on the socket for more data. 
(and the server does not return a null or a new line or anything like that
for me to check end of data)

Is there some kind of peek function that I can use to see if the socket is
going to send more data? How do I handle this situation?

Also, is there any concept of threads in Perl(on unix) like Java where I
can have 1 thread waiting(blocking) on the socket and the other thread
writing to the socket? If so, any url pointers would help.

Thanks for your help,
Ramesh



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

Date: Tue, 15 May 2001 22:46:40 +0100
From: "bobnet" <bobnet604@hotmail.com>
Subject: Re: sorting hash's
Message-Id: <3b01a38b$1@shiva.ukisp.net>

thnx guys,

bobnet




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

Date: Tue, 15 May 2001 18:42:41 GMT
From: Dan Baker <dan@nospam_dtbakerprojects.com>
Subject: Re: South Florida Job
Message-Id: <3B01772A.DD5DC9C3@nospam_dtbakerprojects.com>

I'm sure you'll get more flames on this.... 
comp.lang.perl.misc is NOT a job posting group; please try to restrict
posts to technical questions about the use of the perl language. 

If you want to post job opportunities, try one of the *.job or
*.freelance groups.


Dan

============

Todd Katcher wrote:
> 
> Interested in a full time perl / php job in Sunny South Florida. 2+ years of
> solid
> perl / php development needed. No junior developers please. Local candidates
> will get preference.
> 
> Must be able to work in a fast paced environment and be able to interact
> with business and technical users.
> 
> Please contact todd@dsninc.com for more information. Thanks.


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

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.  

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


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