[17973] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 133 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 24 11:05:27 2001

Date: Wed, 24 Jan 2001 08:05:08 -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: <980352308-v10-i133@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 24 Jan 2001     Volume: 10 Number: 133

Today's topics:
        Adobe Acrobat 4.0 <lpfg@yupimail.com>
    Re: Any suggestions on how to improve this   script?    <ccx138@coventry.ac.uk>
    Re: Any suggestions on how to improve this  script?     (Tad McClellan)
    Re: Any suggestions on how to improve this  script?     (Eric Bohlman)
    Re: Any suggestions on how to improve this  script?     <joe+usenet@sunstarsys.com>
    Re: Any suggestions on how to improve this  script?     <ccx138@coventry.ac.uk>
    Re: Any suggestions on how to improve this script? (Sen <hmerrill@my-deja.com>
    Re: Any suggestions on how to improve this script? (Sen mintcake@my-deja.com
    Re: Free SQL server with perl? <brannon@lnc.usc.edu>
    Re: Free SQL server with perl? <gracenews@optusnet.com.au>
        hash to java <ducateg@info.bt.co.uk>
    Re: hash to java (Rafael Garcia-Suarez)
    Re: Newbie question : Read configuration file. <josef.moellers@fujitsu-siemens.com>
    Re: Newbie question : Read configuration file. <angeraer@hotmail.com>
    Re: passing parameters to perl cronjob? (Rafael Garcia-Suarez)
    Re: passing parameters to perl cronjob? <news@sinik.de>
    Re: passing parameters to perl cronjob? (Rafael Garcia-Suarez)
    Re: Perl Crashes on my Win2k Box <mischief@velma.motion.net>
    Re: perlxstut (Anno Siegel)
    Re: POE oppinion <brannon@lnc.usc.edu>
    Re: Random Numbers with a Twist Gordon.Haverland@agric.gov.ab.ca
        Time / Date Format <paul_wasilkoff@ucg.org>
    Re: Trouble sorting array (Tad McClellan)
    Re: Upgrading to Perl 5.6 under Debian 2.2 <pking123@sympatico.ca>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 24 Jan 2001 15:30:02 -0000
From: Ben Fuentes <lpfg@yupimail.com>
Subject: Adobe Acrobat 4.0
Message-Id: <t6tt7qop90q77d@corp.supernews.com>

I have install Win Me and had have problem for Run Adobe Acrobat 4.0
because said that have at problems with afill32.api
May you help me ?

Thank advance.

Ben

--
Posted via CNET Help.com
http://www.help.com/


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

Date: Wed, 24 Jan 2001 14:52:17 +0000
From: John Tutchings <ccx138@coventry.ac.uk>
Subject: Re: Any suggestions on how to improve this   script?                                                                            (Sent as a private person)
Message-Id: <3A6EEC21.AFE34F01@coventry.ac.uk>

OK, what ever, it is still bad which ever way :)

Eric Bohlman wrote:

> John Tutchings <ccx138@coventry.ac.uk> wrote:
> > This script is linear in that if the first file has 100 lines and the
> > second has 200 lines it makes 300 reads.  The other suggestions are
> > exponential in that they do one loop 100 time and an inner loop 200 time
>   ^^^^^^^^^^^
> > 20000 reads.
>
> Nope, you mean "quadratic."  "Exponential" would mean that the number of
> comparisons was some constant raised to the power of the number of input
> lines, which would be far worse time-wise.



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

Date: Wed, 24 Jan 2001 14:13:52 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Any suggestions on how to improve this  script?                                                                           (Sent as a private person)
Message-Id: <slrn96th51.355.tadmc@tadmc26.august.net>


[ What's with the absurdly long Subject: header? ]


Paul <psb154@deja-news.com> wrote:
>Want to check two text files and determine if a line of text appears in 
>the second file but not in the first file. 
>
>I also want to do the opposite: 
>Determine if a line of text appear in first file but not in the second
>file.
>
>Any suggestions gratefully received :-)


I suggest checking the Perl FAQ before posting to the Perl newsgroup :-)

