Re: Secure Form Submission

2003-08-23 Thread zentara
On Fri, 22 Aug 2003 20:10:37 +, [EMAIL PROTECTED]
(Greenhalgh David) wrote:


Thanks for that. The MD5 is a one way hash, unfortunately. I need to be 
able to decrypt at the server side.

I agree about SSL, unfortunately my client's host (borrowed space on a 
non-commercial server) only has 2 IPs for SSL and both are filled until 
the system upgrade late this year. What I am looking for is a fill in 
solution that will allow  some form of secure transmission of personal 
information (not a password) until the SSL becomes available.

Well you could always use Perl scripts, and setup some socket
connections. You could just ask the client to download a small
script and run it, which do a safe transfer.
It could be done alot of ways. The downloaded perl script could be
run to encrypt a file with rc4, then the client could upload the
results.  The MD5 password method would give you a way to
exchange an initial password safely, then that password could be used
by both sides for the rc4 password.






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



Re: Counter triggered on download

2003-08-23 Thread fliptop
On Wed, 20 Aug 2003 at 13:29, Merrill Oakes opined:

MO:I have a link to a PDF file on a web page.  I want to count how many 
MO:times that someone clicks on the link (i.e. downloads the PDF).  The 
MO:easy way (at least for me) would be to make them go to a download page 
MO:first, and I could put a counter in the page, BUT this requires an extra 
MO:step for the user.
MO:
MO:SO, is there any way to:#1. monitor how many a times a file has been 
MO:downloaded, or maybe #2. have them click on a link (that is really a cgi 
MO:script, that then increments the counter then starts the download/open 
MO:of the PDF?  Of course this last method will disable the ability to do a 
MO:shift-click to download the doc.

merrill - i'm a little late on this thread, and the other suggestions are
valid, but here's one way to serve up files w/o using a direct link by
taking advantage of CGI.pm's header() function:

my $cgi = new CGI;

print $cgi-header('application/pdf');

open OUT, '/path/to/some/pdf/file';
my $buffer;

while (my $read = read(OUT, $buffer, 4096)) {
  print $buffer;
}

close OUT;

# insert code here to increment the counter


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



Re: reinstall PERL

2003-08-23 Thread zsdc
Bulba007 wrote:

How to repair Perl instalation on OBSD 3.3 stable?
Well, I guess it depends on, like... what's wrong with it?

If you want to have a fresh install then get the source from CPAN or 
install the prebuilt binaries with whatever packaging system you are using.

I don't know if my answer is useful, it's quite obvious actually, but 
you know, your question is like asking how to repair Corvette 2001 Turbo.

As the old saying goes, TMTOWTBIsTMTOWTFI -- There's More Than One Way 
To Break It so There's More Than One Way To Fix It.

-zsdc.

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


Re: reinstall PERL

2003-08-23 Thread Ramprasad A Padmanabhan
Bulba007 wrote:
How to repair Perl instalation on OBSD 3.3 stable?



Not very familiar with OBSD. But I think the CPAN.pm module is the best 
way of upgrading perl.

If you can get CPAN

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


Re: Changing case of the first letter of words in string

2003-08-23 Thread zsdc
James Edward Gray II wrote:

On Friday, August 22, 2003, at 05:06  PM, bis wrote:

Thanks Gabriel - your suggested code

s/(SCTN:\s*)(\w+)/$1\u$2\E/g;
[...]
Well, let's see if we can get a little closer:

s/(SCTN:\s*)(.+)$/join '', $1, map { ucfirst $_ } split /( )/, $2/ge;

See if that helps any.
It gives a syntax error. Maybe try this:

  #!/usr/bin/perl -p
  s/(\s)(.)/$1\u$2/g if/SCTN:/;
or instead of /SCTN:/ use /^SCTN:/ or /^\s*SCTN:/ to match only if it's 
the first word in the line. Is that what you need?

-zsdc.

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


a real newbie question!

2003-08-23 Thread Robert Mark White
OK, now don't laugh so hard you fall off your chairs!

I see the #!/usr/bin/perl -w at the top of all programs.
I have read it tells perl where to run the program.
This information I assume refers to a *nix box directory structure.
I am using windows and using activeperl
I think that it may mean I should use #!c:/perl -w,
or am I completely lost here?

Does the #! command mean anything in windows/activeperl programing?

