[24833] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6984 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 10 00:06:26 2004

Date: Thu, 9 Sep 2004 21:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Thu, 9 Sep 2004     Volume: 10 Number: 6984

Today's topics:
    Re: $| (undocumented) magic? <notvalid@email.com>
    Re: another try <tadmc@augustmail.com>
    Re: another try <abigail@abigail.nl>
    Re: Date format in perl <tadmc@augustmail.com>
    Re: Date format in perl <xx087@freenet.carleton.ca>
    Re: DBD::ODBC,SQL Server,brackets - escape? <wunkalunka@elvis.com>
    Re: list of numbers <notvalid@email.com>
    Re: Network Scanner (Chad Brown)
    Re: Network Scanner <sholden@flexal.cs.usyd.edu.au>
    Re: Perl and Inheritance strangeness. <tadmc@augustmail.com>
    Re: Perl and Inheritance strangeness. <abigail@abigail.nl>
    Re: Perl inconsistency <abigail@abigail.nl>
    Re: Perl XSLT module? <ebohlman@omsdev.com>
        Query about Spreadsheet::WriteExcel <a.ymous3@btinternet.com>
    Re: Question <abigail@abigail.nl>
    Re: Question <invalid-email@rochester.rr.com>
    Re: Sending vars from Perl to PHP <glex_nospam@qwest.invalid>
    Re: Xah Lee's Unixism <albalmer@att.net>
    Re: Xah Lee's Unixism <cgibbs@kltpzyxm.invalid>
    Re: Xah Lee's Unixism <firstname@lastname.pr1v.n0>
    Re: Xah Lee's Unixism <john.thingstad@chello.no>
    Re: YOU ALL SUCK! <triso@remove-me.cogeco.ca>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 09 Sep 2004 22:12:59 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: $| (undocumented) magic?
Message-Id: <Lz40d.17729$Lq5.4260@newssvr27.news.prodigy.com>

Michele Dondi wrote:

> While trying my hand at a new japh[*], I've found that $| can only
> hold either 0 or 1 (I guess):
> 
>   # perl -le 'print $|=10'

What's more interesting is the magic associated with decrementing $|:

	perl -le 'print --$| for 1 .. 10'

--Ala


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

Date: Thu, 9 Sep 2004 17:01:21 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: another try
Message-Id: <slrnck1klh.6vb.tadmc@magna.augustmail.com>

Darius <dmedhora@yahoo.com> wrote:

> I don't want to try XML::parser yet,


Why not?


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


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

Date: 10 Sep 2004 00:01:31 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: another try
Message-Id: <slrnck1rmr.qm8.abigail@alexandra.abigail.nl>

Darius (dmedhora@yahoo.com) wrote on MMMMXXVII September MCMXCIII in
<URL:news:26a5971.0409090935.4022f9ef@posting.google.com>:
;;  
;;  I don't want to try XML::parser yet,


Good luck!



Abigail
-- 
print v74.117.115.116.32, v97.110.111.116.104.101.114.32,
      v80.101.114.108.32, v72.97.99.107.101.114.10;


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

Date: Thu, 9 Sep 2004 17:06:38 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Date format in perl
Message-Id: <slrnck1kve.6vb.tadmc@magna.augustmail.com>

MES <mesemailoffers@verizon.net> wrote:
> I want a quick way to convert a unix date to a date in the following format:
> 
> YYYY_MM_DD_HH_MM_SS:
> 
> I currently have $date = time
> 
> Is there an easy way to convert time to the above format?


my $time = time;
my @parts = (localtime $time)[0..5];
$parts[5] += 1900;
$parts[4]++;
my $date = sprintf '%4d_%02d_%02d_%02d_%02d_%02d', reverse @parts;

print "$date\n";



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


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

Date: 10 Sep 2004 02:29:37 GMT
From: Glenn Jackman <xx087@freenet.carleton.ca>
Subject: Re: Date format in perl
Message-Id: <slrnck24ci.j40.xx087@smeagol.ncf.ca>