Perl FAQ, part 7:

   "How do I compute the difference of two arrays?  
    How do I compute the intersection of two arrays?"

Load the 2 files into 2 arrays and compute their difference.


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


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

Date: 24 Jan 2001 14:58:25 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: Any suggestions on how to improve this  script?                                                                           (Sent as a private person)
Message-Id: <94mqih$ds5$2@bob.news.rcn.net>

John Tutchings <ccx138@coventry.ac.uk> wrote:
> This script is linear in that if the first file has 100 lines and the
> second has 200 lines it makes 300 reads.  The other suggestions are
> exponential in that they do one loop 100 time and an inner loop 200 time
  ^^^^^^^^^^^
> 20000 reads.

Nope, you mean "quadratic."  "Exponential" would mean that the number of
comparisons was some constant raised to the power of the number of input
lines, which would be far worse time-wise.



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

Date: 24 Jan 2001 10:07:24 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Any suggestions on how to improve this  script?                                                                           (Sent as a private person)
Message-Id: <m3d7ddq98z.fsf@mumonkan.sunstarsys.com>

John Tutchings <ccx138@coventry.ac.uk> writes:

> This script is linear in that if the first file has 100 lines and the
> second has 200 lines it makes 300 reads.  The other suggestions are
> exponential in that they do one loop 100 time and an inner loop 200 time
> 20000 reads.

s/exponential/quadratic/;

[...]

> Paul wrote:
> 
> > Want to check two text files and determine if a line of text appears in
> > the second file but not in the first file.
> >
> > I also want to do the opposite:
> > Determine if a line of text appear in first file but not in the second
> > file..
> 

Then you want to compute the _intersection_ of the two files; viewing
each unique line as an element. See

% perldoc -q intersect

for one approach.  Here's one (untested) that might work for files 
with non-unique lines; it also reads both files into an array which 
might be undesirable.

#!/usr/bin/perl -w
use strict;

# this takes two array refs and returns list of elements
# from the second array that appear in the first

sub intersection ($$) {

  my %hash;
  @hash{ @{ $_[0] } } = ();
  grep {exists $hash{$_}} @{ $_[1] };

}


open FILE_A, "</tmp/first_file" or die $!;
open FILE_B, "</tmp/second_file" or die $!;

my @result = intersection( [<FILE_A>], [<FILE_B>] );

close FILE_A;
close FILE_B;

print join "\n", @result;

__END__

Note: if FILE_B has multiple lines that match a line in FILE_A,
they will appear more than once in the output.

HTH
-- 
Joe Schaefer



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

Date: Wed, 24 Jan 2001 14:31:00 +0000
From: John Tutchings <ccx138@coventry.ac.uk>
Subject: Re: Any suggestions on how to improve this  script?                                                                           (Sent as a private person)
Message-Id: <3A6EE724.56C58D02@coventry.ac.uk>

This script is linear in that if the first file has 100 lines and the
second has 200 lines it makes 300 reads.  The other suggestions are
exponential in that they do one loop 100 time and an inner loop 200 time
20000 reads.

use strict;

my (%first);

# Load the first file into an ass array
open (FIRST, $ARGV[0])|| die "Can't open $ARGV[0]\n";
while (<FIRST>){
 chomp;
 $first{$_}++;
}
close(FIRST);

open (SEC, $ARGV[1])|| die "Can't open $ARGV[1]\n";

# now look to see if the second file lines are in the first
while(<SEC>){
 chomp;
 if(exists($first{$_})){
  print "$_ is in both\n";
  delete $first{$_};
 }else{
  # get rid of the ones in first, any thing left was not seen
  print "$_ not in first\n";
 }
}
close(SEC);

# Show the ones that were not seen
for (keys(%first)){
 print "$_ not in second\n";
}

Paul wrote:

> Want to check two text files and determine if a line of text appears in
> the second file but not in the first file.
>
> I also want to do the opposite:
> Determine if a line of text appear in first file but not in the second
> file..



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

