[17908] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 68 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jan 16 06:05:36 2001

Date: Tue, 16 Jan 2001 03:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <979643110-v10-i68@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Tue, 16 Jan 2001     Volume: 10 Number: 68

Today's topics:
        ApacheModulePerl.dll <a565a87@my-deja.com>
    Re: bash says: No such file or directory when I try to  <josef.moellers@fujitsu-siemens.com>
    Re: bash says: No such file or directory when I try to  (Joe Smith)
    Re: Can't associate .PL files in Win98 (Damian James)
    Re: Can't associate .PL files in Win98 (Duncan Murdoch)
    Re: Can't get Apache, Win98, and Mod_Perl working. shiloam@my-deja.com
    Re: Forward engineering Perl from Dia <brannon@lnc.usc.edu>
    Re: Limits on array and hash storage (Rich Lafferty)
        More questions about pattern matching <hafateltec@hotmail.com>
    Re: More questions about pattern matching <hafateltec@hotmail.com>
    Re: moving files from directories <Michael.Schlueter@philips.com>
    Re: moving files from directories (Anno Siegel)
        Newbie question: hash tables and dbm files; what am I d <nospam-abuse@[127.0.0.1]>
    Re: NEWBIE: need help with search spider/crawler (someone of export)
    Re: NEWBIE: need help with search spider/crawler (Abigail)
        Perl for Palm? <lifeoneuropa@hotmailnospam.com>
    Re: Random Numbers with a Twist <coppocks@bellsouth.net>
    Re: Random Numbers with a Twist <joe+usenet@sunstarsys.com>
    Re: Random Numbers with a Twist <joe+usenet@sunstarsys.com>
    Re: Random Numbers with a Twist (Craig Berry)
    Re: Random Numbers with a Twist (Anno Siegel)
    Re: RegEx , matching ? (Rafael Garcia-Suarez)
        Using perl to ftp files pularis@my-deja.com
    Re: Using perl to ftp files (Damian James)
    Re: Using perl to ftp files (David Efflandt)
    Re: What do you call the => operator? <nospam-abuse@[127.0.0.1]>
    Re: What do you call the => operator? (Abigail)
    Re: What do you call the => operator? (John McNamara)
        why does system() work on command line but not in brows <brennanb_731@yahoo.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 16 Jan 2001 09:31:57 GMT
From: Rob <a565a87@my-deja.com>
Subject: ApacheModulePerl.dll
Message-Id: <9414ed$8aj$1@nnrp1.deja.com>

I nmade 5.6.0 from the CPAN source distribution, and the root sits on
my C drive.  I'm using the very latest Win32 1.3.14 binary distr. of
Apache.  The Apache root is R:\Program Files\Apache Group\Apache

---
Here's my Autoexec.bat:

@ECHO Off
PATH C:\
VERIFY OFF

C:\ATAPI\MSCDEX /V /D:CDMKE /L:E /M:10
SET PATH=C:/MSVC/BIN;c:/perl/5.6.0/bin;c:/perl/5.6.0/bin/MSWin32-x86;%
PATH%
SET INCLUDE=C:/MSVC/INCLUDE;C:/MSVC/MFC/INCLUDE;%INCLUDE%
SET LIB=C:/MSVC/LIB;C:/MSVC/MFC/LIB;%LIB%
SET INIT=C:/MSVC;%INIT%

---
The httpd.conf DSO line reads:
     LoadModule perl_module modules/ApacheModulePerl.dll

---
Running Apache from the console, not a service.  I get the following:

     R:\Program Files\Apache Group\Apache>apache
     Syntax error on line 205 of r:/program files/apache
     group/apache/http.conf:
     Cannot load r:/program files/apache
     group/apache/modules/ApacheModulePerl.dll into server:
     Note the errors or messages above, and press the <Esc> key to exit.
     R:\Program Files\Apache Group\Apache>apache

The ApacheModulePerl.dll is a binary that I obtained
from .../authors/Jeffrey_Baker.  The file is dated 10/28/98.  (It's the
one that isn't supposed to work with the ActiveState perl.)  I'm not
using an ActiveState distribution.

(Randy Kobes generously suggested a different combination of
ActiveState & mod_perl, which I haven't yet tried.  Just wanted to get
my own perl source successfully made and installed as a beginner before
resorting to all binaries.)

In the existing state that I've described above, any ideas as to why
this mod_perl framework still isn't working on my system?

Thank you for any information that you can provide.
-Rob


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 16 Jan 2001 10:14:27 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: bash says: No such file or directory when I try to execute a perl  script
Message-Id: <3A6410F3.5191100A@fujitsu-siemens.com>

Joe Smith wrote:

> Two things:
> =

>   1) Never name your program "test".  It will conflict the the standard=

