RE: searching for files using perl

2003-04-02 Thread Lile, James AZ2 (VAW-115)
hello,
Quick question,
what does this line do?
push(@files,$File::Find::name) if (/$ending$/i);
I wrote a simalor script to find a certain file on my computer and the only
way I got it to work was by using this code in my WANTED sub
 if ( File::Find::name eq File::Find::dir/$file ) {
print "matches..."
}
that isn't the exact way it way written...
does the pushing of the array of @files do the same thing?
thanks for you time,
James Lile


-Original Message-
From: Peter Kappus [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 02, 2003 3:35 AM
To: Shawn Sharp
Cc: [EMAIL PROTECTED]
Subject: RE: searching for files using perl


Shawn Sharp wrote:
> I created the following code to search for extention .PBD files in the
> htdocs/PBD folder while using the apache webserver.  However it will only
> search in the cgi-bin folder for these files.  What am I doing wrong?

If you're just searching for files, this is probably a great opportunity to
use the File::Find module.  I reinvented the wheel about four times before I
discovered this one...d'oh!

oh yeah,perldoc Find::File


try this:

#!/usr/bin/perl -w
use File::Find;
use strict;
use warnings;   #HEY!  Do i need this with -w?  somebody tell me...

my $root = "C:/temp";   #directory to start from
my $ending = ".pbd";#extension to search for 
my @files;  #our list of found files

#go look for it...
#pass our subroutine for processing each file and the root dir
find(\&gotIt, $root);  

#print our list all pretty like, with linebreaks
print join("\n",@files);

sub gotIt{
push(@files,$File::Find::name) if (/$ending$/i);
}


-good luck.
pk


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Forcing a refresh from within a CGI script

2003-04-02 Thread Rob Dixon
Hi all.

I'm in the process of modifying an existing CGI script. There is a page of
HTML which has an anchor to the script which, when run, modifies the
HTML file which linked to it and redisplays it. At present this is done by
returning just the header line

Location: http://www.domain.com/referrer.htm

to the client after modifying the file.

Firstly, I'm not at all sure if this is the preferred way to force a refresh,
and secondly it doesn't always work as the client browser believes it has
a valid cached copy of the page and refuses to reload it.

Can someone help me towards a better solution?

Thanks,

Rob




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: form user interface issue

2003-04-02 Thread Hughes, Andrew
Okay, I think that I'm getting closer.  I've condensed my code so that it is
a little clearer.  






perl decision making code:

if ($choice eq "") {
checkemailform(); # displays form
}
elsif ($choice eq "check") {
checkemail(); # inserts the data
}

Are you suggesting this for the form?:







I took the name value out of the submit input tag and included a hidden
field that includes a the name choice and the value check, which is what I
logic code is looking for.  Do you think this is the correct path?

Thanks in advance.  I appreciate your "input."

Thanks,
Andrew  


-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 11:01 AM
To: Hughes, Andrew; [EMAIL PROTECTED]
Subject: Re: form user interface issue


That form probably has a submit button that has a parameter name="...".
The script might be checking for that param('...').

If the form is submitted by pressing the button, that parameter from the
submit button is sent to the server while if the form is submitted by
pressing enter from another form field, it is not, so the script will fail
when checking for it.

The solution is to put another hidden field like  and remove the name="..." parameter from the submit
tag.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Hughes, Andrew" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 01, 2003 6:31 PM
Subject: form user interface issue


I have a form that I am using to add data to a mysql database table.  I am
using a .pl scrtipt to generate the html.  I am using cgi.pm and param() to
insert the form data.  And, I am using to the print<

Insider's Advantage






function submitIt(form) {
if (!validEmail(form.check_email.value)) {
alert("Invalid AOLTW Business E-Mail Address.")
form.check_email.focus()
form.check_email.select
return false
}
}

function validEmail(check_email) {
invalidChars = " /:,;"

if (check_email =="") {
return false
}
for (i=0; i
-1) {
return false
}
}
atPos = check_email.indexOf("@",1)
if (atPos == -1) {
return false
}
if (check_email.indexOf("@",atPos+1) >
-1) {
return false
}
periodPos = check_email.indexOf(".",atPos)
if (periodPos == -1) {
return false
}
if (periodPos+3 > check_email.length)  {
return false
}
return true

} //end validEmail






  

  http://insidersadvantage.com/images/promotions/2003brochure/signup_head
