[31159] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 2404 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat May 9 03:09:48 2009

Date: Sat, 9 May 2009 00:09:15 -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           Sat, 9 May 2009     Volume: 11 Number: 2404

Today's topics:
        new CPAN modules on Sat May  9 2009 (Randal Schwartz)
    Re: printing html with perl <benkasminbullock@gmail.com>
    Re: To count # characters in a line and make the line s <someone@example.com>
        use associative array to calculate average & SD <ela@yantai.org>
    Re: use associative array to calculate average & SD derykus@gmail.com
    Re: use associative array to calculate average & SD <ela@yantai.org>
    Re: use associative array to calculate average & SD derykus@gmail.com
    Re: use associative array to calculate average & SD <ela@yantai.org>
    Re: writing get_script() <someone@example.com>
    Re: writing get_script() <tadmc@seesig.invalid>
    Re: writing get_script() <uri@stemsystems.com>
    Re: writing get_script() <frank@example.invalid>
    Re: writing get_script() <frank@example.invalid>
    Re: writing get_script() <uri@stemsystems.com>
    Re: writing get_script() <uri@stemsystems.com>
    Re: writing get_script() <frank@example.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sat, 9 May 2009 04:42:28 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Sat May  9 2009
Message-Id: <KJD12s.102n@zorch.sf-bay.org>

The following modules have recently been added to or updated in the
Comprehensive Perl Archive Network (CPAN).  You can install them using the
instructions in the 'perlmodinstall' page included with your Perl
distribution.