>      Unix command, either /bin/test or /usr/bin/test.  Use "mytest".

Not only that, somtimes "test" is a built-in, and "Nothing happens when
I type 'test'" is a VFAQ!

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize (T.  Pratchett)


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

Date: 16 Jan 2001 09:10:29 GMT
From: inwap@best.com (Joe Smith)
Subject: Re: bash says: No such file or directory when I try to execute a perl script
Message-Id: <941365$hnb$1@nntp1.ba.best.com>

In article <3a5cef6c.112611991@news.pacbell.net>,
Ted Koby <sigmadat@yahoo.com> wrote:
>Wayne, Simon, Zach, Michael,
>
>We are getting a similar result of: Command not found.
>We are also using #!/usr/bin/perl
>When we type ./test it works.  
>Just typing    test    results in the message: Command not found.

Two things:

  1) Never name your program "test".  It will conflict the the standard
     Unix command, either /bin/test or /usr/bin/test.  Use "mytest".

  2) Avoid putting . in your search path.  Instead, put executable
     scripts in a particular directory, such as ~/bin.  Make sure
     that directory is in your PATH.

Note for csh/tcsh users: Remember to type "rehash" after putting a
brand new command into one of the $path directories.
	-Joe

P.S. Don't post to "comp.lang.perl"; that newsgroup was renamed to
     "comp.lang.perl.misc" many years ago.
--
See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.


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

Date: 16 Jan 2001 02:25:10 GMT
From: damian@puma.qimr.edu.au (Damian James)
Subject: Re: Can't associate .PL files in Win98
Message-Id: <slrn967c9p.dks.damian@puma.qimr.edu.au>

David Efflandt wrote:
>On Sun, 14 Jan 2001, Gary Burton wrote:
>
>> The association still would not work in Windows 98.  An opinion on one
>> of the discussion groups was that it can't be done for shell
>> (DOS) programs in Win95 or Win98, although it works fine in Windows
>> NT.  Unfortunately, that seems to be correct because I carefully
>> reviewed the instructions in ActiveState's perlwin32faq4 FAQ called "How
>> do I associate Perl scripts with Perl?" and followed them precisely.
>
>While the file association does not work from the DOS shell, it does work
>from Windows Explorer (see below).  From the DOS shell you either run the
>script as a commandline parameter to Perl, or use pl2bat to convert it to
>a .bat file.  This requires that Perl and pl2bat are in your PATH (usually
>C:\PERL\BIN).  The pl2bat worked for me.
>

Under Win98 and NT, I have found that you can change file associations for
anything at any time by shift-right-clicking on the file, then selecting
"Open With..." from the context menu. 

If the relevent executable is not in the list, click "Other" and locate it
yourself.

You can use this to associate .txt files with vim, for example. Likewise you 
can associate ANY extension you like with the perl executable. Really, the
extension you use is quite arbitrary and is up to you.

As for getting the window to stay around -- myself, I'd just be opening a
DOS/command prompt window and typing "perl filename". 

HTH

Cheers,
Damian


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

Date: Tue, 16 Jan 2001 02:55:01 GMT
From: dmurdoch@pair.com (Duncan Murdoch)
Subject: Re: Can't associate .PL files in Win98
Message-Id: <3a67b729.27013259@news1.on.sympatico.ca>

On Mon, 15 Jan 2001 19:01:49 -0600, David Efflandt <efflandt@xnet.com>
wrote:

>While the file association does not work from the DOS shell, it does work
>from Windows Explorer (see below).  From the DOS shell you either run the
>script as a commandline parameter to Perl, or use pl2bat to convert it to
>a .bat file. 

File associations *do* work from the DOS shell, but you need to use
the "start" program to access them.  That is, if you've associated
*.pl with Perl, then

  start prog.pl

will run "Perl prog.pl".  It saves a bit of typing if Perl isn't on
the current path.  (If you want to save typing even when Perl is on
the path, you could rename start.exe to s.exe...)

Not Perl related, but "start ." is a quick way to open an Explorer
view of the current directory.

Duncan Murdoch


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

Date: Tue, 16 Jan 2001 03:14:00 GMT
From: shiloam@my-deja.com
Subject: Re: Can't get Apache, Win98, and Mod_Perl working.
Message-Id: <940e9i$mju$1@nnrp1.deja.com>