.jpg" border="0">


  Please enter your work email address
below so that we may determine whether or not you are an E-Club member.



  *  Indicates a required
field.


  Work Email Address:
   
*


  
  


   

  



checkemailform

}

..snip3..

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



self refreshing web page question

2003-04-02 Thread Luinrandir Hernsen
I want to create a web page that calls on another web page and automatically
refresh the other webpage every minute. can I do this in JS alone? Perl
alone? or do I have to use both?

Thanks for the help, I just need to be pointed in a direction...

Lou


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Forcing a refresh from within a CGI script

2003-04-02 Thread Bob Showalter
Rob Dixon wrote:
> Hi all.
> 
> I'm in the process of modifying an existing CGI script. There is a
> page of HTML which has an anchor to the script which, when run,
> modifies the HTML file which linked to it and redisplays it. At
> present this is done by returning just the header line
> 
> Location: http://www.domain.com/referrer.htm
> 
> to the client after modifying the file.
> 
> Firstly, I'm not at all sure if this is the preferred way to force a
> refresh, and secondly it doesn't always work as the client browser
> believes it has a valid cached copy of the page and refuses to reload
> it. 
> 
> Can someone help me towards a better solution?

To prevent the client from using its cached copy, you'll need to have the
server send an Expires header with the .html page. This can be accomplished
by adding

   

in the  section of the .html file. (RFC 2616 specifies that clients
must treat an expires value of "0" as "already expired".)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: self refreshing web page question

2003-04-02 Thread Bob Showalter
Luinrandir Hernsen wrote:
> I want to create a web page that calls on another web page and
> automatically refresh the other webpage every minute. can I do this
> in JS alone? Perl alone? or do I have to use both?
> 
> Thanks for the help, I just need to be pointed in a direction...

You can have a page refresh itself by emitting a Refresh response header.

To have one page refreshing another you'll need to have the pages in
separate frames or windows and use JavaScript to trigger the refreshing.

I find the following site helpful for little JavaScript snippets for this
kind of thing:



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Why this perl error?

2003-04-02 Thread Octavian Rasnita
Hi all,

A CGI program made in Perl gives me a bad error and I don't know why nor how
to solve it.

The error is:
perl.exe - Application Error The instruction at "0x28068533" referenced
memory at "0x0004". The memory could not be "read". Click on OK to
terminate the program Click on CANCEL to debug the program OK Cancel

I am running Windows 2000, Apache 2.4 web server, and Perl 5.8.

I've discovered that each time I use the fork() function in a program where
I also use "use DBI", it gives me that error.

I have also tried to exec() another perl program that forks a subroutine,
but it gives me the same error.

Do you have any idea what could be the problem, or ... the solution for it?

Thanks.

Or, ... do I have other ways to for external programs?
I want to fork another perl program.

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Removing all \n in a text file.

2003-04-02 Thread Scot Robnett
By writing it this way:

open(OUTPUTFILE, ">". $outputFile);

the script thinks that you are trying to open a file called

>Out_input2.txt

with the "greater than" sign actually being part of the file name. But what
you want to do is open

Out_input2.txt

for writing, in which case the "greater than" sign, which means "open this
file for writing," needs to be contained inside the quotes.

open(OUTPUTFILE, ">$outputFile");


Scot R.
inSite