At 2004-09-09 12:02PM, MES <mesemailoffers@verizon.net> wrote:
>  I want a quick way to convert a unix date to a date in the following format:
>  
>  YYYY_MM_DD_HH_MM_SS:
>  
>  I currently have $date = time
>  
>  Is there an easy way to convert time to the above format?

use POSIX qw(strftime);
$date = strftime "%Y_%m_%d_%H_%M_%S:", localtime;

-- 
Glenn Jackman
NCF Sysadmin
glennj@ncf.ca


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

Date: Fri, 10 Sep 2004 03:10:22 GMT
From: Derf <wunkalunka@elvis.com>
Subject: Re: DBD::ODBC,SQL Server,brackets - escape?
Message-Id: <Xns955FE1E401254wunkalunkaelviscom@24.93.43.121>

Matthew Braid <mb@uq.net.au.invalid> wrote in
news:chom9l$k6f$1@bunyip.cc.uq.edu.au: 

> DBD::ODBC is good to see in there - I take it you're using DBI.
> 
> DBI extensions should include the functions quote and
> quote_identifier. Hopefully these will do what you want:
> 
> $dbh->do('UPDATE MachineData SET ' .
>           $dbh->quote_identifier('Machine Model No') .
>           ' = ' . $dbh->quote($model));
> 

> MB
> 


Thank You so much!

Derf


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

Date: Thu, 09 Sep 2004 23:36:36 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: list of numbers
Message-Id: <8O50d.18193$Ak1.1699@newssvr29.news.prodigy.com>

Michele Dondi wrote:

> Going down the golfing route, I'd suggest
> 
>   perl -lape'$_=pop@F'

Golf, eh?

     perl -pe's/.*\t//'

--Ala


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

Date: 9 Sep 2004 20:11:57 -0700
From: chad@wononline.net (Chad Brown)
Subject: Re: Network Scanner
Message-Id: <ea150da0.0409091911.2ed769f0@posting.google.com>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<chp59q$kin$2@mamenchi.zrz.TU-Berlin.DE>...
> Chad Brown <chad@wononline.net> wrote in comp.lang.perl.misc:
> > I cant figure this one out... I initialized the variable and it still
> > brings up the warning.
> > 
> > Use of uninitialized value in pack at
> > G:\PHASIC\PROJECTS\NETSCAN\netsweep.pl line 136.
> > 
> > this is the line thats causing it...
> > my $this = pack($sockaddr,$AF_INET,0,my $thisaddr);
>                                        ^^^^^^^^^^^^
> 
> Apart from other possibilities, "my $thisaddr" is guaranteed to
> be undefined.  What's the mystery?
> 
> Anno

Im new to perl... outside the datatypes of pack and unpack im unsure of the rest...
I know the use of "my" is simple.
Anyone have any input on the data typing in perl? 
Im so stuck to laws of VB and C++.

What is the difference between my and local?


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

Date: 10 Sep 2004 03:26:05 GMT
From: Sam Holden <sholden@flexal.cs.usyd.edu.au>
Subject: Re: Network Scanner
Message-Id: <slrnck27md.6r7.sholden@flexal.cs.usyd.edu.au>

On 9 Sep 2004 20:11:57 -0700, Chad Brown <chad@wononline.net> wrote:
> anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote in message news:<chp59q$kin$2@mamenchi.zrz.TU-Berlin.DE>...
>> Chad Brown <chad@wononline.net> wrote in comp.lang.perl.misc:
>> > I cant figure this one out... I initialized the variable and it still
>> > brings up the warning.
>> > 
>> > Use of uninitialized value in pack at
>> > G:\PHASIC\PROJECTS\NETSCAN\netsweep.pl line 136.
>> > 
>> > this is the line thats causing it...
>> > my $this = pack($sockaddr,$AF_INET,0,my $thisaddr);
>>                                        ^^^^^^^^^^^^
>> 
>> Apart from other possibilities, "my $thisaddr" is guaranteed to
>> be undefined.  What's the mystery?
>> 
>> Anno
>
> Im new to perl... outside the datatypes of pack and unpack im unsure of the rest...
> I know the use of "my" is simple.
> Anyone have any input on the data typing in perl? 
> Im so stuck to laws of VB and C++.
>
> What is the difference between my and local?