Date: Wed, 24 Jan 2001 14:10:58 GMT
From: Hardy Merrill <hmerrill@my-deja.com>
Subject: Re: Any suggestions on how to improve this script? (Sent as a private person)
Message-Id: <94mnpa$2ng$1@nnrp1.deja.com>

In article <3A6ED9D6.567F39C8@deja-news.com>,
  Paul <psb154@deja-news.com> wrote:
> Want to check two text files and determine if a line of text appears
in
> the second file but not in the first file.
>
> I also want to do the opposite:
> Determine if a line of text appear in first file but not in the second
> file.
>
> Any suggestions gratefully received :-)
>
> Here's my current script:
> =========================
>
> # INITIALISE VARIABLES.
> #
> $FoundFlag = 1;
>
> # OPEN FIRST FILE.
> #
> if (open(FILE1,  "c:\\temp\\reg-files\\reg-file1.reg"))
> {}
> else
> {
>     print("Could not open first file\n");

Paul, since your script depends on both files, you probably want to
"die" if you can't open either one, right?  If you just want to die, you
can do your opens this way:

open(FILE1, "<c:\\temp\\reg-files\\reg-file1.reg")
   || die "Could not open first file";

open(FILE1, "<c:\\temp\\reg-files\\reg-file2.reg")
   || die "Could not open second file";

Or, if you want to use your approach(with "if"), it might be better if
you use the "not" logic, like:

if (! open(FILE1, "<c:\\temp\\reg-files\\reg-file1.reg")) {
    print("Could not open first file\n");
}

Also, I'm in the habit of using the "<" to open a file for input, ">" to
open a file for output, and ">>" to open a file for append.

> }
>
> # OPEN SECOND FILE.
> #
> if (open(FILE2,  "c:\\temp\\reg-files\\reg-file2.reg"))
> {}
> else
> {
>     print("Could not open second file\n");
> }
>
> # PUT EACH LINE OF FILE 1 INTO A STRING.
> #
> @file1 = <FILE1>;

This loads the file into *array*(not string) @file1, where each line of
the file will be loaded into a separate element of the array.  If you
want to load the whole file into 1 string, you'd do:

$file1 = <FILE1>;

>
> # PUT EACH LINE OF FILE 2 INTO A STRING.
> #
> @file2 = <FILE2>;
>
> # COMPARE FIRST STRING OF FILE 1 WITH EACH STRING OF FILE 2, ETC.
> # IF STRING IS NOT FOUND IN SECOND FILE, PRINT IT TO SCREEN.
> #
> foreach $FirstFileString (@file1)
> {
>     foreach $SecondFileString (@file2)
>     {
> 	if ($FirstFileString eq $SecondFileString)
> 	{
> 	    $FoundFlag = 0;
> 	}
>     }
>
>     if ($FoundFlag == 1)
>     {
> 	print("mswtest3-content-technologies.reg: $FirstFileString");
>     }
>
>     $FoundFlag = 1;
> }

I tend to do this logic just the opposite of you - like:
--------------------------------------------------------
foreach $FirstFileString (@file1)
{
    $found = 0; ### set to false
    foreach $SecondFileString (@file2)
    {
	if ($FirstFileString eq $SecondFileString)
	{
	    $found = 1; ### set to true
	}
    }

    if ($found) ### don't need "== 1"
    {
	print("mswtest3-content-technologies.reg: $FirstFileString");
    }
}

HTH.

--
Hardy Merrill
Mission Critical Linux, Inc.
http://www.missioncriticallinux.com


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


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

Date: Wed, 24 Jan 2001 14:48:08 GMT
From: mintcake@my-deja.com
Subject: Re: Any suggestions on how to improve this script? (Sent as a private person)
Message-Id: <94mpv6$4rk$1@nnrp1.deja.com>

In article <3A6ED9D6.567F39C8@deja-news.com>,
  Paul <psb154@deja-news.com> wrote:
> Want to check two text files and determine if a line of text appears
in
> the second file but not in the first file.
>
> I also want to do the opposite:
> Determine if a line of text appear in first file but not in the second
> file.
>
> Any suggestions gratefully received :-)
>
> Here's my current script:
> =========================
>
> # INITIALISE VARIABLES.
> #
> $FoundFlag = 1;
>
> # OPEN FIRST FILE.
> #
> if (open(FILE1,  "c:\\temp\\reg-files\\reg-file1.reg"))
> {}
> else
> {
>     print("Could not open first file\n");
> }
>
> # OPEN SECOND FILE.
> #
> if (open(FILE2,  "c:\\temp\\reg-files\\reg-file2.reg"))
> {}
> else
> {
>     print("Could not open second file\n");
> }
>
> # PUT EACH LINE OF FILE 1 INTO A STRING.
> #
> @file1 = <FILE1>;
>
> # PUT EACH LINE OF FILE 2 INTO A STRING.
> #
> @file2 = <FILE2>;
>
> # COMPARE FIRST STRING OF FILE 1 WITH EACH STRING OF FILE 2, ETC.
> # IF STRING IS NOT FOUND IN SECOND FILE, PRINT IT TO SCREEN.
> #
> foreach $FirstFileString (@file1)
> {
>     foreach $SecondFileString (@file2)
>     {
> 	if ($FirstFileString eq $SecondFileString)
> 	{
> 	    $FoundFlag = 0;
> 	}
>     }
>
>     if ($FoundFlag == 1)
>     {
> 	print("mswtest3-content-technologies.reg: $FirstFileString");
>     }
>
>     $FoundFlag = 1;
> }
>
> Regards
> --Paul Butterfield.
>
> --
> This email has been sent: "As a private person."
>
> Care has been taken to avoid sending inappropriate remarks or
>
> attachments via this email.
>

It might seem very inefficient and you probably wouldn't do it this way
in any language but perl but how about...

my %file1 = map { $_, 1 } <FILE1>;
my %file2 = map { $_, 1 } <FILE2>;

my @f1_notin_f2 = grep { !exists $file2{$_} } keys %file1;
my @f2_notin_f1 = grep { !exists $file1{$_} } keys %file2;

print "f1-notin-f2\n", @f1_notin_f2;
print "f2-notin-f1\n", @f2_notin_f1;





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


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

Date: Wed, 24 Jan 2001 14:07:58 GMT
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: Re: Free SQL server with perl?
Message-Id: <lb8zo1xcua.fsf@lnc.usc.edu>

brian d foy <comdog@panix.com> writes:

> In article <94lua9$f05$1@nnrp1.deja.com>, spcman@my-deja.com wrote:
> 
> > Ive honestly been searching the net for over a week looking for a free
> > hosting site with SQL and Perl capabilities.  I want to start to learn
> > SQL with Perl:DBI but i cannot find a free service.
> 
> install freebsd, mysql, and perl on your own box. all of those

Does mysql support transactions? I know they have maxSql now. I would
go with postgres over mysql these days.

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


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

Date: Thu, 25 Jan 2001 01:04:39 +1000
From: "Jeffrey Grace" <gracenews@optusnet.com.au>
Subject: Re: Free SQL server with perl?
Message-Id: <3a6eef1f$0$16377$7f31c96c@news01.syd.optusnet.com.au>

"Terrence Brannon" <brannon@lnc.usc.edu> wrote in message
news:lb8zo1xcua.fsf@lnc.usc.edu...
> Does mysql support transactions? I know they have maxSql now. I would
> go with postgres over mysql these days.