-Original Message-
From: Daniel Gross [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 1:07 PM
To: 'Scot Robnett'
Subject: RE: Removing all \n in a text file.


Hi Scot,

Thanks for your help. I am not sure in what way this code differs from
my previous one. Is the change in the open statement significant wrt to
how \n are read and written.


Thanks

Dani




-Original Message-
From: Scot Robnett [mailto:[EMAIL PROTECTED]
Sent: Tuesday, April 01, 2003 1:42 PM
To: Daniel Gross; [EMAIL PROTECTED]
Subject: RE: Removing all \n in a text file.


What if you made just this small change to your code?


my $INPUTFILEHANDLE;
my $OUTPUTFILEHANDLE;
my $outputFile = "Out_input2.txt"; # If this is not in the
   # same directory as your
   # script, make sure that
   # you use the full path

open (INPUTFILEHANDLE, "input.txt"); # When in doubt, full path

# This is what you had:
# open (OUTPUTFILEHANDLE, ">". $outputFile);
# Instead, I think you want

open (OUTPUTFILEHANDLE, ">$outputFile); # overwrites file
# open (OUTPUTFILEHANDLE, ">>$outputFile); # would append instead

while() {

  chomp $_; # just added $_ to make it
# explicit what we're chomping

  print OUTPUTFILEHANDLE $_;
}

close OUTPUTFILEHANDLE;
close INPUTFILEHANDLE;



# Scot R.
# inSite


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: The very un-useful 'premature end of script headers' error message

2003-04-02 Thread Scot Robnett
Not really. If your form allows uploads, your form allows uploads. That's
where DoS comes into play. Disguising the location of your code is a start,
but you still have to figure out what you're going to do if someone tries to
paste rogue code into your form or hit you with an obnoxiously large upload.
CGI.pm does have some provisions for this built in, and I highly recommend
its use for web forms as opposed to home-grown CGI. I believe many others on
the list recommend the same

Scot R.



Well, does it help that this code snippet we have been looking at is not in
a file with a .cgi or .pl extension, but in a .pm file being used by the
actual .cgi file that people would be posting to.  Jes' curious..
Thanks 4 All
Luke




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Removing all \n in a text file.

2003-04-02 Thread Bob Showalter
Scot Robnett wrote:
> By writing it this way:
> 
>   open(OUTPUTFILE, ">". $outputFile);
> 
> the script thinks that you are trying to open a file called
> 
>   >Out_input2.txt
> 
> with the "greater than" sign actually being part of the file name.
> But what you want to do is open
> 
>   Out_input2.txt
> 
> for writing, in which case the "greater than" sign, which means "open
> this file for writing," needs to be contained inside the quotes.
> 
>   open(OUTPUTFILE, ">$outputFile");

No. Those two forms are equivalent.

">$outputFile" actually compiles to ">" . $outputFile internally:

$ perl -MO=Terse,exec -e '">$outputFile"'
OP (0x80f6fe0) enter
COP (0x81025c0) nextstate
SVOP (0x80f6320) const  PV (0x8103490) ">"
SVOP (0x80f6ee0) gvsv  GV (0x8103430) *outputFile
BINOP (0x80f6f60) concat [1]
LISTOP (0x80f6fc0) leave [1]
-e syntax OK

$ perl -MO=Terse,exec -e '">" . $outputFile'
OP (0x80f6fc0) enter
COP (0x81025c0) nextstate
SVOP (0x80f6320) const  PV (0x8103490) ">"
SVOP (0x80f6f00) gvsv  GV (0x80f8210) *outputFile
BINOP (0x80f6f80) concat [1]
LISTOP (0x80f6fa0) leave [1]
-e syntax OK

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: searching for files using perl

2003-04-02 Thread Peter Kappus
for more info: perldoc File::Find

within your "wanted" sub the default variable $_ is set to the name of the
current filename within the current directory.

$File::Find::dir gives you the path of the current directory
$File::Find::name gives you the full path to the current file

(there are some others too, like $File::Find::topdir, topdev, topino,
topmode, and toplink)

SO
push(@files,$File::Find::name) if(/$ending$/i);


looks at the current filename ($_) and sees if it matches $ending at the end
of it... 
so if $ending eq "txt" it will match filenames that end with "txt" and be
case insensitive (/txt$/i)  

if it does match that regular expression, then it pushes the FULL path
($File::Find::name) onto our list of found files (@files)  so that we can
read from that list later if we want.

If you're only interested in printing the files that match once when you
find them, then just use

print "$File::Find::name\n" if(/^nameOfFile$/i);

or something similar...  Then,if you want, you could pipe the output of this
script to a text file or some other command to deal with your list of found
files

Hope this makes sense.  Read up on File::Find for more info.

cheers

-peter

-Original Message-
From: Lile, James AZ2 (VAW-115) [mailto:[EMAIL PROTECTED]

hello,
Quick question,
what does this line do?
push(@files,$File::Find::name) if (/$ending$/i);
I wrote a simalor script to find a certain file on my computer and the only
way I got it to work was by using this code in my WANTED sub
 if ( File::Find::name eq File::Find::dir/$file ) {
print "matches..."
}
that isn't the exact way it way written...
does the pushing of the array of @files do the same thing?
thanks for you time,
James Lile


-Original Message-
From: Peter Kappus [mailto:[EMAIL PROTECTED]

#!/usr/bin/perl -w
use File::Find;
use strict;
use warnings;   #HEY!  Do i need this with -w?  somebody tell me...

my $root = "C:/temp";   #directory to start from
my $ending = ".pbd";#extension to search for 
my @files;  #our list of found files

#go look for it...
#pass our subroutine for processing each file and the root dir
find(\&gotIt, $root);  

#print our list all pretty like, with linebreaks
print join("\n",@files);

sub gotIt{
push(@files,$File::Find::name) if (/$ending$/i);
}

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Why this perl error?

2003-04-02 Thread Peter Kappus
Hi teddy,

I ran into this exact same problem (on win2k using DBI and fork()) and
eventually gave up.  Alas.   Someone more knowledgable will have to give us
a definative answer but my primitive understanding is that fork() typically
uses the system's implementation of the fork() command and that Windows
doesn't have one :(

So, efforts have been made to implement it at the interpreter level with
limited success.  You might look into Win32::Process but I hear it's slow.
I do know that perl6 is supposed to have robust thread support natively, but
I don't know much about it.  (again...any gurus that can help us?)

check out:
http://aspn.activestate.com/ASPN/Mail/Message/perl-win32-porters/1178773
and
http://perlmonks.thepen.com/181655.html

There seems to be a lively discussion on threadding and forking, etc. right
here at perl.org on the perl-ithreads list.

here's the archive:
http://archive.develooper.com/[EMAIL PROTECTED]/msg88946.html

Please let me (and all of us) know if you get to the bottom of this...


Thanks and Good luck (we're all counting on you ;-)

-Peter

-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]
Subject: Why this perl error?

The error is:
perl.exe - Application Error The instruction at "0x28068533" referenced
memory at "0x0004". The memory could not be "read". Click on OK to
terminate the program Click on CANCEL to debug the program OK Cancel

I am running Windows 2000, Apache 2.4 web server, and Perl 5.8.

I've discovered that each time I use the fork() function in a program where
I also use "use DBI", it gives me that error.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



portability question...IIS Vs. Apache

2003-04-02 Thread Peter Kappus
Hey all,

Anyone move scripts between IIS and Apache or need to write scripts that
work on both?  The problem I'm facing is that IIS reports the current
working directory (CWD) as the root dir of the "application" as defined in
the IIS control panel while apache reports the CWD as the actual directory
of the script file itself.

This is a problem when including other files/modules...

For example, to include "/myApp/func.pl" from "/myApp/index.pl":

require "func.pl";  #works fine in Apache but not IIS
require "/myApp/func.pl";   #works for IIS

ditto for modules:

require "myMods::myModule.pm";  #works in Apache
require "myApp::myMods::myModule.pm";   #works in IIS


aarrggh.  I'd rather not add a big block like:

if(-e "func.pl"){
require "func.pl";
}else{
require "/myApp/func.pl";
}

at the top of every file and I don't even know if that would work...

Anybody got a more elegant solution? (other than "dump IIS" ;-)


Thanks!
-Peter


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Saving Content from previous pages

2003-04-02 Thread deb
Hey all,

I just subscribed to this list, so I hope I'm not asking something that has
been discussed recently...  

I'm using the CGI package to write a script.  I'm modeling my script off the
Perl Cookbook example script called, "chemiserie," using %States and using the
$Current_Screen methodology.

http://www.denison.edu/~docs/cookbook.examples/ch19/chemiserie

I've got two pages before the user submits the information for checking.
Everything works swimmingly

Everything, except under certain conditions, when the user uses the BACK arrow 
to see the previous (2nd) page, the textarea box has been cleared.  Now, this
doesn't happen if another textarea box, on the same page, has some
information in it.  Only if this box is the only box filled in (along with a
password box, which must be filled in in any case).

There's a lot of code, I'm not sure what would be useful to post, but maybe
someone can give me an idea on where to focus my efforts to figure this out.


Thanks,

deb

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



warning message

2003-04-02 Thread Christopher G Tantalo
Hello,
In a recent perl script I wrote, I have a procedure, read_config(),
which reads a
config file I have set up and sets a hash to what is in the file.  Now,
before you
mention it, I have stricts on and use the -w on the 1st line, and the
following
message appears.

main::read_config() called too early to check prototype at
./eleadtest.pl line 19.

What does this mean?  Code snippets of the procedure call, and the
procedure itself
are below.

#!/home/ctantalo/perl5/bin/perl -w
#
# Programmer: Chris Tantalo
#
# This program will call eleadsht.sqt and email the eleadsht.lis file
# based on the data in the dmg.eleadsht_parameters table
#
# $Version_id = "@(#) elead.pl [@@/main/dec02_corp_sup/1] >";

use strict;
use Mail::Sender;
use DBI;

# check to see if test machine(cad2) or production(sam)
my $node = `hostname`;
chomp $node;

our %hash;
read_config($node);


# the read_config procedure
sub read_config()
{
my $node = shift @_;
my $cfg_file = "";
my $key;
my $value;

$cfg_file = "/opt/appl/hrstmk/bin/elead.cfg" if($node eq "sam");

$cfg_file = "/usr/appl/cad/prod/hrstmk/bin/elead.cfg" if($node
eq "cad2");
open(CFG_FILE,"$cfg_file") ||die "cannot open $cfg_file for
reading:$!";

while()
{
next if($_ =~ /^#/);
($key,$value) = split(/=/,$_);
$hash{$key}=$value;
}

close(CFG_FILE);
}

TIA,
Chris

--
---
Just Your Friendly Neighborhood
_SPIDEY_
--
Anything added after this was added by my mail server and not me.
--


-
The information contained in this message may be privileged, confidential, and 
protected from disclosure. If the reader of this message is not the intended 
recipient, or any employee or agent responsible for delivering this message to the 
intended recipient, you are hereby notified that any dissemination, distribution, or 
copying of this communication is strictly prohibited. If you have received this 
communication in error, please notify us immediately by replying to the message and 
deleting it from your computer. 

Thank you. Paychex, Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: warning message

2003-04-02 Thread Ken Lehman
looks like you tried to call the sub before you defined it, try putting a
definition just below all the use statements or just move the whole sub up
there
-Ken

-Original Message-
From: Christopher G Tantalo [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 02, 2003 3:43 PM
To: [EMAIL PROTECTED]
Subject: warning message


Hello,
In a recent perl script I wrote, I have a procedure, read_config(),
which reads a
config file I have set up and sets a hash to what is in the file.  Now,
before you
mention it, I have stricts on and use the -w on the 1st line, and the
following
message appears.

main::read_config() called too early to check prototype at
./eleadtest.pl line 19.

What does this mean?  Code snippets of the procedure call, and the
procedure itself
are below.

#!/home/ctantalo/perl5/bin/perl -w
#
# Programmer: Chris Tantalo
#
# This program will call eleadsht.sqt and email the eleadsht.lis file
# based on the data in the dmg.eleadsht_parameters table
#
# $Version_id = "@(#) elead.pl [@@/main/dec02_corp_sup/1] >";

use strict;
use Mail::Sender;
use DBI;

# check to see if test machine(cad2) or production(sam)
my $node = `hostname`;
chomp $node;

our %hash;
read_config($node);


# the read_config procedure
sub read_config()
{
my $node = shift @_;
my $cfg_file = "";
my $key;
my $value;

$cfg_file = "/opt/appl/hrstmk/bin/elead.cfg" if($node eq "sam");

$cfg_file = "/usr/appl/cad/prod/hrstmk/bin/elead.cfg" if($node
eq "cad2");
open(CFG_FILE,"$cfg_file") ||die "cannot open $cfg_file for
reading:$!";

while()
{
next if($_ =~ /^#/);
($key,$value) = split(/=/,$_);
$hash{$key}=$value;
}

close(CFG_FILE);
}

TIA,
Chris

--
---
Just Your Friendly Neighborhood
_SPIDEY_
--
Anything added after this was added by my mail server and not me.
--


-
The information contained in this message may be privileged, confidential,
and protected from disclosure. If the reader of this message is not the
intended recipient, or any employee or agent responsible for delivering this
message to the intended recipient, you are hereby notified that any
dissemination, distribution, or copying of this communication is strictly
prohibited. If you have received this communication in error, please notify
us immediately by replying to the message and deleting it from your
computer. 

Thank you. Paychex, Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Why this perl error?

2003-04-02 Thread Octavian Rasnita
I guess it is a Perl 5.8 bug because this didn't happen in Perl 5.6.1.
Or, ... it might be a DBI module error, but I don't think so.


Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: "Peter Kappus" <[EMAIL PROTECTED]>
To: "'Octavian Rasnita'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, April 02, 2003 9:20 PM
Subject: RE: Why this perl error?


Hi teddy,

I ran into this exact same problem (on win2k using DBI and fork()) and
eventually gave up.  Alas.   Someone more knowledgable will have to give us
a definative answer but my primitive understanding is that fork() typically
uses the system's implementation of the fork() command and that Windows
doesn't have one :(

So, efforts have been made to implement it at the interpreter level with
limited success.  You might look into Win32::Process but I hear it's slow.
I do know that perl6 is supposed to have robust thread support natively, but
I don't know much about it.  (again...any gurus that can help us?)

check out:
http://aspn.activestate.com/ASPN/Mail/Message/perl-win32-porters/1178773
and
http://perlmonks.thepen.com/181655.html

There seems to be a lively discussion on threadding and forking, etc. right
here at perl.org on the perl-ithreads list.

here's the archive:
http://archive.develooper.com/[EMAIL PROTECTED]/msg88946.html

Please let me (and all of us) know if you get to the bottom of this...


Thanks and Good luck (we're all counting on you ;-)

-Peter

-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]
Subject: Why this perl error?

The error is:
perl.exe - Application Error The instruction at "0x28068533" referenced
memory at "0x0004". The memory could not be "read". Click on OK to
terminate the program Click on CANCEL to debug the program OK Cancel

I am running Windows 2000, Apache 2.4 web server, and Perl 5.8.

I've discovered that each time I use the fork() function in a program where
I also use "use DBI", it gives me that error.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: portability question...IIS Vs. Apache

2003-04-02 Thread Gunther Birznieks
IIS thinks the CWD is the root directory of the script alias. Just set 
up a script alias that points to the directory where the cgi actually is 
and you'll be fine.

Peter Kappus wrote:

Hey all,

Anyone move scripts between IIS and Apache or need to write scripts that
work on both?  The problem I'm facing is that IIS reports the current
working directory (CWD) as the root dir of the "application" as defined in
the IIS control panel while apache reports the CWD as the actual directory
of the script file itself.
This is a problem when including other files/modules...

For example, to include "/myApp/func.pl" from "/myApp/index.pl":

require "func.pl";#works fine in Apache but not IIS
require "/myApp/func.pl"; #works for IIS
ditto for modules:

require "myMods::myModule.pm";#works in Apache
require "myApp::myMods::myModule.pm"; #works in IIS
aarrggh.  I'd rather not add a big block like:

if(-e "func.pl"){
require "func.pl";
}else{
require "/myApp/func.pl";
}
at the top of every file and I don't even know if that would work...

Anybody got a more elegant solution? (other than "dump IIS" ;-)

Thanks!
-Peter
 



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: warning message

2003-04-02 Thread Wiggins d'Anconia


Christopher G Tantalo wrote:
Hello,
In a recent perl script I wrote, I have a procedure, read_config(),
which reads a
config file I have set up and sets a hash to what is in the file.  Now,
before you
mention it, I have stricts on and use the -w on the 1st line, and the
following
message appears.
main::read_config() called too early to check prototype at
./eleadtest.pl line 19.
What does this mean?  Code snippets of the procedure call, and the
procedure itself
are below.
In general Perl does not expect you to do strong typing of the arguments 
you pass into a subroutine so there is no need to use prototyping. 
Because you defined your subroutine using '()' Perl thinks you are 
trying to use prototyping, in which case you are calling the sub to 
early. So either you need to pre-declare the subroutine or simply not 
use a blank prototype... so instead of:

sub read_config()
{
> #blah blah blah
}
use:

sub read_config
{
# blah blah blah
}
For much more on subroutines and prototyping have a look at:

perldoc perlsub

In general the order of subroutine definition does not matter, or its 
placement in the file, with the exception of prototype'd functions which 
is what you ran into.

http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Why this perl error?

2003-04-02 Thread Wiggins d'Anconia


Octavian Rasnita wrote:
I guess it is a Perl 5.8 bug because this didn't happen in Perl 5.6.1.
Or, ... it might be a DBI module error, but I don't think so.

Not sure if it is a DBI error or not, but I *believe* (read: have some 
remembrance of it but not sure) that it has been discussed somewhat 
recently, past couple months on the dbi-users list, you might try the 
archives of that list, or repost the question there to see what they say.

http://danconia.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]