perldoc -f my
perldoc -f local

Followed by perldoc perlsub, since both of those say 'See "..." in perlsub'.

You don't have to get permission from here before reading the manual.

-- 
Sam Holden


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

Date: Thu, 9 Sep 2004 16:57:09 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Perl and Inheritance strangeness.
Message-Id: <slrnck1kdl.6vb.tadmc@magna.augustmail.com>

antroy <news@ant-roy.co.uk> wrote:
> Tad McClellan wrote:
> 
>> Anthony Roy <news@ant-roy.co.uk> wrote:
>> 
>> 
>>>Four example files are at the bottom of this email 
>> 
>>                                           ^^^^^^^^^^
>>                                           ^^^^^^^^^^
>> 
>> Usenet is not email!
> 
> Thanks for the constructive advice. 


You're welcome.

Can you identify how it is constructive to know the difference?


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


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

Date: 10 Sep 2004 00:03:09 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Perl and Inheritance strangeness.
Message-Id: <slrnck1rpt.qm8.abigail@alexandra.abigail.nl>

antroy (news@ant-roy.co.uk) wrote on MMMMXXVII September MCMXCIII in
<URL:news:rP20d.119$9n5.18@newsfe1-gui.ntli.net>:
:)  Tad McClellan wrote:
:)  
:) > Anthony Roy <news@ant-roy.co.uk> wrote:
:) > 
:) > 
:) >>Four example files are at the bottom of this email 
:) > 
:) >                                           ^^^^^^^^^^
:) >                                           ^^^^^^^^^^
:) > 
:) > Usenet is not email!
:)  
:)  Thanks for the constructive advice. No really. Prick.


*PLONK*


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";`$@`'


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

Date: 09 Sep 2004 23:56:58 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Perl inconsistency
Message-Id: <slrnck1rea.qm8.abigail@alexandra.abigail.nl>

Mike Mimic (ppagee@yahoo.com) wrote on MMMMXXVII September MCMXCIII in
<URL:news:xD00d.2538$F6.560430@news.siol.net>:
""  Hi!
""  
""  Michele Dondi wrote:
"" > BTW: this is one of the reasons why Perl6 is being designed to be more
"" > consistent (and IMHO *slightly* less magic).
""  
""  It is nice to know that. Then I am waiting with impatience for Perl 6,
""  because I like that things are consistent (so that there are no special
""  cases which are that way just because they are special). If things
""  are not consistent you have to remember all special cases and this is
""  like learning irregular verbs. :-)

If you like consistency, why are you programming in Perl? Most languages
are pretty consistent, and for some languages it's really a selling point.
If you prefer consistency, use Python or Java. Don't complain about Perl
being inconsistent. That's done BY DESIGN, and we like it that way.



Abigail
-- 
@;=split//=>"Joel, Preach sartre knuth\n";$;=chr 65;%;=map{$;++=>$_}
0,22,13,16,5,14,21,1,23,11,2,7,12,6,8,15,3,19,24,14,10,20,18,17,4,25
;print@;[@;{A..Z}];


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

Date: 10 Sep 2004 02:16:25 GMT
From: Eric Bohlman <ebohlman@omsdev.com>
Subject: Re: Perl XSLT module?
Message-Id: <Xns955FD947E34ADebohlmanomsdevcom@130.133.1.4>

antroy <news@ant-roy.co.uk> wrote in news:dL20d.421$K62.86@newsfe6-
win.ntli.net:

> Hi all,
> 
> What is considered the best Perl module for performing XSLT 
> transformations? I am looking to write a perl CGI script for 
> transforming some XML into HTML on the fly using XSLT.