Acme-UNIVERSAL-cannot-0.01
http://search.cpan.org/~bobtfish/Acme-UNIVERSAL-cannot-0.01/
Just so that Acme::LOLCat->cannot('has') 
----
Apache-SWIT-Security-0.11
http://search.cpan.org/~bosu/Apache-SWIT-Security-0.11/
security subsystem for Apache::SWIT 
----
App-Dataninja-0.03
http://search.cpan.org/~jasonmay/App-Dataninja-0.03/
Extensible, DBIC-based IRC bot 
----
App-GitHub-FindRepository-0.01
http://search.cpan.org/~rkrimen/App-GitHub-FindRepository-0.01/
----
App-GitHub-FindRepository-0.02
http://search.cpan.org/~rkrimen/App-GitHub-FindRepository-0.02/
Determine the right case (mixed or lower) for a GitHub repository 
----
App-GitHub-FindRepository-0.03
http://search.cpan.org/~rkrimen/App-GitHub-FindRepository-0.03/
Determine the right case (mixed or lower) for a GitHub repository 
----
App-GitHub-FindRepository-0.04
http://search.cpan.org/~rkrimen/App-GitHub-FindRepository-0.04/
Determine the right case for a GitHub repository 
----
App-GitHub-FindRepository-0.05
http://search.cpan.org/~rkrimen/App-GitHub-FindRepository-0.05/
Determine the right case for a GitHub repository 
----
App-MrShell-2.0100
http://search.cpan.org/~jettero/App-MrShell-2.0100/
do everything the mrsh commandline tool can do and more 
----
B-Foreach-Iterator-0.04
http://search.cpan.org/~gfuji/B-Foreach-Iterator-0.04/
Manipulates foreach iterators 
----
Bio-DB-Das-Chado-0.21
http://search.cpan.org/~scain/Bio-DB-Das-Chado-0.21/
DAS-style access to a chado database 
----
Bio-FASTASequence-0.05
http://search.cpan.org/~reneeb/Bio-FASTASequence-0.05/
Perl extension for Bioinformatics. Parsing sequence informations. 
----
CPANPLUS-Dist-Build-0.28
http://search.cpan.org/~bingos/CPANPLUS-Dist-Build-0.28/
CPANPLUS plugin to install packages that use Build.PL 
----
CPANPLUS-Dist-Deb-0.12
http://search.cpan.org/~kane/CPANPLUS-Dist-Deb-0.12/
----
Catalyst-Authentication-AuthTkt-0.10
http://search.cpan.org/~karman/Catalyst-Authentication-AuthTkt-0.10/
shim for Apache::AuthTkt 
----
Catalyst-Controller-FormBuilder-0.05
http://search.cpan.org/~mstrout/Catalyst-Controller-FormBuilder-0.05/
Catalyst FormBuilder Base Controller 
----
Catalyst-Manual-5.7021
http://search.cpan.org/~hkclark/Catalyst-Manual-5.7021/
The Catalyst developer's manual 
----
Catalyst-Plugin-ErrorCatcher-0.0.2
http://search.cpan.org/~chisel/Catalyst-Plugin-ErrorCatcher-0.0.2/
Catch application errors and emit them somewhere 
----
Dir-Project-3.013
http://search.cpan.org/~wsnyder/Dir-Project-3.013/
Project Environment determination 
----
Elive-0.15
http://search.cpan.org/~warringd/Elive-0.15/
Elluminate Live (c) client library 
----
HTML-FormFu-0.04002
http://search.cpan.org/~cfranks/HTML-FormFu-0.04002/
HTML Form Creation, Rendering and Validation Framework 
----
HTML-FormFu-Model-DBIC-0.04002
http://search.cpan.org/~cfranks/HTML-FormFu-Model-DBIC-0.04002/
Integrate HTML::FormFu with DBIx::Class 
----
HTML-WikiConverter-DokuWikiFCK-0.25
http://search.cpan.org/~turnermm/HTML-WikiConverter-DokuWikiFCK-0.25/
A WikiConverter Dialect supporting the FCKeditor in DokuWiki 
----
HTML-WikiConverter-DokuWikiFCK-0.25-withoutworldwriteables
http://search.cpan.org/~turnermm/HTML-WikiConverter-DokuWikiFCK-0.25-withoutworldwriteables/
A WikiConverter Dialect supporting the FCKeditor in DokuWiki 
----
HTML-WikiConverter-DokuWikiFCK-0.27
http://search.cpan.org/~turnermm/HTML-WikiConverter-DokuWikiFCK-0.27/
A WikiConverter Dialect supporting the FCKeditor in DokuWiki 
----
IPC-Locker-1.484
http://search.cpan.org/~wsnyder/IPC-Locker-1.484/
Distributed lock handler 
----
Log-Dispatch-Screen-Color-0.01
http://search.cpan.org/~yappo/Log-Dispatch-Screen-Color-0.01/
attached color for Log::Dispatch::Screen 
----
Log-Dispatch-Screen-Color-0.02
http://search.cpan.org/~yappo/Log-Dispatch-Screen-Color-0.02/
attached color for Log::Dispatch::Screen 
----
Log-Dispatch-Screen-Color-0.03
http://search.cpan.org/~yappo/Log-Dispatch-Screen-Color-0.03/
attached color for Log::Dispatch::Screen 
----
MP3-PodcastFetch-1.04
http://search.cpan.org/~lds/MP3-PodcastFetch-1.04/
Fetch and manage a podcast subscription 
----
Muldis-D-0.69.0
http://search.cpan.org/~duncand/Muldis-D-0.69.0/
Formal spec of Muldis D relational DBMS lang 
----
MyCPAN-App-DPAN-1.18_03
http://search.cpan.org/~bdfoy/MyCPAN-App-DPAN-1.18_03/
----
MyCPAN-Indexer-1.18_01
http://search.cpan.org/~bdfoy/MyCPAN-Indexer-1.18_01/
Index a Perl distribution 
----
MyCPAN-Indexer-1.18_02
http://search.cpan.org/~bdfoy/MyCPAN-Indexer-1.18_02/
Index a Perl distribution 
----
MyCPAN-Indexer-1.18_03
http://search.cpan.org/~bdfoy/MyCPAN-Indexer-1.18_03/
Index a Perl distribution 
----
Object-InsideOut-3.55
http://search.cpan.org/~jdhedden/Object-InsideOut-3.55/
Comprehensive inside-out object support module 
----
POE-Component-IKC-0.2200
http://search.cpan.org/~gwyn/POE-Component-IKC-0.2200/
POE Inter-Kernel Communication 
----
POE-Component-IRC-Plugin-MegaHAL-0.24
http://search.cpan.org/~hinrik/POE-Component-IRC-Plugin-MegaHAL-0.24/
A PoCo-IRC plugin which provides access to a MegaHAL conversation simulator. 
----
Padre-0.35
http://search.cpan.org/~jquelin/Padre-0.35/
Perl Application Development and Refactoring Environment 
----
Padre-Plugin-SpellCheck-1.1.1
http://search.cpan.org/~jquelin/Padre-Plugin-SpellCheck-1.1.1/
check spelling in Padre 
----
Passwd-Unix-0.48
http://search.cpan.org/~strzelec/Passwd-Unix-0.48/
----
Passwd-Unix-0.481
http://search.cpan.org/~strzelec/Passwd-Unix-0.481/
----
Passwd-Unix-0.5
http://search.cpan.org/~strzelec/Passwd-Unix-0.5/
----
Perl-Metrics2-0.01
http://search.cpan.org/~adamk/Perl-Metrics2-0.01/
Perl metrics storage and processing engine 
----
Rose-DB-0.752
http://search.cpan.org/~jsiracusa/Rose-DB-0.752/
A DBI wrapper and abstraction layer. 
----
SVN-S4-1.032
http://search.cpan.org/~wsnyder/SVN-S4-1.032/
Wrapper for Subversion 
----
Schedule-Load-3.061
http://search.cpan.org/~wsnyder/Schedule-Load-3.061/
Load distribution and status across multiple host machines 
----
Smolder-1.39
http://search.cpan.org/~wonko/Smolder-1.39/
Web-based Continuous Integration Smoke Server 
----
String-Similarity-Group-1.14
http://search.cpan.org/~leocharre/String-Similarity-Group-1.14/
take a list of strings and segregate by similarity 
----
Test-Apache2-0.01
http://search.cpan.org/~kzys/Test-Apache2-0.01/
Simple test harness of mod_perl handler 
----
Test-Apache2-0.02
http://search.cpan.org/~kzys/Test-Apache2-0.02/
Simple test harness of mod_perl handler 
----
Time-Piece-1.14
http://search.cpan.org/~msergeant/Time-Piece-1.14/
Object Oriented time objects 
----
Unix-Processors-2.041
http://search.cpan.org/~wsnyder/Unix-Processors-2.041/
Interface to processor (CPU) information 
----
WebService-UWO-Directory-Student-1.0
http://search.cpan.org/~frequency/WebService-UWO-Directory-Student-1.0/
Perform lookups using the University of Western Ontario's student directory 
----
WebService-UWO-Directory-Student-1.0.1
http://search.cpan.org/~frequency/WebService-UWO-Directory-Student-1.0.1/
Perform lookups using the University of Western Ontario's student directory 