In article <94054d$nu8$1@canopus.cc.umanitoba.ca>,
  "Randy Kobes" <randy@theory.uwinnipeg.ca> wrote:
> <shiloam@my-deja.com> wrote in message
>     news:93vhco$sre$1@nnrp1.deja.com...
> > I am running Windows 98 and have successfully configured Apache
1.3.12
> > to run just fine. I have recently installed ActivePerl and have been
> > teaching myself the language. I have Perl 5.6.0 and I have
downloaded
> > the Mod_Perl apache from the Perl site as well. I cannot seem to
get it
> > working however. Everytime I try to use the LoadModule perl_module
> > modules/ApacheModulePerl or LoadModule perl_module
> > modules/ApacheModulePerl.dll it doesn't work, and gives me a can't
load
> > module error. When I try to register this dll using regsrv32 it says
> > that it can't load the dll as well.
>
> Are you using the mod_perl ppm package and the
> ApacheModulePerl.dll that matches your Apache version?
> And is the ActivePerl perl binary included in your PATH
> when you start Apache?
>
> best regards,
> randy kobes
>
>

Yes, c:\erl\bin is the first item in my path, and I downloaded the
mod_perl from perl.apache.org I think, it came as a package so it must
match. Can anyone help?

Steve Tilden
Instant Perl Fan


Sent via Deja.com
http://www.deja.com/


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

Date: Tue, 16 Jan 2001 10:17:53 GMT
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: Re: Forward engineering Perl from Dia
Message-Id: <lblmsbssvi.fsf@lnc.usc.edu>

Collin Starkweather <collin.starkweather@collinstarkweather.com> writes:

> On 15 Jan 2001, Terrence Brannon wrote:
> 
> > Collin Starkweather <collin.starkweather@collinstarkweather.com> writes:
> >
> > > I have written basic Perl forward-engineering for Dia
> > 
> > What is meant by Perl forward-engineering?
> > 
> > > (http://www.lysator.liu.se/~alla/dia) into Javier O'Hara's dia2code
> > > (http://sourceforge.net/projects/dia2code) (authored in C), but now that
> > > I've accomplished the basics, I would like to solicit some comments from
> > > anyone out there who may be interested.
> > 
> > Is what you did documented? Does it have examples? I went to the URLs   
> > above and saw 2 other people's projects. I still have no idea what you
> > did and how it relates to the above 2 things.
> > 
> > My guess is you have come up with some way of programming perl visually?
> 
> Should have given more background.
>   
> Dia is a diagramming tool with UML diagramming facilities.  It was
> originally __just__ intended to be used for diagramming, but since folks
> put UML into the mix, it seems there is interest in adding some of the
> basic features normally associated with CASE tools.
> 
> dia2code is a code generation program which currently generates C++ and
> Java code from UML diagrams generated in dia.  I am interested in
> expanding the set of languages to enable dia2code to generate Perl
> classes from UML diagrams specified in dia.

It would be interesting to see how easily you could generate the Perl
code for Llamacard, which has UML diagrams for its design. It was
published in Perl 4.0 Conference Proceedings.

How many platforms does gtk+ run on? I should hope one could use mac,
windows, and unix to generate and/or view these diagrams.

Your project sounds interesting, and stronly parallel to a concern of
mine (which has not grown into any code yet ... heheh). Anyway, there
are an increasing number of data description protocols for Perl:

- Tangram, an object-relational mapper
- Class::MethodMaker
- Class::Classgen
- Base Perl Code is pretty nice
  - nested hashes
  - scalar, array, hash
- DDL::Oracle (I'm guessing here)

And their functionality overlaps sometimes. It would be neat to have a
data description language which could create all of these.

> Though I have some primitive (but working) code, nothing has been
> documented or posted yet because I'm still ruminating on the scope of
> the contribution.  However, there are examples on dia2code's homepage
> 
> 	http://dia2code.sourceforge.net/index.html
> 
> of the C++ and Java code generation capabilities.
> 
> > > There are four basic approaches I'm considering, and any comments or   
> > > advice would be appreciated.
> > > 
> > > 1)  Generate all of the Perl explicitly from dia2code.  This would
> > > retain dia2code intact as a standalone app.  Additionally, the C could
> > > potentially be used via XS to facilitate a generic Perl code generation
> > > module.
> > >
> > > 2)  Generate skeletons with h2xs and modify them as necessary.
> >
> > Well, XS is supposed to be thrown out with Perl 6. Correct me if I'm wrong.
> 


-- 
Terrence Brannon
Carter's Compass...
    I know I'm on the right track when by deleting code I'm adding
    functionality.


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

Date: 16 Jan 2001 04:35:11 GMT
From: rich@bofh.concordia.ca (Rich Lafferty)
Subject: Re: Limits on array and hash storage
Message-Id: <slrn967jrv.rc6.rich@bofh.concordia.ca>

In comp.lang.perl.misc,
Abigail <abigail@foad.org> wrote:
> Rich Lafferty (rich@bofh.concordia.ca) wrote
> > William Cardwell <EUSWMCL@am1.ericsson.se> wrote:
> > > 
> > > I notice that large arrays and hashes are commonly used in Perl. I do
> > > the same and have not yet hit limits. Am I really using only ram?
> > 
> > Possibly swap, also. Depends on your operating system.
> 
> Really? There are operating systems that have swap that's located in
> memory that cannot be randomly accessed? Swap on punch cards does exist?

Tsk tsk! Occam's razor, Abigail -- there are operating systems without
swap.

  -Rich

-- 
Rich Lafferty ----------------------------------------
 Nocturnal Aviation Division, IITS Computing Services
 Concordia University, Montreal, QC
rich@bofh.concordia.ca -------------------------------


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

Date: Tue, 16 Jan 2001 16:52:27 +1000
From: "Mike McPherson" <hafateltec@hotmail.com>
Subject: More questions about pattern matching
Message-Id: <940r4m$s87$1@brokaw.wa.com>

First I think that there should be a newsgroup just for perl re alone :)  I
think it would get the traffic LOL