Recent announcement on slashdot.org
(http://slashdot.org/article.pl?sid=01/01/22/0656247&mode=thread):
"
MySQL 3.23 Declared Stable
 Posted by Hemos on Monday January 22, @04:56PM
from the congratumlations-to-all dept.
redcoat writes "After two long years, MySQL 3.23 has been declared stable.
Improvements over 3.22 and .21 include rudimentary transaction support using
the BerkeleyDB lib, full-on replication (master/slave configuration) and
lots of other goodies. It's been a long wait, but a worthwhile one, no
doubt."
"
--
Jeffrey Grace
~~~~~~~~~~~~~~~~~~~~
Queensland, Australia





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

Date: Wed, 24 Jan 2001 14:48:56 -0000
From: "Géry" <ducateg@info.bt.co.uk>
Subject: hash to java
Message-Id: <94mq5r$n3r$1@pheidippides.axion.bt.co.uk>

How do I pass a hash to a java piece of code in order to obtain a lovely
hash table?

Many thanks in advance...
--
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Géry
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<




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

Date: Wed, 24 Jan 2001 15:49:40 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: hash to java
Message-Id: <slrn96tudh.eu4.rgarciasuarez@rafael.kazibao.net>

Géry wrote in comp.lang.perl.misc:
> How do I pass a hash to a java piece of code in order to obtain a lovely
> hash table?

You didn't provide enough information to get useful answers. There are
many ways for programs to communicate, no matter in which language
they're written.

For example, a way would be to write the keys and values of the Perl
hash to a file, (or to a named pipe, or to a socket), and have the Java
program parse this file to populate its hashtable. You can even have the
Perl program write a file compatible with the Java Properties format.
This is a good solution in some applications, but is unapplicable in
other situations.

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


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

Date: Wed, 24 Jan 2001 15:31:12 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Newbie question : Read configuration file.
Message-Id: <3A6EE730.FE08B6D3@fujitsu-siemens.com>

Craig Berry wrote:

> Assuming config file is open as CFG:
> =

>   while (<CFG>) {
>     next if /^#/;                  # Discard comments
>     next unless /^(\w+)=3D(.*)/;     # Ignore bad syntax, empty lines
>     $$1 =3D $2;
>   }

Damian has suggested changing the $$1 to $config{$1}, may I suggest
changing the second re to
	next unless /^(\w+)\s*=3D\s*(.*)/;
	=

-- =

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


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

Date: Wed, 24 Jan 2001 15:11:51 GMT
From: "Andy Geraerts" <angeraer@hotmail.com>
Subject: Re: Newbie question : Read configuration file.
Message-Id: <XgCb6.560$KQ4.3125@nreader1.kpnqwest.net>

>Damian has suggested changing the $$1 to $config{$1}, >may I suggest
changing the second re to
>next unless /^(\w+)\s*=\s*(.*)/;

The first line is only applicable if you use 'hashes'?
What does the second line do?

Thanks,

Andy.




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

Date: Wed, 24 Jan 2001 14:43:30 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: passing parameters to perl cronjob?
Message-Id: <slrn96tqhf.eq0.rgarciasuarez@rafael.kazibao.net>

Carsten Nielsen wrote in comp.lang.perl.misc:
>
> I've installed a perl-script as cronjob.
> The script is called properly but the named parameters that should be passed
> to the script are completly ignored.
>
> crontab:
> perl /pathto/perlscript.pl name="parameter"
>
> How can I pass parameters to a perl-script in crontab correctly?

The same way you pass parameters on the shell command-line. They're
found in @ARGV, as usual. Perhaps have you a problem with the quoting of
special characters? Or do you rely on some environment variables that
are not defined for the cron job?

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


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

Date: Wed, 24 Jan 2001 16:13:43 +0100
From: "Carsten Nielsen" <news@sinik.de>
Subject: Re: passing parameters to perl cronjob?
Message-Id: <94mrf7$pdp$02$1@news.t-online.com>

> The same way you pass parameters on the shell command-line. They're
> found in @ARGV, as usual. Perhaps have you a problem with the quoting of
> special characters? Or do you rely on some environment variables that
> are not defined for the cron job?

I'm using the CGI.pm qw:standard and fetch the parameters with
param('param-name')...
Working fine in Shell but cron...

Any ideas?




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

Date: Wed, 24 Jan 2001 15:38:27 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: passing parameters to perl cronjob?
Message-Id: <slrn96ttog.eu4.rgarciasuarez@rafael.kazibao.net>

Carsten Nielsen wrote in comp.lang.perl.misc:
> > The same way you pass parameters on the shell command-line. They're
> > found in @ARGV, as usual. Perhaps have you a problem with the quoting of
> > special characters? Or do you rely on some environment variables that
> > are not defined for the cron job?
> 
> I'm using the CGI.pm qw:standard and fetch the parameters with
> param('param-name')...
> Working fine in Shell but cron...

A CGI program executed from a crontab ???

CGI stands for "Common Gateway Interface". This is a specification of a
way for HTTP servers to communicate with standalone programs that
generate web pages. Typically the web server feeds CGI programs with
environment variables (QUERY_STRING, PATH_INFO), standard input (for
POST methods) and the standard command-line arguments (for ISINDEX
scripts -- this is vaguely deprecated, as far as I know). CGI.pm defines
a user-friendly wrapper around those inputs. This module is *not*
designed to be used in another environment (except, of course, its
included debugging features).

You can try a hack, making CGI.pm believing it runs under a web server,
by something like :
  QUERY_STRING='param1=value1&param2=value2' perl yourscript.pl
but I'm not sure if it will work properly -- and you'll have to
URL-encode your parameters.

I think that the cleaner way would be to rewrite the part of your script
that reads input parameters to use the standard command-line way (via
@ARGV, see the perlvar manual page) instead of CGI.pm.

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


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

Date: Wed, 24 Jan 2001 15:52:49 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Perl Crashes on my Win2k Box
Message-Id: <t6tuihmsc3o64@corp.supernews.com>

Hawk <someguyREMOVE@removesunflower.com> wrote:
> If the regulars all have attitudes like yours, then they DO need to leave.
> This newsgroup DOES exist to help people. If you can not grasp the concept
> of sharing ideas and experiences to better your (and your peers) knowledge
> of the language, then you DO need to leave. If all newbies are met with this
> kind of resistance then this newsgroups existence is pointless.

If the regulars all have the attitude that a discussion group is for
discussion, then they should leave the discussion group? I'm sorry,
but I didn't see the group name was actually comp.lang.perl.tutoring -
oh, wait, it's not! This newsgroup does not exist to help people who
do not pay attention to the rules and customs. It exists for those
who follow Usenet guidelines and group guidelines to discuss
miscellaneous topics about Perl.

As a few of us have quoted before:

        Get real!  This is a discussion group, not a helpdesk.
        You post something, we discuss its implications. If the
        discussion happens to answer a question you've asked,
        that's incidental. -- nobull, clp.misc

> How can
> "Jeez, seems like we're beating the newbies off with a spoon lately.."
> be taken in any other context? That is a condescending remark. Perhaps you
> should wait until you have a more solid grasp on the English language before
> you post a flame.

That remark might be a little condescending, but when someone posts
without the slightest hint of regard for the rules and customs of a
group, then what do you expect? The original post was equivalent to
someone walking into a board meeting and speaking out of turn.

Anno also wasn't the one who made that remark, but you respond as if
Anno is the only one posting in the thread besides yourself. If you
really want to know what offends me, it's you making fun of a regular
of this newsgroup for not being from the US. Anno has a better grasp
of the English language than many of my clients, and I live in
Illinois.

[snipped much too much quoted text (Jeopardy-quoted, in fact) to which
 the previous poster had no response]

Chris

-- 
Christopher E. Stith

It's not the U in UBE that pisses people off. It's the B.
-- Martien Verbruggen in clp.misc



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

Date: 24 Jan 2001 15:11:42 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: perlxstut
Message-Id: <94mrbe$as1$1@mamenchi.zrz.TU-Berlin.DE>

 <stevezaz@my-deja.com> wrote in comp.lang.perl.misc:
>Hi,
>Trying to do example 4 in perlxstut and When I run make test I get
>this error
>$ make test
>make: Fatal error: Don't know how to make target `pure_all'

Apparently you haven't followed all steps in the example, or haven't
followed them correctly.  The target "pure_all" is clearly provided
in "Makefile.PL" (the one you write yourself, not the one generated by
h2xs).  Has "perl Makefile.PL" created a Makefile in its directory?
If it didn't, find out why.  If it did, does Makefile contain the
"pure_all" target?  It should, if it doesn't find out why.  Etc...

Anno


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

Date: Wed, 24 Jan 2001 14:06:13 GMT
From: Terrence Brannon <brannon@lnc.usc.edu>
Subject: Re: POE oppinion
Message-Id: <lbbssxxcx6.fsf@lnc.usc.edu>

"Bas A. Schulte" <bas@integrators.demon.nl> writes:

> Hi,
> 
> > I've beed reading some documents about a moddule named POE and it seems
> > very good for applications like daemons and stuff.

Proc::Daemon is adequate for daemons. POE is excellent when you really
need extensive reactional programs.


> 
> Just recently, a fine article on how to use POE appeared on 
> www.perl.com, might wanna check it out there.
> 
> Regards,
> 
> Bas.

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


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

Date: Wed, 24 Jan 2001 14:49:49 GMT
From: Gordon.Haverland@agric.gov.ab.ca
Subject: Re: Random Numbers with a Twist
Message-Id: <3a6eea7c.501397501@news.gov.ab.ca>

On 23 Jan 2001 18:23:34 GMT, abigail@foad.org (Abigail) wrote:

>Gordon.Haverland@agric.gov.ab.ca (Gordon.Haverland@agric.gov.ab.ca) wrote
>on MMDCCII September MCMXCIII in <URL:news:3a6d8d78.412036016@news.gov.ab.ca>:
>:) 
>:) >On 20 Jan 2001 00:42:40 GMT, abigail@foad.org (Abigail) wrote:
>:) >
>:) >>The hard part is deciding when to stop, that is, when is the set
>:) >>random enough?
>:) 
>:) You are heading down a slippery path on this one!  It is entirely
>:) possible to "draw" random coordinates from a universe of points and
>:) end up with something that is highly ordered/symmetric.  It may be
>:) unlikely, but it is possible.  If you reject a given outcome for being
>:) "unrandom" according to your personal feelings, you bias your results.
>
>
>Oh, I wasn't suggesting you couldn't stop because the result still 
>looked to ordered.  You would have to decide in advance when to stop
>- and that is the hard problem.