Look into XML::LibXSLT and XML::Sablotron (there's also XML::XSLT, but it's 
incomplete and hasn't been touched in a long time).


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

Date: Fri, 10 Sep 2004 03:01:05 +0000 (UTC)
From: A Ymous <a.ymous3@btinternet.com>
Subject: Query about Spreadsheet::WriteExcel
Message-Id: <414118DF.9B026717@btinternet.com>

When I close a spreadsheet generated by Spreadsheet::WriteExcel
containing formulas (using $worksheet->write_formula), Excel always asks
if I want to save the changes made even if no changes have been made
while using Excel.

Is this normal behaviour?

(Using v2.03 and ActivePerl 5.8.4 on XP )


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

Date: 10 Sep 2004 00:00:08 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: Question
Message-Id: <slrnck1rk7.qm8.abigail@alexandra.abigail.nl>

Mike (lwang@cae.wisc.edu) wrote on MMMMXXVII September MCMXCIII in
<URL:news:chq2hj$hgi$1@news01.intel.com>:
^^  Hi,
^^  
^^  I have a question about the function rand().

Why didn't you put that in the title?

^^  Let say we have a variable $a = int (rand(50)), is there a formula that can
^^  predict how long this random function will hit all the values from 0 to 49?

Considering that it never will return anything but integer values 0 to 49
inclusive, I'd say the answer is "forever".

It'll loop though.



Abigail
-- 
# Perl 5.6.0 broke this.
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi


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

Date: Fri, 10 Sep 2004 03:06:04 GMT
From: Bob Walton <invalid-email@rochester.rr.com>
Subject: Re: Question
Message-Id: <41411A19.5030705@rochester.rr.com>

Mike wrote:

 ...

 > I have a question about the function rand().
 > Let say we have a variable $a = int (rand(50)), is there a formula 
that can
 > predict how long this random function will hit all the values from 0 
to 49?
 > (Assume srand is set to a fixed value)

It is unclear what you are actually asking.  The given expression will 
always generate integer values between 0 and 49, so perhaps you are 
looking for "forever"?

Or do you mean something like "What is the expected value of X, where X 
is the number of iterations which occur of a uniformly distributed 
integer random variable over the range 0 to 49 inclusive when all 50 
possible values are finally generated by the sequence?"  If that is what 
you mean, you have a statistical question, not a Perl question.  If 
that's your question, try asking in a statistics newsgroup.  Or run a 
Monte Carlo experiment.

Also, I'm not sure what you mean by "assume srand is set to a fixed 
value"?  You're not calling srand() with the same argument every time 
you are calling rand() are you?  These days one doesn't ever need to 
call srand() unless one wishes to get exactly the same pseudorandom 
sequence each time the program is executed -- and then, one would call 
srand() only once, at the start of the program.  If srand() is called 
with a fixed value, the pseudorandom sequence returned by rand() will 
start over at the same point each time srand() is called.  See:

    perldoc -f srand
    perldoc -f rand

 ...

 > Mike

-- 
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl


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

Date: Thu, 09 Sep 2004 17:31:27 -0500
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: Sending vars from Perl to PHP
Message-Id: <2R40d.62$Ih1.4385@news.uswest.net>

yusufdestina wrote:
> Hi folks..
> simple question, but to much for me :(
> I want to send some vars from Perl to a php script on my server and
> execute the php script.
> This is what i have:
> Perl script:
> ------------
> print "Value to send: ";
> $value= <STDIN>;
> print "Sending $value to localhost\n";
> $url = "http://localhost/testPerl.php?test=$value";
> ------------
> PHP script:
> ------------
> <?php
> $received = $_GET['test'];
> print "Value received: $received";
> ?>
> ------------------------------------------------------------
> tnx for helping me :)
> 

perldoc lwpcook


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

Date: Thu, 09 Sep 2004 15:36:29 -0700
From: Alan Balmer <albalmer@att.net>
Subject: Re: Xah Lee's Unixism
Message-Id: <2ql1k0t2cgjbmgp34ir47sv5u9ifv5tmem@4ax.com>

On Thu, 09 Sep 2004 23:06:57 +0200, "John Thingstad"
<john.thingstad@chello.no> wrote:

>On Thu, 09 Sep 04 13:12:17 GMT, <jmfbahciv@aol.com> wrote:
>
>
>> I really want to know.  People keep saying this but never say which
>> freedoms have been lost.
>>
>
>Since this is somewhat related to computer programming and AI I will reply.
>
>The US has started a initiative to integrate all information about people  
>in the USA into a central database.

Where have you been? This has been happening for years, in fits and
starts punctuated by ACLU lawsuits. The current political climate
(including the Patriot Act) may expedite the process by providing more
money and (possibly) better coordination between agencies, but it's
nothing new.
>
>This includes confidential information like your medical files. Think what  
>you say to your psychologist is confidential? Think again. Being paranoid  
>can be enough to get a "red flag".
>They will have access to all your credit records and will monitor all your  
>travels in and out of the country.
>If you buy flowers on the apposite side of town they can deduce that you  
>have a lover and
>use this as a means of distortion. (Edgar A. Hoover style)
>
Most of the above is speculative fiction. 

BTW, did you mean "extortion"? Distortion is what we see a lot of
here, though Hoover may have done some of that too.

-- 
Al Balmer
Balmer Consulting
removebalmerconsultingthis@att.net


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

Date: 09 Sep 04 15:28:13 -0800
From: "Charlie Gibbs" <cgibbs@kltpzyxm.invalid>
Subject: Re: Xah Lee's Unixism
Message-Id: <1549.748T655T9283520@kltpzyxm.invalid>

In article <opsd2vlvy7pqzri1@mjolner.upc.no>, john.thingstad@chello.no
(John Thingstad) writes:

>On Thu, 09 Sep 04 13:12:17 GMT, <jmfbahciv@aol.com> wrote:
>
>> I really want to know.  People keep saying this but never say which
>> freedoms have been lost.
>
>Since this is somewhat related to computer programming and AI I will
>reply.
>
>The US has started a initiative to integrate all information about
>people in the USA into a central database.

Not just people in the USA.

>This includes confidential information like your medical files.

<snip>

>The main challenge in computing is sieving through the amount of data.
>Politically it is to pressure the foreign governments to wave their
>privacy protection acts and allow unlimited access to information to
>a foreign power.

It's been revealed that here in British Columbia (that part of
Canada on the Pacific coast for those of you who are geographically
challenged), management of medical information has been farmed out
to a subsidiary of a U.S. corporation.  According to the Patriot Act,
the U.S. government is entitled to access these files, and anyone -
American or Canadian - who so much as mentions that they're doing it
can be thrown into a U.S. jail.