#!/usr/bin/perl -w
print "\nPlease input a ip address in xxx.xxx.xxx.xxx format --->";
$validip = <STDIN>;

unless ($validip =~
/^[0-2][0-5]{2}.[0-2][0-5]{2}.[0-2][0-5]{2}.[0-2][0-5]{2}/) {
chomp($validip);
print "\n$validip: Not a valid ip\n";
}else{
chomp($validip);
print "\n$validip is valid\n";
}


As I read I am seeing more and more on how to do this regexp but there are
still some things that I am not sure on.
For example the above will validate a number such as 111.111.111.111 yet it
will not validate 249.249.249.249 ::

Say for instance I wanted to eval a phone number xxx-xxxx
#!/usr/bin/perl -w
$phone = shift @ARGV;
unless ($phone =~ /\d{3}-\d{4}/) {
print "What phone number is $phone\n";
}
else {
chomp $phone;
print "What a buetifull phone number $phone\n";
}

Works great right... But what if I wanted to make sure that xxx-xxxx

^^^^ = 0001 to 3999 ???

So now you can see some of my frustration.  Unfortunatly my "Mastering
Regular Expressions by Jeffrey Friedl" is still 3 days away from getting
here and I need to figure this out earlier than that so all help is
appriciated.

Thank's
Mike




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

Date: Tue, 16 Jan 2001 17:09:50 +1000
From: "Mike McPherson" <hafateltec@hotmail.com>
Subject: Re: More questions about pattern matching
Message-Id: <940s5d$s9f$1@brokaw.wa.com>

> Say for instance I wanted to eval a phone number xxx-xxxx
> #!/usr/bin/perl -w
> $phone = shift @ARGV;
> unless ($phone =~ /\d{3}-\d{4}/) {
> print "What phone number is $phone\n";
> }
> else {
> chomp $phone;
> print "What a buetifull phone number $phone\n";
> }
>
> Works great right... But what if I wanted to make sure that xxx-xxxx
>
> ^^^^ = 0001 to 3999 ???
>

One note added that I noticed after I posted this:
perlre manpage states:
The following standard quantifiers are recognized:


    *      Match 0 or more times
    +      Match 1 or more times
    ?      Match 1 or 0 times
    {n}    Match exactly n times              #EXACTLY N TIMES ??????
    {n,}   Match at least n times
    {n,m}  Match at least n but not more than m times

then if {n} Matches EXACTLY N TIMES why is it that /\d{3}-\d{4}/ will work
on xxx-xxxx but not xxx-xxxxx ?????






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

Date: Tue, 16 Jan 2001 09:11:58 +0100
From: "Michael Schlueter" <Michael.Schlueter@philips.com>
Subject: Re: moving files from directories
Message-Id: <3a640250$0$8792$4dbef881@businessnews.de.uu.net>

Anno,

bad problem statement, bad solution.
simple as that.