c:/perl is where it is located on my machine,
or do I just do it like everyone else for standards sake?
I can not imagine anyone using a *nux box wanting my programs!


Thanks for your help in advance


RMW

p.s. -  I hope you didn't hurt yourselves to badly falling off your chairs.

-
Robert Mark White
a really new still wet behind the ears, squeekie clean perl newbie!
markwhite28 at comcast dot net
-


---
Outgoing mail is certified virus free by AVG Anti-Virus System Version 6
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.512 / Virus Database: 309 - Release Date: 8/19/2003



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



Re: a real newbie question!

2003-08-23 Thread Janek Schleicher
Robert Mark White wrote at Fri, 22 Aug 2003 23:37:48 -0600:

 I see the #!/usr/bin/perl -w at the top of all programs.
 I have read it tells perl where to run the program.

No, it usually tells the (*nix) shell what program has to start
- in this case /usr/bin/perl - and with what kind of arguments - -w -.
The shell then passes all lines but this first one as STDIN to the called
program, in this case perl.

 This information I assume refers to a *nix box directory structure.
 I am using windows and using activeperl
 I think that it may mean I should use #!c:/perl -w,
 or am I completely lost here?

Well, the windows shell (dos box) doesn't interpret the shebang line 
#!...,
so it doesn't play that important role whether
/usr/bin/perl is written or c:/perl.
However I personally would prefer to write
#!/usr/bin/perl
even on windows as it doesn't matter for windows,
but is more likely to run also on *nix machines

 Does the #! command mean anything in windows/activeperl programing?

Yes, allthough windows itself doesn't interpret this line,
perl still scans it.
E.g. it looks for the -w switch or any other possible arguments on the
#! line.

(I believe, perl expects also that the substring perl is in the #! line
for interpreting, otherwise it assumes the #... line is really only a
commentar)

 c:/perl is where it is located on my machine,
 or do I just do it like everyone else for standards sake?
 I can not imagine anyone using a *nux box wanting my programs!

Why? Does your program something very operating system specific?
Unless it is an extra work, it's always a good habit to work with
standards and intercompability.
You can't loose anything but perhaps winning in one day some time.


Greetings,
Janek

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



Re: Read dir / sort

2003-08-23 Thread Rob Dixon

Bob Showalter wrote:
 Paul Kraus wrote:
  WTF now its working with no changes to the program..
  This is very frustrating.
  Is perl some how looking at the way the directory was last
  sorted in my
  Ms window even though its pulling it from a UNIX server?

 Perl isn't doing anything but calling the OS's underlying readdir(2) call.
 You shouldn't make any assumptions about the order in which readdir()
 returns files. If you need them in some particular order, read them and then
 sort them.

Exactly. Moreover, you should never assume the order of anything
returned by an iterator like 'readdir' unless it is documented.

The nicest general solution I can think of is to use 'File::Find'
with your 'wanted' routine set to push $File::Find::name onto an
array @files. Then you can just do

  @files = sort { -M $A = -M $B} @files;

(People will then tell you to use Randalian Transform   ;-)
but then I will tell you to worry only if your code is too slow.)

Cheers,

Rob




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



Re: Trying to open a word document on the shell

2003-08-23 Thread Michele Ouellet
You need to supply the full path of your document, even though it may be
sitting in the current directory.

Good luck,

Michèle.

