Re: Getting lots of redefined statements in the error_log

2005-06-20 Thread Martin Moss
Can you confirm you have the same version of Perl on
both systems?

I've seen these errors on perl 5.8 after upgrading
from perl 5.005

Marty

p.s. I still have them too, so any help with this
issue would be useful to me too...

--- Boysenberry Payne [EMAIL PROTECTED]
wrote:

 Here is a sample of a long list:
 
 [Fri Jun 17 15:17:19 2005] Unix.pm: Subroutine _cwd
 redefined at 

/usr/lib/perl5/5.8.0/i386-linux-thread-multi/File/Spec/Unix.pm
 line 
 470.
 [Fri Jun 17 15:17:19 2005] Carp.pm: Subroutine
 import redefined at 
 /usr/lib/perl5/5.8.0/CGI/Carp.pm line 289.
 
 This only happens on our external server (currently
 being tested and 
 set up.)  I didn't set it up, otherwise I would
 offer config settings.
 
 It doesn't happen on my local system when I run the
 same script.  I'm 
 not sure why I'm getting all of these redefined
 errors.
 I thought maybe someone here would know what's going
 on
 
 Thanks,
 Boysenberry
 
 This message contains information that is
 confidential
 and proprietary to Humaniteque and / or its
 affiliates.
 It is intended only for the recipient named and for
 the express purpose(s) described therein.
 Any other use is prohibited.
 
 http://www.habitatlife.com
 The World's Best Site Builder
 
 




___ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com


Re: [JOB] Perl Programmer for large-scale Apache/mod_perl development

2005-06-20 Thread Ian D. Stewart

Dodger wrote:


If you're unwilling to let a programmer telecommute, you're still in the
dark ages, and I wouldn't want to work for you anyway.

I am amazed by the technology companies that think that programming
requires physical presence in the 21st century. Yeesh.

 

This is only true if you restrict the definition of programming to the 
actual process of writing/testing/debugging source code, checking it 
into your source management repository, etc.  It has been my personal 
experience that alot of the design breakthroughs happen as a direct 
result of informal conversations in the hallways, around the 
watercooler, in the smoking area, etc.  This sort of dynamic interaction 
just isn't possible in a telecommute situation.


Then there is the question of project management.  The amount of 
personal interaction required for proper project management is an order 
of magnitude greater than that required for development.


It has been my personal experience that telecommuting works best on 
short-term contracts (3-6 months) when bringing in talent that brings a 
skillset to the table that's not available in the local market.  Given 
the New York City market, I doubt there are many positions that would 
meet that criteria.  Restricting the job search to the local market also 
helps to avoid the conflicts that invariably arise when working with 
folks from very different cultural mindsets.



Ian


Re: Tied Apache::Session objects in AxKit::XSP::BasicSession

2005-06-20 Thread Kjetil Kjernsmo
On Friday 17 June 2005 06:00, Perrin Harkins wrote:
  I currently assign to pnotes like this:
      $r-pnotes(session = tied %session);

 No, you want the hash, not the object it's tied to:
 $r-pnotes('session' = \%session);

 Then use it like this:
 my $session_ref = $r-pnotes('session');
 $session-{'key'} = 'value';

Uh, actually, that's what I did in my first version, as it is the intuitive 
thing to do, and couldn't get it to do what it should... To me, it looked as 
if just the hash was passed, not the tied object... Of course, it could be 
that I did something else entirely wrong 

Since I was going to retrieve this session reference from pnotes maaany times 
in the code, I created a little sub for it, perhaps that wasn't such a good 
idea...? But I think it looked as if only the hash was passed allready in 
there, so I don't think that was the problem... No alarm bells are going off 
for me here, any for you?

Cheers,

Kjetil 


Re: Tied Apache::Session objects in AxKit::XSP::BasicSession