what's your solution, then?

cheers




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

Date: 16 Jan 2001 09:57:39 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: moving files from directories
Message-Id: <9415uj$o9q$2@mamenchi.zrz.TU-Berlin.DE>

Michael Schlueter <Michael.Schlueter@philips.com> wrote in comp.lang.perl.misc:
>Anno,
>
>bad problem statement, bad solution.
>simple as that.

The problem statement was pretty clear.  The flaws in your proposal
come from not reading the problem statement.  And if you know your
solution is bad, why post it?

>what's your solution, then?

I'm not giving one.  After Bernard El-Hagin has enumerated all the
necessary components the solution is trivial.

Anno


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

Date: Tue, 16 Jan 2001 02:41:20 -0500
From: "James Kauzlarich" <nospam-abuse@[127.0.0.1]>
Subject: Newbie question: hash tables and dbm files; what am I doing wrong?
Message-Id: <yXS86.2625$d25.15703@newsfeed.slurp.net>

Ok, I'm trying to manipulate some dbm files, the first two programs I
cobbled together work fine, the 2nd two do NOT.   I'm getting very
frustrated.  Do the dbm files NOT work with Hashes of hashes??

These two programs work as expected:  (print out the orders.db file, but I
do include a printout of dbprint)

=====================================
[jamesk@tux jamesk]$ cat dbman
!#/usr/bin/perl

dbmopen (%data, "orders", 0666);
print "What is your name?\n";
$name = <STDIN>;
chomp($name);
print "What is your order?\n";
$ord = <STDIN>;
chomp($ord);
$data{$name} = $ord;
print "you said $data{$name}";
$data{'googookaka'} = "Big Mac";

dbmclose (%data);
print "\n\n";

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

[jamesk@tux jamesk]$ cat dbprint
!#/usr/bin/perl

print "\nOutput:\n";
dbmopen (%data, "orders", 0777);
foreach (keys %data) {
  print "$_ ordered a: $data{$_}\n";
}
dbmclose (%data);
print "bye!\n";

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

[jamesk@tux jamesk]$ perl dbprint

Output:
Jim ordered a: Yoohoo
googookaka ordered a: Big Mac
dog ordered a: cat
jacko ordered a: rabbit
jacko rabbit ordered a: ree
Dan ordered a: Diamond
big john ordered a: car
carrot ordered a: ear
Pain in the arse ordered a: Nitting needle
bye!

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

As expected, dbman accepts input, updats the orders.db file, then prints out
the contents of the %data hash table.