[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I am trying to open a document as below

 #!/usr/local/bin/perl -w


 use Tk;


 my $mw = new MainWindow();

 my $filename=$mw-getOpenFile(-filetypes=[['WinWord','winword.exe']]);


 system($filename john.doc);


 But it says it cannot find the $filename path

 the $filename form is C:/Program Files/Microsoft
Office/Office/WINWORD.EXE

 How can i overcome this problem?







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



Re: Trying to open a word document on the shell

2003-08-23 Thread Sourabh Kumar Verma
Ya,same thing works in Unix/linux shell(typically).The variable PATH
should contain the name of the directories(separated by a colon) in which
shell will look for
the given command.
Regards,
Sourabh


 



On Sat, 23 Aug 2003, Michele Ouellet wrote:

 You need to supply the full path of your document, even though it may be
 sitting in the current directory.
 
 Good luck,
 
 Michèle.
 
 [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  I am trying to open a document as below
 
  #!/usr/local/bin/perl -w
 
 
  use Tk;
 
 
  my $mw = new MainWindow();
 
  my $filename=$mw-getOpenFile(-filetypes=[['WinWord','winword.exe']]);
 
 
  system($filename john.doc);
 
 
  But it says it cannot find the $filename path
 
  the $filename form is C:/Program Files/Microsoft
 Office/Office/WINWORD.EXE
 
  How can i overcome this problem?
 
 
 
 
 
 
 
 -- 
 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: Changing case of the first letter of words in string

2003-08-23 Thread James Edward Gray II
On Saturday, August 23, 2003, at 02:34  AM, zsdc wrote:

s/(SCTN:\s*)(.+)$/join '', $1, map { ucfirst $_ } split /( )/, $2/ge;
See if that helps any.
It gives a syntax error. Maybe try this:
Sorry, I forgot to backwack those /.  My fault for not testing the 
code.  I'll try again:

s{(SCTN:\s*)(.+)$}{ join '', $1, map { ucfirst $_ } split /(\s+)/, $2 
}ge;

Good luck.

James

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


Re: Changing case of the first letter of words in string

2003-08-23 Thread zsdc
*Please* CC the mailing list when you answer. I'm writing it so everyone 
on the list could learn something, not just to fix your program or solve 
your particular problem.

bis wrote:

Tnaks zsdc and JEGII.

 --- zsdc [EMAIL PROTECTED] wrote:

It gives a syntax error. Maybe try this:

  #!/usr/bin/perl -p
  s/(\s)(.)/$1\u$2/g if/SCTN:/;
This capitalises the first letter of every word in the
whole document.
No, it doesn't. Only the lines containing SCTN: Have you run it?

or instead of /SCTN:/ use /^SCTN:/ 
This doesn't do anything.

or /^\s*SCTN:/ 

Nor does this.
Well... Yes, it does. How did you run it, anyway?

I think the title of my query was misleading - what I
maybe should have said was Uppercasing the first
letter and lowercasing all the other letters of every
word in a mixed case part of a string?
This is much harder. It's easy to make the output like this:

  I'Ve Been Reading O'Reilly Books

OR:

  I've Been Reading O'reilly Books

but not:

  I've Been Reading O'Reilly Books

which is correct. I suggest you to only uppercase characters, but if you 
have to also lowercase the other ones then try:

  #!/usr/bin/perl -p
  s/(\s)(\S+)/$1\L\u$2/g if/^\s*SCTN:/;
or

  #!/usr/bin/perl -p
  s/\b(\w+)/\L\u$1/g if/^\s*SCTN:/;
(and maybe add:

  use locale;

at the beginning) and see which suits your needs better. You might find 
better examples in the Cookbook.

-zsdc.

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


Re: reinstall PERL

2003-08-23 Thread Bulba007
U¿ytkownik zsdc [EMAIL PROTECTED] napisa³ w wiadomo¶ci
news:[EMAIL PROTECTED]
 Bulba007 wrote:

  How to repair Perl instalation on OBSD 3.3 stable?

 Well, I guess it depends on, like... what's wrong with it?

 If you want to have a fresh install then get the source from CPAN or
 install the prebuilt binaries with whatever packaging system you are
using.

 I don't know if my answer is useful, it's quite obvious actually, but
 you know, your question is like asking how to repair Corvette 2001 Turbo.

OpenBSD 3.3-stable (GENERIC) #0: Thu Jun  5 14:37:12 CEST 2003

Terminal type? [xterm]

A lot of program are writing those ugly errors: (eg mrtg)

-bash-2.05b# mrtg
2003-08-23 17:43:09 -- String found where operator expected at
/usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 364, near carp
stat($start): $!
2003-08-23 17:43:09 --  (Do you need to predeclare carp?)
2003-08-23 17:43:09 -- String found where operator expected at
/usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 375, near carp
opendir($dotdots): $!
2003-08-23 17:43:09 --  (Do you need to predeclare carp?)
2003-08-23 17:43:09 -- String found where operator expected at
/usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 380, near carp
stat($dotdots): $!
2003-08-23 17:43:09 --  (Do you need to predeclare carp?)
2003-08-23 17:43:09 -- String found where operator expected at
/usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 394, near carp
readdir($dotdots): $!
2003-08-23 17:43:09 --  (Do you need to predeclare carp?)
2003-08-23 17:43:09 -- String found where operator expected at
/usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 419, near croak Cannot
chdir to $path: $!
2003-08-23 17:43:09 --  (Do you need to predeclare croak?)
2003-08-23 17:43:09 -- String found where operator expected at
/usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 422, near croak Cannot
chdir back to $cwd: $!
2003-08-23 17:43:09 --  (Do you need to predeclare croak?)
2003-08-23 17:43:09 -- syntax error at
/usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 364, near carp
stat($start): $!
syntax error at /usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 375, near
carp opendir($dotdots): $!
syntax error at /usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 380, near
carp stat($dotdots): $!
syntax error at /usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 394, near
carp readdir($dotdots): $!
syntax error at /usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 419, near
croak Cannot chdir to $path: $!
syntax error at /usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 422, near
croak Cannot chdir back to $cwd: $!
BEGIN not safe after errors--compilation aborted at
/usr/libdata/perl5/i386-openbsd/5.8.0/Cwd.pm line 506.
-bash-2.05b#

B.




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



Re: how do I file lock for a form?

2003-08-23 Thread Randal L. Schwartz
 Gregg == Gregg O'Donnell [EMAIL PROTECTED] writes:

Gregg Hi. When a user hits submit many times after completeing a
Gregg form, I get multiple (duplicate) entries in my
Gregg spreadsheet. I've read that I can add a hidden field with a
Gregg unique identifier to lock the file so this won't happen. I
Gregg don't know how to do this - can anyone explain/direct me to a
Gregg good info source (I am a newbie). Thanks, Gregg

My column at

http://www.stonehenge.com/merlyn/WebTechniques/col64.html

shows this very technique.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
[EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

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



Temp variable

2003-08-23 Thread ryan10975073
hi,
The statement ($a,$b) = ($b ,$a);  is swapping without a third variable. 
But looking at a lower level , it is storing a temporary variable in the 
registers. How can i get that temporary variable/value from the 
registers/memory which will have value of either $a or $b.
Would love to see solution on that.
Thank you.
Regards,
Ishwar.



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


Re: Temp variable

2003-08-23 Thread Rob Dixon

Ryan10975073 wrote:

 The statement ($a,$b) = ($b ,$a);  is swapping without a third variable.
 But looking at a lower level , it is storing a temporary variable in the
 registers.

No it's not. It's building a temporary list of two values.

 How can i get that temporary variable/value from the
 registers/memory which will have value of either $a or $b.

There is no 'temporary variable'. You are getting confused
with what Perl does and how you would write the swap in
another language.

  ($a,$b) = ($b ,$a)

does precisely what it says. No more and no less. If it
were implemented internally like this

  $a ^= $b;
  $b ^= $a;
  $a ^= $b;

then where is the value that you imagine you are looking
for?

 Would love to see solution on that.

Why?

You can hold on to a temporary list like this:

  use strict;
  use warnings;

  my ($a, $b, $c, $d);

  {
my $temp = [$b, $a];
($a, $b) = @$temp;
($c, $d) = @$temp;
  }

but you haven't explained what you're trying to do.

Rob



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



Re: Temp variable

2003-08-23 Thread John W. Krahn
Ryan10975073 wrote:
 
 hi,

Hello,

 The statement ($a,$b) = ($b ,$a);  is swapping without a third variable.
 But looking at a lower level , it is storing a temporary variable in the
 registers.

Not necessarily.  :-)

$ perl -le'
my ( $x, $y ) = ( 5, 16 );
print \$x = $x   \$y = $y;
$x ^= $y;
$y ^= $x;
$x ^= $y;
print \$x = $x   \$y = $y;
'
$x = 5   $y = 16
$x = 16   $y = 5

$ perl -le'
my ( $x, $y ) = ( two, three );
print \$x = $x   \$y = $y;
$x ^= $y;
$y ^= $x;
$x ^= $y;
print \$x = $x   \$y = $y;
'
$x = two   $y = three
$x = three   $y = two


 How can i get that temporary variable/value from the
 registers/memory which will have value of either $a or $b.
 Would love to see solution on that.

Just create your own temporary variable.

my $temp = $x;
$x = $y;
$y = $temp;



John
-- 
use Perl;
program
fulfillment

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