[28372] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 9736 Volume: 10

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

Date: Mon, 18 Sep 2006 11: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: 9736

Today's topics:
    Re: arrays and hashes anno4000@radom.zrz.tu-berlin.de
    Re: arrays and hashes <mritty@gmail.com>
    Re: arrays and hashes <David.Squire@no.spam.from.here.au>
    Re: arrays and hashes anno4000@radom.zrz.tu-berlin.de
    Re: arrays and hashes <christoph.lamprecht.no.spam@web.de>
    Re: arrays and hashes <David.Squire@no.spam.from.here.au>
    Re: arrays and hashes anno4000@radom.zrz.tu-berlin.de
    Re: arrays and hashes <rvtol+news@isolution.nl>
    Re: Can't locate boject methoid Cells via package Sspre jmcnamara@cpan.org
    Re: Can't locate oject methoid Cells via package Ssprea <pamelapdh@aol.com>
    Re: Complex extensions in C <Peter@PSDT.com>
    Re: deleteing records from DB_File doesnt decrease file <glex_no-spam@qwest-spam-no.invalid>
    Re: How to find methods of Classes ? <tadmc@augustmail.com>
    Re: If...else and exit; <mattjones@hotmail.co.uk>
    Re: If...else and exit; <klaus03@gmail.com>
    Re: If...else and exit; <mattjones@hotmail.co.uk>
    Re: Perl compiler <VN@VN.VN>
    Re: Preventing changes to a module's variables in mod_p anno4000@radom.zrz.tu-berlin.de
    Re: Replace a line anno4000@radom.zrz.tu-berlin.de
    Re: Replace a line <tadmc@augustmail.com>
        Set the window always on top zaffran_ad@hotmail.com
    Re: Set the window always on top <mritty@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 18 Sep 2006 09:37:48 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: arrays and hashes
Message-Id: <4n77ncF90hp7U2@news.dfncis.de>

Paul Lalli <mritty@gmail.com> wrote in comp.lang.perl.misc:
> Abigail wrote:
> > David Squire (David.Squire@no.spam.from.here.au) wrote on MMMMDCCLXIII
> > September MCMXCIII in <URL:news:eeeauv$jr1$1@gemini.csx.cam.ac.uk>:
> > ;;
> > ;; > What is the difference with ()
> > ;;
> > ;;  allows you to construct a list
> >
> > Eh, not really. Context makes lists - the only place where () is significant
> > in creating a list is on the left hand side of the x.
> 
> Hrm.  How does that jive with things such as:
> 
> my $x = @foo;
> vs
> my ($x) = @foo;
> 
> The way I understand it, in the first, @foo is evaluated in scalar
> context, because we're assigning to a scalar value, and so $x gets the
> size of @foo.  In the second, @foo is evaluated in list context,
> because we're assigning to a list, and so $x gets the first value of
> @foo.  So didn't the parentheses change "$x" from "a scalar value" to
> "a list containing a single scalar value"?

That is what Abigail said:  () creates list context when used on the left
side of an assignment.

Anno


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

Date: 18 Sep 2006 03:19:10 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: arrays and hashes
Message-Id: <1158574750.287186.51600@m73g2000cwd.googlegroups.com>

anno4000@radom.zrz.tu-berlin.de wrote:
> Paul Lalli <mritty@gmail.com> wrote in comp.lang.perl.misc:
> > Abigail wrote:
> > > Eh, not really. Context makes lists - the only place where () is significant
> > > in creating a list is on the left hand side of the x.

> That is what Abigail said:  () creates list context when used on the left
> side of an assignment.


Okay.... I guess I didn't interpret "left hand side of the x" as "left
side of an assignmen".

Paul Lalli



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

Date: Mon, 18 Sep 2006 11:56:58 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: arrays and hashes
Message-Id: <eelu19$rlk$1@gemini.csx.cam.ac.uk>

anno4000@radom.zrz.tu-berlin.de wrote:
> Paul Lalli <mritty@gmail.com> wrote in comp.lang.perl.misc:
>> Abigail wrote:
>>> David Squire (David.Squire@no.spam.from.here.au) wrote on MMMMDCCLXIII
>>> September MCMXCIII in <URL:news:eeeauv$jr1$1@gemini.csx.cam.ac.uk>:
>>> ;;
>>> ;; > What is the difference with ()
>>> ;;
>>> ;;  allows you to construct a list
>>>
>>> Eh, not really. Context makes lists - the only place where () is significant
>>> in creating a list is on the left hand side of the x.

