[28371] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9735 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Sep 18 03:05:53 2006

Date: Mon, 18 Sep 2006 00:05:07 -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           Mon, 18 Sep 2006     Volume: 10 Number: 9735

Today's topics:
        Can't locate boject methoid Cells via package Sspreadsh <pamelapdh@aol.com>
    Re: Can't locate boject methoid Cells via package Sspre <mgarrish@gmail.com>
    Re: Can't locate boject methoid Cells via package Sspre <pamelapdh@aol.com>
    Re: Can't locate boject methoid Cells via package Sspre <benmorrow@tiscali.co.uk>
    Re: Complex extensions in C arne.muller@gmail.com
    Re: Complex extensions in C arne.muller@gmail.com
        How to find methods of Classes ? nkprajapati@gmail.com
    Re: Learning perl - for experienced programmers cartercc@gmail.com
    Re: Learning perl - for experienced programmers <john@castleamber.com>
        new CPAN modules on Mon Sep 18 2006 (Randal Schwartz)
    Re: Perl compiler <benmorrow@tiscali.co.uk>
    Re: Perl compiler <sisyphus1@nomail.afraid.org>
    Re: Perl compiler <bill@ts1000.us>
    Re: Perl compiler <sisyphus1@nomail.afraid.org>
    Re: Replace a line <vedpsingh@gmail.com>
        String Pattern Matching: regex and Python regex documen <xah@xahlee.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 17 Sep 2006 15:35:15 -0700
From: "Pam" <pamelapdh@aol.com>
Subject: Can't locate boject methoid Cells via package Sspreadsheet::WriteExcel::Worksheet
Message-Id: <1158532515.158417.156650@i42g2000cwa.googlegroups.com>

Hello:

I am having a problem trying to use print "At ($row, $col) the value is
%s \n",
   $worksheet->Cells($row,$col)->{'Value'};

I am trying to get the contents of a cell, this will allow me to check
if the cell is empty
before I wite to it.  I only want to write to the Cell if it is empt
but at compilation I  get
Can't locate boject method Cells via package
Sspreadsheet::WriteExcel::Worksheet

This is a snippet of my code and modules I have in my perl code

use Spreadsheet::ParseExcel;
use Spreadsheet::WriteExcel;

use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';


# Create a new Excel workbook
my $workbook  =
Spreadsheet::WriteExcel->new("3GSoftwareCCB_MeetingAgenda$datestamp.xls");
my $worksheet = $workbook->add_worksheet();


# get already active Excel application or open new
my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
    || Win32::OLE->new('Excel.Application', 'Quit');



my $oBook =

Spreadsheet::ParseExcel::Workbook->Parse("3GSoftwareCCB_MeetingAgenda$datestamp.xls");
#my $oBook =
$oExcel->Parse("3GSoftwareCCB_MeetingAgenda$datestamp.xls");
$row = 1;
$col = 11;
my $myval;


#Tring to check for empty cell

for(my $row =1 ;
                 $row <= $total ; $row++) {

               $myval = $oBook->{Cells} [$row] [$col];
               print "This is my value ($row , $col ) <= $total",  This
will only give me the row and col number
              $myvalue->{'Valaue'},"\n";

       print "At ($row, $col) the value is %s \n",
   $worksheet->Cells($row,$col)->{'Value'};     Here I want the
contents

              print $row, "\n";

        }


       I want to check for an empty  before I write to it.

If ( $worksheet->Cells($row,$col)->{'Value'} = "")
{
    {
      $worksheet->write($row, $col, "3G_Platform", $format2);



     }
      $row= $row + 1;

}

If any one can help me it will be greatly appreciated.  I tried
everything I know to 
get thsi workin


Thank You,
Pamela



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

Date: 17 Sep 2006 18:06:58 -0700
From: "Matt Garrish" <mgarrish@gmail.com>
Subject: Re: Can't locate boject methoid Cells via package Sspreadsheet::WriteExcel::Worksheet
Message-Id: <1158541618.607357.226560@m73g2000cwd.googlegroups.com>


Pam wrote:

> Hello:
>
> I am having a problem trying to use print "At ($row, $col) the value is
> %s \n",
>    $worksheet->Cells($row,$col)->{'Value'};
>
> I am trying to get the contents of a cell, this will allow me to check
> if the cell is empty
> before I wite to it.  I only want to write to the Cell if it is empt
> but at compilation I  get
> Can't locate boject method Cells via package
> Sspreadsheet::WriteExcel::Worksheet
>

The error is telling you that there's no such method in
Spreadsheet::WriteExcel. As you'll see later, it's because you're
calling the method on the wrong object.

> This is a snippet of my code and modules I have in my perl code
>

use strict;
use warnings;

Unless you don't need them, you should always use them (and turn them
off only where you don't). The code you've pasted is unrunnable, which
is bad usenet form.

> use Spreadsheet::ParseExcel;
> use Spreadsheet::WriteExcel;
>
> use Win32::OLE qw(in with);
> use Win32::OLE::Const 'Microsoft Excel';
>
>
> # Create a new Excel workbook
> my $workbook  =
> Spreadsheet::WriteExcel->new("3GSoftwareCCB_MeetingAgenda$datestamp.xls");
> my $worksheet = $workbook->add_worksheet();
>