>Don't know what you think of this but it scares the hell out of me!

Me too.

--
/~\  cgibbs@kltpzyxm.invalid (Charlie Gibbs)
\ /  I'm really at ac.dekanfrus if you read it the right way.
 X   Top-posted messages will probably be ignored.  See RFC1855.
/ \  HTML will DEFINITELY be ignored.  Join the ASCII ribbon campaign!



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

Date: Fri, 10 Sep 2004 00:13:56 +0200
From: Morten Reistad <firstname@lastname.pr1v.n0>
Subject: Re: Xah Lee's Unixism
Message-Id: <4jkqhc.p7p1.ln@via.reistad.priv.no>

In article <4140A885.90B945AC@yahoo.com>,
CBFalconer  <cbfalconer@worldnet.att.net> wrote:
>Morten Reistad wrote:
>> 
>... snip ...
>> 
>> A lack of focus on world politics has been a characteristica of
>> the US presidents since Eisenhower. Bush is not special, he just
>> got the mess in his lap and had to deal with it; just as Nixon
>> inherited the Vietnam war.
>
>That is understandable considering the relative sizes of the US
>GDP and the rest of the world (until recently), the isolationist
>ethic between the wars, and such things as the world attitude that
>Spain was much more then the US could bite off in 1898.  Wilson,
>Roosevelt (both), Truman, Kennedy, Carter, Clinton, Nixon are
>among the counter-examples.  Even Reagan, while a sad example of
>domestic policy, did fairly well in the foreign affairs
>department.  Elephants do not need to pay too much attention to
>the surrounding fauna.