I am happy to be corrected on this, but the usage I was referring to, in 
the context of the OP's original post, is something like this:

my @new_array = (1, 2, 3);

as opposed to, say,

my $new_array_ref = [1, 2, 3];

Is my understanding of the usage of (...) in the first instance flawed?



DS


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

Date: 18 Sep 2006 11:27:07 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: arrays and hashes
Message-Id: <4n7e4bF904ooU1@news.dfncis.de>

David Squire  <David.Squire@no.spam.from.here.au> wrote in comp.lang.perl.misc:
> anno4000@radom.zrz.tu-berlin.de wrote:
> > Paul Lalli <mritty@gmail.com> wrote in comp.lang.perl.misc:
> >> Abigail wrote:
> >>> David Squire (David.Squire@no.spam.from.here.au) wrote on MMMMDCCLXIII
> >>> September MCMXCIII in <URL:news:eeeauv$jr1$1@gemini.csx.cam.ac.uk>:
> >>> ;;
> >>> ;; > What is the difference with ()
> >>> ;;
> >>> ;;  allows you to construct a list
> >>>
> >>> Eh, not really. Context makes lists - the only place where () is significant
> >>> in creating a list is on the left hand side of the x.
> 
> I am happy to be corrected on this, but the usage I was referring to, in 
> the context of the OP's original post, is something like this:
> 
> my @new_array = (1, 2, 3);
> 
> as opposed to, say,
> 
> my $new_array_ref = [1, 2, 3];
> 
> Is my understanding of the usage of (...) in the first instance flawed?

It is correct, it is even necessary, but it has nothing to do with list
context.

"=" binds rather tightly in Perl, so leaving out the () is interpreted
as

    ( @new_array = 1), 2, 3;

(which is worth a warning).

The parens around ( 1, 2, 3) serve to change the precedence, just like
in "($x + $y)*$z".

Anno


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

Date: Mon, 18 Sep 2006 13:34:01 +0200
From: Ch Lamprecht <christoph.lamprecht.no.spam@web.de>
Subject: Re: arrays and hashes
Message-Id: <eem077$mp6$1@online.de>

David Squire wrote:
> anno4000@radom.zrz.tu-berlin.de wrote:
> 
>> Paul Lalli <mritty@gmail.com> wrote in comp.lang.perl.misc:
>>
>>> Abigail wrote:
>>>
>>>> David Squire (David.Squire@no.spam.from.here.au) wrote on MMMMDCCLXIII
>>>> September MCMXCIII in <URL:news:eeeauv$jr1$1@gemini.csx.cam.ac.uk>:
>>>> ;;
>>>> ;; > What is the difference with ()
>>>> ;;
>>>> ;;  allows you to construct a list
>>>>
>>>> Eh, not really. Context makes lists - the only place where () is 
>>>> significant
>>>> in creating a list is on the left hand side of the x.
> 
> 
> I am happy to be corrected on this, but the usage I was referring to, in 
> the context of the OP's original post, is something like this:
> 
> my @new_array = (1, 2, 3);
> 
> as opposed to, say,
> 
> my $new_array_ref = [1, 2, 3];
> 
> Is my understanding of the usage of (...) in the first instance flawed?

(...) are for precedence in this case as demonstrated by the following piece of 
code:

use strict;
use warnings;

my @array;
my $counter = 0;

@array = (getval(),getval(),getval());
@array =  getval(),getval(),getval() ;

sub getval{
     print  "array is now @array\n";
     print  "getval returns $counter\n";
     return $counter++;
}
print "array is now @array\n";



Christoph
-- 

perl -e "print scalar reverse q/ed.enilno@ergn.l.hc/"


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

Date: Mon, 18 Sep 2006 12:38:30 +0100
From: David Squire <David.Squire@no.spam.from.here.au>
Subject: Re: arrays and hashes
Message-Id: <eem0f2$399$1@gemini.csx.cam.ac.uk>