If I remember earlier parts of this thread correctly, your problem has
a built in rejection component.  You generate trial points and
possibly reject a point if it fits certain criteria.  The easiest
stopping rule is going to be N successive rejections.  As soon as a
trial point is accepted, you set a rejection counter to zero.  Then
every time you reject a point, you increment the rejection counter.
When the counter exceeds some value, you quit drawing random
coordinates.  Obviously, this critical value has to be bigger than 1.
How much bigger depends on how long you want to wait.  You should be
able to do some experiments, and plot time or iterations versus
critical value.  The points will have some scatter, but will probably
fit some kind of curve (especially for larger values of the critical
value).

Gord


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

Date: Wed, 24 Jan 2001 10:14:29 -0500
From: "PaAnWa" <paul_wasilkoff@ucg.org>
Subject: Time / Date Format
Message-Id: <t6tser2n7vcfd0@corp.supernews.com>

I am trying to add a time/date stamp to form data run through a script and
then written to a file.  How do I capture the server t/d in the following
format:
YYYY/MM/DD HH:MM:SS

PAW




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

Date: Wed, 24 Jan 2001 14:13:53 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Trouble sorting array
Message-Id: <slrn96thtn.355.tadmc@tadmc26.august.net>

David Waters <davidwaters@bigfoot.com> wrote:
>I have the following lines of text as separate elements in an array
>(not necessarily in this order).