If you're an author of one of these modules, please submit a detailed
announcement to comp.lang.perl.announce, and we'll pass it along.

This message was generated by a Perl program described in my Linux
Magazine column, which can be found on-line (along with more than
200 other freely available past column articles) at
  http://www.stonehenge.com/merlyn/LinuxMag/col82.html

print "Just another Perl hacker," # the original

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion


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

Date: Sat, 9 May 2009 05:21:03 +0000 (UTC)
From: Ben Bullock <benkasminbullock@gmail.com>
Subject: Re: printing html with perl
Message-Id: <gu33rv$k2v$1@news.motzarella.org>

On Wed, 06 May 2009 20:48:32 -0700, Keith Keller wrote:

> There are some cute features of CGI.pm.  For example, you can feed
> list-like elements, like li(), an arrayref, and it'll generate all the
> HTML for you:
> 
> print $cgi->li([1,2,3,4]);
> 
> prints
> 
> <li>1</li> <li>2</li> <li>3</li> <li>4</li>

s/cute/evil/g;


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

Date: Fri, 08 May 2009 18:50:47 -0700
From: "John W. Krahn" <someone@example.com>
Subject: Re: To count # characters in a line and make the line shorter
Message-Id: <Yj5Nl.40059$BX.31723@newsfe18.iad>