anno4000@radom.zrz.tu-berlin.de wrote:
> David Squire  <David.Squire@no.spam.from.here.au> wrote in comp.lang.perl.misc:
>> anno4000@radom.zrz.tu-berlin.de wrote:
>>> Paul Lalli <mritty@gmail.com> wrote in comp.lang.perl.misc:
>>>> Abigail wrote:
>>>>> David Squire (David.Squire@no.spam.from.here.au) wrote on MMMMDCCLXIII
>>>>> September MCMXCIII in <URL:news:eeeauv$jr1$1@gemini.csx.cam.ac.uk>:
>>>>> ;;
>>>>> ;; > What is the difference with ()
>>>>> ;;
>>>>> ;;  allows you to construct a list
>>>>>
>>>>> Eh, not really. Context makes lists - the only place where () is significant
>>>>> in creating a list is on the left hand side of the x.
>> I am happy to be corrected on this, but the usage I was referring to, in 
>> the context of the OP's original post, is something like this:
>>
>> my @new_array = (1, 2, 3);
>>
>> as opposed to, say,
>>
>> my $new_array_ref = [1, 2, 3];
>>
>> Is my understanding of the usage of (...) in the first instance flawed?
> 
> It is correct, it is even necessary, but it has nothing to do with list
> context.
> 
> "=" binds rather tightly in Perl, so leaving out the () is interpreted
> as
> 
>     ( @new_array = 1), 2, 3;
> 
> (which is worth a warning).
> 
> The parens around ( 1, 2, 3) serve to change the precedence, just like
> in "($x + $y)*$z".

Ah. Thanks very much. I guess it is a happy coincidence that the 
parentheses for precedence here make the RHS look like what you would 
want if you were inducing list context on the LHS.


DS


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

Date: 18 Sep 2006 11:50:13 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: arrays and hashes
Message-Id: <4n7fflF904ooU2@news.dfncis.de>

David Squire  <David.Squire@no.spam.from.here.au> wrote in comp.lang.perl.misc:
> anno4000@radom.zrz.tu-berlin.de wrote:
> > David Squire  <David.Squire@no.spam.from.here.au> wrote in comp.lang.perl.misc:
> >> anno4000@radom.zrz.tu-berlin.de wrote:

[...]

> >> my @new_array = (1, 2, 3);
> >>
> >> as opposed to, say,
> >>
> >> my $new_array_ref = [1, 2, 3];
> >>
> >> Is my understanding of the usage of (...) in the first instance flawed?
> > 
> > It is correct, it is even necessary, but it has nothing to do with list
> > context.
> > 
> > "=" binds rather tightly in Perl, so leaving out the () is interpreted
> > as
> > 
> >     ( @new_array = 1), 2, 3;
> > 
> > (which is worth a warning).
> > 
> > The parens around ( 1, 2, 3) serve to change the precedence, just like
> > in "($x + $y)*$z".
> 
> Ah. Thanks very much. I guess it is a happy coincidence that the 
> parentheses for precedence here make the RHS look like what you would 
> want if you were inducing list context on the LHS.

It is one of the things that make Perl look more consistent than it
is.

Anno


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

Date: Mon, 18 Sep 2006 14:01:22 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: arrays and hashes
Message-Id: <eem8ub.1is.1@news.isolution.nl>

David Squire schreef:

> my @new_array = (1, 2, 3);
>
> as opposed to, say,
>
> my $new_array_ref = [1, 2, 3];
>
> Is my understanding of the usage of (...) in the first instance
> flawed?

$ perl -le '@_=1,2,3; print "@_"'
1


$ perl -le '@_=(1,2,3); print "@_"'
1 2 3


$ perl -le '@_=@{[1,2,3]}; print "@_"'
1 2 3


$ perl -le '@_=do{1,2,3}; print "@_"'
1 2 3


$ perl -le '$_=(@_=4,5,6); print "@_\n$_"'
4
6


$ perl -le '$_=(@_=(4,5,6)); print "@_\n$_"'
4 5 6
3

-- 
Affijn, Ruud

"Gewoon is een tijger."




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

Date: 18 Sep 2006 01:06:15 -0700
From: jmcnamara@cpan.org
Subject: Re: Can't locate boject methoid Cells via package Sspreadsheet::WriteExcel::Worksheet
Message-Id: <1158566775.330191.28580@e3g2000cwe.googlegroups.com>

Pam wrote:
> I  get
> Can't locate boject method Cells via package
> Spreadsheet::WriteExcel::Worksheet

