Storable segfaulting

2002-02-18 Thread raptor

hi,


I have object that inherit Storable... so I store the object.. later
when I try to retrieve the object I get :

Segmentation fault (11)

Mandrake 8.1, Storable 1.012

Can u help me .

raptor
[EMAIL PROTECTED]








Re: performance coding project? (was: Re: When to cache)

2002-01-31 Thread raptor

One memory  speed saving is using global VARS, I know it is not
recomended practice, but if from the begining of the project u set a
convention what are the names of global vars it is ok..F.e. I'm using in
all DB pages at the begining :

our $dbh = dbConnect() or dbiError();

See I know (i'm sure) that when I use DB I will always initialize the
var. One other example is (ASP.pm):

our $userID = $$Session{userID};
my $something = $$Request{Params}{something}

This is not saving me memory, but shorten my typewriting especialy if it
is used frequently or if I need to change FORM-param from something to
anything..etc..

I think in mod_perl world we are about to search MEMORY optimisation
RATHER speed optimisation... :)


raptor
[EMAIL PROTECTED]




Re: mod_perl vs. C for high performance Apache modules

2001-12-19 Thread raptor

...
 work on Mars.  The investor claims to have evaluated Perl vs. C years ago, 
 to have witnessed that every single hit on the webserver under mod_perl 
 causes a CPU usage spike that isn't seen with C, and that under heavy load 
]- this seems to me like non-compiled script, module or eventually
running under Apache::PerlRun :))





Setting Perl-stuff inside Perl section

2001-10-05 Thread raptor

hi,

How can I set in perl section, say :

PerlModule Blah.pm
PerlSetVar XXX On
PerlSetVar YYY Off

and similar...

$VirtualHost{address} = {
PerlModule = 'Blah.pm',
PerlSetVar = { XXX = 'On', YYY = 'Off' }
};
!!?!

Thanx
=
iVAN
[EMAIL PROTECTED]
=




Set VirtualHost IP-Address

2001-10-04 Thread raptor

hi,

Can I set the IP Address of VirtualHost via script from inside Perl
section in httpd.conf !?
Example?
Thanx
=
iVAN
[EMAIL PROTECTED]
=




site copies under the one httpd

2001-09-30 Thread raptor

hi,

I have a site, it has two copies one that is on the Dev server (dev-copy)
and the other Production one.
So what I want ?
I want to have the Production site on my dev machine ... ( i'm arraging that
the DB and all dependant stuff get copied after some time passes). But AS U
KNOW I can't have two different modules with the same name under one
mod_perl even if they are on different virtual-hosts, 'cause they get
precompiled under the same name...
Is the only solution to use differnt mod_perl processes to handle this
situation ?!!
=
iVAN
[EMAIL PROTECTED]
=




Dynamic Virtualhost !?

2001-09-19 Thread raptor

hi,

Anyone to know a way to set the host virtual-address dinamcly i.e.depending
on what is the dynamic address I get by the pppd deamon when I connect !?!
=
iVAN
[EMAIL PROTECTED]
=




Re: my OR our that is the question ?!

2001-08-10 Thread raptor

Note that there are _no_ nested subroutines in Perl ..So what you
basicaly have are two global subroutines with
 local values. You get the closure for the first invocation. But it's
 not the same variable anymore.

]- Now understand  thanx alot
=
iVAN
[EMAIL PROTECTED]
=




my OR our that is the question ?!

2001-08-09 Thread raptor

hi,

I have the following situation ... it is not big issue but i'm interested
why this happen .. so here is it :

my $ID = 555;
print $ID;

sub blah {
..
 {
local $$dbh{AutoCommit} = 0;
   eval  {
   local $$dbh{RaiseError} = 1;
   $ID =  selectrow query;#say it returns 111

   };
.
 };
 print $ID;

};#end blah

print $ID

So this shortened example prints sometimes :

555
111
111- correct

rarely  :

555
111
555 --- not correct

OK... this seemed to me like uninitialised variable ... or there is special
behaviour when using lexical-var insde eval 
but the problem dissappeared when I declared it like that :

our $ID;


Could someone explain me why this happen.
=
iVAN
[EMAIL PROTECTED]
=





Re: my OR our that is the question ?!

2001-08-09 Thread raptor