2005-06-20 Thread Perrin Harkins
On Mon, 2005-06-20 at 20:22 +0200, Kjetil Kjernsmo wrote:
  No, you want the hash, not the object it's tied to:
  $r-pnotes('session' = \%session);
 
  Then use it like this:
  my $session_ref = $r-pnotes('session');
  $session-{'key'} = 'value';
 
 Uh, actually, that's what I did in my first version, as it is the intuitive 
 thing to do, and couldn't get it to do what it should... To me, it looked as 
 if just the hash was passed, not the tied object... Of course, it could be 
 that I did something else entirely wrong 

You just need to call tied() on the hash to get the object at any time.

 Since I was going to retrieve this session reference from pnotes maaany times 
 in the code, I created a little sub for it, perhaps that wasn't such a good 
 idea...? But I think it looked as if only the hash was passed allready in 
 there, so I don't think that was the problem... No alarm bells are going off 
 for me here, any for you?

I'm not sure what you're talking about here.  Show me the code you're
referring to.

- Perrin



basic question

2005-06-20 Thread Tony Allen

Hello,
I have a fairly basic question as I'm not quite sure I get the big 
picture on modules.  Maybe someone can give me a better picture. 


I'll use 3 example modules: Main, Main::Config, and Main::HTML
Main is the main object which contains the variables needed (like 
$main-{config}) which it needs to share with HTML, so HTML can read 
$main-{config}-{dbhost} for example.


This is how I understand it...

So in Main,  I say main is an exporter so I can give the allowance for 
other modules to import $main.  (I understand EXPORT_OK, but what is 
EXPORT for? and if there's nothing needed to EXPORT, then is that line 
necessary?)

Main.pm
BEGIN {
   use Exporter ();

   @Main::ISA = qw/Exporter/;
   @Main::EXPORT = qw();
   @Main::EXPORT_OK = qw/ $main /;
}

use Main::Config;
use Main::HTML qw( get_template $main )

sub new{
  #for simplification I'll leave the regular class/bless stuff out
  $self-{config}= Main::Config-new();
}
-

The Main::Config module just has a simple new function which sets 
$self-{dbname}, etc. and returns $self.


Then Main::HTML I want to be able to interact with all of the $main 
variables including the config.  So I have this:

HTML.pm-
BEGIN {
   use Exporter ();
   @Main::HTML::ISA = qw(Exporter);
   @Main::HTML::EXPORT = qw();
   @Main::HTML::EXPORT_OK = qw(get_template $main);

}

use Main qw( $main );

sub get_template{
 $dbname = $ems-{config}-{'dbname'};
  print DB name is $dbname\n;
}

-
But dbname doesn't print out.  So I guess my understanding of how the 
importing exporting works.

This is what I want, I think...
---
| Main-uses-   |
| | HTML ||
|  $main-- | \$main ||
| --   |
--
Any words of wisdom?
Thanks!
Tony


RE: Getting lots of redefined statements in the error_log

2005-06-20 Thread Perrin Harkins
On Mon, 2005-06-20 at 14:06 -0600, Aaron Scott wrote:
 FWIW, I've noticed redefined subroutine errors when I require a single
 package using two different statements.  E.g., 
 
 --- File1.pm
 
 use MyPackage;
 
 --File2.pm
 
 use SomeDir::MyPackage;
 
 
 
 Loading File2 when File1 has already been loaded seemed to cause a
 redefined subroutine.

Huh?  Are you saying that MyPackage and SomeDir::MyPackage are somehow
the same file?  Or that they actually declare the same package name?  Or
don't declare any package name at all?

- Perrin



Apache2::Upload Issue

2005-06-20 Thread D. Hageman


I have a mod_perl module that I wrote for mod_perl 1.x that would accept 
an image upload from VBA script running under Microsoft Access.  I then 
converted it to use mod_perl 2.0.1 and Apache2::Upload 2.0.5.  It seems to 
work fine using a web browser, but it doesn't appear to like my upload 
from the VBA script.  The error message I get from the Apache2::Upload is 
End of file found.


I have dumped the various posts in hopes to find a discrepancy, but I have 
not found anything different between the two other then the web browser is 
uploading using binary ... and the VBA script uses base64.  Listed below 
is the various headers and body from the VBA post.  Can anyone spot an 
issue in my multpart/form-data construction?  Anyone have suggestions?