That is because Cell() isn't a Spreadsheet::WriteExcel method it is a
Spreadsheet::ParseExcel method.

You are calling the wrong method on the wrong object.

John.
--



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

Date: 18 Sep 2006 09:33:18 -0700
From: "Pam" <pamelapdh@aol.com>
Subject: Re: Can't locate oject methoid Cells via package Sspreadsheet::WriteExcel::Worksheet
Message-Id: <1158597175.798104.172770@m73g2000cwd.googlegroups.com>


jmcnamara@cpan.org wrote:
> Pam wrote:
> > I  get
> > Can't locate boject method Cells via package
> > Spreadsheet::WriteExcel::Worksheet
>
> That is because Cell() isn't a Spreadsheet::WriteExcel method it is a
> Spreadsheet::ParseExcel method.
>
> You are calling the wrong method on the wrong object.
>
> John.
> --


Yes, I was calling the wrong methond on the wrong object.  I have
corrected that, I think the confussion because I am trying to write to
a file as well as read it.  I have corrected that as well, but I am
still having problems getting the contents of the cell.
I no longer get the warning about not being able to locate object
method.  I fixed that part.

$filename ="CCB.txt";

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

close (FILE);

#This is the holding variable for date because the requirements want
the date in filename

$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";
    }

}
      print "Adding sheet1\n";


   print "Now will format .xls file\n";


#Holding Variables for mailing list
$Name1 = '3gccbhst@motorola.com';




# Add a Format
  $format = $workbook->add_format();
#must set wrap for CCB comments and Description
  $format->set_text_wrap();
  $format->set_bold();
  $format->set_bg_color('51');
  $format->set_border();
  $format->set_bottom();
  $format->set_top();
  $format->set_left();
  $format->set_right();







# The general syntax is write($row, $col, $token, $format)

# 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);
       $worksheet->write(0, 9, "Project", $format);
       $worksheet->write(0, 10,"Product", $format);
       $worksheet->write(0, 11,"Products-targeted", $format);
       $worksheet->write(0, 12,"Products-targed_del", $format);
       $worksheet->write(0, 13,"Products-targetd_add", $format);
       $worksheet->write(0, 14,"Program", $format);

my $Book = $Excel->Workbooks->Open("D:/Profiles/w8143c/My

Documents/Spreadsheet-WriteExcel-2.17/3GSoftwareCCB_MeetingAgenda$datestamp.xls");


#$row = 1;
$col = 11;


print "Is this book geeting seen", $Book, "\n";

#Tring to check for empty cell
#This looks at Sheet1 in the workbook
my $Sheet = $Book->Worksheets(1);


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



printf "At ($row, $col) the value is %s and the formula is %s\n",
                       $Sheet->Cells($row,$col)->{'Value'},
                       $Sheet->Cells($row,$col)->{'Formula'};

                       print $row, "\n";

        }

  After this I get warning talking about use of uninitialized value and
it does not print value(which I was hoping to get contents of the cell
but print statement is empty


print $total, "\n";

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

          $row= $row + 1;

}


#Here I am writing to the file but I need to check if the row is empty

If I use something like  if ($Sheet->Cells($row,$col)->{'Value'} " ")
it blows up on me.  If I put a string in it complains about it is not
numeric



Thanks,
Pamela



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

Date: Mon, 18 Sep 2006 11:07:59 GMT
From: Peter Scott <Peter@PSDT.com>
Subject: Re: Complex extensions in C
Message-Id: <pan.2006.09.18.11.07.58.620012@PSDT.com>

On Sat, 16 Sep 2006 07:32:26 -0700, arne.muller wrote:
> 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.

Try
http://www.amazon.com/Extending-Embedding-Perl-Tim-Jenness/dp/1930110820

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/



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

Date: Mon, 18 Sep 2006 12:27:51 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: deleteing records from DB_File doesnt decrease file size?
Message-Id: <450ed64e$0$34073$815e3792@news.qwest.net>

botfood wrote:

> The REASON this was required hasnt gone away, and I'm not quite sure
> what to do about it long term. Its not a perl issue, but is a web
> server memory issue.... I have a site running on Apache with this
> pretty big database, grew to about 20k records with a total file size
> that grew to around 12MB.  

That sounds more like a pretty small database.

