crypt output

2002-11-01 Thread Ember Normand
Does anyone know the what kind of data can be in the output of perl's crypt
function? (ie what symbols are allowed in the encrypted output, are spaces
allowed, etc.)  I wasn't able to find the answer in the camel book and some
online searching.  
Thanks in advance!  
Ember
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Windows PID

2002-06-18 Thread Ember Normand

It seems that Active State has not implemented getppid.
Any hints on how I can get the PID that is in the Windows Task Manager?
Thank you,
Ember
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Newbie book

2002-05-10 Thread Ember Normand

When I was learning Perl, I really liked the O'Reilly book:  "Learning Perl"
(aka the llama book) fits your requirements.  It explains from the ground up
with lots of exercises.
I've used a lot of the O'Reilly Perl books and I've really liked them.  Also
check out "Programming Perl" (aka the camel book).

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 10, 2002 10:23 AM
To: [EMAIL PROTECTED]
Subject: Newbie book



Would you please recommend an introductory level book.
I prefer ones with alot of tutorials/projects.
A book of projects would be great.

I am fair with VB and Javascript.


Thanks for your time,


Todd
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Perl Modularisation

2002-05-03 Thread Ember Normand

Save I have a perl module (MyPerlPackage.pm) that is located 1 directory up
and down in the directory directoryname.

Here's how I would get to it:

use lib '../directoryname';
use MyPerlPackage;

-Original Message-
From: Sean Ahern [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 03, 2002 11:00 AM
To: [EMAIL PROTECTED]
Subject: RE: Perl Modularisation


At 16:25 03/05/2002 +0100, Aaron Trevena wrote:
>path/to/module/module.pm can be accessed as :
>use path::to::module::module;
>
>where the module starts :
>package path::to::module::module;

And as far as I know perl only finds this if it is in the perl search path 
@INC.  Which its not, because I dont want to set a global search path that 
includes each and every project.


>' use lib "dir/"; ' - this allows you to do:
>use lib "path/to/module/";
>use module;
>
>or
>
>use lib "path/to/";
>use module::module;
>
>assuming you declare the package in module to be module or module::module
>respectively

I think you missed where I said I dont want to have to use 'use lib' 
(because I believed it used absolute paths)

Ive had a suggestion that 'use lib' might be able to use relative paths, 
though.  I have to check that.

>as for:
>
>use module qw(foo bar);
>
>use exporter and put foo and bar into @EXPORT_OK
>
>this is explained in perldoc Exporter, and the documentation for modules.

I know that, and I already do this.  Hence I dont believe this has anything 
to do with my problem.  My problem -here- is that

use "module.pm" qw(foo bar)
and
use "../Modules/module.pm" qw(foo bar)

dont seem to be valid syntax.


>I'd reccomend the Camel Book ( aka O'Reilly - Programming Perl - Wall,
>Christiansan, Schwartz )
>
>It explains all this rather well.]

I have it in front of me.  It explains all of what you have said rather 
well, which is why my existing version of the program works perfectly 
well.  However Im afraid that none of what you have brought up appears to 
address what I actually  was asking.  It certainly doesnt cover the

use "module.pm" qw(foo bar)

case

I'll state it as clearly as I can:  I want to be able to 'use' or 'require' 
modules that are not in my search path in @INC, to be able to do so by 
means of relative filepaths, and without the necessity for 'use 
lib'  statements.
This is exacerbated by the fact that I cant find any documentation anywhere 
(camel Book, perlfaq, PerlMonks etc.) covering the case of attempting only 
to import a subset of the exportable subroutines of a module  when the 
module is accessed via a path supplied in the 'use "path/module" qw(sub) ' 
statement itself.

 Sean


---

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: remove first line

2002-04-09 Thread Ember Normand

That's an interesting idea.  We are pursuing options for when we can't use
an "official" transaction manager.  I had not considered this method.
What would you recommend for "chunking" the file?
Thanks,
Ember