BUT  The following programs are giving me fits:  (You will see some html
intersperced throughout the code, though I've removed most of it while
trying to track down where I'm messing up.  I'm trying to write a
'foodorder' program that will sit on my webpage, and allow all my co-workers
to (once we've agreed on where to order from) place food orders.  Eventually
I may have it build it's own db of prices by places, then you just select
what you want.  But that is far far in the future for now.)

=====================================
[jamesk@tux dbcrap]$ cat works.pl
#! /usr/bin/perl
#dbmopen (%food, "orders3", 0666);
%food =         (
                me=>
                        {
                                bread => "1",
                                water => "0"
                        },

                dan=>

                        {
                                rice      => "1",
                                green_tea => "1"
                        },

                genome=>
                        {
                                pizza     => "15",
                                "dr pepper" => "1"
                        },
                );

foreach $x ( keys %food )
        {
        print "\n$x ordered the following:\n";
        foreach ( keys %{$food{$x}} )
                {
                print "$_ costs \$$food{$x}{$_}\n";
                }
        print "\n";
        }
#dbmclose (%food);


=====================================
Gives me the following output (as expected):
[jamesk@tux dbcrap]$ perl works.pl

me ordered the following:
water costs $0
bread costs $1


genome ordered the following:
dr pepper costs $1
pizza costs $15


dan ordered the following:
green_tea costs $1
rice costs $1

=====================================
but, simply un-comment out the dbmopen/close commands, and the following
output results:

me ordered the following:


dan ordered the following:


genome ordered the following:

=====================================
Whaaaa!  Splain it to me Ricky!

One last mystery, if you please,  even through I've told it to make the db
files -rw-rw-rw- with a 0666, I've been getting -rw-rw-r--, though they seem
to work fine (for now, from a command line).  What's going on?










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

Date: Tue, 16 Jan 2001 04:25:38 GMT
From: lashawn@rice.edu (someone of export)
Subject: Re: NEWBIE: need help with search spider/crawler
Message-Id: <3a63ccb3.184683563@news.rice.edu>

On 15 Jan 2001 22:58:52 GMT, abigail@foad.org (Abigail) wrote:
(snippage of my inquiry)
>Hire someone.
>
>
>
>Abigail
I'd like to figure out how to do it.  Not much of a solution for a
newcomer to purchase every program or script they need. Any help with
the problem would be great, but there's no need for snarking. 
s.


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

Date: 16 Jan 2001 08:56:18 GMT
From: abigail@foad.org (Abigail)
Subject: Re: NEWBIE: need help with search spider/crawler
Message-Id: <slrn96835i.kig.abigail@tsathoggua.rlyeh.net>

someone of export (lashawn@rice.edu) wrote on MMDCXCV September MCMXCIII
in <URL:news:3a63ccb3.184683563@news.rice.edu>:
<> On 15 Jan 2001 22:58:52 GMT, abigail@foad.org (Abigail) wrote:
<> (snippage of my inquiry)
<> >Hire someone.
<> >
<> >
<> >
<> >Abigail
<> I'd like to figure out how to do it.  Not much of a solution for a
<> newcomer to purchase every program or script they need. Any help with
<> the problem would be great, but there's no need for snarking. 


You don't learn carpenting by asking how to build a church either.

Hiring someone *IS* a good advice. What you want to do is complex, and
requires quite some code - not at all suitable for a self proclaimed
newbie. 


Abigail
-- 
print 74.117.115.116.32;
print 97.110.111.116.104.101.114.32;
print 80.101.114.108.32;
print 72.97.99.107.101.114.10;


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

Date: Tue, 16 Jan 2001 10:24:58 GMT
From: "allNIC.net" <lifeoneuropa@hotmailnospam.com>
Subject: Perl for Palm?
Message-Id: <160120010205351995%lifeoneuropa@hotmailnospam.com>

Greetings,

Does anyone know of any PDAs which have decent Perl ports?

If so, please email me at: joshwa@sonic.net


Thanks!
-joshua


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

Date: Mon, 15 Jan 2001 22:50:52 -0800
From: "Shawn Coppock" <coppocks@bellsouth.net>
Subject: Re: Random Numbers with a Twist
Message-Id: <HuP86.309$zc4.50082@news2.mco>

Thanks for all of the input. It really helped. Problem solved!

I created a tiled system... each square say... 75x75 ... that gave me a 25
buffer on all sides and a random placement in the center 25. This avoided
overlaps.

Again, thanks for all the input!

Regards,
Shawn





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

Date: 15 Jan 2001 23:11:29 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Random Numbers with a Twist
Message-Id: <m3ofx8xhji.fsf@mumonkan.sunstarsys.com>

"Shawn Coppock" <coppocks@bellsouth.net> writes:

> Thanks for all of the input. It really helped. Problem solved!
> 
> I created a tiled system... each square say... 75x75 ... that gave me a 25
> buffer on all sides and a random placement in the center 25. This avoided
> overlaps.

Huh?  That doesn't sound like a solution to the question you asked.  
Chris' solution (although I haven't tested it, it appears to be ok) 
should solve your problem under the conditions you stated.  Did you 
try it?  Is it too slow or something?

The solution you came up with here is rather artificial, since the 
vast majority of your screen (the margins of your 75x75 box) will 
never contain a point.

If you are unsatisfied with the speed of Chris' solution or something, 
there are more sophisticated (aka space-filling, or quasi-)random 
sequences you might try instead of using the stock "rand" on your box.
Try google(quasi-random space filling) to learn more about them.

HTH
-- 
Joe Schaefer



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

Date: 15 Jan 2001 23:24:57 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Random Numbers with a Twist
Message-Id: <m3k87wxgx2.fsf@mumonkan.sunstarsys.com>

Joe Schaefer <joe+usenet@sunstarsys.com> writes:

> If you are unsatisfied with the speed of Chris' solution or something, 