thanx,
Yes I see ... but I was interested WHY when we are in nested subroutines ...
the inner-one will see the lexical var only the first time !! I mean the
REASON of this perl behaviour ! It it closer/easier to think of it that
my-vars  are visible all the time in their inner scopes (except if u are
going outside the scope of the variable itself) .. what I mean if I'm not
very clear ... it is easy to think that :

{
$var is not visible here

{
 my $var = 5;
   { { sub blah {{ sub xxx{ $var is visible here all the time, not just the
first one } } } } }
}

$var is not visible here
}


On the other hand 'our' and use vars make a global var which as stated
anywhere is not a good programming practice (only in some special cases,
this is not one of them I think :)   / i mean use global where U need
global use local var where u need local/ ).   {note : not local-op }
So I'm using ASP.pm which compiles all scripts into one package (by
default) so the purpose of  lexical-scope splitconquer  is no more
valid... I mean that the variable 'say $ID into script blah.pl I want to be
differnt from the $ID var into xxx.pl i.e. I don't want this :

package AllCompiledScripts;

our $ID;

sub compiled_blah {
  $ID =15;#or if u like our $ID = 15
sub inner_blah{   };
};

sub compiled_xxx {
  $ID =555
sub inner_xxx{   };
};
1;

I want this :

package AllCompiledScrips;

compiled_blah ::  $ID is not visible here
compiled_xxx ::  $ID is not visible here

sub compiled_blah {
  my $ID =15
sub inner_blah{ compiled_blah ::  $ID visible here but compiled_xxx ::
$ID not visible  };
};

sub compiled_xxx {
  my $ID =555
sub inner_xxx{ compiled_xxx ::  $ID visible here  but compiled_blah ::
$ID not visible };
};

compiled_blah ::  $ID is not visible here
compiled_xxx ::  $ID is not visible here

1;