> It recently acted very strangely and would
> not write any new records. My best guess at this point is that settings
> like the Apache::SizeLimit have something to do with it, but it remains
> to be seen whether the Host is willing to alter config files for me.
They/You should be able to determine if it's a memory issue, before 
blindly changing things.

> 
> ThePERL part of this is that I'm open to what people may suggest as
> ways to reduce the memory used by any single process accessing the DB.
> Especially if I have a report that needs to go thru the whole DB, how
> can I reduce the hit on the server? Would it work to split out record
> contents into a couple different 'tables' and pull them in if required?
> 
> I had thought that by tie()ing to a file on disk,I'd avoid eating up
> the RAM and process memory except, but I dont really understand memory
> and paging and all that.....
> 
> comments? ideas?

Only a small part of the DBM is in memory at one time, so I'd doubt it's 
a memory issue with DBM access.  The file size of the DBM really doesn't 
matter. More than likely, if it is a memory issue, it's in how you are 
using that data (e.g. looping through the records and storing it in a 
data structure) that is causing a problem.  Since you don't provide any 
code, that's only a guess.

Since it wouldn't write new records, it might have been corrupted, so be 
sure to lock the DBM appropriately.  See the documentation for "Locking: 
The Trouble with fd" in perldoc DB_File for possible solutions.


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

Date: Mon, 18 Sep 2006 07:08:35 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to find methods of Classes ?
Message-Id: <slrnegt323.4vc.tadmc@magna.augustmail.com>

nkprajapati@gmail.com <nkprajapati@gmail.com> wrote:

>             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.
                                                        ^^^^
                                                        ^^^^

So if a method is defined but never called it should not be reported?


> Can any one help me out how to go ahead ?


The first step would be to get a C++ parser.


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


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

Date: 18 Sep 2006 06:43:52 -0700
From: "MattJ83" <mattjones@hotmail.co.uk>
Subject: Re: If...else and exit;
Message-Id: <1158587032.789383.325060@i42g2000cwa.googlegroups.com>

> By which I mean that the print() statements should print out exactly
> what was to be written to the database in exactly the same place in the
> code as it would have been written.

As seen below:

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