s/Chris/Craig/ - sorry about that.  Mis-attribution seems 
to be going around in clp.misc :(

-- 
Joe Schaefer


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

Date: Tue, 16 Jan 2001 05:32:16 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Random Numbers with a Twist
Message-Id: <t67n706e6keq03@corp.supernews.com>

Joe Schaefer (joe+usenet@sunstarsys.com) wrote:
: Joe Schaefer <joe+usenet@sunstarsys.com> writes:
: > If you are unsatisfied with the speed of Chris' solution or something, 
: 
: s/Chris/Craig/ - sorry about that.  Mis-attribution seems 
: to be going around in clp.misc :(

No prob.  The funny thing is that, while reading your post, I was thinking
"Hm, haven't seen a post from anybody named Chris...wonder how it compares
to mine?" :)

-- 
   |   Craig Berry - http://www.cinenet.net/~cberry/
 --*--  "The hills are burning, and the wind is raging; and the clock
   |   strikes midnight in the Garden of Allah." - Don Henley


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

Date: 16 Jan 2001 09:43:39 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Random Numbers with a Twist
Message-Id: <94154b$o9q$1@mamenchi.zrz.TU-Berlin.DE>

Abigail <abigail@foad.org> wrote in comp.lang.perl.misc:
>Anno Siegel (anno4000@lublin.zrz.tu-berlin.de) wrote on MMDCXCIV
>September MCMXCIII in <URL:news:93v9ij$d0d$1@mamenchi.zrz.TU-Berlin.DE>:

>__ Well, you could conceptually tile your rectangle with 30x30 squares,
>__ and select 60 of those at random. Then, in a second step, select a
>__ random point in each preselected square.
>
>
>That of course doesn't garantee to satisfy the conditions.
>
>Suppose two of your squares are (1, 1) x (30, 30) and (31, 1) x (60, 30).
>
>Now, point (25, 10) lies in the first square, and (35, 15) in the
>second, but they aren't 30 apart.

Logic!  It always gets in the way of a Good Idea.

Anno


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

Date: Tue, 16 Jan 2001 07:50:51 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: RegEx , matching ?
Message-Id: <slrn967vb0.ars.rgarciasuarez@rafael.kazibao.net>

Ricky wrote in comp.lang.perl.misc:
> I've just read a post on regex that made curios about the following thing:
> 
> Suppose I have :
> $string = 'abc ab abcde abcDef abc 123 ab';
> 
> the regex : /([A-Za-z]+)/ returns me ($1) 'abc' which is 3 char long.
> Imagine now I want that regexp to return me 'abcDef' which is 6 char long.

Ok -- I imagine that you want the longest substring that matches.
You need to extract all substrings that match and find the longest. This
can't be done with a single regexp.

Here is the a short bit of code that does what you want :

my $string = 'abc ab abcde abcDef abc 123 ab';
my $longest = (sort { length $b <=> length $a } ($string =~ /([A-Za-z]+)/g))[0];
print $longest;

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Tue, 16 Jan 2001 02:56:38 GMT
From: pularis@my-deja.com
Subject: Using perl to ftp files
Message-Id: <940d93$lnb$1@nnrp1.deja.com>

Greetings,
  How can I use perl to establish a ftp connection, change directory
and then put a file on a remote host. I am using a unix machine as the
sender and a NT server running ftp is the recepient. thanks a much


Sent via Deja.com
http://www.deja.com/


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

Date: 16 Jan 2001 03:34:35 GMT
From: damian@puma.qimr.edu.au (Damian James)
Subject: Re: Using perl to ftp files
Message-Id: <slrn967gbv.dks.damian@puma.qimr.edu.au>

In article <940d93$lnb$1@nnrp1.deja.com>, pularis@my-deja.com wrote:
>  How can I use perl to establish a ftp connection, change directory
>and then put a file on a remote host. I am using a unix machine as the
>sender and a NT server running ftp is the recepient. thanks a much
>

%cat .netrc
machine remote_hostname
login your_username password your_password
macdef init
	cd your_remote_directory
	lcd your_local_directory
	asc or bin
	put your_file
	quit

%cat do_ftp.pl
#!/usr/local/bin/perl -w
use strict;

exec('ftp remote_hostname');

___END___

:-)

Alternately, you could go to a command prompt and type:

perldoc -q ftp

HTH 

Cheers,
Damian


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

Date: Tue, 16 Jan 2001 03:53:32 +0000 (UTC)
From: efflandt@xnet.com (David Efflandt)
Subject: Re: Using perl to ftp files
Message-Id: <slrn967hde.tj8.efflandt@efflandt.xnet.com>

On Tue, 16 Jan 2001, pularis@my-deja.com <pularis@my-deja.com> wrote:
>  How can I use perl to establish a ftp connection, change directory
>and then put a file on a remote host. I am using a unix machine as the
>sender and a NT server running ftp is the recepient. thanks a much

Net::FTP in the libnet group of modules.

-- 
David Efflandt  efflandt@xnet.com  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/


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

Date: Tue, 16 Jan 2001 03:38:08 -0500
From: "James Kauzlarich" <nospam-abuse@[127.0.0.1]>
Subject: Re: What do you call the => operator?
Message-Id: <2NT86.2630$d25.16177@newsfeed.slurp.net>


Martien Verbruggen <mgjv@tradingpost.com.au> wrote in message
news:slrn966si0.jgc.mgjv@verbruggen.comdyn.com.au...
> On Mon, 15 Jan 2001 19:53:48 GMT,
> Bart Lateur <bart.lateur@skynet.be> wrote:
> > Villy Kruse wrote:
> >
> >>On 15 Jan 2001 10:40:52 GMT, Abigail <abigail@foad.org> wrote:
> >>>
> >>>IDO.
> >>
> >>Care to expand?  Don't know what IDO is.
> >>
> >>>``infix dereference operator'' (from man perlop)
> >
> > Is this a joke, or what?
>
> Hopefully. The perlop documentation does contain this fragment:
>
>        The Arrow Operator
>
>        "`->'" is an infix dereference operator, just as it is in
>        C and C++.  If the right side is either a `[...]',
>        `{...}', or a `(...)' subscript, then the left side must
>        be either a hard or symbolic reference to an array, a
>        hash, or a subroutine respectively.  (Or technically
>        speaking, a location capable of holding a hard reference,
>        if it's an array or hash reference being used for assign­
>        ment.)  See the perlreftut manpage and the perlref man­
>        page.
>
> However, the title of that paragraph ('_The_ arrow operator') and the
> use of an indeterminate article in front of 'infix dereference
> operator', seems to suggest strongly that, at least, the authors of
> the documentation want to call this thing the arrow operator, and
> classify it as an infix dereference operator.
>
> Martien

::gag::

Ok, I know I have no standing in this group, but how about calling the two
 -> and => ) single arrow and double arrows?