So what is the REASON for this copy-on-first-call behaviour.(there have to
be some reason, if i'm not totaly dull to see it )

Thanx alot for your attention
=
iVAN
[EMAIL PROTECTED]
=


  rI have the following situation... it is not big issue but
  ri'm interested why this happen...
  r
  rmy $ID = 555;
  rsub blah {
  r...
  r$ID =  selectrow query;
  r...
  r}
 
  This is, in fact, a big issue. You should see a message in your error
log
  shared variable $ID will not stay shared. You should not use a my
  variable defined at the top level of your Apache::Registry script in a
  subroutine. See this entry in the mod_perl guide:
 
 
http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S
 
  The workaround is to make $ID a package global (use vars qw($ID)).

 With Perl 5.6, the following are roughly equivalent:

   use vars qw($ID);

   our $ID;

 However, you will need to put the `our' declaration within the block
(which
 may happen implicitely with Apache::Registry).

 So (pre-5.6):

   use vars qw($ID);

   sub foo {
   $ID = shift;
   }

 But (= 5.6):

   sub foo {
   our $ID = shift;
 }




Re: my OR our that is the question ?!

2001-08-09 Thread raptor

didn't thought of that :)), but what will broke if the var is
copied/aliased every time not just the first time ...

I mean the call to closure make a new instance of the sub()  every time
isn't it ?!?
! I see the closures get bound every-time , but non closures only the
first time !
But still can figure out ...if I'm thinking correctly .

- closure makes a new instance of of itself and get the latest value of
outer-lexical variable in its private space.
- there is no reason why normal sub() can get/alias! this value every time,
this doens't broke the closure behaviour (i.e. normal sub() doesn't need to
make its own private copy but use the outer-scope-lexical  ) or I'm wrong
again.
=
iVAN
[EMAIL PROTECTED]
=




Re: Just while we are so nicely [OT]: SQL Search Results in pages

2001-08-02 Thread raptor

 This may be of interest:

 http://search.cpan.org/doc/TIMB/DBI_Talk5_2001/sld059.htm

]- Where is $h-{FetchHashKeyName}, I didn't found it even in the source
perl -m DBI my version is 1.18

 Tim.




Re: What counts as a real DBMS?

2001-08-01 Thread raptor

ok my 5c,

My vote is for Interbase. Why ?

+small runtime size
+zero administration
+FK with CASCADE
+I think it runs on more platforms than any other DB
+SUSPEND in stored procs
+stored procs can be used in FORM clause
+can run on less-powerfull PC's

Personaly I've used it on Win95, Win98, WinNT and Linux..

-no LIMIT and/or TOP

I had tried a litle bit both MySQL and PostgreSQL..

-the thing I hated in PostgreSQL was that u can't use VIEWS with agregating
functions 'cause of the way they are/was implemented ... don't know if it is
already corrected in newer versions..
-does it support FK already ?!? (PSQL)
+ InterBase,  PostgreSQL are multiversioning engines.. so they don't need
transaction log  (anyone with expirience with MS SQL transaction log
:) )


so I think InterBase counts as a REAL DB. :)
=
iVAN
[EMAIL PROTECTED]
=





Re: Buffering Output

2001-07-31 Thread raptor

Anybody know if exist some module how CGI::Out for buffering output in CGI
script ?

]- The other approach if  U don't want to append to var...then U can do
something like this :

my $buffer;
sub xprint { $buffer .= @_ };

possibly U will want to move this code into separate module...!!

then use xprint instead of print... and on the end of the script just :

print $buffer;

I also often direct all my output like errors,debug messages etc... trought
similar function... this aproach is also very useful 'cause if for example
want later to switch to other envoirment u need to correct just one function
or if U use Template system...

HtH
=
iVAN
[EMAIL PROTECTED]
=





cached value !!

2001-07-26 Thread raptor

hi,

I have the following problem... a module/object that use a callback
func..example :

use Blah;
my $obj = new Blah(...);

..later on ...

my $firstcall = 1;
sub checkSomething {
if ($firstcall) {$firstcall = 0; return 0}
   code ...
};

$$obj{checkCode} = \checkSomething;

$obj-callSomemethod();

the problem is that during the invocations of the script the $firstcall
sometimes stays 0, instead to be initialised to 1 on every invocation of
the script  any ideas how can I cure this 

Thanx alot in advance...
=
iVAN
[EMAIL PROTECTED]
=




Re: cached value !!

2001-07-26 Thread raptor

thanx alot I also thought it has to be closure... but didn't done it in the
right way...
i.e. i was doing this way :) :

{
 my $firstcall = 1;
 sub checkSomething {
 if ($firstcall) {$firstcall = 0; return 0}
code ...
 };
}

but it has to be anonymous ...:)


 raptor wrote:

  hi,
 
  I have the following problem... a module/object that use a callback
  func..example :
 
  use Blah;
  my $obj = new Blah(...);
 
  ..later on ...
 
  my $firstcall = 1;
  sub checkSomething {
  if ($firstcall) {$firstcall = 0; return 0}
 code ...
  };
 
  $$obj{checkCode} = \checkSomething;
 
  $obj-callSomemethod();
 
  the problem is that during the invocations of the script the $firstcall
  sometimes stays 0, instead to be initialised to 1 on every
invocation of
  the script  any ideas how can I cure this 
 
  Thanx alot in advance...
  =
  iVAN
  [EMAIL PROTECTED]
  =

 cf manual:
 http://perl.apache.org/guide/perl.html#my_Scoped_Variable_in_Nested_S

 --
 My mother always used to tell me, The early bird gets the worm.
 The message seemed pretty clear to me: If you sleep late, you're
 a lot less likely to be killed by a bird.
 -- Elliott Downing







http://dailynews.yahoo.com/h/zd/20010723/tc/it_bugs_out_over_iis_security_1.html

2001-07-23 Thread raptor

http://dailynews.yahoo.com/h/zd/20010723/tc/it_bugs_out_over_iis_security_1.
html




Re: Post processing Perl output through PHP

2001-07-15 Thread raptor


 Ironically, having tried the suggestion from Darren, I discover that I
don't have
 LWP installed. My sysadmin however, will install anything for me as long
as
 I provide him with an RPM for it.

 I don't mean to sound lazy, and I have just checked rpmfind.net, but I
can't
 quickly put my hands on an rpm which includes LWP::Simple for Red Hat 7.0

]- get checkinstall and install LWP on your computer as stated in the
checkinstall docs and it will make the RPM for U :)
http://mayams.net/~izto/checkinstall-en.html
after u install checkinstall u have to do something like this :

perl Makefile.pl
make
make test
checkinstall make install

HtH
=
iVAN
[EMAIL PROTECTED]
=






[ASP] FileUploadMax -- FileMaxUpload

2001-07-13 Thread raptor

hi,
FileUploadMax wrongly stated in ASP docs, U should use :

PerlSetVar FileMaxUpload  xxx

instead.
One more thing, does someone knows a way to capture the error, if the user
tries to upload bigger file than accepted.
So I can inform him.
Is it possible to set CGI::POST_MAX on a per request i.e. dynamicly as I
read in the dosc ASP.pm set this value every time before it calls CGI to
handle the request...

Thanx alot
=
iVAN
[EMAIL PROTECTED]
=




Re: [aliasing] Using mod_perl handlers for max speed?

2001-07-12 Thread raptor

!!! Is it possible to have  reference on the left side of the equation !!!
I've tried this to alias HASH :) but didn't succeeded...
sub {
 my \$hash = shift; # $_[0] is  \%myhash
};

Yes I know that there is aliasing : my *hash = \%{$hashref}..
And I see that here u use  : \$r-blah
...Never mind it is cute construct anyway. Do U have any benefit in speed
using it in this way ?!

PS. didn't u think that there must finaly alias keyword in perl
=
iVAN
[EMAIL PROTECTED]
=


 Files ~ (hello\.bench)
 Perl
# ModPerl Handler
  package Apache::bench;
  sub handler {
my(\$r) = shift;
\$r-content_type('text/html');
\$r-send_http_header();
\$r-print('Hello ');
\$r-print('World');
200;
  }
1;
 /Perl
 SetHandler perl-script
 PerlHandler Apache::bench
 /Files





!!!reevaluating part of the module

2001-07-10 Thread raptor

hi,

What I want is access from module to executed-at-the-moment script namespace
i.e.

the module  Utils.pm :

$abc.asp::buffer .= 'hello.';

the script xxx.asp :

use Utils;
use vars qw($buffer);
print $buffer

==

How can I do this. Currently I'm doing something like this :
the module  Utils.pm :
(export  $buffer)

our $buffered = 1;
our $buffer;
eval qq{ $buffer = '' };

sub _print {
 if ($buffered) { $buffer .= $_ for @_  }
  else  {  print $_ for @_ };
};

the script :
use Utils;
print $buffer

but this still doen't clear the buffer betwen different invocation of the
script..
tried also  :

eval q{ $buffer = '' };
AND
eval { $buffer = '' };

how can I achieve similar effect .. or I'm doing something wrong

PS. It seems to work only if into the script I'm clearing $Utils::buffer at
the begining of the script, but this is exactly what I don't want to do...
want this to be done from outside... code reuse i say :). It doesn't matter
too much to me where is the $buffer variable in Utils or in the script
name-space, I just don't want to clear it out manualy every time in the
script...


Thanx alot in advance
=
iVAN
[EMAIL PROTECTED]
=







Re: [CGI.pm] ASP.pm and multipart/form .. error

2001-07-10 Thread raptor

hi again,

I've made some tests and debuging, the problem seems to be in CGI module...
first of all in eg/file_upload.asp   this :

print $q-start_multipart_form();

returns this :

FORM METHOD= ENCTYPE=multipart/form-data

do U see no POST (the interesting thing is that $r-method returns GET in
this case i didn't knowed that :) ).. even when I make it manualy and put
debuging code into $Request object multipart handling

if($@) {
$self-{asp}-Error(can't use file upload without CGI.pm:
$@);
} else {
my %form;
my $q = $self-{cgi} = new CGI;
$self-{debug} = '--'.$q-param('xxx');# =
there is one more text field in the form named 'xxx'
for(my @names = $q-param) {
my @params = $q-param($_);
..

I get nothing into $$Request{debug}

SO CAN SOMEONE TELL ME FROM WHERE I CAN GET CGI with LOWER VESRION THAN 3.02
:(


Thanx alot
=
iVAN
[EMAIL PROTECTED]
=




 ivan wrote:
 
  hi there ,
 
  I encoutred a problem with ASP.pm (ver.2.17) and multipart form what is
  happening is that when I try to use file fields I get something like
this
  into the log
 
  [Mon Jul  9 23:20:22 2001] [error] [client 192.168.0.5] Invalid method
in
  request -7d11b8668d0668
  [Mon Jul  9 23:20:41 2001] [error] [client 192.168.0.5] Invalid method
in
  request -7d13c1268d0668
  [Mon Jul  9 23:21:41 2001] [error] [client 192.168.0.2] Invalid method
in
  request -7d17811a20
 
  if the form is normal (w/o enctype=multipart/form-data ) I'm getting
  normally data into $Request.. nothing is crashing just I'm getting
nothing
  into $Request collection...
 

 Can you get the ./site/eg/file_upload.asp example working from
 the distribution?  If so, see what's different about your script.
 I believe I'm running the same Apache + modperl now too, and I
 have never seen the problem you report, Apache 1.3.20, mod_perl 1.25

 BTW, from the error, it doesn't look like it has to do with Apache::ASP.
 Maybe someone from the modperl list will give you some better info
 specific to modperl.

 -- Josh




[Solved] ASP.pm and multipart/form .. error

2001-07-10 Thread raptor

hi,

I moved to CGI.pm 2.74 and everything is OK now :)
So be aware that u may have problems with the following config :
RedHat 7.1  + Apache 1.3.20/mod_perl 1.25, ASP.pm, CGI ver 3.x  

CGI 3.01 even gives error on /compilation test.
CGI 3.02 doesn't give this error

HtH
=
iVAN
[EMAIL PROTECTED]
=





Re: Want to work at a Game company?

2000-05-19 Thread raptor

On Thu, 18 May 2000, ___cliff rayman___ wrote:
 legitimate job offers from a reputable company are never spam.
 

especially if your salary is not more than ~$150-$200 per month :"(

sorry for the off-topic

iVAN
[EMAIL PROTECTED]



Re: [preview] Search engine for the Guide

2000-05-19 Thread raptor

hi,

very interesting. Search for : "statinc" returns nothing and the box get filled
with "tatinc" instead "statinc" ?!?!:")

this under KDE viewer, now will try netscape   ...!!



KHTTPD for static and Apache/mod_perl for dynamic??

2000-05-15 Thread raptor

hi,

My question is instead of using two Apache servers OR Apache+proxy scenario
(static vs dynamic pages) will it be possible to leave static pages to kHTTPD
and run only one APACHE server.
Did someone tried it...

Thanx
=
iVAN
[EMAIL PROTECTED]
=



Re: [RFC] XML/Apache Templating with mod_perl

2000-04-25 Thread raptor

Yeah that will be really cool... can you inform me about the progress on
this, if you made something ... I thought about something similar not exact but
some sort of processor to handle XML(XSLT) - HTML conversations +
some sort of caching tehnique, but I also like this approachsomething like
this will help easy integrate XML stuff in the current scheme of producing
final HTML

see ya
=
iVAN
[EMAIL PROTECTED]
=



mod_perl for BeOS ??

2000-04-20 Thread raptor

hi, someone to know is there a binary package of mod_perl for BeOS



Send directly to me : Apache - Linux vs BSD

2000-04-12 Thread raptor

hi,

Anyone with experience running Apache on both platforms any recomentation
pluses, minuses.
Send them directly to me not to the list. Not war's, I just need oppinions.
You can include Solaris too.

Thanx alot in advance
=
iVAN
[EMAIL PROTECTED]
=



PerlTransHandler and Files ~ .. sort of mapping

2000-04-07 Thread raptor

hi,

I was wondering how to map PerlTransHandler only for certain type of files.
( I'm doing URI rewriting not URI-filename translation ?!!)

Something like :
Location
 Files ~ "xml$"
   PerlTransHandler  Apache::MyHandler
 /Files
/Location

Yes I know this is wrong...can this be done in some other way ?

Thanx
=
iVAN
[EMAIL PROTECTED]
=



No Subject

2000-01-28 Thread raptor

hi,

Check this :")
http://www.fenrus.demon.nl/



Session

1999-12-15 Thread raptor

hi,

Is there Session module that has capability more like ASP::Session
rather than Apache::Session.(I mean hanlidng the cookies too, Joshua is
it easy to extract Session functionality from ASP as a standalone module
:")).
OR
what mostly the MASON people use to handle Sessions.

Thanx
=
[EMAIL PROTECTED]
=



LWP vs Netscape

1999-12-03 Thread raptor

hi,

If I put this on Location: bar on the Netscape browser, I get the result
of the search as expected (try it).
http://www.volunteermatch.com/results/results.jtmpl?zip=5radius=60when=30ongoing=bcategory=Everythingsubmit=Search



But If I try to do this via LWP package, I didn't get the result page,
but the FORM that is used to create this query(something is going
wrong). Why ?!?!? What also is nesecary to send to the Web server, some
Headers or what ?? Which ?
I even got this result if I try the same query via telnet ?

#!/usr/bin/perl
use LWP::UserAgent;
my $UA = new LWP::UserAgent;
#$UA-agent("Agent/007:)");

my $req = HTTP::Request-new(GET =
'http://www.volunteermatch.com/results/results.jtmpl?zip=5radius=60when=30ongoing=bcategory=Everythingsubmit=Search'
);
my $result = $UA-request($req);
print $req-as_string;
 if ($result-is_success)
  {
   $bb = $result-content . "BR\n";
   $bb =~ s/^.*body bg(.*)\/body.*$/$1/is;
   print $bb;
  }
   else {print "no success\n";}




THANX
=
iVAN
[EMAIL PROTECTED]
=



Query/Parse/Format/Display ?

1999-12-02 Thread raptor

hi,

I want to make the following :
1. Query a site ?
2. Get the results of the query in my script (we are still in Apache)
3. Exctract the information I need ?
4. Fomat it and send to the browser ?

Does someone made something similar. Example ?
Thanx in advance

=
iVAN
[EMAIL PROTECTED]
==



AGAIN - mod_rewrite escaping ???

1999-11-01 Thread raptor

hi,

I've tried :

RewriteMap  escape-map  prg:/path/to/file/escape.pl
RewriteRule ^(.*)\/index\.html$ /tohtml.pl?path=${escape-map:$1}

when the script is as follow for ex.:

$| = 1;
while() { s//_/g;  print $_};

or similar it doesn't work (more precisely if I use  or STDIN ?!?!)
If I use this :

$| = 1;
print "hello";

it works only the first time ?!?!
If I use :

RewriteMap  escape-map  int:toupper
RewriteRule ^(.*)\/index\.html$ /tohtml.pl?path=${escape-map:$1}

it works. But :

RewriteMap  escape-map  int:escape
RewriteRule ^(.*)\/index\.html$ /tohtml.pl?path=${escape-map:$1}

doesn't work ?!!!?
What I'm doing wrong ?
=
iVAN
[EMAIL PROTECTED]
=


 RewriteRule ^(.*)\/index\.html$/tohtml.pl?path=$1
 
 rewriten like this :
 
 /tohtml.pl?path=blahwlah
 
 and then in my script the result is that :
 
 QueryString("path") is equal to "blah", but not to "blahwlah".
 
 HOW to make escaping in RewriteRule ?

 I don't see any way to do this without recourse to an external rewrite engine.
 http://www.engelschall.com/pw/apache/rewriteguide/#ToC44.

 But, if you are already using mod_perl, you might as well ditch mod_rewrite
 and write your own PerlTransHandler for the URI. See Eagle book p.334,
 http://www.modperl.com/book/chapters/ch7.html#The_URI_Translation_Phase,
 better yet, buy the book and show your support.




Re: Precomplie ASP ?

1999-10-07 Thread raptor

Lionel Benhaim wrote:

]- add to your startup.pl file, something like this :

use Apache::ASP ();
Apache::ASP-Loader('/home/httpd/project/', "(asp|htm|html)\$");

You must have first in httpd.conf something like this :

PerlRequire /home/httpd/project/global/startup.pl

Or you can add it directly in httpd.conf :
Perl
Apache::ASP-Loader('/home/httpd/project/', '(asp|htm|html)$');
/Perl

HtH
=
iVAN
[EMAIL PROTECTED]
=


 Hi everybody,

 Please,
 I'm beginer in Apache and ASP on Linux.
 I would like to know how can i precompile or compile the ASP.
 I have seen  in the docs ASP the fonction Loader(), but i don't
 understand how to use it, and where i must put it.

 Thank you very much :)