Here is your WriteExcel object.

>
> # get already active Excel application or open new
> my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
>     || Win32::OLE->new('Excel.Application', 'Quit');
>

But what do you think the above is doing? You don't use a running
application anywhere that I see in your code, or is this not your
real/full code?

>
>
> my $oBook =
>

Please try and format your code so that other people can read it. Of
note, howeve, is that $oBook now contains a ParseExcel object, which is
what you should be using to read your excel sheet.

> Spreadsheet::ParseExcel::Workbook->Parse("3GSoftwareCCB_MeetingAgenda$datestamp.xls");
> #my $oBook =
> $oExcel->Parse("3GSoftwareCCB_MeetingAgenda$datestamp.xls");

Again, we don't need to see code that you aren't using. The cleaner you
can make you example the more likely you'll be to get help.

> $row = 1;
> $col = 11;
> my $myval;
>
>
> #Tring to check for empty cell
>
> for(my $row =1 ;
>                  $row <= $total ; $row++) {
>

for my $row (1..$total) {

But where did $total come from?

>                $myval = $oBook->{Cells} [$row] [$col];
>                print "This is my value ($row , $col ) <= $total",  This
> will only give me the row and col number
>               $myvalue->{'Valaue'},"\n";
>

Where did $myvalue come from and what is 'Valaue'? I have to think you
tried to type this code in. If you aren't going to post your real
problem why do you expect people to guess what you might really be
doing wrong in your code?

>        print "At ($row, $col) the value is %s \n",
>    $worksheet->Cells($row,$col)->{'Value'};     Here I want the
> contents
>

Syntax error. I assume this is where you're getting the error, which is
understandable for the reason I stated above. Why aren't you using the
$oBook object?

>               print $row, "\n";
>
>         }
>
>
>        I want to check for an empty  before I write to it.

The point of a short and runnable example is that people don't have to
go back and correct all your errors. Please try running your examples
before posting them for others to look at.

Matt



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

Date: 17 Sep 2006 21:08:15 -0700
From: "Pam" <pamelapdh@aol.com>
Subject: Re: Can't locate boject methoid Cells via package Sspreadsheet::WriteExcel::Worksheet
Message-Id: <1158552495.429309.32840@e3g2000cwe.googlegroups.com>


Matt Garrish wrote:
> Pam wrote:
>
> > Hello:
> >
> > I am having a problem trying to use print "At ($row, $col) the value is
> > %s \n",
> >    $worksheet->Cells($row,$col)->{'Value'};
> >
> > I am trying to get the contents of a cell, this will allow me to check
> > if the cell is empty
> > before I wite to it.  I only want to write to the Cell if it is empt
> > but at compilation I  get
> > Can't locate boject method Cells via package
> > Sspreadsheet::WriteExcel::Worksheet
> >
>
> The error is telling you that there's no such method in
> Spreadsheet::WriteExcel. As you'll see later, it's because you're
> calling the method on the wrong object.
>
> > This is a snippet of my code and modules I have in my perl code
> >
>
> use strict;
> use warnings;
>
> Unless you don't need them, you should always use them (and turn them
> off only where you don't). The code you've pasted is unrunnable, which
> is bad usenet form.
>
> > use Spreadsheet::ParseExcel;
> > use Spreadsheet::WriteExcel;
> >
> > use Win32::OLE qw(in with);
> > use Win32::OLE::Const 'Microsoft Excel';
> >
> >
> > # Create a new Excel workbook
> > my $workbook  =
> > Spreadsheet::WriteExcel->new("3GSoftwareCCB_MeetingAgenda$datestamp.xls");
> > my $worksheet = $workbook->add_worksheet();
> >
>
> Here is your WriteExcel object.
>
> >
> > # get already active Excel application or open new
> > my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
> >     || Win32::OLE->new('Excel.Application', 'Quit');
> >
>
> But what do you think the above is doing? You don't use a running
> application anywhere that I see in your code, or is this not your
> real/full code?
>
> >
> >
> > my $oBook =
> >
>
> Please try and format your code so that other people can read it. Of
> note, howeve, is that $oBook now contains a ParseExcel object, which is
> what you should be using to read your excel sheet.
>
> > Spreadsheet::ParseExcel::Workbook->Parse("3GSoftwareCCB_MeetingAgenda$datestamp.xls");
> > #my $oBook =
> > $oExcel->Parse("3GSoftwareCCB_MeetingAgenda$datestamp.xls");
>
> Again, we don't need to see code that you aren't using. The cleaner you
> can make you example the more likely you'll be to get help.
>
> > $row = 1;
> > $col = 11;
> > my $myval;
> >
> >
> > #Tring to check for empty cell
> >
> > for(my $row =1 ;
> >                  $row <= $total ; $row++) {
> >
>
> for my $row (1..$total) {
>
> But where did $total come from?
>
> >                $myval = $oBook->{Cells} [$row] [$col];
> >                print "This is my value ($row , $col ) <= $total",  This
> > will only give me the row and col number
> >               $myvalue->{'Valaue'},"\n";
> >
>
> Where did $myvalue come from and what is 'Valaue'? I have to think you
> tried to type this code in. If you aren't going to post your real
> problem why do you expect people to guess what you might really be
> doing wrong in your code?
>
> >        print "At ($row, $col) the value is %s \n",
> >    $worksheet->Cells($row,$col)->{'Value'};     Here I want the
> > contents
> >
>
> Syntax error. I assume this is where you're getting the error, which is
> understandable for the reason I stated above. Why aren't you using the
> $oBook object?
>
> >               print $row, "\n";
> >
> >         }
> >
> >
> >        I want to check for an empty  before I write to it.
>
> The point of a short and runnable example is that people don't have to
> go back and correct all your errors. Please try running your examples
> before posting them for others to look at.
>
> Matt


Hello Matt:

Sorry my code does run, Let me be a bit more concise.  What I am doing
is dialing into a
database that we use at my company(DDTS) I use a saved query.  My
script actually dials in using my log in and pass word.  I get the
contents of the query,  I then put that date inot comma seperated file.
Then I take that comma seperated file and put it into an Excel format
which works fine.  The $total variable is the count for how many lines
are in the spreadsheet which tells us how many defects there will be
for that day.  I take the $total variable and put it into an email
which is also working. $myvalue is just a variable I am using.

 The reason I did not use obook is because when I did a print on oBook
it did not give me my file name

$filename ="CCB.txt";

open(FILE,">$filename") || die("Cannot Open File $filename : $!" );
print FILE $query_result->content;
print "File open ";

close (FILE);
$datestamp = strftime("%Y%m%d",localtime) ;

# Open the Comma Separated Variable file
open (CSVFILE, $filename) or die "$filename: $!";


# Create a new Excel workbook
my $workbook  =
Spreadsheet::WriteExcel->new("3GSoftwareCCB_MeetingAgenda$datestamp.xls");
my $worksheet = $workbook->add_worksheet();

# get already active Excel application or open new
my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
    || Win32::OLE->new('Excel.Application', 'Quit');


# Create a new CSV parsing object
my $csv = Text::CSV_XS->new;

# Row and column are zero indexed
my $row = 0;

while (<CSVFILE>) {
    if ($csv->parse($_)) {
        my @Fld = $csv->fields;

        my $col = 0;
        foreach my $token (@Fld) {
            $worksheet->write($row, $col, $token);
            $col++;
        }
        $row++;
       if ($row > 1){
           $count = $count + 1;

         $total = $count;

        }

    }
    else {
        my $err = $csv->error_input;
        print "Text::CSV_XS parse() failed on argument: ", $err, "\n";
    }

}

# Write some formatted text

      $col = 0;
      $row = 0;


       $worksheet->write(0, $col, "Identifier", $format,);
       $worksheet->write(0, 1, "Team Comments", $format,);
       $worksheet->write(0, 2, "Description", $format);
       $worksheet->write(0, 3, "Status", $format);
       $worksheet->write(0, 4, "Severity", $format);
       $worksheet->write(0, 5, "Priority", $format);
       $worksheet->write(0, 6, "CCBComments_encl", $format);
       $worksheet->write(0, 7, "Primary-feature-team", $format);
       $worksheet->write(0, 8, "Sub-feature-team", $format);

my $oBook =
Spreadsheet::ParseExcel::Workbook->Parse("3GSoftwareCCB_MeetingAgenda$datestamp.xls");

$row = 1;
$col = 11;
my $myval;
print "Is this book geeting seen", $oBook, "\n";
I get a HASH(some numbers) didn't think it was working


#Triyng to check for empty cell

        print "Trying to seek if worksheet exist", $currentwksheet,
"\n";
for(my $row =1 ;
                 $row <= $total ; $row++) {

               $myval = $oBook->{Cells} [$row] [$col];
               print "This is my value ($row , $col ) <= $total",
$myvalue->{'Valaue'},"\n";

             # print "This is the value( $row , $col ) <= $total\n" ;
#if($myval);
print "At ($row, $col) the value is %s \n",
   $worksheet->Cells($row,$col)->{'Value'};

              print $row, "\n";


I want to add something like this once I get the Cells working


while ($row <= $total)
{


 if($worksheet->Cells($row,$col)->{'Value'} = " ")

     {
      $worksheet->write($row, $col, "3G_Platform", $format2);



     }
      $row= $row + 1;

}


Right now iI'm writing to every cell and not paying attention to if
there is somethiung already in the cell
I don't have this added yet.
if($worksheet->Cells($row,$col)->{'Value'} = " ")


Hope this is better, I left out a lot becuase I thought it was a bit
much, sorry won't make that mistake again.


Thank You,
Pamela



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

Date: Mon, 18 Sep 2006 00:33:37 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: Can't locate boject methoid Cells via package Sspreadsheet::WriteExcel::Worksheet
Message-Id: <hj21u3-9vk.ln1@osiris.mauzo.dyndns.org>


Quoth "Pam" <pamelapdh@aol.com>:
> 
> I am having a problem trying to use print "At ($row, $col) the value is
> %s \n",
>    $worksheet->Cells($row,$col)->{'Value'};
> 
> I am trying to get the contents of a cell, this will allow me to check
> if the cell is empty
> before I wite to it.  I only want to write to the Cell if it is empt
> but at compilation I  get
> Can't locate boject method Cells via package
> Sspreadsheet::WriteExcel::Worksheet

Don't retype error messages: copy and paste them.

> This is a snippet of my code and modules I have in my perl code

Where are

    use strict;
    use warnings;

?

> use Spreadsheet::ParseExcel;
> use Spreadsheet::WriteExcel;
> 
> use Win32::OLE qw(in with);
> use Win32::OLE::Const 'Microsoft Excel';

Well, which are you using? Spreadsheet::ParseExcel or Win32::OLE? You
are expected to create a *minimal* testcase that exhibits the problem
you are having.

> # Create a new Excel workbook
> my $workbook  =
> Spreadsheet::WriteExcel->new("3GSoftwareCCB_MeetingAgenda$datestamp.xls");

What is $datestamp?

IMO it would be clearer to write that as

    "3GSoftwareCCB_MeetingAgenda${datestamp}.xls"

, though what you have above isn't wrong.

> my $worksheet = $workbook->add_worksheet();
> 
> # get already active Excel application or open new
> my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
>     || Win32::OLE->new('Excel.Application', 'Quit');
> 
> my $oBook =
> 
> Spreadsheet::ParseExcel::Workbook->
>     Parse("3GSoftwareCCB_MeetingAgenda$datestamp.xls");

[line above wrapped for clarity]

It is clearer to indent when you are continuing a statement on another
line.

When you have a long and/or complex string you are using more than once
it is a very good idea to assign it to a variable.

Do you really mean to be reading from the same workbook you are writing?
I seriously doubt if that works. Create a temporary file and rename it
over the original when you've finished. Or just use Win32::OLE
thoughout, of course, and edit the file using Excel's own methods.

> #my $oBook =
> $oExcel->Parse("3GSoftwareCCB_MeetingAgenda$datestamp.xls");

I presume this line has wrapped in your newsreader? Please make sure
code is still valid *as posted*.

What is $oExcel? It's undeclared. If you meant $Excel, then I don't
believe the Excel.Application object has a Parse method, although I
don't know.

> $row = 1;
> $col = 11;

These should both be declared with my. The $row here will never be used,
as you declare a new one below over the scope of the for loop.

> my $myval;
> 
> #Tring to check for empty cell
> 
> for(my $row =1 ;
>                  $row <= $total ; $row++) {

This would be better written

    for my $row (1 .. $total-1) {

(though, again, what you have isn't wrong).

Please sort out your indentation before posting code: it makes it much
easier to read.

>                $myval = $oBook->{Cells} [$row] [$col];
>                print "This is my value ($row , $col ) <= $total",  This
> will only give me the row and col number

Comments start with #. This is not valid Perl code.

>               $myvalue->{'Valaue'},"\n";

I'm fairly sure you've misspelled 'Value'

Hash keys that match /^\w+$/ don't need quoting.

print is much easier to use if you learn about $\: read about it in
perldoc perlvar.

It's generally easier to use warn rather than print for debugging
output such as this, not least because Perl will tell you where in your
program it is talking about.

>        print "At ($row, $col) the value is %s \n",
>    $worksheet->Cells($row,$col)->{'Value'};     Here I want the
> contents

print ne printf. It's probably easier to just use print, especially if
you use the magic vars that control it:

    local ($,, $\) = (' ', "\n");
    print "At ($row, $col) the value is",
        $worksheet->Cells($row, $col)->{Value};

$worksheet is the worksheet you are writing to, not the one you are
reading from (as the error message told you). If you give your variables
better names it will be easier to avoid making that sort of mistake.

Ben

-- 
Heracles: Vulture! Here's a titbit for you / A few dried molecules of the gall
   From the liver of a friend of yours. / Excuse the arrow but I have no spoon.
(Ted Hughes,        [ Heracles shoots Vulture with arrow. Vulture bursts into ]
 'Alcestis')        [ flame, and falls out of sight. ]  benmorrow@tiscali.co.uk


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

Date: 17 Sep 2006 12:09:40 -0700
From: arne.muller@gmail.com
Subject: Re: Complex extensions in C
Message-Id: <1158520179.954867.245410@d34g2000cwd.googlegroups.com>


xhoster@gmail.com wrote:
> arne.muller@gmail.com wrote:
> > Hello,
> >
> > I'm looking for some resources (books, web-sites, docs ...) on how to
> > write complex perl extensions in C. I've read the perlxstut, but still
> > don't understand how to convert complex types.
> >
> > Specificly, my C-routine needs a pointer to a structure, some members
> > of this structure are pointers to type double arrays. On the perl side
> > this structure is an object.
>
> A Perl object or merely an opaque object held in Perl?  I.E. does Perl have
> to do anything with it, other than just pass the root pointer back into C?

Well, this should be a real perl object. The part that I'd like to
implement in C is just part of a larger application in which this
object lives ...

   Arne

> Xho
>
> --
> -------------------- http://NewsReader.Com/ --------------------
> Usenet Newsgroup Service                        $9.95/Month 30GB



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

Date: 17 Sep 2006 12:16:44 -0700
From: arne.muller@gmail.com
Subject: Re: Complex extensions in C
Message-Id: <1158520604.280471.270960@k70g2000cwa.googlegroups.com>

Ben Morrow wrote:
> Quoth anno4000@radom.zrz.tu-berlin.de:
> >  <arne.muller@gmail.com> wrote in comp.lang.perl.misc:
> > > Hello,
> > >
> > > I'm looking for some resources (books, web-sites, docs ...) on how to
> > > write complex perl extensions in C. I've read the perlxstut, but still
> > > don't understand how to convert complex types.
> > >
> > > Specificly, my C-routine needs a pointer to a structure, some members
> > > of this structure are pointers to type double arrays. On the perl side
> > > this structure is an object. The return value of the C function is a
> > > different type of structure, but again containing pointers to array (on
> > > the perl side this is an object).
> >
> > So you want to translate Perl objects (which presumably contain lists of
> > numbers) into C structs for consumption by XS routines.  The basic
> > method is to use pack() to build the struct in a string.  You pass the
> > string to the XS routine as such and cast it to a (pointer to) the type
> > of struct you have built.  If you have got it right (which will be
> > non-trivial), you'll find a workable struct in your XS program.
> >
> > You'll have to use the cumbersome "p" template to create pointers
> > from one part of the string to another.
>
> Note that there are nontrivial issues regarding struct packing and the
> like (you will likely need a little C program to construct the pack
> template for you using offsetof). You can also pass a hash to an XS
> routine that then builds the struct by pulling the members out of the
> hash in C.
>
> It may be easier to make the Perl side properly OO, or implement a tied
> hash/array, and keep the data in 'C format' all the time.

Maybe it's easier to write a wrapper routine in perl that takes the
perl object, extracts it's attributes (scalars and arrays) and passes
it to a C-wrapper routine which re-creates the proper C-structs from
it's function arguments. Finally the C-routine that takes athe pointe
rargument is called from this wrapper. This means the perl object gets
copied, and there's a perl object and a C struct. This may just be fine
for me.

   regards,

   Arne

> Ben
>
> --
>   The cosmos, at best, is like a rubbish heap scattered at random.
>                                                            Heraclitus
>   benmorrow@tiscali.co.uk



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

Date: 17 Sep 2006 23:03:43 -0700
From: nkprajapati@gmail.com
Subject: How to find methods of Classes ?
Message-Id: <1158559422.965534.239230@m73g2000cwd.googlegroups.com>

Hi All,

            I have 5 millions lines of source code, purely written in
c++.  I want to find all the methods of some classes, used in code.
This classes are library implementation. I want to have a script that
will do it. I have 55 such classes, whose methods I have to find from
source.


e.g.  I have following source code:

MYType  obj1;
obj1.findFirstStream();
obj1.getSourceLength();

so If I run script   it will list down all used method (i.e.
findFirstStream and getSourceLength ).

Can any one help me out how to go ahead ?

Thanks,
Naresh Prajapati



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

Date: 17 Sep 2006 06:30:03 -0700
From: cartercc@gmail.com
Subject: Re: Learning perl - for experienced programmers
Message-Id: <1158499803.447283.25140@m7g2000cwm.googlegroups.com>

Peter J. Holzer wrote:
> I strongly debate that Javadoc doesn't require the programmer to
> document his code. It can extract some interesting facts about the API
> from the source code (such as parameters and return type of methods or
> the super class of a class), but that's not much more than you can get
> with grep. The most interesting questions ("what does it do?" and "why
> does it do that?") have to be documented by the programmer.

I certainly didn't mean to imply that a programmer shouldn't document
his code. I believe strongly that a programmer should document his
code.  I faithfully document my code, and I agree that the 'why' is the
most important of all. 'What' is not always obvious from the code, and
that should be documented as well.

> What Javadoc does very well (and pod doesn't do at all) is that it makes
> it glaringly obvious if the programmer neglected to document something.
> There's a big empty rectangle in his manager's browser, and the manager
> will say to the programmer "Fill this rectangle, or you will be fired."

I'd phrase this a little differently. javadoc builds a framework within
which the programmer can document his code. It DOES NOT replace
internal documentation, or supplement internal documentation, but
fulfills a different purpose. When coding, which would you really
rather have at hand, the language API or a series of textual
explanations on the Active State variety? (I confess that about 75% of
my Perl programming is on Windows, but that is dictated by the users I
support, not by my preference, so I use Active State very heavily.)

> > "The industry" selects, usually, the best tools at hand for any
> > particular job.
>
> I don't believe this. "The industry" seldom selects the best tools. It
> selects tools which are good enough and require little change.

The word 'best' has many definitions. Being good enough and not subject
to change may make a technology 'best' as well as being free or being
supported by a big company. Actually, saying that 'the industry'
selects the 'best' tool is a little tautological, as you can define
'best' by what 'the industry' selects.

> As to why Java was widely accepted, I don't think it was because it was
> the best tool for any particular job. I believe some of the reasons
> were:
>
> * It was touted as a simpler version of C++. C++ was already used a lot,
>   so that was little change.
>
> * It promised platform independence.
>
> * Applets were seen as possibility to distribute feature-rich
>   applications to users over the web.
>
> * There was a big player (Sun) behind it. A respectable company, not
>   some long-haired academic.

Or a long-haired non-academic.

>
> * It's a statically typed language. Statically typed languages are seen
>   as more professional than dynamically typed languages. In any case,
>   "the industry" is used to them (COBOL, FORTRAN, Pascal, C, C++, ...)
>
> * It has separate compiler/interpreter stages: You can deliver some
>   binary ".class" files to your customers and don't have to show them
>   the source code. Just like you delivered binary executables and
>   libraries from your C programs.

You forgot to mention security. I agree with everything you said about
Java. You can also make a similar list for Perl. The solution is to be
able to use a number of different technologies and choose the best one
for the job.

CC



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

Date: 18 Sep 2006 02:32:09 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: Learning perl - for experienced programmers
Message-Id: <Xns9841DB131B762castleamber@130.133.1.4>

cartercc@gmail.com wrote:

> John Bokma wrote:
>> My oh my, weren't you the one who wasn't aware of POD? If you think
>> that "the industry" selects a language because it's well fitted for
>> the tasks at hand you are more then naive.
> 
> John, I don't want this to sound ugly. I had decided to ignore your
> remark. I formed the conclusion that you had no idea what you were
> talking about.

Funny, maybe read the other replies, which probably do it better then I
can do. 

> The javadoc utility produces a Java API of your code. You can write an
> application, run javadoc, and WITHOUT ANY FURTHER EFFORT ON THE
> PROGRAMMER'S PART have a full API of your application. POD is an HTML
> type

Like I said: you have to read more on POD. Also, it sounds like you have
little experience with javadoc. Maybe you should closely examine the
source that comes with a JDK install and count the number of lines that
have comment and wonder aloud why someone has been typing that. Next,
wonder how useful "your" javadoc is for pratical purposes after deleting
all those comments. 

[ rest snipped, couldn't be bothered ]

-- 
John                Experienced Perl programmer: http://castleamber.com/

          Perl help, tutorials, and examples: http://johnbokma.com/perl/


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

Date: Mon, 18 Sep 2006 04:42:09 GMT
From: merlyn@stonehenge.com (Randal Schwartz)
Subject: new CPAN modules on Mon Sep 18 2006
Message-Id: <J5ruE9.3pr@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.

Business-UTV-0.03
http://search.cpan.org/~psinnott/Business-UTV-0.03/
Module for retrieiving UTV internet account information
----
Chart-Clicker-1.1.1
http://search.cpan.org/~gphat/Chart-Clicker-1.1.1/
Powerful, extensible charting.
----
Chitresh_ncbi
http://search.cpan.org/~chi/Chitresh_ncbi/
----
Crypt-Lite-0.82.09
http://search.cpan.org/~retoh/Crypt-Lite-0.82.09/
Easy to use symmetric data encryption and decryption
----
DBIx-Timeout-1.00
http://search.cpan.org/~samtregar/DBIx-Timeout-1.00/
provides safe timeouts for DBI calls
----
Data-UUID-0.143
http://search.cpan.org/~rjbs/Data-UUID-0.143/
Perl extension for generating Globally/Universally Unique Identifiers (GUIDs/UUIDs).
----
DateTime-Format-DateParse-0.03
http://search.cpan.org/~jhoblitt/DateTime-Format-DateParse-0.03/
Parses Date::Parse compatible formats
----
DateTime-Format-DateParse-0.04
http://search.cpan.org/~jhoblitt/DateTime-Format-DateParse-0.04/
Parses Date::Parse compatible formats
----
Device-USB-0.18
http://search.cpan.org/~gwadej/Device-USB-0.18/
Use libusb to access USB devices.
----
Email-MIME-Creator-1.451
http://search.cpan.org/~rjbs/Email-MIME-Creator-1.451/
Email::MIME constructor for starting anew.
----
Email-MIME-Encodings-1.310
http://search.cpan.org/~rjbs/Email-MIME-Encodings-1.310/
A unified interface to MIME encoding and decoding
----
Email-MIME-Modifier-1.440
http://search.cpan.org/~rjbs/Email-MIME-Modifier-1.440/
Modify Email::MIME Objects Easily
----
ExtUtils-FakeConfig-0.08
http://search.cpan.org/~mbarbon/ExtUtils-FakeConfig-0.08/
overrides some configuration values
----
Facebook-0.0.0alpha1
http://search.cpan.org/~snoyberg/Facebook-0.0.0alpha1/
----
File-Next-OO-0.02
http://search.cpan.org/~borisz/File-Next-OO-0.02/
File-finding iterator Wrapper for File::Next::files function
----
HTML-SBC-0.13
http://search.cpan.org/~memowe/HTML-SBC-0.13/
simple blog code for valid (X)HTML
----
HTML-WikiConverter-MediaWiki-0.55
http://search.cpan.org/~diberri/HTML-WikiConverter-MediaWiki-0.55/
Convert HTML to MediaWiki markup
----
Mail-SpamCannibal-0.75
http://search.cpan.org/~miker/Mail-SpamCannibal-0.75/
A tool to stop SPAM
----
NCBI
http://search.cpan.org/~chi/NCBI/
----
POE-Component-Server-SimpleContent-1.02
http://search.cpan.org/~bingos/POE-Component-Server-SimpleContent-1.02/
The easy way to serve web content with POE::Component::Server::SimpleHTTP.
----
POE-Component-SpreadClient-0.03
http://search.cpan.org/~apocal/POE-Component-SpreadClient-0.03/
handle Spread communications in POE
----
POE-Filter-IRCD-2.1
http://search.cpan.org/~bingos/POE-Filter-IRCD-2.1/
A POE-based parser for the IRC protocol.
----
Parse-DMIDecode-0.00_1
http://search.cpan.org/~nicolaw/Parse-DMIDecode-0.00_1/
Interface to SMBIOS under Linux using dmidecode
----
Rose-DB-0.726
http://search.cpan.org/~jsiracusa/Rose-DB-0.726/
A DBI wrapper and abstraction layer.
----
Rose-DB-Object-0.753
http://search.cpan.org/~jsiracusa/Rose-DB-Object-0.753/
Extensible, high performance RDBMS-OO mapper.
----
Sys-MemInfo-0.90
http://search.cpan.org/~scresto/Sys-MemInfo-0.90/
----
TAPx-Parser-0.30
http://search.cpan.org/~ovid/TAPx-Parser-0.30/
Parse TAP output
----
XML-DOM-XPath-0.12
http://search.cpan.org/~mirod/XML-DOM-XPath-0.12/
Perl extension to add XPath support to XML::DOM, using XML::XPath engine
----
XML-XPathEngine-0.04
http://search.cpan.org/~mirod/XML-XPathEngine-0.04/
a re-usable XPath engine for DOM-like trees


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/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Sun, 17 Sep 2006 15:24:39 +0100
From: Ben Morrow <benmorrow@tiscali.co.uk>
Subject: Re: Perl compiler
Message-Id: <7e20u3-4kg.ln1@osiris.mauzo.dyndns.org>


Quoth "Sisyphus" <sisyphus1@nomail.afraid.org>:
> 
> "Bill H" <bill@ts1000.us> wrote in message
> news:1158424157.465990.313280@h48g2000cwc.googlegroups.com...
> > Can anyone recommend a good perl compiler for creating .exe files
> > running under Dos?
> >
> 
> The PAR module has a very good perl2exe utility called 'pp.bat'. There's
> usually a windows ppm for it at the uwinnipeg repository (among other
> places).

You're presuming the OP doesn't actually *mean* DOS... :)

Ben

-- 
                Outside of a dog, a book is a man's best friend.
                Inside of a dog, it's too dark to read.
benmorrow@tiscali.co.uk                                           Groucho Marx


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

Date: Mon, 18 Sep 2006 09:09:54 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Perl compiler
Message-Id: <450dd6cc$0$386$afc38c87@news.optusnet.com.au>


"Ben Morrow" <benmorrow@tiscali.co.uk> wrote in message
 .
 .
>
> You're presuming the OP doesn't actually *mean* DOS... :)
>

Heh ... indeed I am :-)

Cheers,
Rob




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

Date: 17 Sep 2006 17:36:22 -0700
From: "Bill H" <bill@ts1000.us>
Subject: Re: Perl compiler
Message-Id: <1158539782.081264.79580@i42g2000cwa.googlegroups.com>


Ben Morrow wrote:
> Quoth "Sisyphus" <sisyphus1@nomail.afraid.org>:
> >
> > "Bill H" <bill@ts1000.us> wrote in message
> > news:1158424157.465990.313280@h48g2000cwc.googlegroups.com...
> > > Can anyone recommend a good perl compiler for creating .exe files
> > > running under Dos?
> > >
> >
> > The PAR module has a very good perl2exe utility called 'pp.bat'. There's
> > usually a windows ppm for it at the uwinnipeg repository (among other
> > places).
>
> You're presuming the OP doesn't actually *mean* DOS... :)
>
> Ben
>
> --
>                 Outside of a dog, a book is a man's best friend.
>                 Inside of a dog, it's too dark to read.
> benmorrow@tiscali.co.uk                                           Groucho Marx

Actually I do mean Dos, well command prompt in XP. I do all my Perl
coding outside of windows and want to have a few of my programs
compiled so I do not have to invoke perl each time. I have perl2exe but
was wondering if there were other programs available.

Bill H www.ts1000.us



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

Date: Mon, 18 Sep 2006 11:55:03 +1000
From: "Sisyphus" <sisyphus1@nomail.afraid.org>
Subject: Re: Perl compiler
Message-Id: <450dfd7f$0$5110$afc38c87@news.optusnet.com.au>


"Bill H" <bill@ts1000.us> wrote in message
 .
 .
>
> Actually I do mean Dos, well command prompt in XP.

That's commonly referred to as  the "DOS shell" - but you're actually
running Windows XP and not DOS (which is a different operating system).

> I do all my Perl
> coding outside of windows

I *think* you're probably trying to make a distinction between programs run
in the cmd.exe shell and programs run as gui applications. In both case
you're running Windows.

> and want to have a few of my programs
> compiled so I do not have to invoke perl each time.

You can run your 'script.pl' as 'script.pl'  or just 'script' if you set
your file associations appropriately. Enter "ftype /?" (minus the quotes) at
the command prompt.

> I have perl2exe but
> was wondering if there were other programs available.
>

IndigoStar and ActiveState both have commercial programs that do that. Iirc,
IndigoStar's is 'perl2exe' and ActiveState's is 'PDK' (Perl Development
Kit).

The free utility that does that is the PAR module. If you're running
ActivePerl then just enter at the prompt (while connected to the internet):

ppm install http://theoryx5.uwinnipeg.ca/ppms/PAR-588.ppd

Then enter "perldoc pp" at the prompt for documentation.

Cheers,
Rob




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

Date: 17 Sep 2006 22:49:38 -0700
From: "Ved" <vedpsingh@gmail.com>
Subject: Re: Replace a line
Message-Id: <1158558578.803424.106030@m7g2000cwm.googlegroups.com>

Hi Ted,
When I run this program, it printed what is written in _DATA_
Is the code complete?

Regards
Ved

Tad McClellan wrote:
> Ved <vedpsingh@gmail.com> wrote:
>
> > I have to replace only the lines
> >
> > if ( dat0s0 > dat1s0) then
> >
> > with
> >
> > if ( abs(dat0s0) > abs(dat1s0)) then
>
>
> -------------------------------------
> #!/usr/bin/perl
> use warnings;
> use strict;
>
> while ( <DATA> ) {
>    if ( /^\s*if.*then$/ ) {
>       s/(\S+)(\s*\))/abs($1)$2/;  # 2nd operand
>       s/(\(\s*)(\S+)/$1abs($2)/;  # 1st operand
>    }
>    print;
> }
>
> __DATA__
> if ( dat0s0 > dat1s0) then
>   dat0s1 <= dat0s0 ;
>   dat1s1 <= dat1s0 ;
>   else
>   dat0s1 <= dat1s0 ;
>   dat1s1 <= dat0s0 ;
>   end if;
>
>   if ( dat2s0 > dat3s0) then
>   dat2s1 <= dat2s0 ;
>   dat3s1 <= dat3s0 ;
>   else
>   dat2s1 <= dat3s0;
>   dat3s1 <= dat2s0 ;
>   end if;
>
>   ----
>   if ( dat4s0 > dat5s0) then
>
>   dat4s1 <= dat4s0 ;
>   dat5s1 <= dat5s0 ;
>   else
>   dat4s1 <= dat5s0;
>   dat5s1 <= dat4s0 ;
>   end if;
> -------------------------------------
>
>
> --
>     Tad McClellan                          SGML consulting
>     tadmc@augustmail.com                   Perl programming
>     Fort Worth, Texas



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

Date: 17 Sep 2006 09:50:09 -0700
From: "Xah Lee" <xah@xahlee.org>
Subject: String Pattern Matching: regex and Python regex documentation
Message-Id: <1158511809.605421.100510@d34g2000cwd.googlegroups.com>

the Python regex documentation is available at:
http://xahlee.org/perl-python/python_re-write/lib/module-re.html

Note that, i've just made the terms of use clear.

Also, can anyone answer what is the precise terms of license of the
official python documentation? The official python.org doc site is not
clear.

Note also, that the regex syntax used by Perl is the same as Python.
So, this section
 http://xahlee.org/perl-python/python_re-write/lib/re-syntax.html
which contains clear explanation of regex syntax, will be of interest
to Perl programers as well.

If you are studying regex, you might also be interested in this lisp
doc:
http://xahlee.org/elisp/Regular-Expressions.html

Also note, that the regex syntax, is one of unix's $free$ fuckup that
has damaged a entire computer industry for decades. ($free$ as drugs
given to children)

For some examples of corrective steps, see:

=E2=80=A2 Scsh manual, Chapter 6: Pattern-matching strings with regular
expressions
http://www.scsh.net/docu/html/man-Z-H-7.html

=E2=80=A2 Mathematica Book, section 2.8.4 String Patterns
http://documents.wolfram.com/mathematica/book/section-2.8.4

  Xah
  xah@xahlee.org
=E2=88=91 http://xahlee.org/



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

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


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