I mean if the name is up in the air, they seem like nice, straightfoward
names.  ^_^

jmk





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

Date: 16 Jan 2001 08:57:28 GMT
From: abigail@foad.org (Abigail)
Subject: Re: What do you call the => operator?
Message-Id: <slrn96837o.kig.abigail@tsathoggua.rlyeh.net>

James Kauzlarich (nospam-abuse@[127.0.0.1]) wrote on MMDCXCV September
MCMXCIII in <URL:news:2NT86.2630$d25.16177@newsfeed.slurp.net>:
@@ 
@@ 
@@ Ok, I know I have no standing in this group, but how about calling the two
@@  -> and => ) single arrow and double arrows?


Since <=> is the space ship operator, what about calling => the
damaged space ship operator?



Abigail
-- 
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s};;;
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};                # Perl 5.6.0 broke this...
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))


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

Date: Tue, 16 Jan 2001 10:39:42 GMT
From: jmcnamara@cpan.org (John McNamara)
Subject: Re: What do you call the => operator?
Message-Id: <3a6423f9.6809976@News.CIS.DFN.DE>

Ar 16 Jan 2001 08:57:28 GMT, do schriobh abigail@foad.org (Abigail):
>Since <=> is the space ship operator, what about calling => the
>damaged space ship operator?

And < the damage operator.

John.
-- 
And the eighth and final rule, if this is your first time using Perl,
you will have to write code.


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

Date: Mon, 15 Jan 2001 22:43:49 -0600
From: "BB" <brennanb_731@yahoo.com>
Subject: why does system() work on command line but not in browser?
Message-Id: <riQ86.1848$hD5.46346@nnrp1.sbc.net>

I'm trying to get the system "run_my_prog", "args"; to run in both an AIX
4.3.3 environment with Apache and have also try W2000 running IIS 5.0.  I
can do anything else from perl (read and write files, display html code),
but when I try to run the system command from within the html page, it
doesn't execute.  If I run the perl script from the command line it works
fine - in both environments.

On the W2000 machine, I get an "Access denied" on the web page that tries to
run the system command.  On the AIX machine, I get nothing.  In both
instances, all I did was do a directory listing and pipe it to a file.

Here's the code (W2000 version):

use CGI qw(:standard);

#deleted html formatting code...
system "dir c:\ > results1.txt";
#other stuff

Now on the AIX version (which I can't get to right now because I shutdown
the machine before I left work) I established the proper $ENV("path") values
so that the internal server error would not show up on the page.  Now, this
script will work fine from the command line, but not from an html page.

Please help!!!!

Thanks,
Billy  brennanb_731@yahoo.com






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

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 V10 Issue 68
*************************************


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