-Original Message-
From: Aaron Trevena [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 09, 2002 11:33 AM
To: '[EMAIL PROTECTED]'
Subject: RE: remove first line


> I need to process a file where each line contains data.  Each
> line can be of variable length.  I need to avoid losing any data if the
process
> of the line failed.  I was thinking if I could read and then remove the
first line of
> the file, I would not affect the rest of the file if I died mid-process.
>
> Does anybody know of any modules that do this?  Or have any other
> suggestions?

You probably want to use some kind of transaction - you could put the index
of the last line you correctly processed in a semaphore file so that when
the process reumed it could pick up from the last line processed. If the
file is only read then a seperate process can check the semaphore and remove
the lines as they have been processed.

It may be better to split the file being processed into chunks and only
remove them when the entire chunk has been processed - again as an ATOMic
transaction.

rgds,

A.

--
Aaron J Trevena, BSc (Hons) www.head2head.co.uk
Internet Application Developer  Perl, UNIX, IIS/ASP


___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: remove first line

2002-04-09 Thread Ember Normand

I'm more worried about dying because the machine goes down.

-Original Message-
From: Tillman, James [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 09, 2002 11:01 AM
To: 'Ember Normand'; '[EMAIL PROTECTED]'
Subject: RE: remove first line


> I need to process a file where each line contains data.  Each 
> line can be of
> variable length.  I need to avoid losing any data if the 
> process of the line
> failed.  I was thinking if I could read and then remove the 
> first line of
> the file, I would not affect the rest of the file if I died 
> mid-process.  

Why not use "eval" and avoid dying in the first place?  I hate it when I die
;-)

jpt
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



remove first line

2002-04-09 Thread Ember Normand

I need to process a file where each line contains data.  Each line can be of
variable length.  I need to avoid losing any data if the process of the line
failed.  I was thinking if I could read and then remove the first line of
the file, I would not affect the rest of the file if I died mid-process.  

Does anybody know of any modules that do this?  Or have any other
suggestions?

Thank you,
Ember
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: Encoding HTML in hidden inputs

2002-03-11 Thread Ember Normand

Try:
$yourname = CGI::escape($yourname);

-Original Message-
From: David Kaufman [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 1:13 PM
To: Byron Wise; Perl-Win32-Users
Subject: Re: Encoding HTML in hidden inputs


"Byron Wise" <[EMAIL PROTECTED]> wrote:

> I have a form that allows the user to input html.
> After they submit I'm needing to put that value in a
> hidden field and wait for them to fill out the second
> page before processing.
> What is the best method of encoding the html.  It
> seems that the problem is double quotes but I'd rather
> have a more robust solution than just handeling the
> quotes.

you will eventually run acros data that contains four things that will tend
to break html forms (whether your re-populating hidden inputs, text inputs,
or textareas) and they are quotes, both single *and* double, since
single-quotes can also be used to delimit input values, and also in some
cases, those pesky open- and close-angle-brackets <> can screw up a
textarea.

you can get around all of them by replacing each with their HTML entities:

$html_data =~ s/\'/&/gs;
$html_data =~ s/\"/"/gs;
$html_data =~ s/\/>/gs;

there are also some weird cases (i've run into at least once, but can't
remember why) where you might need to replace ampersands with their html
entity &

$html_data =~ s/\&/&/gs;

obviously if you do this, you need to be sure to run this substitution on
the string *before* the four above, since they will insert their own
ampersands which must not be re-replaced.

hth,

-dave

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



RE: a question of regular expression

2001-10-15 Thread Ember Normand

@sub_folders = grep !/^\.\.?$/, readdir (DIR);

1) you need to send in the directory handle (DIR) not the directory name
2) you can use grep to pull out the . and ..
This does work on windows.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 15, 2001 3:42 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: a question of regular expression


I am sorry, I do not make it clear.
The code is like:
opendir (DIR, $directory) || die "can not open it:$!";
@sub_folders = readdir($directory);

can I do something on the second line to make @sub_folders not include "."
and ".."?
Thanks
Lixin 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 15, 2001 4:36 PM
To: [EMAIL PROTECTED]
Subject: a question of regular expression


Dear all,
I want to open a directory and get all sub folders except "." and ".." under
directory, how can I do it?
Thanks
Lixin
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Perl on IIS

2001-07-03 Thread Ember Normand

Adam,
There's a couple of problems with your code.  The following code works:

$name = "World";
print "Content-type: text/html\n\n";
print <
 Hello $name !


EOT


Notice, there is no << in the print "Content".  Also, the print Thank you for the help everyone, but I think I failed to make my question
>more apparent.
>
>I can get basic .pl files to run from the command line. The problem is I
>want my CGI's to use perl as its langauge, hence the example previously
>listed below would be saved as hellowrold.cgi:
>
>#!/C:/perl/perl
>$name = "World";
>print<<"Content-type: text/html\n\n";
>print<
>
> Hello $name !
>
>
>EOT;
>
>
>Now my question is, why can I not configure my IIS sever to use PERL to
>interprit this as a CGI?
>
>Thanks again guys.
>
>___
>Perl-Win32-Users mailing list
>[EMAIL PROTECTED]
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



Win32::OLE::Lite error, HELP, please

2001-03-07 Thread Ember Normand

Hi,
I was hoping somebody out there might have some insight into this problem.
We are using Win32::OLE to instantiate some COM objects.  We are using
PerlEx on IIS5/Win2K.  Things seem to be working for us, but we are getting
some errors in our PerlEx error logs:

"retrying default method at d:/Perl/site/lib/Win32/OLE/Lite.pm line 156"

I'm afraid that this may propagate itself as an error to our users, because
we do not always get this in the error log.

I looked at Lite.pm and this is a warning when the autoload fails and then
retries.  But I need to know why is this happening?  Am I doing something
wrong in instantiating the COM objects that is causing this error?  Is this
normal?

Thank you!
Ember
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: Install PM

2001-03-07 Thread Ember Normand

You can use lib to include other perl modules.  I'm currently using IIS5 on
Win2k, with PerlEx.  I've done similar things on Unix with Apache.  You may
need to tweek this a little depending upon your platfor.

Say your .cgi's are all located in, /cgi-bin/, and your modules are located
in /cgi-bin/mylib/, and you want to access, /cgi-bin/mylib/MyModule.pm.

Then in the top of your cgi, with all of your other use statements, put:
use lib 'mylib';
use MyModule;

The "use lib 'mylib';" adds the mylib directory to your @INC.

If we happen to have a cgi in a different branch of the directory structure,
we can still get to our library modules.  For example:  /cgi-bin/mylib/
contains all our modules; /other-cgis/ contains some separate cgis.  To get
to our modules from /other-cgis/ using lib:
use lib '../cgi-bin/mylib/';
use MyModule;

Hope this helps.
Good luck,
Ember

-Original Message-
From: Christopher Hahn [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 06, 2001 6:36 PM
To: 'Mauricio Lairet P.'; Perl Users Mailing List
Subject: RE: Install PM



Hello,

I have also dealt with providing my own
support, beyond what my ISP was giving me
to do my webiste with.

...and I used the -I command line option of Perl to
add to @INC.

This works in the #! line of a CGI script, as in:
#!/usr/bin/perl -I/web/king/chahn/cgi-bin/perl
use Astro::MoonPhase;  <---My ISP did not have this ready.

(I needed to use a SSI to stuff the phase of the moon
into a clock website)

Good luck,

Christopher

> -Original Message-
> From: Mauricio Lairet P. [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 06, 2001 3:01 PM
> To: Perl Users Mailing List
> Subject: Install PM
> 
> 
> Hi!
> 
> First of all I wanted to thak all who helped me with my 
> Questions about SQL
> and ODBC.
> 
> Now, Im thinking of using DBI module to work with databases 
> intead of using
> Win32::ODBC but my hosting provider has only the typical 
> extensions of Perl
> installed and they are not helping so much. So I wanted to 
> know if there is
> a way to tell a script that the PM file is in other directory 
> so it will not
> look for it in the standard Perl directory. I want ot know 
> this not only for
> the mentioned DBI module but also to use any module I'd like 
> to use without
> asking the hosting provider to install it for me.
> 
> I'd really appreciate if you could help me here.
> 
> Thank you so much!
> 
> ___
> Perl-Win32-Users mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
> 
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users



RE: running another script under win98

2001-03-01 Thread Ember Normand

I believe you need to run perl with the perl script to get it to run.
I currently have a script that runs another script with the following line:
exec "perl myscript.pl $n";

This works fine for me on Windows2000.  $n is just the variable I'm passing
in to myscript.pl.  The perl.exe is in my path.  Also, the myscript.pl is in
the directory of the original script.

*
Well, maybe you already figured this all out, but here goes.
Modules are also very easy.  Assume your module is:  mymodule.pm
At the top of your calling script include the following line with the rest
of you use statements:
use mymodule;

If you have your module in a separate directory, you will have to tell perl:
use lib '/go'; #where /go is the location of your module on the
current drive
   #lib just adds another directory to the paths
where modules are located
use mymodule;

Then to use your module in your script:
mymodule::myfunction(); #referencing your function like this helps
in readability
#and also makes sure you call the
myfunction you think you're calling 

Create the module as a separate file, mymodule.pm, use the following
structure:

package mymodule;

sub myfunction {
#Code functionality
}

1;

You can have as many functions as you like.  Just make sure the package ends
in a "1;" (without the quotes) and starts with the package name (without the
.pm).  

Hope this helps.
--Ember

-Original Message-
From: Jean-Paul Felix [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 01, 2001 11:07 AM
To: Perl-Win32-Users (E-mail)
Subject: running another script under win98


I have several scripts which all execute the same code at the end. I would
like to separate this common code into another file and have it executed by
each script just before it finishes (no return).

I've looked at libraries, packages, modules and it all seems over
complicated for what I require as no variables are passed just a file read
and another written.

I've tried: exec ("c:/go/script.pl");
but it dies quietly with no errors. 'system' does no better.
any suggestions?
thanks
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users