[13504] in Perl-Users-Digest
Perl-Users Digest, Issue: 914 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 26 16:07:26 1999
Date: Sun, 26 Sep 1999 13:05:09 -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: <938376309-v9-i914@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 26 Sep 1999 Volume: 9 Number: 914
Today's topics:
ANNOUNCE: MPEG::MP3Play 0.09 <joern@netcologne.de>
ANNOUNCE: sperl <salvador@my-deja.com>
ANNOUNCE: sybperl 2.11 <mpeppler@peppler.org>
Re: awesome perl/CGI sites <gellyfish@gellyfish.com>
Re: cookbook: nonforker <SternSZ@gmx.de>
DBIx::CGI v0.04 released <racke@linuxia.net>
Re: does something like istram.h exist for perl <gellyfish@gellyfish.com>
Re: does something like istram.h exist for perl (Abigail)
Re: LINE into array <gellyfish@gellyfish.com>
Re: LINE into array (Abigail)
Re: LINE into array <garyg@gator.net>
Re: memory use of children (Abigail)
Re: memory use of children <gellyfish@gellyfish.com>
Prob - PerlIS stops working <SteveMcAllister@BigFoot.com>
Re: Randomize array..... <bowman@montana.com>
Re: Randomize array..... (Kragen Sitaker)
Re: Randomize array..... (Yanick Champoux)
Re: Randomize array..... (Abigail)
Re: Randomize array..... (Abigail)
Re: security question (Abigail)
TempDir module 1.2 <sanface@sanface.com>
Re: You should be admired, or What does this have to do <tchrist@mox.perl.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 26 Sep 1999 19:37:13 GMT
From: Joern Reder <joern@netcologne.de>
Subject: ANNOUNCE: MPEG::MP3Play 0.09
Message-Id: <7slsl9$pkg$1@play.inetarena.com>
I just uploaded MPEG::MP3Play 0.09 to CPAN.
Its final destination is:
http://www.perl.com/CPAN/modules/by-authors/id/J/JR/JRED/MPEG-MP3Play-0.09.tar.gz
Version 0.09 is a minor bugfix release. Mainly a few 'perl -w' warning
messages are fixed. See the CHANGES section of the attached README for
details. There are no changes to the interface.
NAME
MPEG::MP3Play - Perl extension for playing back MPEG music
SYNOPSIS
use MPEG::MP3Play;
my $mp3 = new MPEG::MP3Play;
$mp3->open ("test.mp3");
$mp3->play;
$mp3->message_handler;
DESCRIPTION
This Perl module enables you to playback MPEG music.
This README and the documention cover version 0.09 of the
MPEG::MP3Play module.
PREREQUISITES
Xaudio SDK
MPEG::MP3Play is build against the 3.0 version of the Xaudio SDK
and uses the async interface of the Xaudio library.
I don't know if older versions will work properly. The SDK is
not part of this distribution, so get and install it first
(http://www.xaudio.com/).
Perl
I built and tested this module using Perl 5.005_03. It should
work also with Perl 5.004_04 and above, but I did not test this.
If someone builds MPEG::MP3Play successfully with other versions
of Perl, plesase drop me a note.
Optionally used Perl modules
samples/play.pl uses Term::ReadKey if it's installed.
samples/handler.pl requires Term::ReadKey.
samples/gtk*.pl require Gtk.
DOWNLOADING
You can download MPEG::MP3Play from any CPAN mirror. You will
find it in the following directories:
http://www.perl.com/CPAN/modules/by-module/MPEG/
http://www.perl.com/CPAN/modules/by-authors/id/J/JR/JRED/
You'll also find recent information and download links on my
homepage:
http://www.netcologne.de/~nc-joernre/
INSTALLATION
First, generate the Makefile:
perl Makefile.PL
You will be prompted for the location of the Xaudio SDK. The
directory must contain the include and lib subdirectories, where
the Xaudio header and library files are installed.
make
make test
./runsample play.pl
./runsample handler.pl
./runsample gtk.pl
./runsample gtkhandler.pl
./runsample gtkinherit.pl
./runsample synopsis.pl
make install
SAMPLE SCRIPTS
There are some small test scripts in the samples directory. You
can run these scripts before 'make install' with the runsample
script (or directly with 'perl', after running 'make install').
For runsample usage: see above.
All scripts expect a mp3 file 'test.mp3' in the actual
directory.
play.pl Textmodus playback. Displays the timecode. Simple volume
control with '+' and '-' keys.
handler.pl
Does generally the same as play.pl, but uses the builtin
message handler. You'll see, that this solution is much
more elegant. It *requires* Term::ReadKey.
This script makes use of the debugging facility and is
best documented so far.
gtk.pl This script demonstrates the usage of MPEG::MP3Play with the
Gtk module. It produces a simple window with a progress
bar while playing back the test.mp3 file.
gtkhandler.pl
This script does the same as gtk.pl but uses the builtin
message handler concept instead of implementing message
handling by itself. Advantage of using the builtin
message handler: no global variables are necessary
anymore.
Because 'runsample' uses '`perl -w'' you'll get a
warning message here complaining about a subroutine
redefinition. See the section USING THE BUILTIN MESSAGE
HANDLER for a discussion about this.
gtkinherit.pl
This is 'gtkhandler.pl' but throwing no warnings,
because it uses subclassing for implementing messages
handlers.
synopsis.pl
This one proves that the usage shown in the SYNOPSIS
*really* works ;)
BASIC CONCEPT
The concept of the Xaudio async API is based on forking an extra
process (or thread) for the MPEG decoding and playing. The
parent process controls this process by sending and recieving
messages. This message passing is asynchronous.
This module interface provides methods for sending common
messages to the MPEG process, eg. play, pause, stop. Also it
implements a message handler to process the messages sent back.
Eg. every message sent to the subprocess will be acknowledged by
sending back an XA_MSG_NOTIFY_ACK message (or XA_MSG_NOTIFY_NACK
on error). Error handling must be set up by handling this
messages.
You will find detailed information about the interface of
this module in its POD documentation.
TODO
- Win32 support
- support of the full Xaudio API, with input/output
modules, etc.
- documentation: more details about the messages
hashes
Ideas, code and any help are very appreciated.
BUGS
Currently there are no known bugs.
PROBLEMS AND REPORTING BUGS
First check if you're using the most recent version of this
module, maybe the bug you're about to report is already fixed.
Also please read the documentation entirely.
If you find a bug please send me a report. I will fix this as
soon as possible. You'll make my life easier if you provide the
following information along with your bugreport:
- your OS and Perl version (please send me the output
of 'perl -V')
- exact version number of the Xaudio development kit
you're using (including libc version, if this is relevant
for your OS, e.g. Linux)
- for bug reports regarding the GTK+ functionality
I need the version number of your GTK+ library and
the version number of your Perl Gtk module.
If you have a solution to fix the bug you're welcome to send me
a unified context diff of your changes, so I can apply them to
the trunk. You'll get a credit in the Changes file.
If you have problems with your soundsystem (you hear nothing, or
the sound is chopped up) please try to compile the sample
programs that are part of the Xaudio development kit. Do they
work properly? If not, this is most likely a problem of your
sound configuration and not a MPEG::MP3Play issue. Please check
the Xaudio documentation in this case, before contacting me.
Thanks.
MPEG::MP3Play APPLICATIONS
I'm very interested to know, if someone write applications based
on MPEG::MP3Play. So don't hesitate to send me an email, if you
like (or not like ;) this module.
TESTED ENVIRONMENTS
This section will list the environments where this module is
known to function well:
- Perl 5.005_03 and Perl 5.004_04, Linux 2.0.33 and
Linux 2.2.10, Xaudio SDK 3.01 glibc6,
gtk+ 1.2.3, Perl Gtk 0.5121
- FreeBSD 3.2 and 3.3. See README.FreeBSD for details
about building MPEG::MP3Play for this platform.
AUTHOR
Joern Reder <joern@netcologne.de>
COPYRIGHT
Copyright (C) 1999 by Joern Reder, All Rights Reserved.
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
The Xaudio SDK is copyright by MpegTV,LLC. Please refer to the
LICENSE text published on http://www.xaudio.com/.
SEE ALSO
perl(1), MPEG::MP3Info.
CHANGES
Revision history for Perl extension MPEG::MP3Play.
0.09 Fri Sep 26 1999, joern
- The error messages thrown on exit of the Gtk+ sample
scripts are gone. Thanks to Dermot Musgrove for his
suggestions. I added a small chapter about preventing
these error messages in the documentation.
- 'runsample' now uses 'perl -w'. MPEG::MP3Play and
all sample scripts should now work without throwing
warning messages (except 'gtkhandler.pl' where this
is intended).
- There is a new sample script 'gtkinherit.pl' to demonstrate
implementing message handlers by subclassing MPEG::MP3Play
- README.FreeBSD added, thanks go to Bryan Collins
<bryan@casper.spirit.net.au> for his detailed information
- 'runsample' is now generated by Makefile.PL to ensure that
the correct Perl interpreter is used
------------------------------
Date: 26 Sep 1999 19:36:43 GMT
From: Salva <salvador@my-deja.com>
Subject: ANNOUNCE: sperl
Message-Id: <7slskb$pk7$1@play.inetarena.com>
I just uploaded sperl 1.00 to CPAN
It's a script that lets you run perl scripts in remote machines through
ssh (or rsh).
Its location is:
http://www.perl.com/CPAN/authors/id/S/SA/SALVA/sperl-1.00
This is the documentation for it:
NAME
sperl - runs perl scripts in remote machines through ssh
SCRIPT CATEGORIES
Networking UNIX/System_administration Perl/Utilities
README
sperl is some kind of enhanced perl that lets you work in a
network environment and run scripts and oneliners in remote
machines without the need to
USAGE
$ sperl \
[-v] \
[-r<remote command flags>] \
[-R<remote command>] \
[-Q<perl path>] \
[<usual perl flags>] \
<[<remote user>@]remote_host>[,...] \
[<[<[<user>@]machine>:]script.pl | -e 'perl code'>] \
[<script args>]
INSTALLATION
To install sperl, copy it to some place in your path like
/usr/local/bin/sperl and allow execution of it with `chmod 755
/your/path/to/sperl'.
If you want, you can edit the script and change the PERL and
REMOTE_CMD constants at the beginning to match your real
environment.
DESCRIPTION
`sperl' lets you run a locally stored perl script in a remote
machine for which ssh (or equivalent) access is available.
It doesn't need any special module installed in local or remote
machines, just plain perl.
If there isn't script name in the command line, neither `-e'
option, sperl will try to read the code form stdin as perl use
to do.
It's possible to take the script file from another remote
machine with the syntax `machine:/path/to/script.pl' or even
`user@machine:/path/to/script.pl'.
It's also possible to include several remote host names
separated by commas and the script will be run in all of them.
For example `hippo,bugs,bill@www.microsoft.com'
OPTIONS
`sperl' accepts the same command line options as `perl' does.
The options are passed unchanged to the remote perl interpreter
so some of them like `-S' are nonsense.
Additionally, it accepts some specific options:
-r<remote command flags>
pass options to ssh. For instance `-r-v'
-R<remote command>
specify the command to use in place of ssh to connect to the
remote machine. for instance `-Rrsh'.
-Q<remote perl path>
specify the location of the perl interpreter in the remote
machine. By default, sperl will try to look for the perl
path in the script first line, if it uses the notation
`#!/path/to/perl'. As its last resource it expects perl to
be in the PATH.
-v dumps the remote command to stderr before running it. This is
primary for debugging purposes.
EXAMPLES
[salvador@hippo:~]$ sperl admin@willy \
> -e 'print "hello from ".`hostname`'
hello from willy
# the -t option force ssh to allocate a new tty...
[salvador@hippo:~]$ sperl -w -r-t willy -e 'print $count+1,"\n"'
Use of uninitialized value at (eval 1) line 1.
1
# you can even invoke the perl debugger remotely:
[salvador@hippo:~]$ sperl -d -r-t willy -e 1
Loading DB routines from perl5db.pl version 1.0401
Emacs support available.
Enter h or `h h' for help.
main::(-e:1): BEGIN{eval"sub _R{".(pack"h*",shift)."}"}_R(@ARGV)
DB<1> p `hostname`
p `hostname`
willy
DB<2> ...
# running the same code in several machines:
[salvador@hippo:~]$ sperl bugs,willy,hippo -e \
> 'chomp($h=`hostname`);print "hello from $h!!!\n"'
hello from bugs!!!
hello from willy!!!
hello from hippo!!!
CHANGES
sperl 1.00 Thu Sep 23 1999
First public release
BUGS AND LIMITATIONS
This is a beta release so expect errors in it.
Lots of spelling errors in the docs... Help me!!!
The order of the options in the command line is very inflexible.
Switch parsing for the first line of the script is not very
clever and it will produce unexpected results if something
complex is there.
Scripts with `__END__' or `__DATA__' sections will fail.
I don't know if there is any possibility to make this to work in
Microsoft's world.
AUTHOR
Salvador Fandiño García <salvador@cesat.es, fandino@usa.net>
SEE ALSO
the perl(1) manpage, the ssh(1) manpage or the rsh(1) manpage,
the perlrun(1) manpage.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 26 Sep 1999 19:36:19 GMT
From: Michael Peppler <mpeppler@peppler.org>
Subject: ANNOUNCE: sybperl 2.11
Message-Id: <7slsjj$pk6$1@play.inetarena.com>
The uploaded file
sybperl-2.11.tar.gz
has entered CPAN as
file: $CPAN/authors/id/MEWP/sybperl-2.11.tar.gz
size: 164518 bytes
md5: 2441a76c126d9f7265ad9996b94bbca1
This is mostly a bug fix release - making sure that most of the fixes
that I have applied or received since the 2.10_02 release get out.
>From the CHANGES file:
2.11 Various bug fixes.
nsql() patch from W. Philipp Moore.
Added EMBED_SYBASE configuration variable.
dbreadtext() could cause a core dump if the internal call failed.
Figured out what was needed to get Sybase::DBlib to talk to an
MS-SQL 7 dataserver. Sybase::CTlib still does not work with the
normal, non-patched MS-SQL 7 server.
Fixed bug 261: Money/Numeric potentially lose precision in
Sybase::CTlib.
2.10_02
Fix incorrect dropping of locale structure in CTlib::DESTROY.
Link pod/sybperl.pod to CTlib/CTlib.pod and DBlib/DBlib.pod so
that perldoc Sybase::DBlib now works.
2.10_01
Added dbbylist().
Added DBIORDESC() and DBIOWDESC() (contributed by David Worenklein)
Modifications to nsql() contributed by W. Phillip Moore.
Added minimal support for languages and charsets to Sybase::CTlib.
Enjoy!
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@peppler.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
------------------------------
Date: 26 Sep 1999 19:07:44 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: awesome perl/CGI sites
Message-Id: <7slqu0$dao$1@gellyfish.btinternet.com>
On Sun, 26 Sep 1999 16:45:26 GMT akashgoel@my-deja.com wrote:
> We have a
> listing of a the best CGI/PERL websites available.
What is this CGI/PERL I have been hearing so much about recently ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Sep 1999 21:19:46 +0200
From: Benjamin Schweizer <SternSZ@gmx.de>
Subject: Re: cookbook: nonforker
Message-Id: <m3wvtdjx9p.fsf@anthrax.local.net>
+-->Jonathan Stowe <gellyfish@gellyfish.com>:
| > No, I´ve installed the package of my distribution (SuSE) from their
| > ftp-server.
[get the source]
Ok, I´ll do so. I´ll be back soon... ;-%
regards
-Benjamin
--
http://privat.schlund.de/SternSZ/
$ man 1 perl | grep -A1 "virtues" -A1
------------------------------
Date: 26 Sep 1999 19:37:08 GMT
From: Stefan Hornburg <racke@linuxia.net>
Subject: DBIx::CGI v0.04 released
Message-Id: <7slsl4$pkf$1@play.inetarena.com>
Contains now a script to update SQL databases from text files.
DBIx::CGI - Easy to Use DBI Interface for CGI Scripts
*****************************************************
* The homepage of `DBIx::CGI' is http://www.linuxia.net/DBIx/CGI/.
* The latest version (currently 0.04) is always available as
http://www.linuxia.net/DBIx/CGI/DBIx-CGI.tar.gz.
Requirements
************
* DBI (URL: http://www.symbolstone.org/technology/perl/DBI/index.html)
* `DBD::Pg', `DBD::mysql' or `DBD::mSQL' (ask for other database drivers)
* CGI (URL: http://stein.cshl.org/WWW/software/CGI/)
Installation
************
tar -xzf DBIx-CGI.tar.gz
cd DBIx-CGI-0.04
perl Makefile.PL
make
make install
Author
******
Stefan Hornburg <racke@linuxia.net>
--
LinuXia - Solutions of Cool Competence - Internetprogramming and more
D-30163 Hannover, Waldstraße 4, 0511-3941290 (http://www.linuxia.net/)
Wir realisieren Onlineshops mit Minivend (http://www.minivend.com)
und MiniMate (http://www.linuxia.net/minimate/).
------------------------------
Date: 26 Sep 1999 19:49:26 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: does something like istram.h exist for perl
Message-Id: <7sltc6$db7$1@gellyfish.btinternet.com>
On Sun, 26 Sep 1999 10:00:30 -0600 bowman wrote:
> Oliver Folini wrote:
>>
>> (streampos istream::tellg(), istream& istream::seekg(streampos). does
>> something like this exist for perl?
>
> There are some strangely named functions like 'seek' and 'tell' that may
> be what you are looking for.
>
OK. But you will have had to read the whole file and done 'tell' on
every line to determine the positions that you need to 'seek' to in the
first place - it will work of course but you will have to touch the file
twice. Probably the C++ library functions will require this to happen
as well but hide it from you.
If you have a theoretically unlimited memory and you have a predefined
range of *lines* to read then you can quite simply do:
@lines = (<FILE>)[45 .. 75];
but unless I am mistaken this will cause the whole file to be read
before the assignment takes place.
Depending on the circumstance either approach might prove attractive ..
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Sep 1999 14:41:47 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: does something like istram.h exist for perl
Message-Id: <slrn7usu6c.88i.abigail@alexandra.delanet.com>
Oliver Folini (folini@swix.ch) wrote on MMCCXVII September MCMXCIII in
<URL:news:37EE25F1.8BB47600@swix.ch>:
;; hi
;; i'm pretty new in the world of peer and have some problems...
;; i would like to read lines 45 to 75 four times out of a file without
;; reading all the other lines. i'm looking for something like the
;; istream-class from c++
;; (streampos istream::tellg(), istream& istream::seekg(streampos). does
;; something like this exist for perl?
open FILE, "file" or die "Cannot open file: $!";
<> while $. < 44;
my $pos = tell FILE;
foreach (1 .. 4) {
foreach (45 .. 75) {
my $line = <>;
}
seek FILE, $pos, 0 or die "Cannot seek file: $!";
}
Abigail
--
perl -wlpe '}{$_=$.' file # Count the number of lines.
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Sep 1999 19:51:52 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: LINE into array
Message-Id: <7sltgo$dba$1@gellyfish.btinternet.com>
On Sun, 26 Sep 1999 10:19:18 -0700 Eugene Lee wrote:
> Good Morning,
>
> Is there a command to go from a LINE (from an input file) to an array?
>
You mean like:
@array = <FILE>;
where FILE is an open filhandle ?
Please read the documentation next time :
perldoc perl
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 26 Sep 1999 14:46:20 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: LINE into array
Message-Id: <slrn7usuet.88i.abigail@alexandra.delanet.com>
Eugene Lee (eyl@uclink4.berkeley.edu) wrote on MMCCXVII September
MCMXCIII in <URL:news:37EE5596.7CF855DC@uclink4.berkeley.edu>:
{}
{} Is there a command to go from a LINE (from an input file) to an array?
I usually go left, take a right on the third intersection, and then
a left at the second traffic light.
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 26 Sep 1999 15:53:10 -0400
From: "Gary M. Greenberg" <garyg@gator.net>
Subject: Re: LINE into array
Message-Id: <37EE79A6.1A869FA6@gator.net>
Eugene Lee wrote:
>
> Good Morning,
It's 3 PM as I read this BUT my brain is just re-awaking ;-)
>
> Is there a command to go from a LINE (from an input file) to an array?
>
1. @line2array = split(' ',$line);
2. @line2array = split(',',$line);
3. my @line2array;
for (my $i = 0; $i < length($line); $i++) {
$line2array[$i]=substr($line,$i,1); # which buys you nothing! ;-}
}
4. unpack
And so, as you can see, there really isn't a built-in command per se.
It depends on what's in the line && what you want to do with it.
Cheers,
Gary
-=- Avenue Programmers' Reference (Created with Perl) -=-
Class Hierarchy, Requests, and Hyperlinked Sample Scripts:
http:/www.gator.net/~garyg/aveclass.htm
------------------------------
Date: 26 Sep 1999 14:13:02 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: memory use of children
Message-Id: <slrn7ussgf.88i.abigail@alexandra.delanet.com>
Ian Garlick (ijg@connect.org.uk) wrote on MMCCXVII September MCMXCIII in
<URL:news:37EE66DC.18B39946@connect.org.uk>:
``
`` > Only on silly OSses. I once did 'perl -we "fork while fork"' on a
`` > Sparc 4, running Solaris 2.6.
``
`` I am curious. Did you do this deliberately to see what would happen :-)or hor
`` horrors you made a mistake?
I did this deliberately.
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Sep 1999 19:35:05 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: memory use of children
Message-Id: <7slsh9$das$1@gellyfish.btinternet.com>
On 26 Sep 1999 04:10:55 -0500 Abigail wrote:
> Jonathan Stowe (gellyfish@gellyfish.com) wrote on MMCCXIII September
> MCMXCIII in <URL:news:7sbf2k$843$1@gellyfish.btinternet.com>:
> ""
> "" Well I figure about five minutes of :
> ""
> "" perl -e 'fork while(1)'
> ""
> "" Would probably require the switch to resolve on this machine ...
>
>
> Only on silly OSses. I once did 'perl -we "fork while fork"' on a
> Sparc 4, running Solaris 2.6. And while the load reached 980, the
> machine remained quite usable; it allowed me to switch between windows
> and in another window write a little script that killed all the forking
> processes. Running that as root with a high priority brought the situation
> back to normal.
>
> If your OS can't deal with such a fork bomb, get a real OS. ;-)
>
I think that you want to talk about the process scheduling schemes of
various OS - I believe that would better be discussed in another group :)
But I did have Netscape navigator running - so all bets are off really
baby ...
Anyhow I have seen a single process drag down FreeBSD, SCO, DRS/NX without
any ill intent (I've seen something or other doing something nasty to
something else at the tanhauser gate etc etc like tears in rain ...)
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 26 Sep 1999 19:39:05 GMT
From: SM McAllister <SteveMcAllister@BigFoot.com>
Subject: Prob - PerlIS stops working
Message-Id: <7slsoo$1ec$1@nnrp1.deja.com>
I have seen a few errors on my IIS4/SP4/SS3 development machine.
I appears that every so often the Perl for IIS COM object won't work.
The Perl .plx files are rarely run. Maybe 10 - 20 times a week.
It's more likely that some other COM objects we are creating or the
Site Server ones are stomping on something.
Any ideas?
I searched the log files any saw some errors.
I don't have access to them now, but I can report if needed.
SM McAllister
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Sun, 26 Sep 1999 13:05:02 -0600
From: bowman <bowman@montana.com>
Subject: Re: Randomize array.....
Message-Id: <37EE6E5E.1A2458EC@montana.com>
HKS wrote:
>
> number in the "@result" array.. (e.g "2,3,5,2,1,6") which i dont want. is
> there any way i can make sure the result will not contain any duplicate
> numbers?
There are a couple of common 'shuffle a deck of cards' algorithms.
1: create an array 1..6 , select an element at random and place it into
the
output array. Compact the original array to 5 elements, and so forth.
2: create your array of n elements. select a random element from 1 to
n-1 and swap it with element 0.
The second form and variations on that theme tend to be a little faster
and easier to implement as you can do it in place.
------------------------------
Date: Sun, 26 Sep 1999 19:39:51 GMT
From: kragen@dnaco.net (Kragen Sitaker)
Subject: Re: Randomize array.....
Message-Id: <bEuH3.303$J66.55194@typ11.nn.bcandid.com>
In article <37ee628a.0@news.highway1.com.au>, HKS <hks3@usa.net> wrote:
>i just learning perl for couple of days, and i encountered a problem on
>randomize the array elements and put the result into another array...
See perlfaq4, "How do I shuffle an array randomly?". I found it with
perldoc -q random.
--
<kragen@pobox.com> Kragen Sitaker <http://www.pobox.com/~kragen/>
Sun Sep 26 1999
43 days until the Internet stock bubble bursts on Monday, 1999-11-08.
<URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Sun, 26 Sep 1999 19:41:21 GMT
From: yanick@comnet.com (Yanick Champoux)
Subject: Re: Randomize array.....
Message-Id: <rustn1ge3i56@corp.supernews.com>
In article <37ee628a.0@news.highway1.com.au>,
"HKS" <hks3@usa.net> writes:
> [..] say i
> created an array "@num", which contains "1,2,3,4,5,6" and i want to
> randomize these numbers and put it into another array, say "@result" which
> will contain the randomized numbers(e.g "2,3,4,1,5,6").
Easy:
#! /usr/bin/perl
srand;
my @num = ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 );
@result = sort By_Random @array;
sub By_Random
{
return (-1,1)[rand(2)]; # return -1 or 1 at random
}
print join ' ', @result, "\n";
__END__
Joy,
Yanick
------------------------------
Date: 26 Sep 1999 14:49:26 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Randomize array.....
Message-Id: <slrn7usukm.88i.abigail@alexandra.delanet.com>
HKS (hks3@usa.net) wrote on MMCCXVII September MCMXCIII in
<URL:news:37ee628a.0@news.highway1.com.au>:
''
'' i just learning perl for couple of days, and i encountered a problem on
'' randomize the array elements and put the result into another array... say i
'' created an array "@num", which contains "1,2,3,4,5,6" and i want to
'' randomize these numbers and put it into another array, say "@result" which
'' will contain the randomized numbers(e.g "2,3,4,1,5,6").
''
'' i tried using "srand and rand" ..it works, but sometimes i had the same
'' number in the "@result" array.. (e.g "2,3,5,2,1,6") which i dont want. is
'' there any way i can make sure the result will not contain any duplicate
'' numbers?
Yes. Don't write bugs. (What else can we say? You don't show us any code...)
You also might want to peek in the FAQ.
Abigail
--
perl -wle 'print "Prime" if ("m" x shift) !~ m m^\m?$|^(\m\m+?)\1+$mm'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Sep 1999 14:50:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Randomize array.....
Message-Id: <slrn7usun4.88i.abigail@alexandra.delanet.com>
bowman (bowman@montana.com) wrote on MMCCXVII September MCMXCIII in
<URL:news:37EE6E5E.1A2458EC@montana.com>:
`` HKS wrote:
`` >
`` > number in the "@result" array.. (e.g "2,3,5,2,1,6") which i dont want. is
`` > there any way i can make sure the result will not contain any duplicate
`` > numbers?
``
`` There are a couple of common 'shuffle a deck of cards' algorithms.
``
`` 1: create an array 1..6 , select an element at random and place it into
`` the
`` output array. Compact the original array to 5 elements, and so forth.
That's a quadratic algorithm.
`` 2: create your array of n elements. select a random element from 1 to
`` n-1 and swap it with element 0.
And that algorithm is *wrong*. Think about it.
Abigail
--
perl -wleprint -eqq-@{[ -eqw\\- -eJust -eanother -ePerl -eHacker -e\\-]}-
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Sep 1999 15:04:05 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: security question
Message-Id: <slrn7usvg6.88i.abigail@alexandra.delanet.com>
michael yanai (mich@babylon.com) wrote on MMCCXVII September MCMXCIII in
<URL:news:37EE539E.E242DB20@babylon.com>:
//
// if my perl cgi script run ok with the -T( taint check )
// does this mean that it is safe and can not be used
// to hack my server?
No. But, if used wisely, it will help you in preventing someone to
hack your server. -T isn't a magical switch that makes things safe.
It's a tool to help you making things safe.
You should read the perlsec manpage.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 26 Sep 1999 19:37:01 GMT
From: SANFACE Software <sanface@sanface.com>
Subject: TempDir module 1.2
Message-Id: <7slskt$pke$1@play.inetarena.com>
Thanks for all your suggestions, they help this module to grow up.
What is tmpdir?
Every PERL tool use temporary files.
If you want your code can be simply portable on different OS, you need
to select the correct temporary directory. The purpose of this module
is to check the correct temporary directory in every OS supported by
PERL to use it.
We need your help.
We ask you to send us the correct tempory directory for every OS
supported by PERL and to suggest us good modifies (sanface@sanface.com).
The news:
The default Mac OS directory can be found with the FindFolder toolbox
function
use Mac::Files;
$tmp = FindFolder(kOnSystemDisk,kTemporaryFolderType);
However, MacPerl automatically assigns this directory to $ENV{TMPDIR}.
[by Chris Nandor]
The latest version of this library is likely to be available from:
SANFACE Software (http://www.sanface.com)
every CPAN mirror S/SA/SANFACE/
Copyright 1999, SANFACE Software
This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
--
SANFACE Software
http://www.sanface.com
mailto:sanface@sanface.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 26 Sep 1999 13:18:57 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: You should be admired, or What does this have to do with Perl?
Message-Id: <37ee71a1@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc,
Dan Woods <dwoods@ucalgary.ca> writes:
:That depends on what you mean by popular. I would classify Perl, UNIX,
:C, Java, sh/csh/ksh/awk, Vi/Emacs editors into the category of
:"definitely not for beginners".
That's completely bizarre. These are what beginners used when they
signed up for a programming class at university. Oh, we didn't have
Perl, Java, or ksh when I was at college, but the rest of them (BSD Unix
on a PDP-11, csh, and vi) were certainly standard. And people with no
programming background used them. And no, they weren't all destined to
become professionals. Plenty of non-majors were in those classes.
I happen to think that that generation turned out fine, and certainly
they were beginners at the time.
--tom
--
"The trick is to stop thinking of it as `your' money."
--IRS auditor
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 914
*************************************