clearguy02@yahoo.com wrote:
> Hi experts,
> 
> In my script, I need to check if a total number of characters in a
> line is more than 10 or not and it it is >10, I should the cut the
> original line to only 10 characters.
> 
> Example:
> =============
> $orig_line = "Perl is a good language";
> $total_char = length ($orig_line)";
> 
> $second_line;
> 
> if ($total_char > 10)
>  {
>    print "The original's size is $total_char, but it should be
> $second_line";
> }
> 
> One way I can think is to get the difference between the $total_char
> and the limit value (10) and after the finding the difference number,
> I can truncate those many characters from the original line and store
> that modified line in $second_line variable.
> 
> Does some one suggest me a shorter way of doing it?


     my $new_line = substr $orig_line, 0, 10;




John
-- 
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov


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

Date: Sat, 9 May 2009 10:07:16 +0800
From: "ela" <ela@yantai.org>
Subject: use associative array to calculate average & SD
Message-Id: <gu2ogk$dri$1@ijustice.itsc.cuhk.edu.hk>

In a for loop retreiving individual $numAttr to derive the $tnumAttr, the 
following will serve:

for ($i=0; $i<3; $i++) {
 ...
   $tnumAttr += $numAttr;
 ...
}

However, I still have the following variables or more to get the totals,

$mcc,$se,$ppv,$sp,$npv,$tp,$tn,$fp,$fn

how to use the concept of associative array to get something like:

array->[mcc], array->[se] etc. so I can write a function and just pass the 
arguments like:

Sum ($mcc,$se,$ppv,$sp,$npv,$tp,$tn,$fp,$fn);



sub Sum {

   foreach $_ (@_) {

       $array->[$_] += $_;

   }

}




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

Date: Fri, 8 May 2009 19:35:35 -0700 (PDT)
From: derykus@gmail.com
Subject: Re: use associative array to calculate average & SD
Message-Id: <78603c58-b832-4341-800f-6ff30ba50f90@y10g2000prc.googlegroups.com>

On May 8, 7:07=A0pm, "ela" <e...@yantai.org> wrote:
> In a for loop retreiving individual $numAttr to derive the $tnumAttr, the
> following will serve:
>
> for ($i=3D0; $i<3; $i++) {
> ...
> =A0 =A0$tnumAttr +=3D $numAttr;
> ...
>
> }
>
> However, I still have the following variables or more to get the totals,
>
> $mcc,$se,$ppv,$sp,$npv,$tp,$tn,$fp,$fn
>
> how to use the concept of associative array to get something like:
>
> array->[mcc], array->[se] etc. so I can write a function and just pass th=
e
> arguments like:
>
> Sum ($mcc,$se,$ppv,$sp,$npv,$tp,$tn,$fp,$fn);
>
> sub Sum {
>
> =A0 =A0foreach $_ (@_) {
>
> =A0 =A0 =A0 =A0$array->[$_] +=3D $_;
>
> =A0 =A0}
>
> }
>
>


http://search.cpan.org/~colink/Statistics-Descriptive-2.6/Descriptive.pm

--
Charles DeRykus


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

Date: Sat, 9 May 2009 10:39:40 +0800
From: "ela" <ela@yantai.org>
Subject: Re: use associative array to calculate average & SD
Message-Id: <gu2qdb$eis$1@ijustice.itsc.cuhk.edu.hk>

http://search.cpan.org/~colink/Statistics-Descriptive-2.6/Descriptive.pm

--
Charles DeRykus

It's a link talking about stat but I'm asking array of array.

each $mcc, $tp, $tn will have to be calculated for its own stat. I wish to 
handle them generically. 




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

Date: Fri, 8 May 2009 22:20:13 -0700 (PDT)
From: derykus@gmail.com
Subject: Re: use associative array to calculate average & SD
Message-Id: <9f8d2b90-a814-42e5-86d3-353e9129cd4d@y33g2000prg.googlegroups.com>