I do not agree. Kennedy and  Clinton had a lousy foreign-policy
record. The Bay of Pigs, Vietnam, the Cuba crisis were all 
examples of glorious miscalculations. Ditto Rwanda, Somalia, and
the 

Carter was not so bad; but remained unfocused; using all energy
withing the US. I still don't get why they didn't see the Iranian
blow-up. Everyone else did.  

Nixon is a special case; the way he inherited the Vietnam war, 
the Cold war and the way he messed up domestic policy. I think
he did all right, but no better, on a foreign policy front.

>However Bush is demonstrably poor.  He ignored the warnings from
>the CIA, FBI, outgoing Clinton administration about imminent
>attacks.  He was focused on attacking Saddam and Iraq from the
>first, and perverted 9/11 into that at the earliest opportunity. 
>He has offended many more than most of his predecessors.  I will
>say that he seems to have learned the names of some foreign
>leaders since being elected.

Bush has had an agenda all right; but I don't quite get what it is. 

If it is oil, then he is mishandling it big time; Iraqi oil is NOT
flowing. Iraq is a huge mess. Why was that guy Bremer chosen; his
qualifications does not make sense. 

You either have to make converts or do a Pinochet. (hit so hard
everyone is afraid they will NOT die.)

-- mrr


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

Date: Fri, 10 Sep 2004 01:04:50 +0200
From: "John Thingstad" <john.thingstad@chello.no>
Subject: Re: Xah Lee's Unixism
Message-Id: <opsd202cospqzri1@mjolner.upc.no>

On Thu, 09 Sep 2004 15:36:29 -0700, Alan Balmer <albalmer@att.net> wrote:

>
> BTW, did you mean "extortion"? Distortion is what we see a lot of
> here, though Hoover may have done some of that too.
>

I guess what I see are endless possibilities of abuse.
No government can be trusted with that type of power.
I feel it is our responsibility as programmers to prevent this type
of abuse of information. I'd rather take my chances with the terrorists.
When you sell out freedom, liberty and justice then what exactly are we  
fighting to protect?
Bader-Meihof groups philosophy was that in order to protect the public  
 from terror
the government would turn the country into a police state. Then the people  
would rebel and
support the revolution. From this point of view Bush is letting the  
terrorist's win by
sacrificing our constitutional rights.

Anyhow this is probably not the place to discuss this...

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/


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

Date: Fri, 10 Sep 2004 00:05:52 GMT
From: Tris Orendorff <triso@remove-me.cogeco.ca>
Subject: Re: YOU ALL SUCK!
Message-Id: <Xns955FCC8E99C10RepublicPicturesLtd@216.221.81.119>

carl.scharenberg@gmail.com (Carl Scharenberg) wrote in
news:e930c085.0409020529.2db830fc@posting.google.com: 


>> This seems to be of somewhat better quality than the output of the
>> typical random-text generator.  Can anyone suggest something on CPAN
>> useful for such?
> 
> You can do this by analyzing a sample text at a higher level. Instead
> of generating text from the frequency of single letters, you generate
> using the frequencies of 2, 3, or 4-letter sequences. You analyze a
> large text so you have a database of frequencies. When generating each
> new character you look at the frequences of the letters given that the
> 3 previous letters are 'the'. The possibilities are a space, 'r'
> (their), 'y' (they), and some others. Overall it will generate words
> and even phrases that seem to almost make sense. It is neat stuff.

This is known as a Markov Chain and it works even better if you generate using words rather than letters.  
Using letters creates words and non words.  The output is written in the same style as the input text.


-- 
Sincerely,

Tris Orendorff

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d++ s+:- a+ C+ UL++++ P+ L+ E- W+ N++ o- K++ w+ O+ M !V PS+ PE Y+ PGP t+ !5 X- R- tv--- b++ 
DI++ D+ G++ e++ h---- r+++ y+++
------END GEEK CODE BLOCK------




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

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 6984
***************************************


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