Headers:

Content-Type: multipart/form-data; boundary=AaB03x
Content-Length: 3543
Accept: */*
User-Agent: Mozilla/4.0 (compatible; Win32; WinHttp.WinHttpRequest.5)
Host: devel.eecs.ku.edu
Connection: Keep-Alive


Body:

 --AaB03x\r\nContent-Disposition: form-data; name=image; 
filename=C:\\Documents and Settings\\dhageman\\My 
Documents\\jayhawk.png\r\nContent-Type: 
image/jpeg\r\nContent-Transfer-Encoding: 
base64\r\n\r\niVBORw0KGgoNSUhEUgAAADcAA


snip Base64 Encoded data/

ggRIASUVORK5CYII=\r\n--AaB03x--


Any insight would be appreciated!


//\\
||  D. Hagemandhageman@dracken.com  ||
\\//


RE: Getting lots of redefined statements in the error_log

2005-06-20 Thread Aaron Scott
 Huh?  Are you saying that MyPackage and SomeDir::MyPackage are somehow
 the same file?  Or that they actually declare the same package name?
Or
 don't declare any package name at all?
 
 - Perrin

For a file /path/to/SomeDir/MyPackage.pm, if I 'use MyPackage;' in one
file, then subsequently 'use SomeDir::MyPackage' in another file, the
second 'use' generates redefined subroutine errors.

-Aaron





RE: Getting lots of redefined statements in the error_log

2005-06-20 Thread Perrin Harkins
On Mon, 2005-06-20 at 16:04 -0600, Aaron Scott wrote:
 For a file /path/to/SomeDir/MyPackage.pm, if I 'use MyPackage;' in one
 file, then subsequently 'use SomeDir::MyPackage' in another file, the
 second 'use' generates redefined subroutine errors.

But those should be two totally separate files with separate package
declarations at the top.  It doesn't make sense that there would be any
namespace collisions.

- Perrin



RE: Getting lots of redefined statements in the error_log

2005-06-20 Thread Aaron Scott
 
 But those should be two totally separate files with separate package
 declarations at the top.  It doesn't make sense that there would be
any
 namespace collisions.
 
 - Perrin

I can duplicate it with the following simple example:

-- mod_perl.conf

PerlRequire conf/startup.pl

Location /loc 
  SetHandler perl-script
  PerlResponseHandler MyHandler
/Location


-- startup.pl

use SomeDir::MyPackage;



-- /path/to/SomeDir/MyPackage.pm

package SomePackage;

sub foo { return 1; }

1;


-- /path/to/MyHandler.pm

require AnotherPackage;


-- /path/to/SomeDir/AnotherPackage.pm

package AnotherPackage;

use SomePackage;

1;

---

The end result is that %INC has entries:

   SomeDir/MyPackage.pm = /path/to/SomeDir/MyPackage.pm,
   MyPackage.pm = /path/to/SomeDir/MyPackage.pm

and my log file has

Subroutine foo redefined at /path/to/SomeDir/SomePackage.pm line 3




Re: [JOB] Perl Programmer for large-scale Apache/mod_perl development

2005-06-20 Thread Philip M. Gollucci

Ian D. Stewart wrote:


Dodger wrote:


If you're unwilling to let a programmer telecommute, you're still in the
dark ages, and I wouldn't want to work for you anyway.

I am amazed by the technology companies that think that programming
requires physical presence in the 21st century. Yeesh.

 

This is only true if you restrict the definition of programming to the 
actual process of writing/testing/debugging source code, checking it 
into your source management repository, etc.  It has been my personal 
experience that alot of the design breakthroughs happen as a direct 
result of informal conversations in the hallways, around the 
watercooler, in the smoking area, etc.  This sort of dynamic 
interaction just isn't possible in a telecommute situation.


Then there is the question of project management.  The amount of 
personal interaction required for proper project management is an 
order of magnitude greater than that required for development.


It has been my personal experience that telecommuting works best on 
short-term contracts (3-6 months) when bringing in talent that brings 
a skillset to the table that's not available in the local market.  
Given the New York City market, I doubt there are many positions that 
would meet that criteria.  Restricting the job search to the local 
market also helps to avoid the conflicts that invariably arise when 
working with folks from very different cultural mindsets.


I always liked the companies... like my current one that pretty much say 
you have to come to work as a programmer... specifically for the dymanic 
interactions list above, but hey, you don't feel like comming 1 day a 
week or every other week, just let us know and work from home.


I'd say I do this about 1-2 times a month and it works great.


--
END 
-

   What doesn't kill us, can only make us stronger.
  Nothing is impossible.

Philip M. Gollucci ([EMAIL PROTECTED]) 301.254.5198
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Developer / Liquidity Services, Inc.
http://www.liquidityservicesinc.com



Re: Apache2::Upload Issue

2005-06-20 Thread Joe Schaefer
D. Hageman dhageman@dracken.com writes:

 ggRIASUVORK5CYII=\r\n--AaB03x--
 ^^
Missing an \r\n there I think.


-- 
Joe Schaefer



Re: [JOB] Perl Programmer for large-scale Apache/mod_perl development

2005-06-20 Thread Greg Sabino Mullane

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


 I am amazed by the technology companies that think that programming
 requires physical presence in the 21st century. Yeesh.

I'm all for it. Among other good reasons, requiring a physical presence
is a great insurance against being outsourced.

- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200506202136
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iD8DBQFCt29kvJuQZxSWSsgRAjitAJ0UyqMx998Rri6NsepgMgDlzUMSmACg9NMD
RSmMLfTNrdhkELN3EbeGplw=
=f3mk
-END PGP SIGNATURE-




Re: [JOB] Perl Programmer for large-scale Apache/mod_perl development

2005-06-20 Thread Foo Ji-Haw
Not just being outsourced. But I don't think even with today's 
technologies you can create better team dynamics than in physical 
presence with the rest of the guys. Unless you are a super programmer 
who can change the world just by being in the basement 8x5, team play 
(not just with the co-developers, but also with the marketing/ sales 
team as well) is pivotal.



Greg Sabino Mullane wrote:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


 


I am amazed by the technology companies that think that programming
requires physical presence in the 21st century. Yeesh.
   



I'm all for it. Among other good reasons, requiring a physical presence
is a great insurance against being outsourced.

- --
Greg Sabino Mullane [EMAIL PROTECTED]
PGP Key: 0x14964AC8 200506202136
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-BEGIN PGP SIGNATURE-

iD8DBQFCt29kvJuQZxSWSsgRAjitAJ0UyqMx998Rri6NsepgMgDlzUMSmACg9NMD
RSmMLfTNrdhkELN3EbeGplw=
=f3mk
-END PGP SIGNATURE-


 



Re: Apache2::Upload Issue

2005-06-20 Thread Dorian Taylor
uh, hate to bring up a no-brainer, but just out of curiosity, is
the Content-length request header accurate for the encoded payload
*after* it's encoded? just on the off chance that libapreq2 is
stricter than libapreq1, an error like end of file reached would
occur if there was extraneous data after the buffer of Content-Length
size was filled. i'd make sure to double, nay, triple-check that
value in the vb.

On Mon, Jun 20, 2005 at 09:07:57PM -0400, Joe Schaefer wrote:
 D. Hageman dhageman@dracken.com writes:
 
  ggRIASUVORK5CYII=\r\n--AaB03x--
  ^^
 Missing an \r\n there I think.
 
 
 -- 
 Joe Schaefer
 


how to run a startup script once (redux)

2005-06-20 Thread Foo Ji-Haw

Hello guys,

I've asked this before, but I hope to follow through on the suggestions 
contributed by you guys.


You know that Apache2 restarts itself, so a PerlRequire or a 
PerlPostConfigRequire will be run more than once. A friendly mailing 
list reader suggests using Apache2::ServerUtil::restart_count(). Good 
idea. But in the Windows environment, I get:

1
2
1
2

if I use the following script:
open (OUTFILE,'debug.txt');
print OUTFILE Apache2::ServerUtil::restart_count().\n;
close OUTFILE;

This seems to suggest the following:
1. The script is run 4 times instead of 2 (!!!)
2. There are two independent interpreters at work, hence the revert back 
to 1 on the third line.


My sneaky plan is to have the startup script start off an independent 
single-threaded process (if this is possible). Perhaps something like a 
scheduler. A singleton. Obviously I cannot simply put it as-is in the 
PerlRequire script, since that will shoot off 4 schedulers. Also, a 
restart might mess things up.


Has anyone done this before? Appreciate your ideas!




RE: Getting lots of redefined statements in the error_log

2005-06-20 Thread Perrin Harkins
On Mon, 2005-06-20 at 16:45 -0600, Aaron Scott wrote:
 I can duplicate it with the following simple example:
 
 -- mod_perl.conf
 
 PerlRequire conf/startup.pl
 
 Location /loc 
   SetHandler perl-script
   PerlResponseHandler MyHandler
 /Location
 
 
 -- startup.pl
 
 use SomeDir::MyPackage;
 
 
 
 -- /path/to/SomeDir/MyPackage.pm
 
 package SomePackage;
 
 sub foo { return 1; }
 
 1;
 
 
 -- /path/to/MyHandler.pm
 
 require AnotherPackage;
 
 
 -- /path/to/SomeDir/AnotherPackage.pm
 
 package AnotherPackage;
 
 use SomePackage;
 
 1;
 
 ---
 
 The end result is that %INC has entries:
 
SomeDir/MyPackage.pm = /path/to/SomeDir/MyPackage.pm,
MyPackage.pm = /path/to/SomeDir/MyPackage.pm
 
 and my log file has
 
 Subroutine foo redefined at /path/to/SomeDir/SomePackage.pm line 3

This example is kind of broken, but I'm guessing you meant to say use
MyPackage rather than use SomePackage?  And maybe package
SomePackage; was supposed to say package SomeDir::MyPackage?

The only way I can imagine this happening is if you put '.' in your @INC
in addition to '/path/to' and are this calling the same file by two
different names.  Of course that will redefine your subs.

Sorry if I'm misunderstanding, but this doesn't look like a mod_perl
issue to me.

- Perrin



Re: [JOB] Perl Programmer for large-scale Apache/mod_perl development

2005-06-20 Thread Perrin Harkins
Guys, I understand that you're interested in discussing the dynamics of
programming teams and hiring approaches, but it really isn't on-topic
for this list.  It isn't even specifically about Perl.  Maybe one of you
could start a thread on http://discuss.joelonsoftware.com/?biz and post
the URL here for others who want to join?

- Perrin



Re: how to run a startup script once (redux)

2005-06-20 Thread Perrin Harkins
Have you tried putting a use Module inside of a Perl section in the
config or in your startup.pl and testing how many times that gets run?

 My sneaky plan is to have the startup script start off an independent 
 single-threaded process (if this is possible).

This would probably be more easily done by modifying the apachectl shell
script to start your process after starting httpd.

- Perrin



Re: [JOB] Perl Programmer for large-scale Apache/mod_perl development

2005-06-20 Thread Garrison Hoffman
Perrin Harkins wrote:
 Guys, I understand that you're interested in discussing the dynamics of
 programming teams and hiring approaches, but it really isn't on-topic
 for this list.  It isn't even specifically about Perl.  Maybe one of you
 could start a thread on http://discuss.joelonsoftware.com/?biz and post
 the URL here for others who want to join?

If the parent post is considered on-topic, why would you want to
discourage discussion, even if it becomes a wee bit tangential?

I'll admit that I'm naturally paranoid, but I'd be far less suspicious
if you didn't work for the company in question and hadn't already posted
in this thread.

-gh
-- 
__
 Garrison Hoffman  (718) 210-3445
 Codefix Consulting, Inc. http://codefix.net/