On May 8, 7:39=A0pm, "ela" <e...@yantai.org> wrote:
> http://search.cpan.org/~colink/Statistics-Descriptive-2.6/Descriptive.pm
>
> --
> Charles DeRykus
>
> It's a link talking about stat but I'm asking array of array.
>
> each $mcc, $tp, $tn will have to be calculated for its own stat. I wish t=
o
> handle them generically.

Have you looked at the docs,  eg. perldoc perldsc,
perldoc perllol, etc?  This should help jumpstart
some code you can write on your own. Post your
code here if you run into snags or want alternative
solutions.

--
Charles DeRykus



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

Date: Sat, 9 May 2009 13:54:47 +0800
From: "ela" <ela@yantai.org>
Subject: Re: use associative array to calculate average & SD
Message-Id: <gu35r7$j9a$1@ijustice.itsc.cuhk.edu.hk>

Have you looked at the docs,  eg. perldoc perldsc,
perldoc perllol, etc?  This should help jumpstart
some code you can write on your own. Post your
code here if you run into snags or want alternative
solutions.

--
Charles DeRykus

Thanks for your reference again. But neither of them talks about how to 
create variables dynamically. Let me illustrate:

$var1, $var2, ..., $varn

$array[var1] #impossible because var1 is a string

or $array->[var1] #possible but in fact previously it's $var1 but not var1

what i have to get is to somehow "de-reference" (I wish this's the correct 
term) the variables 1 to n to get their names and then use these names to 
hash the associative arrays.




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

Date: Fri, 08 May 2009 18:41:36 -0700
From: "John W. Krahn" <someone@example.com>
Subject: Re: writing get_script()
Message-Id: <lb5Nl.67196$3k7.43499@newsfe17.iad>