>I would like to sort the array in reverse order so it would be 3's then
>2's then 1's. However, there are some lines which have a '+' after the
>number which I would like to be at the top of each set of numbers.
>
>so the result should be
>
>3+,line_two,ro_address
>3,postcode,ro_address
>2+,ro_address,companies_house_data
>2,accounts_type,companies_house_data
>2,acc_ref_date,companies_house_data
>2,acc_made_up_date,companies_house_data
>1+,companies_house_data,
>
>Can anyone help please?


Adapted from the answer to this Perl FAQ:

   "How do I sort an array by (anything)?"


my @sorted = map  { $_->[0] }
             sort { $b->[1] <=> $a->[1]  or
                    $b->[2] cmp $a->[2]
                  }
             map  { [ $_, /^(\d+)(\+?)/ ] } @unsorted;


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


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

Date: Wed, 24 Jan 2001 16:00:16 GMT
From: "Debian User" <pking123@sympatico.ca>
Subject: Re: Upgrading to Perl 5.6 under Debian 2.2
Message-Id: <k_Cb6.147256$f36.5843184@news20.bellglobal.com>

In article <slrn96tjfr.n5q.mgjv@martien.heliotrope.home>,
mgjv@tradingpost.com.au  wrote:

> [removed comp.lang.perl. That group hasn't existed for years. Notify
> your news admin]
> [remove alt.perl. That group doesn't exist as far as I'm concerned]
> 