my @filenames  = </home/username/logs/*.log>;
foreach my $filename (@filenames) {


    open my $LOG, '<', $filename or die "can't open $filename: $!\n";

    my ($fast, $error, $update, $deletion, $elapsed);
    while(<$LOG>) {
        if (/Rows in fast-search index updates table: (.*)/) {
            $update = $1;
        }

        if (/Rows in fast-search index deletions table: (.*)/) {
            $deletion = $1;
        }

        if (/elapsed/) {
            if ($fast or $error) {
                /deltas: elapsed=(.*), cpu=(.*), user=(.*), sys=(.*),
n=(.*)/;
                $elapsed = $1;

               last;
            }
        }

        if (/FASTSEARCH/) {
            $fast = $_;
        }

        if (/conflicting/) {
            $error = $_;
        }
    }
close($LOG);

print ("$filename\n", "$update\n", "$deletion\n", "$elapsed\n",
"$error\n");

}

                         __________END_________


_____one.log_____
Rows in fast-search index updates table: 50
Rows in fast-search index deletions table: 5
deltas: elapsed=0, cpu=0, user=0, sys=0, n=0
FASTSEARCH
deltas: elapsed=1, cpu=1, user=1, sys=1, n=1
inversions
deltas: elapsed=2, cpu=2, user=2, sys=2, n=2

______two.log________
Rows in fast-search index updates table: 10
Rows in fast-search index deletions table: 2
deltas: elapsed=0, cpu=0, user=0, sys=0, n=0
conflicting
deltas: elapsed=1, cpu=1, user=1, sys=1, n=1
inversions
deltas: elapsed=2, cpu=2, user=2, sys=2, n=2


Ok, so the code above will get the second of the elapsed (after
FASTSEARCH or conflicting).
I would like the code to exit if it can't find FASTSEARCH or
conflicting. I would also like it to exit if it can't find 'inversions'
(i can't seem to pick this up with the code yet though -im struggling
to see where i would tell the code to look for inversions).


ps - thank you for shouwing me the correct indentation - people had
been saying it was quite bad - but weren't explaining what the format
should be like!



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

Date: 18 Sep 2006 07:20:29 -0700
From: "Klaus" <klaus03@gmail.com>
Subject: Re: If...else and exit;
Message-Id: <1158589228.862402.213770@b28g2000cwb.googlegroups.com>

MattJ83 wrote:
> ps - thank you for shouwing me the correct indentation - people had
> been saying it was quite bad - but weren't explaining what the format
> should be like!

perldoc perlstyle



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

Date: 18 Sep 2006 07:45:42 -0700
From: "MattJ83" <mattjones@hotmail.co.uk>
Subject: Re: If...else and exit;
Message-Id: <1158590741.929529.171480@m7g2000cwm.googlegroups.com>


> perldoc perlstyle

Thanks - couldn't find that last week for some reason!



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

Date: Mon, 18 Sep 2006 16:56:19 +0200
From: VN <VN@VN.VN>
Subject: Re: Perl compiler
Message-Id: <450eb396$0$28393$ba620e4c@news.skynet.be>

Bill H wrote:
> Can anyone recommend a good perl compiler for creating .exe files
> running under Dos?
> 
> Bill H www.ts1000.us
> 

I use ActiveState Perl dev kit.


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

Date: 18 Sep 2006 09:18:35 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Preventing changes to a module's variables in mod_perl
Message-Id: <4n76jbF90hp7U1@news.dfncis.de>

Brian McCauley <nobull67@gmail.com> wrote in comp.lang.perl.misc:
> 
> max@maxgraphic.com wrote:
> > Brian McCauley wrote:
> > > max@maxgraphic.com wrote:
> > >
> > > > Is there a way to get Readonly to warn instead of die when a
> > > > modification attempt is made?
> > >
> > > There's no such feature at the moment but it would be no biggie to add
> > > if you wanted to. Just change the croaks() to carps().
> >
> > Seemingly better still, Readonly uses its own croak wrapper, so adding
> >
> > sub Readonly::croak { warn $_[0]; }
> >
> > to my module seems to do the trick.
> 
> You'd probably get more informative errors with
> 
>   sub Readonly::croak {
>     require Carp;
>     goto &Carp::carp;
>  }
> 
> The problem with this approach is it breaks any other uses of Readonly
> that are going on in other modules that anyone who happens to use your
> module is also using.

The substitution can be localized to a block or file:

    local *Readonly::croak = sub {
        require Carp;
        goto &Carp::carp;
     };

Anno


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

Date: 18 Sep 2006 07:40:49 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Replace a line
Message-Id: <4n70s1F91l97U1@news.dfncis.de>

Ved <vedpsingh@gmail.com> wrote in comp.lang.perl.misc:

Please don't top-post.  I have moved your reply in context.

> 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

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

His name is Tad.

The program adds the required abs() to the operands.  Please look again.

Anno

> > -------------------------------------
> > #!/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;
> > -------------------------------------


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

Date: Mon, 18 Sep 2006 07:03:50 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Replace a line
Message-Id: <slrnegt2p6.4vc.tadmc@magna.augustmail.com>


[ Please see the Posting Guidelines that are posted here frequently. ]


Ved <vedpsingh@gmail.com> wrote:
> 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;
>> -------------------------------------

> Hi Ted,


Hi Vad,


> When I run this program, it printed what is written in _DATA_


No it doesn't.


> Is the code complete?


Yes.


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


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

Date: 18 Sep 2006 05:51:43 -0700
From: zaffran_ad@hotmail.com
Subject: Set the window always on top
Message-Id: <1158583903.920741.306150@m73g2000cwd.googlegroups.com>

Hi,

i'm french so sorry for my english skill...

i need some help ;)

i use the win32 api with win32::GUI and i would like set the main
window of my application always on top.

It may exist a proprety that allow us to do that... like maybe
$Window->SetToTop(1) or something else...

Thx!



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

Date: 18 Sep 2006 07:59:51 -0700
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Set the window always on top
Message-Id: <1158591591.171613.91870@e3g2000cwe.googlegroups.com>

zaffran_ad@hotmail.com wrote:

> i'm french so sorry for my english skill...
>
> i need some help ;)
>
> i use the win32 api with win32::GUI and i would like set the main
> window of my application always on top.
>
> It may exist a proprety that allow us to do that... like maybe
> $Window->SetToTop(1) or something else...

I've never used the module, but some Google'ing suggests you should try
adding the
-topmost => 1
attribute to your Win32::GUI::new() constructor.

Paul Lalli



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

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


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