Uri Guttman wrote:
>>>>>> "FS" == Franken Sense <frank@example.invalid> writes:
> 
>   FS> In Dread Ink, the Grave Hand of Ben Morrow Did Inscribe:
>   >>> How do I make a single input record to be what lies between the ##:###:###
>   >>> ?
>   >> 
>   >> $/ = "";
> 
>   FS> Thanks, Ben, so far so good:
> 
>   FS> use strict;
>   FS> use warnings;
>  
>   FS> # process all lines in input file
>   FS> $/ = "";
>   FS> while( my $line = <$fh> ) {
>   FS>   chomp($line);
> 
> chomp removes what is in $/ and you set it to '' (paragraph mode) so it
> becomes a no-op here. 

Not a no-op:

$ perl -e'
my $x = "one\n\ntwo\n\nthree\n\nfour\n";
open my $FH, "<", \$x or die "\$x: $!";
$/ = "";
while ( <$FH> ) {
     print "Length = ", length;
     my $y = chomp;
     print " and now Length = ", length, " and chomp returned: $y\n";
     }
'
Length = 5 and now Length = 3 and chomp returned: 2
Length = 5 and now Length = 3 and chomp returned: 2
Length = 7 and now Length = 5 and chomp returned: 2
Length = 5 and now Length = 4 and chomp returned: 1





John
-- 
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov


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

Date: Fri, 8 May 2009 20:41:36 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: writing get_script()
Message-Id: <slrnh09nqg.hd9.tadmc@tadmc30.sbcglobal.net>

Uri Guttman <uri@stemsystems.com> wrote:
>>>>>> "FS" == Franken Sense <frank@example.invalid> writes:

>  FS> $/ = "";


You should get in the habit of localizing changes to global variables.


>  FS> while( my $line = <$fh> ) {
>  FS>   chomp($line);
>
> chomp removes what is in $/ and you set it to '' (paragraph mode) so it
> becomes a no-op here. 


No, it removes the record separator.

When the record separator is "one or more blank lines" (ie. para mode),
then chomp() removes "one or more blank lines".


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

local $/ = '';
while ( <DATA> ) {
    print "(($_))\n";
    chomp;
    print "[[$_]]\n";
}

__DATA__
paragraphs can
span many
lines



or they can be all on one line
--------------------------


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Fri, 08 May 2009 23:54:53 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: writing get_script()
Message-Id: <87bpq30w36.fsf@quad.sysarch.com>

>>>>> "JWK" == John W Krahn <someone@example.com> writes:

  JWK> Uri Guttman wrote:
  >> 
  >> chomp removes what is in $/ and you set it to '' (paragraph mode) so it
  >> becomes a no-op here. 

  JWK> Not a no-op:

you are correct and it is even documented:

	When in paragraph mode ("$/ = """), it removes all trailing
	newlines from the string.  When in slurp mode ("$/ = undef") or
	fixed-length record mode ($/ is a reference to an integer or the
	like, see perlvar) chomp() won't remove anything.

of course it should be mentioned in the docs for $/ but it isn't. this
is action at a distance where a special global var affects a
function. so the docs for the global var should mention that. chomp
isn't mentioned anywhere in perlvar. i would call this a doc bug.

also the above docs show another reason to use single quotes for fixed
strings. the part after paragraph mode is painful to look at.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Sat, 9 May 2009 00:00:39 -0700
From: Franken Sense <frank@example.invalid>
Subject: Re: writing get_script()
Message-Id: <1466t55qxmb0i$.12l9l93duklhb.dlg@40tude.net>

In Dread Ink, the Grave Hand of Uri Guttman Did Inscribe:

>   FS>   # print modified fields
>   FS>   for my $i (0..$#s) {
> 
> why loop over the indices when you only print each element?

One thing I always have trouble with when I start up again with perl is
control structures.

I think I can answer your question if you can tell me why this is giving me
numbers instead of words:

#!/usr/bin/perl
# perl m5.pl  
use warnings;
use strict;

local $/="";
while ( <DATA> ) {
  my @s = split /\s+/, $_;

  # print fields
  print $s[0];

  my $outline = join(' ', (1..$#s));
  print  "$outline\n";
}

__DATA__
44:005:017 Then the high priest rose up, and all they that were with him,
           (which is the sect of the Sadducees,) and were filled with
           indignation,

44:005:018 And laid their hands on the apostles, and put them in the
           common prison.

44:005:019 But the angel of the Lord by night opened the prison doors,
           and brought them forth, and said,

44:005:020 Go, stand and speak in the temple to the people all the words
           of this life.


C:\MinGW\source>perl m5.pl
44:005:0171 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
44:005:0181 2 3 4 5 6 7 8 9 10 11 12 13 14
44:005:0191 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
44:005:0201 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

C:\MinGW\source>
-- 
Frank

[Newt Gingrich] is the most unpopular politician in America. His favorable
rating is only four points higher than the Unabomber.
~~ Al Franken, 1996


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

Date: Sat, 9 May 2009 00:04:33 -0700
From: Franken Sense <frank@example.invalid>
Subject: Re: writing get_script()
Message-Id: <1ciuo2wb75yci$.11rkd7lcmag0h.dlg@40tude.net>

In Dread Ink, the Grave Hand of Tad J McClellan Did Inscribe:

>> chomp removes what is in $/ and you set it to '' (paragraph mode) so it
>> becomes a no-op here. 
> 
> 
> No, it removes the record separator.
> 
> When the record separator is "one or more blank lines" (ie. para mode),
> then chomp() removes "one or more blank lines".

It would seem that both
local $/ = "";
and
local $/ = '';
induce paragraph mode.

P. 492 of the camel book speaks to this somewhat with the -O switch, which
specifies the record separator as an octal number.  I would have thought
that a goocher of
C:\MinGW\source>perl m5.pl -0 00

would be equivalent 

local $/="";

, but the former gives me the following output:

C:\MinGW\source>perl m5.pl -0 00
s[0] = 44:005:017
s[1] = Then
s[2] = the
s[3] = high
s[4] = priest
s[5] = rose
s[6] = up,
s[7] = and
s[8] = all
s[9] = they
s[10] = that
s[11] = were
s[12] = with
s[13] = him,
44:005:017 Then the high priest rose up, and all they that were with him,
s[0] =
s[1] = (which
s[2] = is
s[3] = the
s[4] = sect
s[5] = of
s[6] = the
s[7] = Sadducees,)
s[8] = and
s[9] = were
s[10] = filled
s[11] = with
 (which is the sect of the Sadducees,) and were filled with
s[0] =
s[1] = indignation,
 indignation,

s[0] = 44:005:018
s[1] = And
s[2] = laid
s[3] = their
s[4] = hands
s[5] = on
s[6] = the
s[7] = apostles,
s[8] = and
s[9] = put
s[10] = them
s[11] = in
s[12] = the
44:005:018 And laid their hands on the apostles, and put them in the
s[0] =
s[1] = common
s[2] = prison.
 common prison.
 ...
-- 
Frank

And by the way, a few months ago, I trademarked the word 'funny.' So when
Fox calls me 'unfunny,' they're violating my trademark. I am seriously
considering a countersuit.
~~ Al Franken, in response to Fox's copyright infringement lawsuit


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

Date: Sat, 09 May 2009 02:17:48 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: writing get_script()
Message-Id: <87preizto3.fsf@quad.sysarch.com>

>>>>> "FS" == Franken Sense <frank@example.invalid> writes:

  FS> In Dread Ink, the Grave Hand of Uri Guttman Did Inscribe:
  FS> for my $i (0..$#s) {

  >> why loop over the indices when you only print each element?

  FS> I think I can answer your question if you can tell me why this is
  FS> giving me numbers instead of words:

  FS>   my $outline = join(' ', (1..$#s));

i don't see any word data in that code. what do you think 1 .. $#s will
do? do you know what $#s does? (these are for you to answer). how would
you think that data has anything to do with the word data you have in
@s?

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Sat, 09 May 2009 02:22:15 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: writing get_script()
Message-Id: <87ljp6ztgo.fsf@quad.sysarch.com>

>>>>> "FS" == Franken Sense <frank@example.invalid> writes:

  FS> It would seem that both
  FS> local $/ = "";
  FS> and
  FS> local $/ = '';
  FS> induce paragraph mode.

and why would you think otherwise. what is the difference in data
between '' and "" ?

  FS> P. 492 of the camel book speaks to this somewhat with the -O switch, which
  FS> specifies the record separator as an octal number.  I would have thought

that is -0, not -O. please be careful of typos.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


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

Date: Sat, 9 May 2009 00:39:07 -0700
From: Franken Sense <frank@example.invalid>
Subject: Re: writing get_script()
Message-Id: <toosl0eqrsrm.1nqqad1xx8e43$.dlg@40tude.net>

In Dread Ink, the Grave Hand of Uri Guttman Did Inscribe:

>>>>>> "FS" == Franken Sense <frank@example.invalid> writes:
> 
>   FS> In Dread Ink, the Grave Hand of Uri Guttman Did Inscribe:
>   FS> for my $i (0..$#s) {
> 
>   >> why loop over the indices when you only print each element?
> 
>   FS> I think I can answer your question if you can tell me why this is
>   FS> giving me numbers instead of words:
> 
>   FS>   my $outline = join(' ', (1..$#s));
> 
> i don't see any word data in that code. what do you think 1 .. $#s will
> do? do you know what $#s does? (these are for you to answer). how would
> you think that data has anything to do with the word data you have in
> @s?
> 
> uri

What I want it to do is join the first through the ultimate words in s.

If I knew the answer, I wouldn't ask; I'd just continue.
-- 
Frank

In many ways I'm still a Hubert Humphrey Democrat -- someone who believes
in afflicting the comfortable and comforting the afflicted. A society is
judged by how it treats the elderly, the sick, the impoverished. To me it's
a matter of ethics and compassion.
~~ Al Franken, Playboy interview


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

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 V11 Issue 2404
***************************************


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