There are about 500+ posters who don't seem to agree with you :) However,
unless there is proof that the forementioned groups are deprecated, I
am in favour of posting anywhere I feel I can obtain the proper help.

> On Wed, 24 Jan 2001 11:54:22 GMT,
> 	Debian User <pking123@sympatico.ca> wrote:
>> Hello:
>> 
>> In brief, I changed my mind about upgrading to 5.6 under Debian due to
>> the problems it was causing in the operating system.
> 
> I doubt it sincerely. Perl would not in any way cause your OS to become
> unstable. Maybe you've got some tools that were expecting another
> version of Perl, and that didn't deal with the newer version correctly,
> but I'd hardly call that 'problem in the operating system'.

No. There are simply tools that version 5.6 claims does not exist, when
they in fact do. They break dselect and some window manager applets. I 
think was clear enough about what I meant when I said "problems in the
operating system", having now repeated myself. These are "system programs",
as far as I am concerned. Having dropped back to the original version has
fixed these problems.

> 
> What exactly were the symptoms? And maybe you should report them to
> Debian, so they can investigate how it is possible that something like
> Perl can cause their OS to have problems.

I think the real cause is Debian's over-dependance on Perl, and on its
insistance to "expect" files such as libraries and modules to be in a
certain place. That place being, a non-version-specific directory tree under 
/usr/lib/perl5. After upgrading, all that was "forgotten", even though
the files were stil there. My question concerns: how can I upgrade in
such a way that the new Perl "remembers" where the old libraries/modules are?
(you might have answered that below)

>> CPAN requires that I upgrade to Perl 5.6 first before I begin.
> 
> Huh? If it does, you might want to get an older version of CPAN, but I
> doubt it would.
> 

Well, this has always been a problem, and I appear to have no
control over my decision to do this, when I use CPAN for the firt time
on a Linux installation. When I had RedHat, I went along with
it and had none of the problems I experience now under Debian. It seems
that my problems therefore are Debian-specific.

>> The upgrading I was doing was through CPAN using the Perl shell
>> command:
>>     perl -MCPAN -e shell
>> and then using various "install" commands for each module or  library.
>> But this appears to break many of Debian's scripts.
> 
> Well... No offense, but then the Debian scripts are broken. They
> shouldn't care.
> 
>> Any help on how to upgrade Perl while recognising Debian's  scripts and
>> libraries would be appreciated.
> 
> I fail to see the real problem. If you upgrade Perl in-place, you should
> still have all your old modules around. 

Correct. They in fact, are still around. The new Perl just doesn't notice
them.

> if you install a new version in
> a different place, you just need to install the appropriate modules, or
> set PERL5LIB.

Pardon my ignorance, but where do I set this? /etc/profile?

Paul

> 
> Doesn't Debian have a package fot 5.6.0 yet? How Slack.
> 
> Martien


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

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


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