Re: how to require() a file?

2009-03-04 Thread Stanisław T. Findeisen

Gunnar Hjalmarsson wrote:

Stanisław T. Findeisen wrote:
I am trying to require() a file using its absolute name. In command 
line mode everything works fine, but not in Apache:


[Fri Feb 27 17:45:07 2009] [error] Can't locate 
/home/stf/public_html/test/arcv/public_html/../common.pl in @INC (@INC 
contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi





/usr/lib/perl5/5.8.8 . /etc/httpd) at

---^

How can I require() a file when using Perl in CGI mode? Do I have to 
modify @INC?


Based on your reply (to an answer that I not saw) it seems like giving 
the web server read access to common.pl solved your problem. Together 
with the fact that the current directory is included in @INC, it 
indicates that you are not running the script under mod_perl.



I guess I am using mod_perl:


Guess?? You really, really ought to know! What happens if you add this 
line to the script:


print "Not mod_perl\n" unless $ENV{MOD_PERL};


Nothing is being printed. :-) I am having taint mode commented out in my 
/etc/httpd/conf.d/perl.conf file:


# Uncomment this line to enable taint checking globally.  When Perl is
# running in taint mode various checks are performed to reduce the
# risk of insecure data being passed to a subshell or being used to
# modify the filesystem.  Unfortunately many Perl modules are not
# taint-safe, so you should exercise care before enabling it on a
# production server.
#
#PerlSwitches -T

and that's why I am having . included in @INC, I guess.

STF

===
http://eisenbits.homelinux.net/~stf/ . My PGP key fingerprint is:
9D25 3D89 75F1 DF1D F434  25D7 E87F A1B9 B80F 8062
===



signature.asc
Description: OpenPGP digital signature


user sessions

2009-03-04 Thread Stanisław T. Findeisen

Hello, how to make user sessions? Something like:

* log in using password
* maintain session state across several executions of several scripts 
forming the application

* log out

Do I have to do it manually or is there something ready that you can 
recommend?


Thank you.

STF

===
http://eisenbits.homelinux.net/~stf/ . My PGP key fingerprint is:
9D25 3D89 75F1 DF1D F434  25D7 E87F A1B9 B80F 8062
===



signature.asc
Description: OpenPGP digital signature


Re: how to require() a file?

2009-02-27 Thread Stanisław T. Findeisen

Dermot Paikkos wrote:
If you are using mod_perl then you can use the PerlSwitches directive 
for -I/path/to/common.pl. Alteratively you use `use lib` in your 
ticket-list.pl


Alternatively, I can do

chmod g+r,o+r common.pl

:-)

STF

===
http://eisenbits.homelinux.net/~stf/ . My PGP key fingerprint is:
9D25 3D89 75F1 DF1D F434  25D7 E87F A1B9 B80F 8062
===



signature.asc
Description: OpenPGP digital signature


how to require() a file?

2009-02-27 Thread Stanisław T. Findeisen
I am trying to require() a file using its absolute name. In command line 
mode everything works fine, but not in Apache:


[Fri Feb 27 17:45:07 2009] [error] Can't locate 
/home/stf/public_html/test/arcv/public_html/../common.pl in @INC (@INC 
contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi 
/usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 
/usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 
/usr/lib/perl5/site_perl 
/usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi 
/usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 
/usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 
/usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi 
/usr/lib/perl5/5.8.8 . /etc/httpd) at 
/home/stf/public_html/test/arcv/public_html/ticket-list.pl line 13, 
 line 344.\n


How can I require() a file when using Perl in CGI mode? Do I have to 
modify @INC?


I don't really feel like making it a module, and putting it into Some 
Well Known Location is something I don't feel like even more. It's just 
a supporting file that I want to keep together with the rest of the 
application.


I guess I am using mod_perl:

[Fri Feb 27 16:31:48 2009] [notice] Apache/2.2.6 (Unix) DAV/2 PHP/5.2.4 
mod_perl/2.0.3 Perl/v5.8.8 configured -- resuming normal operations


Thanks!

STF

===
http://eisenbits.homelinux.net/~stf/ . My PGP key fingerprint is:
9D25 3D89 75F1 DF1D F434  25D7 E87F A1B9 B80F 8062
===



signature.asc
Description: OpenPGP digital signature


RE: perplexing popup problem -- CGI .pm bug?

2006-08-29 Thread Moore, George T.
Take a look at the if statement below. I think you want <= not just <

-Original Message-
From: Mary Anderson [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 29, 2006 11:42 AM
To: beginners-cgi@perl.org
Subject: perplexing popup problem -- CGI .pm bug?


I am having a problem with popup-menus.  
   foreach $rowCount  (0..(@rptEntityValuesArray + $MaxNumberRepeats -
1)){
if ($rowCount < @rptEntityValuesArray){
@rptEntityValues = @{$rptEntityValuesArray[$rowCount]};
} 

Thanks
Mary Anderson


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




RE: Perl script problem

2006-08-29 Thread Moore, George T.
The cgi attachment is here, but the html didn't make it.

The lack of comments comes from this:
tie(%mail, "SDBM_File", "c09ex3", O_RDONLY, 0)
 or die "Error opening c09ex3. $!, stopped";
$mail{$email} = "$name|$comments";
untie(%mail);

The line 
$mail{$email} = "$name|$comments"; 
is causing your problem. 


-Original Message-
From: Joel Alvo [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 26, 2006 8:32 AM
To: beginners-cgi@perl.org
Subject: perl script problem

Hi.  I have some perl script attached that does not
return anything when I click the link "see what others
have to say ...

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




RE: Hyperlink return

2006-07-21 Thread Moore, George T.
You seem to be missing a quotation mark after $login. It looks like you
have got yourself caught in a loop because you call one script from
another without exiting the first one, so the first script becomes the
location you are in. Try printing your location when you enter each
script to see where you are. You may be able to improve the navigation
with -href=>"./EditLab.pl etc. or -href=>"../EditLab.pl etc.

-Original Message-
From: Mary Anderson [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 19, 2006 10:28 AM
To: beginners-cgi@perl.org
Subject: Hyperlink return


Hello all,

I would like some help on hyperlinks.  I have two files EnterLab.pl
and
EditLab.pl which have hyperlinks to each other.  I do

EnterLab.pl

  print a({ -href=>"EditLab.pl/Login=$login }, "Edit Record");

EditLab.pl

  print a({ -href=>"Enter.pl/Login=$login }, "New Record");


In navigating the application I hit "Edit Record" and reach the EditLab
script with no problem.  Coming back doesn't work.  The bar at the top
of
the window informs me that I am trying to go to 

  http://mydirectory/EditLab.pl/EnterLab.pl.


What I am trying to do, of course, is to Edit a record using the code in
Edit record and then to allow the user the option of entering a new
record.
The application is a bit complex -- each of these files has 1500 to 2000
lines of code.


While I am at it, how does redirect work?  I do print redirct({-location
=
mynewlocation}) and just get a message with a code and the information
that
the url is relocating.  

Thanks,

Mary Anderson



-- 
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: Multiple .cgi scripts vs. one large script

2006-06-14 Thread Moore, George T.
It depends on how you are using your scripts. The most "expensive"
aspect of the files is the IO used to read them from the hard drive they
reside on. If you are calling on the scripts multiple times and they
have to be read each time, rather than being cached in memory, then you
only want to read what is absolutely necessary. If one script always
calls another then you are probably better having the subroutines, which
would save IO. 

-Original Message-
From: Hardly Armchair [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 14, 2006 4:40 PM
To: beginners-cgi@perl.org
Subject: Multiple .cgi scripts vs. one large script

Hello All,

I was wondering if it is more efficient (in terms of speed and processor

load) to have two different scripts of approximately the same size 
called to handle two different functions, or to have one large script 
handle all cgi functions using subroutines.  Or perhaps these situations

are equivalent.

I apologize if I have just asked an unanswerable question.

Thanks,
Adam

-- 
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: How to send mail on IIS on a Windows server

2006-06-14 Thread Moore, George T.
Are you just printing lines and directing the output to the Linux Mail,
or are you using the Perl Mail package on Linux? 
Mail::Sendmail should work platform independent.
If that is what you are using, perhaps you might want to show a line of
code that you are using that needs to be modified for XP.

-Original Message-
From: Angus Comber [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 14, 2006 10:03 AM
To: beginners-cgi@perl.org
Subject: How to send mail on IIS on a Windows server

Hello

I havew been using the MAIL command on Linux but I need to get a Perl
script working on a Windows XP machine running Internet Information
Server.

How do I send an email on this beast?

Angus

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




Re: valid use of while expression

2005-03-30 Thread T Raymond
Thanks Charles,
I got what I wanted to work by replacing while with for.
--Teresa
Charles K. Clarkson wrote:
T Raymond <mailto:[EMAIL PROTECTED]> wrote:
: If there is a word in $words[$n], is the following expression for
: while valid? --Teresa
   Define "valid".
   We can test the _syntax_: I get "a.pl syntax OK".
#!/usr/bin/perl -c
use strict;
use warnings;
my @words = split ' ', 'The quick brown fox';
my @letters;
my $n = 1;
while ( $words[$n] ) {
   @letters=split//;
}
__END__
   Do you want to know if the while loop is endless? Yes it is.
$words[$n] will always evaluate true until we do something to it
to make it evaluate to not true.
   But these are things you could have tried yourself. So what
do you mean by "valid"?
HTH,
Charles K. Clarkson
 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



valid use of while expression

2005-03-30 Thread T Raymond
Hello everyone:
If there is a word in $words[$n], is the following expression for while 
valid? --Teresa

#get letters into array
my @letters;
my $length = 1;
 while ($words[$n])
 {
  @letters=split//;
 }

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



Re: need logic and one error help

2005-03-28 Thread T Raymond
Hi Charles and everyone,
It turns out I was clearing my hash each time because it was 
re-initializing every time. Once I stopped doing that, my error went 
away. Thanks everyone for your tips and help, I will try to incorporate 
your tips in my programs.
--Tee

Charles K. Clarkson wrote:
T Raymond <mailto:[EMAIL PROTECTED]> wrote:
: Hi all,
: Please advise me about my logic/syntax errors. I can't seem to figure
: out how to write in a logical sequence this code.
   What is in 'employee.dat'? It would be helpful if we could run the
example.
: I'm also getting an
: error  which I don't understand which states that m/^$first_name/ has
: an uninitialized variable.
   Chances are there is a situation where $first_name is not set to
a value before it is used.
HTH,
Charles K. Clarkson
 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Re: need logic and one error help

2005-03-27 Thread T Raymond
Hi,
This is a homework assignment but we are allowed to get help.
--Tee
T Raymond wrote:
Hi all,
Please advise me about my logic/syntax errors. I can't seem to figure 
out how to write in a logical sequence this code. I'm also getting an 
error  which I don't understand which states that m/^$first_name/ has 
an uninitialized variable.
-Tee

#!/usr/bin/perl -w
use CGI qw(:all);
use CGI::Carp 'fatalsToBrowser';
use strict;
print header,
start_html(-title=>'Employee Search'),
h1('Teresa Raymond\'s Employee Search');
&search_form  unless param;
if (param)
{
   my $filename='employee.dat';
   my $match;
   my $first_name=param('first_name');
   my $last_name=param('last_name');
   my $fn_weight;
   my $ln_weight;
   my $weight;
   my $ot_hours;
   my ($id, $fname, $lname, $hourly_wage, $hours_worked);
   my $gross_pay;
   my @rows;
   my %employees;
   open (FH, $filename) or die "cannot locate $filename\n";
   @rows = ;
   close(FH);
   print table({-border=>'l'});
   print Tr();
   print th('Weight').th('Employee ID').th('Last Name').
   th('First Name').th('Hourly Wage').th('Hours Worked').
   th('Overtime Hours').th('Gross Pay');
   for (@rows)
   {
   ($id, $lname, $fname, $hourly_wage, $hours_worked) = 
split(/\t/i);

   if (my @matches = $fname =~ m/^$first_name/ig)
   {
   $match=scalar(@matches);
   if ($hours_worked > 40)
   {
   $ot_hours = $hours_worked - 40;
   }
   else
   {
   $ot_hours = 0;
   }
   $gross_pay = &sub_calc_ot_pay($hourly_wage, $ot_hours) +
&sub_calc_normal_pay($hours_worked, $hourly_wage);
   $weight = $match;
   %employees = ($id => {  lname => $lname,
   fname => $fname,
   wage => $hourly_wage,
   hours_worked => 
$hours_worked,
   ot_hours => $ot_hours,
   gross_pay => $gross_pay,
   weight => $weight
});
   }
   else
   {
   chomp;
   }

   if (my @matches = $lname =~ m/^$last_name/ig)
   {
   $match += scalar(@matches);
   if ($hours_worked > 40)
   {
   $ot_hours = $hours_worked - 40;
   }
   else
   {
   $ot_hours = 0;
   }
  $gross_pay = &sub_calc_ot_pay($hourly_wage, $ot_hours) +
   &sub_calc_normal_pay($hours_worked, $hourly_wage);
   $weight = $match;
   %employees = ($id => {  lname => $lname,
   fname => $fname,
   wage => $hourly_wage,
   hours_worked => 
$hours_worked,
   ot_hours => $ot_hours,
   gross_pay => $gross_pay,
   weight => $weight
});
   }
   else
   {
   chomp;
   }
   }
   if ($match > 0)
   {
   for (keys %employees)
   {
  if ($employees{$_}{$fname}=~m/^$first_name/ig)
  {
 print Tr();
 print td("$employees{$_}{$weight}").td("$id").
   td("$lname").td("$fname").td("$hourly_wage").
   td("$hours_worked").td("$ot_hours").
   td("$gross_pay");
  }
  if ($employees{$_}{$lname}=~m/^$last_name/ig)
  {
 print Tr();
 print td("$employees{$_}{$weight}").td("$id").
   td("$lname").td("$fname").td("$hourly_wage").
   td("$hours_worked").td("$ot_hours").
   td("$gross_pay");
  }
   }
}
   if ($match == 0)
   {
   print h2("Sorry there was no match for $first_name 
$last_name");
   &sub_search_form;
   }

}
sub search_form
{
   print start_form,
   p('First Name: '),
   textfield(-name=>'first_name', -size=>'20'),
   p('Last Name: '),
   textfield(-name=>

need logic and one error help

2005-03-27 Thread T Raymond
Hi all,
Please advise me about my logic/syntax errors. I can't seem to figure 
out how to write in a logical sequence this code. I'm also getting an 
error  which I don't understand which states that m/^$first_name/ has an 
uninitialized variable.
-Tee

#!/usr/bin/perl -w
use CGI qw(:all);
use CGI::Carp 'fatalsToBrowser';
use strict;
print header,
start_html(-title=>'Employee Search'),
h1('Teresa Raymond\'s Employee Search');
&search_form  unless param;
if (param)
{
   my $filename='employee.dat';
   my $match;
   my $first_name=param('first_name');
   my $last_name=param('last_name');
   my $fn_weight;
   my $ln_weight;
   my $weight;
   my $ot_hours;
   my ($id, $fname, $lname, $hourly_wage, $hours_worked);
   my $gross_pay;
   my @rows;
   my %employees;
   open (FH, $filename) or die "cannot locate $filename\n";
   @rows = ;
   close(FH);
   print table({-border=>'l'});
   print Tr();
   print th('Weight').th('Employee ID').th('Last Name').
   th('First Name').th('Hourly Wage').th('Hours Worked').
   th('Overtime Hours').th('Gross Pay');
   for (@rows)
   {
   ($id, $lname, $fname, $hourly_wage, $hours_worked) = 
split(/\t/i);

   if (my @matches = $fname =~ m/^$first_name/ig)
   {
   $match=scalar(@matches);
   if ($hours_worked > 40)
   {
   $ot_hours = $hours_worked - 40;
   }
   else
   {
   $ot_hours = 0;
   }
   $gross_pay = &sub_calc_ot_pay($hourly_wage, $ot_hours) +
&sub_calc_normal_pay($hours_worked, $hourly_wage);
   $weight = $match;
   %employees = ($id => {  lname => $lname,
   fname => $fname,
   wage => $hourly_wage,
   hours_worked => 
$hours_worked,
   ot_hours => $ot_hours,
   gross_pay => $gross_pay,
   weight => $weight
});
   }
   else
   {
   chomp;
   }

   if (my @matches = $lname =~ m/^$last_name/ig)
   {
   $match += scalar(@matches);
   if ($hours_worked > 40)
   {
   $ot_hours = $hours_worked - 40;
   }
   else
   {
   $ot_hours = 0;
   }
  $gross_pay = &sub_calc_ot_pay($hourly_wage, $ot_hours) +
   &sub_calc_normal_pay($hours_worked, $hourly_wage);
   $weight = $match;
   %employees = ($id => {  lname => $lname,
   fname => $fname,
   wage => $hourly_wage,
   hours_worked => 
$hours_worked,
   ot_hours => $ot_hours,
   gross_pay => $gross_pay,
   weight => $weight
});
   }
   else
   {
   chomp;
   }
   }
   if ($match > 0)
   {
   for (keys %employees)
   {
  if ($employees{$_}{$fname}=~m/^$first_name/ig)
  {
 print Tr();
 print td("$employees{$_}{$weight}").td("$id").
   td("$lname").td("$fname").td("$hourly_wage").
   td("$hours_worked").td("$ot_hours").
   td("$gross_pay");
  }
  if ($employees{$_}{$lname}=~m/^$last_name/ig)
  {
 print Tr();
 print td("$employees{$_}{$weight}").td("$id").
   td("$lname").td("$fname").td("$hourly_wage").
   td("$hours_worked").td("$ot_hours").
   td("$gross_pay");
  }
   }
}
   if ($match == 0)
   {
   print h2("Sorry there was no match for $first_name $last_name");
   &sub_search_form;
   }

}
sub search_form
{
   print start_form,
   p('First Name: '),
   textfield(-name=>'first_name', -size=>'20'),
   p('Last Name: '),
   textfield(-name=>'last_name', -size=>'20'),
   br, submit,
   hr,br,
   ul({-type=>'disc&#

Re: Help needed in extracting html over HTTTPS protocol.

2004-08-03 Thread T. Raymond
Anas,
I think it is doing that because it is the secure protocol. Presumably, I 
think that means that others can't tap into it unless they have a username 
and password or some other authorized access. If you're trying to extract 
from your own site, then I think you need to download the html into a 
folder onto your PC and then run your cgi through perl on your machine.
--Teresa

At 04:07 AM 8/3/2004, you wrote:
Hi All,
My requirement is to extract html from any site ( HTTPS) and then parse
it for selective contents
I am able to connect to HTTP sites but when it comes to HTTPS , it is
throwing errors.
Code snippet for HTTP
---
my $res;
use LWP::Request;
require LWP::UserAgent;
require Io::All;
 my $ua = LWP::UserAgent->new;
 $ua->timeout(10);
 $ua->env_proxy;
 $ua->proxy('http', 'http://proxy:80/');
 my $response = $ua->get('http://email.indiatimes.com');
 if ($response->is_success) {
   print $response->content;  # or whatever
 }
 else {
 die $response->status_line;
 }
-
This is working fine. Can any body help me with HTTPS?
Thanks
Anas Perwez
--
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: File upload question

2004-07-27 Thread T. Raymond
Hi Sean,
I'm not sure but try taking out "$q ->" in front of your print statements. 
i.e.: print header();

my $value=$q->param('upload_file');
Also, in the above you set the value of my $value but then do not use it 
elsewhere in your script. In the below you end up using the value of my $value.

if ($q->param('upload_file'))  {
  my $fh=$q->upload('upload_file');
  while (<$fh>) {
print $_;
  }
}
print $q->end_html();
-Teresa  


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



Re: perl script as binary

2003-08-21 Thread David T-G
Sven --

...and then Sven Bentlage said...
% 
% Thanks for the tips to everyone.
% > Can you turn the app into a web app?
% Unluckily that would be even more difficult, I think.

Hmmm...


% I`m trying to write a small script / program to shutdown a linux box 
% remotely.

That sounds easy.  Why not a secure & password-locked web page that takes
a challenge-response password and then uses sudo to execute a reboot?
You can do any number of things to ensure a one-time use of a page and
even a password so that nobody can resubmit the page or even the captured
stream and bounce your box when you weren't expecting it.

Frankly I'd rather something like this than a remote script that can
connect to bounce the box; the latter seems entirely too hackable and now
you've just given away root access entirely.


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


downloading data as text file

2003-03-26 Thread T. Murlidharan Nair
Hi!!
I need to provide the users that access my database a way to
download data as a text file.  The data is stored in a mysql database, has
anyone done this, if so I would really appreciate their help.
Thanks and Cheers always!!
Murli


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


Re: FW: Perl/CGI with FRAMES

2003-03-03 Thread Fred T. Sanders

- Original Message - 
From: "Fred T. Sanders" <[EMAIL PROTECTED]>
To: "drieux" <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 9:20 PM
Subject: Re: FW: Perl/CGI with FRAMES


I haven't read through the whole thread but has anyone suggested just using
the  tag to set a global target for all links in the page.

i.e. 

Fred T. Sanders

- Original Message -
From: "drieux" <[EMAIL PROTECTED]>
To: "Maureen E Fischer" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 7:43 PM
Subject: Re: FW: Perl/CGI with FRAMES



On Monday, Mar 3, 2003, at 09:38 US/Pacific, Maureen E Fischer wrote:
[..]
> My Hesitation is that I wrote the system without this in
> Mind.
[..]

I was afraid you would notice that.

the two crucial places you will need to think your
way through the frame problem is

a. 
b. 

most people do not think about why the target attribute
is there to begin with and this is a part of the why.

What can help is if you 'story board' the flow - so you
know where things are suppose to be landing. Fortunately
ruth worked much of that out, and it was up to me to
make the static html mock up actually become dynamic,
do the queries, resolve incoming queries, and make sure
that the 'output' went where it was suppose to go.

What I finally did was flat out CHEAT

Wetware::Hq::Web::Page

became a module with our basic 'pages' - one of which
I showed which is how we lay out the basics at the
index.cgi level - there are also methods for making
a vertical Navigation page - and the other basic
framework for each type of page so that all of the
basic 'look and feel' is all managed in one place.

This of course lead to

Wetware::Hq::Web::Page::

These are basically how to cache that we have these
specific types of arguments and stuff

Remember that SSI's can help in a bunch of other ways
as long as your client does not have a 'specific look'
that requires that things lay out in a given manner.

ciao
drieux

---


--
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: checking if its a real number

2003-02-27 Thread T. Murlidharan Nair
Thanks to all for replying to my questions.
Cheers always!!
Murli
zentara wrote:

On Wed, 26 Feb 2003 16:30:56 -0800, [EMAIL PROTECTED] (T. Murlidharan Nair)
wrote:
 

I have a cgi that  need to accept only  numeric values. ie +ve or -ve 
real numbers.
Is there a quick and easy way to check this. I was trying using a reg exp
if(/^[-0-9][\.0-9]*/) {
do something
}

but this breaks when the number is say --75.4  It still accepts if it 
has two - signs.
   

$_ = 4.01;

if (/\D/){ print "has nondigits\n" }
if (/^\d+$/) { print "is a whole number\n" }
if (/^-?\d+$/)   { print "is an integer\n" }
if (/^[+-]?\d+$/){ print "is a +/- integer\n" }
if (/^-?\d+\.?\d*$/) { print "is a real number\n" }
if (/^-?(?:\d+(?:\.\d*)?|\.\d+)$/) { print "is a decimal number\n" }
if (/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/)
{ print "a C float\n" }
°
Also check out the Regex::Common module, it has number-type detection.


 

-



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


checking if its a real number

2003-02-26 Thread T. Murlidharan Nair
I have a cgi that  need to accept only  numeric values. ie +ve or -ve 
real numbers.
Is there a quick and easy way to check this. I was trying using a reg exp
if(/^[-0-9][\.0-9]*/) {
do something
}

but this breaks when the number is say --75.4  It still accepts if it 
has two - signs.

Thanks for your help.
Cheers always!!
Murli


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


NULL insertion

2003-02-24 Thread T. Murlidharan Nair
Hi!!
I need to insert NULL into the database using a perl CGI . So if a variable
is to be made NULL in perl and it needs to be used in an sql statement what
is best way to do it. Do I assign ' \N' to it or 'NULL' ?
Thanks and Cheers always!!
Murli




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


Perl problem:(

2003-02-14 Thread t
Hello all:)

You have been greaet helps to me in the past, and im hoping you can help now:) A 
friend of mine is
in a class learning perl and her script keeps getting an error that there is a bracket 
missing on
line 190. When i looked at it, all i could see was the nested statement problem i had 
at one time.
Do you think that is the problem? and if so, what would be the best way to fix it? I 
want her to
be able to learn it, not to have it done for her, but i want to give her the best 
advice possible:

Script:::

#!/usr/bin/perl
#
#   lab3.pl
#

my @scorearray;

sub getinformation()
{

local $score = 0;
local $total = 0;
local $ctr = 0;
local $rpt_ctr = 0;
open (OUTFILE, ">>info.txt")
|| die "cannot open info.txt $!";

local $var = "bad";
while ($var eq "bad")
{
print "enter student's first name: ";
$firstname = ;
chop ($firstname);
$length = length($firstname);
if (!$length)
{
print "Not a valid First Name, try again.\n";
next;
{
if($length > 20)
{
print "Not a valid First Name, try again. \n";
next;
}
if($length)
{
$var = "good";
print (OUTFILE "$firstname|");
}
}   

local $var1 = "bad";
while ($var1 eq "bad")
{

print "enter student's last name: ";
$lastname = ;
chop ($lastname);

if (!$length1)
{
print "Not a valid last name, try again. \n";
next;
}
if($length1 > 20)
{
print "Not a valid last name, try again. \n";
next;
}
if($length1)
{
$var1 = "good";
print(OUTFILE "$lastname|");
}
}

local $var2 = "bad";
while($var2 = "bad")

{
print "enter student's SSN:";
$ssn = ;
chop($ssn);

$length2=length($ssn);
if(!$length2)
{
print "Not a valid Social Security Number, try again.\n";
next;
}
$ssn =~ s/[^\d]//g;
if($ssn !~ m/^\d{9}$/)
{
print "Not a valid Social Security Number, try again.\n";
next;
}
if($ssn =~ m/^\d{9}$/)
{
$var2 = "good";
print(OUTFILE "$ssn");
}
}


local $ctr1 = 1;
while ($ctr < 4) 
{

print "enter a test score $ctr1: ";
$score = ;
chop ($score);

if ($score eq "q")
{
last;
}

local $error = "true";
testscore($score);

if ($error eq "false")
{
next;
}
else
{
$total += $score;
$ctr++;
$ctr1++;
$scorearray[$ctr]=$score;
}

};

while($rpt_ctr <= $ctr)
{
print (OUTFILE "$scorearray[$rpt_ctr]");

if($rpt_ctr < 3)
{
print(OUTFILE "|");
}

$rpt_ctr++; 
}

print (OUTFILE "\n");
getscore();
};

sub getscore()
{
local $display = 4 - $ctr;
local $avg = $total / 4;
print "Score total is $total \n";
print "number of scores entered is $ctr \n";
print "Score Average is $avg \n";
print "$firstname is missing $display tests\n";
warnings();
};

sub testscore()
{
if ($score > 100)
{
print "invalid score, please make sure the score is less than or equal 
to 100\n";
$error = "false";
}
if ($score < 0)
{
print "invalid score, please make sure the score is greater than or 
equal to 0\n";
$error = "false";
}
};

sub warnings()
{
if ($avg <= 60)
{
print "Grim Warning, $firstname !";
}
elsif ($avg <= 70)
{
print "Uh-oh! You maybe in trouble, $firstname !";
}
elsif ($avg <= 80)
  

Re: Graphs on the fly

2003-01-15 Thread T. Murlidharan Nair
Does this work for Unix? Which module do I use for Unix ...
Thanks and Cheers always!!
Murli


[EMAIL PROTECTED] wrote:


In a message dated 1/14/2003 4:33:13 PM Eastern Standard Time, 
[EMAIL PROTECTED] writes:


 

Can anybody tell me how to install GD for Active State Perl?  Thanks a lot.
   


Go: http://www.activestate.com/PPMPackages/zips/6xx-builds-only/GDTextUtil.zip";>Here and download GD.zip. Unzip, and chdir to the directory you 
downloaded to. Then do "ppm install GD.ppd"
Repeat with GDGraph.

 


-




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




Graphs on the fly

2003-01-13 Thread T. Murlidharan Nair
Hi !!
Does any one have a module that I can use to generate bar graphs  using
a cgi ?
Thanks and Cheers always!!
Murli



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




Nested hash

2002-12-12 Thread T. Murlidharan Nair
Hi!!
I have a CGI that updated a mysql database, I have a nested hash 
structure in it.
something like
$repeats{$solID[i]}{$expId[i]}{$elemenet[$i]}=1

If I am to check this hash  is the inner loop written as
foreach $k1 (keys %repeats){
   foreach $k2 (keys  %repeats{$k1}) {
   foreach $k3( keys %repeats{$k1}{$k2}){
if ($repeats{$k1}{$k2}{$k3} 
==1){
   print "I got it\n";
   }
 }
   }
   }

Is this correct ??
Thanks  and Cheers always!!
Murli


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



Checking for existance for data in a column

2002-12-03 Thread T. Murlidharan Nair
Hi!!
I have a CGI that looks up data from a mysql data base and
does a bunch of calculations.  I only want to do calculations
on the columns which contains any data.  What I mean is for
some colums there is no data available at all.  So I don't want to do
any calculations on them obviously.  How do I check whether
the column contains data, once I have retrived all the  data
using fetchrow_hashref().
Thanks and Cheers alway!!
Murli



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




Another Hash ref question

2002-11-14 Thread T. Murlidharan Nair
I am writing this  as part of a module, so it prints fine in the main 
but not in
the method...
Any suggestions .

sub new{

while (my $hashRef = $sth->fetchrow_hashref()) {

   foreach $keys(keys %$hashRef){

   $self->{'_colData'}{$keys}=$$hashRef{$keys};

  print "$self->{'_colData'}{$keys}\n"; # IT PRINTS FINE HERE 
   #print "$keys\t";
   #print "$$hashRef{$keys}\n";

}

  }
}


sub dump{
   my $self = shift;

   my ($keys, $n_col, $n_row);

   foreach $keys(keys (%{$self->{'_colData'}})){
  
   print $self->{'_colData'}{$keys};  IT IS NOT DOING IT HERE, I CALLING THE METHODS PROPERLY
  }
  my $getchar =<>;

}

	
Thanks and cheers always!!
Murli






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



fetchrow_hashref

2002-11-14 Thread T. Murlidharan Nair
Hi!!
I am retriving data in a while loop using fetchrow_hashref
How do I assign it to another hash.  I am trying the following

   while (my %hashRef =$sth->fetchrow_hashref()){
   foreach $keys (keys %hashRef){
   print $keys;
   print "$hashRef{$keys}\t";
   }
   print "\n";
}

Its  does not return me anything. Please let me know if there is a  better
way to handle it.

Thanks and cheers always!!
Murli



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




Re: Unable to run cgi script

2002-11-11 Thread David T-G
Kelvin --

...and then Kelvin McWha said...
% 
...
% 

I *think* you have to qualify this, as

  action="http://localhost/home/kelvin/cgi-bin/myscript.cgi";>

Certainly worth a try...


HTH & HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg06869/pgp0.pgp
Description: PGP signature


Writings PERL CGI in windows environment

2002-10-28 Thread T. Murlidharan Nair
Hi!!
Has any one written  something similar to using a LWP user agent
under windows environment ?  If you have an example code that
greatly help.
Cheers always!!
Murli



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




Perl MSGraph

2002-10-28 Thread T. Murlidharan Nair
Hi!!
I must confess this is not a Perl CGI question, but,since we have some 
Perl gurus here
I am taking the liberty to ask this question, hoping that  someone might 
be able to help me
out.
Has anyone used the MSGraph module developed by Mark Solomon? I am 
getting having
problems with his example code. It is asking for some dec2hex.pl file. 
The example code
does not provide them. The code contains a statement requires dec2hex.pl 
.. I tried other
examples which does not contain this, then it complains by saying  Can't 
locate object method "gif"
via package "GD: :Image" at pie.pl  line 19
The URL for MSGraph is http://www.seva.net/~msolomon/MSGraph/
I would really appreciate if someone could help.
Thanks and Cheers always!!
Murli

-
Department 0537,   
San Diego Supercomputer Center   
University of California, San diego, 
La Jolla, CA 92093, USA  
Lab: 858-822-0887 
Res: 858-277-8809
http://www.sdsc.edu/~nair
-



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



ending a script

2002-09-12 Thread t

I have now got my script to work off of my html form (thanks for all the suggestions, 
turns out if
i take out the eq out of the if/then statements, it works), but i have found a rather 
bizarre
problem. run against the html form it works fine, BUT, if i just try to run the cgi 
script, it
just keeps running and fills up the error log with unitialized value errors over and 
over. We have
constant idiots who keep running things against our server, and so i know we could end 
up having
an overload if we are not careful. How do i get it to end if it didn't come from the 
form>?

thia



__
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

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




uninitialized values

2002-09-11 Thread t

Hello:)

in my script my values come from my html form. I define them with:

my $OptOut = $q->param( "OptOut" ); 

BUT, when i try to get them to print in the e-mail, i get the uninitialized value 
error "Use of
uninitialized value at /cgi-bin/newreg.cgi line 316."

(thE FOLLOWING STARTS WITH line 316)
if  ($OptOut eq "Yes") 
{print MAIL "\t-Do not use my information\n\n";}
else {print MAIL "\t-not checked\n\n";}

I am using the cgi.pm module on an IHS server. Besides the error, it also gives me a 
screen after
i hit submit on the form that says i have a header error. But it doesn't do it 
everytime, so i
don't know if i really have one or not:(

Anyone ever come across this before? I would really appreciate your help:)

ty

thia



__
Yahoo! - We Remember
9-11: A tribute to the more than 3,000 lives lost
http://dir.remember.yahoo.com/tribute

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




Perl CGI Object handling

2002-09-10 Thread T. Murlidharan Nair

Hi !!
Well, I am not sure how to pose this question properly, but let me
give it a try.
I am have a cgi that reads the file and loads it into a mysql database.
The entire file is read as an object and the methods associated with
that object then does all the work like chacking the data formats
and loading the file in to the database. Once I have created the
object  is it possible throw something to the browser and access
that object back again. What I want to avoid here is the reading of the file
 and intantiating the object again.
Thanks
Cheers always!!
Murli







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




Re: Error: requires explicit package name

2002-08-30 Thread t

Felix

Thanks! That was just what i needed:)

thia


--- Felix Geerinckx <[EMAIL PROTECTED]> wrote:
> on Fri, 30 Aug 2002 13:58:47 GMT, [EMAIL PROTECTED] (T) wrote:
> 
> >  "Global symbol "$auto" requires explicit package name"
> 
> [...]
>  
> >  if ($Country eq "Argentina")
> >  {my $auto = $q->param( '[EMAIL PROTECTED]' ); 
> >  }
> > and
> >  if ($Country eq "Argentina")
> >  {$auto = $q->param( '[EMAIL PROTECTED]' ); 
> >  }
> > 
> 
> A lexical my declaration is only visible in the enclosing block.
> 
> You should write:
> 
> my $auto;
> if ($Country eq "Argentina") {
> $auto = $q->param( '[EMAIL PROTECTED]' );
> }
> 
> See M-J. Dominus' "Coping with Scoping" article for an excellent 
> introduction to scoping at
> 
>   <http://perl.plover.com/FAQs/Namespaces.html>
> 
> -- 
> felix
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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




Error: requires explicit package name

2002-08-30 Thread t

Hello:)

i am working on a script and have come across a problem. if i call a variable from the 
preceeding
form, it works correctly, BUT, if i declare a variable within the script, then try to 
use it as
the "To:" fiels in an e-mail, it tells me that 
 "Global symbol "$auto" requires explicit package name"

i have been looking through my perl and cgi books to try to figure out what this 
means, but am
totally at a loss. 

i have declared it two different ways, and both ways it comes back with the same error:

 if ($Country eq "Argentina")
{my $auto = $q->param( '[EMAIL PROTECTED]' ); 
}
and
 if ($Country eq "Argentina")
{$auto = $q->param( '[EMAIL PROTECTED]' ); 
}

i figure i am probably missing one little thing, but i can't figure out what it is. 
Anyone got any
ideas? This is the last part of my script that i need to get working, as it will be a 
huge
if/elsif statement that i will end up putting into a module.

thanks:)

thia

__
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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




telnet/ssh web interface

2002-08-27 Thread David T-G

Hi, folks --

Has anyone seen or written some code that will talk to a shell or ssh
socket on one side and a web page on the other?  I'd like to build a
web ssh script for those times when I have nothing but a web browser
available and want to get to my shell.

This seems quite complex but nonetheless not impossible.  It should
make an ssh connection to my account, since obviously I'm not the web
server, and should run over ssl so that nobody can see my text content,
and should have some sort of authenticaion so that only I can use the
page and run the script, and it should have a session ID so that not only
can the state be maintained but perhaps I could have a second session as
well.

Any thoughts?


TIA & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg06347/pgp0.pgp
Description: PGP signature


Re: problems with sendmail within a cgi

2002-08-16 Thread t

Janek,

YAY, that was the problem. So, now it sends it correctly. I am seeing one other 
problem now that i
can get that to work, i have changed it to 

my $recipient = $q->param( "recipient" ) =~  /^[\w@\,\-]+$/;

print MAIL < wrote:
> No Longer Exists wrote at Wed, 14 Aug 2002 21:40:41 +0200:
> > I have this code that redirects just fine, gives me no
> > errors, yet will NOT send out the e-mail that is
> > written within the script. IT is running on a AIX
> > machine. Anyone have any ideas on how to get the
> > e-mail to run? i have to rewrite ALL 100+ scripts
> > within my companies cgi-bin within 3 weeks and could
> > REALLY use the help:)
> > ...
> > open MAIL, "| '/usr/lib/sendmail' -t -i" or die "Could
> > not open sendmail: $!";
> > 
> > print MAIL < > To: cynkim\@yahoo.com
> > From: mememememe\@yahoo.com
> > Reply-To: cynkim\@yahoo.com
> > Subject: Perl security test
>   ^^
> > 
> > This is a test, it is only a test
> > EOM
> > close MAIL or die "Error closing sendmail: $!";
> 
> I'm not sure,
> but I can't imagine that sendmail works with indented headers in that way
> (even if these are only tabs).
> 
> You should better try:
> 
> print MAIL < To: cynkim\@yahoo.com
> From: mememememe\@yahoo.com
> Reply-To: cynkim\@yahoo.com
> Subject: Perl security test
> 
> This is a test, it is only a test
> EOM
> close MAIL or die "Error closing sendmail: $!";
> 
> 
> Best Wishes,
> Janek
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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




Re: Checking Form data

2002-08-14 Thread David T-G

Jim, et al --

...and then Jim Lundeen said...
% 
% on a side note:  does anyone know the % of people that actually disable
% javascript in their browser?  can javascript actually be used to harm (lets

100% of the people on my computer do :-)


% pretend those annoying pop-up windows don't count!)?   i'm not really a
% hard-core javascript person, so any stats that you have would be interesting
% and helpful...   thanks!

I don't have anything handy, I'm afraid, but I know that my brother wrote
a 5-minute hack that will kill any browser running JS a few years ago --
and he's not even a cracker type.  It is my understanding that JS cannot
actually create/modify/destroy files, but it can read them and transfer
data, so at the very least it's a privacy hole.

I'm interested in this topic, and particularly interested in just what JS
can and cannot do, so please at least keep me in the CC list if this
thread goes off-list (which it probably should).


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg06209/pgp0.pgp
Description: PGP signature


Re: new lines and stupidity

2002-08-14 Thread David T-G

Jimmy --

...and then Jimmy George said...
% 
% Hello World

Hi!


% 
% David pointed out that the \n is not applicable in the context I was in
% and that the html  was. Of course! Only silly tired people like me
% do dumb things like that after having been using them in text
% definitions for the previous hour or more.

Don't be so hard on yourself; it happens to us all :-)


HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg06205/pgp0.pgp
Description: PGP signature


Re: REMOVE ME from your mailing list!

2002-08-13 Thread David T-G

Troy, et al --

...and then Troy May said...
% 
% LOL  This cracked me up!  :)

Happy to be of service :-)


Thanks & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg06193/pgp0.pgp
Description: PGP signature


Re: REMOVE ME from your mailing list!

2002-08-13 Thread David T-G

Mr. Buskirk --

...and then Buskirk, Richard Mr USAREC said...
% 
% i have done everything but beg and i dont want to recieve this again!

I am sorry to hear of your difficulties unsubscribing.  Subscribing to
and unsubscribing from mailing lists are extremely delicate technical
procedures and should not be attempted by amateurs.


% Alternate Email account
% [EMAIL PROTECTED] 
% [EMAIL PROTECTED]
% Richard L. Buskirk
% Software Developer/Web Developer

You have two more email accounts in the mix?  My goodness; that could be
extremely challenging.

I recommend that you take advantage of our unsubscription service
immediately.  Simply send your credit card number (we'll give you a
multiple-account discount price of $40 instead of the usual $15 per
account) and account passwords to the list and you will receive immediate
attention.  I'm sorry, but because we do not have a color laser printer
we cannot accept cash via email at this time.


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

Don't read the lines just above this...  Whatever you do, don't look at
them.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg06191/pgp0.pgp
Description: PGP signature


Re: Annoying 1

2002-08-01 Thread David T-G

Kyle --

...and then Kyle Babich said...
% 
% What do you mean empty?  I tried it, it works.  When I open the file it
% adds the 1 as the last character of the file.  So when I chop it the 1
% gets deleted.

That's only because you print $content at the end of your script --
you're not really printing the whole file there, but line by line in 
each of your open loops!  Take a look again at my example, and try
printing your $content with a few more surrounding diagnostics (or, 
of course, dive into the debugger and just take a look at it directly).


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg06117/pgp0.pgp
Description: PGP signature


Re: Annoying 1

2002-08-01 Thread David T-G

Kyle --

...and then Kyle Babich said...
% 
% Nevermind, I spoke to soon.  I just "chop()"ed the 1 off to fix it.

Um, now it's empty...  

  bash-2.05a$ cat patient.records
"Electronic patient records are becoming tologically
reified entities that play the role of epistemic patient
analogues in information space."
  
"Health information,
privacy, confidentiality and ethics," Eike-Henner W. Kluge,
"International Journal of Bio-Medical Computing, 
vol. 35 (Suppl. 1) (1994), pp. 23-7
  bash-2.05a$ \
  > perl -e '$content=open(F,"patient.records"); \
  > print "HERE IT COMES\n"; print $content ; \
  > print "THERE IT WAS\n"; close(F);'
  HERE IT COMES
  1THERE IT WAS
  bash-2.05a$ \
  > perl -e '$content=open(F,"ppatient.records"); \
  > print "HERE IT COMES\n"; print $content ; chop $content; \
  > print "THERE IT WAS\n"; close(F);'
  HERE IT COMES
  THERE IT WAS

Just what were you planning to do with $content anyway?


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg06114/pgp0.pgp
Description: PGP signature


Re: Annoying 1

2002-08-01 Thread David T-G

Kyle --

...and then Kyle Babich said...
% 
% I wrote the attached script not realizing that when I open() files it
% would return the 1 when it was sucessful.  How would I open a file

Yep.


% without the 1, or anything else besides the content of the file, being
% returned?

Just don't capture the result if you don't care; I see that you

  $content = open( INDEXDEF, " )
  {
print $_;
  }
#  flock ( INDEXDEF, LOCK_UN );
  close( INDEXDEF ) || die( "error:  close INDEXDEF failed\n" );

so you're reading the actual content in your while() loop; either skip
the $content trap or look at it as $success instead of $content.

From what I can tell you expect to capture "the whole file" for printing
later but, in the meantime, you also print it line by line.  Is doubled
output your intent?

It looks like your procedure is the same for every file except for the
name of the file you open.  Why not put your open / flock / seek /
while() / unlock / close (BTW, why bother with locking when you only
read?) in a function and pass it the filename, a la

  if ( $con eq "" || $con eq "index" ) { dofilemagic("index.html") }
  if ( $con eq "index2" ) { dofilemagic("index2.html") }
  if ( $con eq "main" ) { dofilemagic("main.html") }
  ...

(though I'd prefer to use the lovely Switch module from CPAN in this sort
of case)?


% 
% Thank you,
% --
% Kyle


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg06113/pgp0.pgp
Description: PGP signature


Re: Post to a second CGI script

2002-07-29 Thread David T-G

Jim --

...and then Jim Lundeen said...
% 
% Hello All,

Hi!


% 
% I have 2 scripts.  One accepts 3 values LOGIN_USERNAME, LOGIN_PASSWORD
% and ACTION from an HTML form.  That script looks in a user table in
% MySQL to verify the user.  If valid, it passes them to MENU.CGI with
% LOGIN_USERNAME and a unique session number (USN).

Good enough.


% 
% Here's the question:  How to I "post" the LOGIN_USERNAME and USN to the
% MENU.CGI script?  I don't want the user "carrying" the info around in
% the "Location" bar as "?USN=1234&LOGIN_USERNAME=somebody" -- I want it

Right.  That would be ugly.


% to be part of the user's Perl process if you know what I mean, so that
% if they hit RELOAD the values are still with them.  Too, I don't want
% someone trying to modify the info if it were in the "Location" bar, so
% it needs to be a part of the "post."

I can never remember which is POST and which is GET, but just have your
script pass the data over to MENU.CGI (are you on a Win machine, BTW, or
do you ALWAYS SHOUT? ;-) in the environment as that-which-is-not-the-url
method does.


% 
% Any advice would be much appreciated!

HTH & HAND


% 
% Thanks!
% 
% Jim
% 


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg06068/pgp0.pgp
Description: PGP signature


Re: Finding the country

2002-07-24 Thread David T-G

Teddy --

...and then Octavian Rasnita said...
% 
% Hello all,

Hi!


% 
...
% I would like to find the IP address of the visitor ISP, or something else
% that can help me to  find the country.

That's easy; just use %ENV{REMOTE_ADDR} as Apache hands it to you.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05989/pgp0.pgp
Description: PGP signature


Re: question about cgi-lib.pl

2002-07-23 Thread David T-G

Michal --

...and then Michal Simovic said...
% 
% I'd like to ask how to tell perl script to use
% cgi-lib.pl and where cgi-lib.pl should be placed.

1) I agree with Connie; you're probably using really old code.

2) To use a module, just

  use modulename ;

and away you go.

3) To use code from another file that isn't a module (not that I'm
recommennding that, and watch for drieux to chime in here on why you
shouldn't and how easy it is to not :-) require it instead, IIRC:

  require somefilename.pl ;

4) If the module is in a directory in your @INC array then you don't have
to do anything to tell perl where it is.  If it isn't, you could set

  PERLLIB="/path/to/dir-containing-module"

or

  PERL5LIB="/path/to/dir-containing-module"

in your shell or

  use lib ( /path/to/dir-containing-module ) ;

in your script code to add that directory to @INC, or you could just

  use /path/to/modulename ;

and explicitly point to the module, each of which has its own pros and
cons.

5) If you're installing the module, perl will probably put it in a right
place for you.  If you're installing the non-modular file, put it in a
directory in your @INC to find it effortlessly or anywhere you want to
make yourself use the tricks in 4) above.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05963/pgp0.pgp
Description: PGP signature


Re: Running CGIs offline

2002-07-22 Thread David T-G

Bob, et al --

...and then Bob Showalter said...
% 
% > -Original Message-
% > From: David T-G [mailto:[EMAIL PROTECTED]]
...
% > You know, it never hurts to check CPAN; maybe someone has 
% > already written
% > a little web server in perl :-)
% 
% HTTP::Daemon, part of Bundle::libwww

Way cool.  Awesome.  I should have looked myself :-) but it only occurred
to me as I was answering him.  Can't wait to install this sucker; this'll
be good.


Thanks! & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05950/pgp0.pgp
Description: PGP signature


Re: Running CGIs offline

2002-07-22 Thread David T-G

Timothy --

...and then [EMAIL PROTECTED] said...
% 
% I'm interested in taking a website, composed of HTML and perl cgis and
% moving it offline. I want to burn it to a CD that will run on Mac and PC,
% Explorer and Navigator. Are there tools to do this sort of thing? A
% browser-based perl interpreter? A CGI faker?

I hate to just add a "me too", but that's basically all this is.  I doubt
that you'll find what you seek, but I'm interested if you do.

The problem is that a web server is much more than just a script and 
your browser; the web server code is what calls the script, hands it 
the environment, and takes the results and ships them to your browser.
Without it you're just looking at file:/// static pages; you can have 
the browser run a script (or I'd be much happier in a couple of other
projects).  Your best bet for ultimate portability is (I hate to say it)
javascript (oooh, I feel so dirty), but even it can't do everything that
a perl (or even php, also interpreted by the web server even though it's
written in your .html page) script can.

The closest thing to what you seek, I think, is some standalone little
web server that runs on your various platforms, handles any calls to
scripts, and so on.  That, while non-trivial, seems like it could be
written (even in perl, of course!) so all you'd need would be

  - perl package for every OS/arch you have in mind (so it'll run from CD)
  - some script that helps you find the proper version, I imagine
  - this magic perl web server
  - your web site content
  - all of your scripts, rewritten to find the proper perl from the CD

and away you go.  This magic script, in order to have a browser talk to
it without knowing the difference, would have to grab port 80 (or maybe
 or whatever; it's your choice) and talk to the internal network,
which could be tricky on, say, a Win box with no network stack loaded,
and I'm sure it could be dumb enough to not have to talk off the box (but
it might be nice to make it smart enough to not talk off the box so that
nobody can hit you while this is running).

You know, it never hurts to check CPAN; maybe someone has already written
a little web server in perl :-)


% 
% Thank you for whatever you say!


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05948/pgp0.pgp
Description: PGP signature


Re: CGI Calendar Script

2002-07-10 Thread David T-G

Gunther, et al --

...and then Gunther Birznieks said...
% 
% At 08:55 AM 7/10/2002, David T-G wrote:
% >
...
% >searching (fruitlessly) for a calendar that will print multi-day events
% >in a lined-up bar across the days instead of jumbling events together.
% >Will yours work for me?
% 
% Our calendar does something like this within our day view. We call it a 
% "chunking algorithm" to allow events to span different hours and overlap 

Good name; quite descriptive.


% with other events within the same day while looking nice.

Exactly.


% 
% Our month and week views do not do this same chunking (the events are just 

Ah.


% repeated) but the general chunking algorithm could probably be reused in 
% our month and week views if this was something you were keen on.

That's good to know.


% 
% It's part of the downloads on http://www.extropia.com/

Thanks; I'll save the bookmark!

extropia sounds very familiar; hmmm...  Ah!  Yep; I hit the Selena web
page when looking for web-based calendars back in '98 or so :-)  Perhaps
it's time I visited again.


% 
% Later,
% Gunther
% 


Thanks again & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05812/pgp0.pgp
Description: PGP signature


Re: CGI Calendar Script

2002-07-09 Thread David T-G

Roger --

...and then Roger Spears said...
% 
% Hello,

Hi!


% 
% Well for my next project I'm trying to build an interactive calendar
% system using Perl/CGI.

Neat.  I'd be quite interested in the finished product.  I've been
searching (fruitlessly) for a calendar that will print multi-day events
in a lined-up bar across the days instead of jumbling events together.
Will yours work for me?


% 
% I've got it all worked out on paper...almost, but I can't figure out how
% to get the script to actually fill in the table of boxes which represent
% the days of the month.  That is to say, how can I get the script to
% figure out that the 1st of July this year was a Monday?  Anyone know of
% any example scripts or snippets of code I could look at for this
% project?

You mean something like

  bash-2.05a$ cal 07 2002 | head -3
   July 2002
  Su Mo Tu We Th Fr Sa
  1  2  3  4  5  6
  bash-2.05a$ \
  > perl -e 'use Date::Manip;print Date_DayOfWeek("7","1","2002") . "\n";'
  1
  bash-2.05a$ cal 08 1968 | head -3
  August 1968
  Su Mo Tu We Th Fr Sa
   1  2  3
  bash-2.05a$ \
  > perl -e 'use Date::Manip;print Date_DayOfWeek("8","1","1968") . "\n";'
  4

or so? :-)  If you know the epoch time of a given date then localtime
will give you the day of the week, too, but I couldn't think of a way to
get the right expr to feed localtime in thirty seconds so I fell back on
an additional module (which is quite handy, BTW).


% 
% Thanks,
% Roger

HTH & HAND


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05807/pgp0.pgp
Description: PGP signature


Re: how to add

2002-07-07 Thread David T-G

Henk --

...and then Henk van Ess said...
% 
% Connie, Niko & Janek,
% 
% Ty for you fast input. Your suggestions assume that the "'s are added
% during the inputphase. But I want the "'s to be added AFTER the user entered
% the input. Do your suggestion still work then?

Sure.  Using the examples provided, you can see how to modify any string.
In fact, limiting it to only input that was just collected is a bit
trickier than the general case.

Once you have a string from some source (user, file, whatever), just wrap
it in quotes as shown and then write it somewhere as you like.


% 
% -- 
% Best regards,
%  Henk  mailto:[EMAIL PROTECTED]


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05763/pgp0.pgp
Description: PGP signature


Re: Extract numbers from in between parentheses with regex

2002-06-26 Thread David T-G

Kristofer --

...and then Kristofer Hoch said...
% 
% David(s),
%  Thank you for your help. It works perfectly now. I am adding in both of 
% y'alls names into my class file for your help.

Happy to help!


% 
% 
% (803 is South Carolina, which should explain the accent on the yall)

I know.  Less than a week and I'm home in Atlanta!  Yee ha!


% 
% 
% Thank you botha again.
% Kristofer.


HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05596/pgp0.pgp
Description: PGP signature


Re: Extract numbers from in between parentheses with regex

2002-06-26 Thread David T-G

Kristofer --

...and then Kristofer Hoch said...
% 
% David,
%  Thank you very much for your help. Don't know Utah, I have a lot of 
% friends from there. The expression you provided is almost what I am after.. 
% Here is my string.
% 
% my $String = "Characters(803), Value(3)";
% 
% What I am trying to get is "803", but I keep getting "(803)". Is there a 
% way to get 803 without the enclosing parens?

His method almost works for you; you simply have to change around the
parens:

  [zero] [1:55pm] ~>  \
  perl -e 'my $var = "Characters(803), Value(3)"; $var =~ /\((\d+)\)/; \
my $output = $1 ; print "output is $output\n";'
  output is 803

When doing string matching, as you've found, () will match a pattern and
then store the result as $1 or $2 or whatever is appropriate.  David's
first example explodes a bit to

  ( \(numbers\) )

which means "start saving your place for $1 later" and "match an actual
opening paren and then some digits and an actual closing paren" and
then, finally, "you're finished saving your place for $1".  Of course,
you want the in-the-text parens outside the save-your-place expression,
so it changes from

  (\(\d+\))

to

  \((\d+)\)

and if we knew that your target digits would be the first on the line
like in the example instead of "My2Thing(803), Value(3)" which would mess
us up, we could just use

  (\d+\)

because it would simply match the digits and ignore the parens
completely.


% 
% Thank you
% Kristofer


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05594/pgp0.pgp
Description: PGP signature


Re: passing variables in POST

2002-06-25 Thread David T-G

Marty, et al --

...and then Marty Landman said...
% 
% At 05:47 AM 6/25/02 -0700, John Brooking wrote:
% 
...
% >  But wait, there's more! Even if your script *did*
% >check the referer, that's no protection either! An
% >experienced programmer can easily use Perl's LWP
% >module or its equivalent in some other language to
% >make the request with a faked referer variable. So
% >really, POST variables are no more secure than GET
% >variables, it just takes a little more doing to fake
% >them.
% 
% Didn't realize this. What exactly is the right procedure then to safeguard 
% scripts such as formmailers from being hijacked?
% 
% >   By the way, I'm still not a security expert, so
% >don't take my word as the final one either!
% 
% Me either, eager to learn and improve myself.

It takes being hacked a lot to finally be able to call yourself an
expert :-)


% 
% Marty
% 
% --
% SIMPL WebSite Creation: http://face2interface.com/Home/Demo.shtml


TIA & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05558/pgp0.pgp
Description: PGP signature


Re: passing variables in POST

2002-06-25 Thread David T-G

Marty --

...and then Marty Landman said...
% 
% At 06:50 AM 6/25/02 -0500, David T-G wrote:
% 
...
% >view the page source and you will see the form structure and the hidden
% >(note that "hidden" simply means "don't bother to try to display on the
% >page", not "secretly encrypted or made to disappear so that nobody can
% >find it") variable right there.
% 
% Oops, sorry I didn't follow this thread from the beginning David or I 

I wondered about that...


% would've understood your point; which is that hidden form fields aren't 
% and are certainly no place to put data that shouldn't be available over the 
% web for site visitors to see.

Yep.


% 
% Right?

Absolutely.


% 
% >Well, the browser has to know what to send back to your script as STDIN,
% >no?  And if it knows what to send, then it must have that on the page
% >somewhere, no?  And if it's on the page somewhere then the user can see
% >it, no?
% 
% Absolutely... so can a program for using LWP for example. I could even find 
% it using the GRABURL Windows app from a  batch exec, then parse out the 
% hidden form fields on my PC using Java or C++.

Of course.  I just wanted to show the easy example, particularly since
it's my understanding that the goal is to keep the user much less some
intelligent hacker, from seeing this data -- and the user pretty much
only has 'view source' at his disposal, but that's more than enough in
this case.


% 
% The proper way to handle this kind of requirement imo is to use a hidden 
% form field with a key, and then have the server side pgm validate the 
% HTTP_REFERER. So the key itself is of no value unless the authenticated 
% referer coupled with the key tells the server pgm to access the secured 
% info using that key.

Sounds good to me.  I actually don't have enough info or experience to
design even a moderately secure system; that's why I'm following this
thread.  [My particular target application is a cookie-less clean-URL
SSL script framework; I want something robust and secure so that I can
run various applications, like a calendar or an anonymizer-style wrapper
or whatever, through this script *and* be "different" in two different
windows (maybe I want to talk to two hotmail accounts at once on the same
PC, for instance) and I don't want to have to turn on cookies (though
this script should handle them, if things were REALLY written elegantly)
on the PC, where I leave them and javascript off.]

As with most security and cryptography, though, some holes are easy to
spot and almost as easy to explain, so I jumped in the fray to clarify.


% 
% But you already knew that. :)

Well, yeah, but sometimes it takes a while for folks to believe it ;-)


% 
% Marty
% 
% --
% SIMPL WebSite Creation: http://face2interface.com/Home/Demo.shtml


HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05537/pgp0.pgp
Description: PGP signature


Re: passing variables in POST

2002-06-25 Thread David T-G

Marty --

...and then Marty Landman said...
% 
% At 06:06 AM 6/25/02 -0500, David T-G wrote:
% 
% >If the variables are in the page to be in the form to be
% >sent back via POST, then the user can find them, period.
% >
% >Try it yourself: set up something via POST and then surf to the page
% >and then "view source" or the equivalent in your browser (and if there
% >isn't an equivalent then find a browser, even if just for a moment,
% >that DOES have it) and look and see your data hanging right out there
% >for all to see.
% 
% David,
% 
% Sorry but I don't get what you mean here. When I have a page call a program 
% with info from a form being posted then the program picks up the data and 
% then creates whatever output web page is appropriate. The posted data comes 

Right.  That makes sense.  So you have something like

  page1   scriptpage2
  form   -->  think...  ->  some
var1process...output

right?


% in via STDIN so unlike a GET where the data is actually part of the URL, in 
% a POST it isn't viewable from the browser.

When you have page1 loaded and you're about to press the submit button
to send it, and your secret var1, off to the script, don't; instead,
view the page source and you will see the form structure and the hidden
(note that "hidden" simply means "don't bother to try to display on the
page", not "secretly encrypted or made to disappear so that nobody can
find it") variable right there.


% 
% If I'm all wrong about this please give a specific example... and sorry if 
% I'm being thick. Also I'm not claiming that POST is safe as is, that's what 

I trust that the example above will either illustrate the problem *or*
clarify any confusion; it's certainly possible that I'm misunderstanding
the process you propose.

Your turn to tell me if *I* am being thick :-)


% SSL is for to encrypt the data between the server and client and vice 
% versa. Only I don't get the exposure you're talking about. Didn't realize 
% that STDIN was part of the browser's viewable source code.

Well, the browser has to know what to send back to your script as STDIN,
no?  And if it knows what to send, then it must have that on the page
somewhere, no?  And if it's on the page somewhere then the user can see
it, no?


% 
% Marty
% 
% --
% SIMPL WebSite Creation: http://face2interface.com/Home/Demo.shtml


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05535/pgp0.pgp
Description: PGP signature


Re: passing variables in POST

2002-06-25 Thread David T-G

Niko, et al --

...and then Niko Gunadi said...
% 
% On Mon, Jun 24, 2002 at 02:35:06PM -0700, Ovid wrote:
% >Niko,
% >
% >If you pass the variables to the page, the user can find them, period.  If you 
control the output
...
% 
%   From what i know (which is limited :), if we pass the variable in POST
%   method, the user can't find out what we have passed, can they ?

Yes s/he can.  If the variables are in the page to be in the form to be
sent back via POST, then the user can find them, period.

Try it yourself: set up something via POST and then surf to the page
and then "view source" or the equivalent in your browser (and if there
isn't an equivalent then find a browser, even if just for a moment,
that DOES have it) and look and see your data hanging right out there
for all to see.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05533/pgp0.pgp
Description: PGP signature


Re: What editor for Perl do you recommend?

2002-06-24 Thread David T-G

Teddy, et al --

...and then David T-G said...
% 
% ...and then Octavian Rasnita said...
% % 
...
% % Can you recommend me a good editor for Perl scripts that runs under Windows?
% % It should:
% 
% vim.  Maybe gvim if you're feeling decadent.

I forgot to mention that it's lightweight and fast, too, unlike a certain
other entire operating system disguised as an editor! 


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05500/pgp0.pgp
Description: PGP signature


Re: What editor for Perl do you recommend?

2002-06-24 Thread David T-G

Teddy --

...and then Octavian Rasnita said...
% 
% Hi all,

Hello!


% 
% Can you recommend me a good editor for Perl scripts that runs under Windows?
% It should:

vim.  Maybe gvim if you're feeling decadent.


% 
% 1. Save the text with Unix end of lines.

Yep.


% 2. Write somewhere the current line I am in.

Yep.


% 3. Not necessary but it would be wonderful to have a hotkey to jump from
% subroutine to subroutine, or to list the subroutines in a combo or list and
% to be able to choose the one I want from there.

You can macro this, although paragraph-jumping is usually sufficient for
me.  I haven't yet played with folding in 6.x, but I look forward to it;
entire blocks (subroutines, modules, whatever) can get folded up in an
instant.


% 
% With all the success of Perl, I am wondering why isn't there any accessible
% good and proffessional editor for Windows.

There is; you just haven't met vim yet :-)  It has a wonderful syntax
file that does keyword highlighting and quote matching and so on.

Precompiled binaries for just about every OS, including DOS (yes, even
16-bit and you can still save in UNIX format!) and Windows, as well as
sources available from ftp.vim.org or http://vim.org at your leisure.


% 
% Thank you.
% 
% Teddy Center for the blind: http://teddy.fcc.ro/
% Mail: [EMAIL PROTECTED]

HTH & HAND


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05498/pgp0.pgp
Description: PGP signature


Re: test.cgi hashing error

2002-06-24 Thread David T-G

Kyle --

...and then Kyle Babich said...
% 
% That confuses me; I would just copy and paste and that would be it but 
% I would have no idea how that is working and I don't really want to put 

I think that's a wise course :-)


% anything in that I don't understand yet.  Is there a simpler way that 
% would be more like:
% 
% my $links = #hash here ;

Not really; you can't print the hash directly and have it look sensible.
But that's what the loop basically does below...


% 
...
% > ...and then Kyle Babich said...
% > % 
...
% > % How could I put this all into a scalar to call up later?
% > 
% > Didn't you try my idea from my last post?
% > 
% >   [zero] [6:42am] ~>  \
% >   perl -we 'my %pages = \

This starts perl and starts to define the %pages hash.


% > ("yahoo","http://yahoo.com","google","http://google.com";); \

This fills the %pages hash so we have an example.


% > my $output = "" ; while ( my ($key, $page) = each %pages ) \

This defines a scalar ($output) to catch the printing and starts a loop
that goes through the %pages hash for each element and assigns $key and
$page to hold what comes out.  This loop could be written a number of
different ways, as other folks have shown.


% >   { $output .= qq{$key\n};}; \

This appends (.=) to $output the text between the {} (which are used with
qq because we want to embed "" in the output and we don't want to mess
with escaping the quotes and so on).  It's the same as saying

  $output = $output . some_more_text

but it's a nice shorthand.


% > print "OUTPUT:\n$output";'

This just prints the result to prove the example.


% >   OUTPUT:
% >   http://google.com";>google
% >   http://yahoo.com";>yahoo

And there's the output as it would look when stuck into your HTML.


% >   [zero] [6:42am] ~>  

What you'd really do, after setting up $output as above, is then print
out your HTML something like

  print <
  ...
  
  ...
  My favorite links:
  $output
  
  
  EndOfHTML

and stick $output in where you want the links to show up.


% > 
% > % 
% > % Thank you,


HTH (more clearly this time!) & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05491/pgp0.pgp
Description: PGP signature


Re: test.cgi hashing error

2002-06-24 Thread David T-G

Kyle, et al --

...and then Kyle Babich said...
% 
% This is what I have:
% 
% my %pages = ("Yahoo","http://www.yahoo.com/";,
%   "Google", "http://www.google.com/";,
%   "All The Web", "http://www.alltheweb.com/";);
% 
% while ( my ($key, $pages) = each %pages ) {
%print qq{$key};
%  }
% 
% How could I put this all into a scalar to call up later?

Didn't you try my idea from my last post?

  [zero] [6:42am] ~>  \
  perl -we 'my %pages = \
("yahoo","http://yahoo.com","google","http://google.com";); \
my $output = "" ; while ( my ($key, $page) = each %pages ) \
  { $output .= qq{$key\n};}; \
print "OUTPUT:\n$output";'
  OUTPUT:
  http://google.com";>google
  http://yahoo.com";>yahoo
  [zero] [6:42am] ~>  

% 
% Thank you,
% Kyle


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05486/pgp0.pgp
Description: PGP signature


Re: test.cgi hashing error

2002-06-23 Thread David T-G

Kyle --

...and then Kyle Babich said...
% 
% Ok, I've got it down to one problem right now, I need an explicit 
% package name for this:
% foreach $key(keys %pages) {
%   print "$key\n";
% }

Well, only if you use it that way :-)


% 
% It says I need it for $key but no matter where I put the my it won't 
% stop giving me that error.  Where in that does the my go?

Right in front of the declaration (first use), of course:

  [zero] [8:45am] ~>  \
  perl -we 'use strict; my %pages = (); foreach $key (keys %pages) {print ".\n"}'
  Global symbol "$key" requires explicit package name at -e line 1.
  Execution of -e aborted due to compilation errors.
  [zero] [8:46am] ~>  ^each^each my^
  perl -we 'use strict; my %pages = (); foreach my $key (keys %pages) {print ".\n"}'
  [zero] [8:46am] ~>


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05469/pgp0.pgp
Description: PGP signature


Re: test.cgi hashing error

2002-06-23 Thread David T-G

Kyle --

...and then Kyle Babich said...
% 
% Ok, I decided to make my test.cgi into a kind of refernce page for when 
% I'm creating my site.  There is some kind of problem with my hash.  
% Once again can someone explain to me what I'm doing wrong?

As perl tells you, there are a few errors.


% 
% Here is what I got from doing perl -Tcw in the shell:
% > bash-2.05$ perl -Tcw test.cgi
% > bash-2.05$ Scalar found where operator expected at test.cgi line 37, 
% near "print
% >  "$link's"
% > >   (Might be a runaway multi-line "" string starting on line 36)
% > > (Do you need to predeclare print?)

This is, in fact, something like that; you have a " in front of foreach.


% > > Bareword found where operator expected at test.cgi line 37, 
% near "$link's page
% > "
% > > (Missing operator before page?)
% > > Global symbol "%pages" requires explicit package name at test.cgi 
% line 32.
% > > Global symbol "$link" requires explicit package name at test.cgi 
% line 36.
% > > syntax error at test.cgi line 37, near "print "$link's "

As a result, this follows.


% > bash: Scalar: command not found
% > bash-2.05$ Global symbol "%pages" requires explicit package name at 
% test.cgi lin
% > e 37.

Same thing here.  So everything can be traced back to one point, as far
as I can tell :-)


% 
% Here is the source:
...
% 
% my $foreach = "foreach $link (links %pages) {
%   print "$link's page:  $pages{$link}\n";
% }";

Here ya go.  It looks like you're trying to save this foreach loop for
later, probably to spit out the contents in your HTML, but your quoting
gets messed up.  You have

  ... = "foreach ...
print " ... more garbage that perl sees as OUTSIDE the quotes

and so that won't work.

Usually I'd just say that you need to escape the inside quotes or use
different quotes (perhaps qw@@ or the like) but that will simply give you
the literal text of the foreach loop in your HTML output, which probably
isn't what you want.

It's still early :-) and I don't see an elegant way of doing this through
my pre-Cheerios fog.  You could, though, try something like

  my foreach = "" ;
  foreach $link (keys %pages)   # you meant this instead of (links %pages), no?
  {
foreach =. "$link's page: $pages{$link}\n"
  }

to iterate through your links and add the text you want to a $foreach
variable, which ou can then spit out later.  It feels like there should
be a less clunky way, but other than breaking the HTML section into two
or more here docs I don't see it.  Perhaps one of the other wizards will
come up with something prettier :-)


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05466/pgp0.pgp
Description: PGP signature


Re: Perl Help

2002-06-13 Thread David T-G

Links --

What a funny name you have...

...and then LinkS On WeB said...
% 
% using the stat function, say I was using $stat[9],
% which displays the time of the file, how would I make
% it just display the date. Month-DayofMonth-Year

Take the seconds that come out of stat and feed them to localtime and
interpret from there (months are 0 - 11; years are years since 1900):

  [zero] [4:27pm] ~>  touch 01020304 fooble

  [zero] [4:27pm] ~>  ls -lF fooble
  -rw-r--r--   1 davidtg 0 Wed Jan 02 03:04:00 2002 fooble 

  [zero] [4:27pm] ~>  perl -e '$mtime = (stat("./fooble"))[9]; \
(undef,$min,$hour,$day,$mon,$year) = (localtime($mtime)); \
print "Year is $year, Mon is $mon, Day is $day, \
Hour is $hour, Min is $min\n";'
  Year is 102, Mon is 0, Day is 2, Hour is 3, Min is 4

See

  perldoc -f stat
  perldoc -f localtime

and have fun :-)


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05380/pgp0.pgp
Description: PGP signature


Re: Any web site teaching comparison of Shell and Perl?

2002-06-13 Thread David T-G

Amy --

First of all, you might get a better response to this on the beginners
list, since it's not really a CGI matter.  That aside, though, ...

...and then Amy Kim said...
% 
% I am looking for web sites teaching differences or comparison of Shell and Perl. 
Does anybody know any good web sites for that?

You might narrow down your focus a little to talk about just what kind of
differences you mean -- programming style, portability, purposes, or
whatnot -- since the man pages for each should provide you with an
understanding of the two so that you can draw your own conclusions if you
want to curl up with a bit of good reading.

I don't know of any comparison sites (though I'd be interested in your
findings), but a start might be Google's

  
http://directory.google.com/Top/Computers/Programming/Languages/Comparison_and_Review/

which might include shell in there.

A little more googling led me to

  http://www.unixreview.com/documents/s=2427/uni1021415397994/0205f.htm

which covers how to do a task in shell and perl and might show you some
of the differences.  

All in all, it's probably a very good question in need of a good answer.


% 
% Amy


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05377/pgp0.pgp
Description: PGP signature


Re: Having problems with login

2002-06-12 Thread David T-G

Ben --

...and then Ben Huyghebaert said...
% 
% Thanks but I don't think that will work because as someone pointed out my foreach 
loop leaves me with only the last elements of @access.  

Well, it did that as you wrote it; you looped through the whole file and
*then* started any comparing.

I was afraid you wouldn't get it on the first pass, but didn't follow
up, since the explanation as well as the rewrite say the same thing as
I redundantly would.  Maybe not so redundantly, though...


% I need it to give me all the elements in two @s I'll see if I can figure it out 
maybe someone know the best way?

Have you actually tried it?  Try David's code and see what you get.
I think you'll find that yours does

  loop through whole file
capture name, password

  compare name, password to hash

while his does

  loop through whole file
capture name, password
compare name, password to hash

thus letting you check every user instead of only the last one.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05363/pgp0.pgp
Description: PGP signature


Re: Using strict and a configuration file?

2002-06-11 Thread David T-G

Teddy --

...and then Octavian Rasnita said...
% 
% Hi all,

Hello!


% 
% Is it possible to use "use strict;" if I get the variables from a
% configuration file?
% 
% I've tried:
% 
% use strict;
% require "f:/xxx/config.txt";

Have you tried

  use "f:/xxx/config.txt";

instead?  From my reading of the camel book, require happens at run time
and thus anything it defines won't be defined at compile time and strict
will puke, whereas use "essentially performs a require at compile time
and then lets yuou import declarations into your own namespace", the
latter part of which may also be useful (no put intended ;-) in light
of some of the scoping concerns brought up in other replies.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05345/pgp0.pgp
Description: PGP signature


Re: [OT] RE: POD vs. # Comments

2002-06-11 Thread David T-G

John, et al --

...and then John Brooking said...
% 
...
% Hey! The Camel book (am I right in assuming that is
% the Perl community's nickname for O'Reilly's

It sure is, but ...


% "Programming Perl"?) says that "comment", when used as
% a translator keyword following "=for", is by

Whoa!  You found that in there??  Do you have 3e or 2e?  I couldn't find
any POD commands in my 2e ("Covers Perl5!") copy, which is why I kept
bugging the list for pointers (and finally got them; thanks, all!).
If it was in there, though, I sure would like to know where so that I
can at least know how I missed it...


TIA & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05344/pgp0.pgp
Description: PGP signature


Re: [OT] RE: POD vs. # Comments

2002-06-10 Thread David T-G

Felix, et al --

...and then Felix Geerinckx said...
% 
% on Mon, 10 Jun 2002 18:56:20 GMT, David T-G wrote:
% 
% > Yeah, but the point is that I still don't know what I'm doing.
...
% 
%   perldoc perlpod

Ah!  I was trying "perldoc pod" and every permutation thereof, but never
thought of perlpod.

Now I can curl up with a good man page.  Thanks!


% 
% comes to mind. And you will find plenty of examples in the directories 
% from your '@INC'.

Ah.  Good to know, though I still have some of the "but I don't know
what this layout is doing" problems that way.  But once I do (cf above)
then I can grok their structure.


% 
% -- 
% felix


Thanks! & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05314/pgp0.pgp
Description: PGP signature


Re: [OT] RE: POD vs. # Comments

2002-06-10 Thread David T-G

Hi, all --

...and then Felix Geerinckx said...
% 
...
% =for those_interested_in_the_nifty_algorithm
% 
% Explanation of the nifty algorithm
% 
% =cut

Yeah, but the point is that I still don't know what I'm doing.

I've seen =head1 and =head2 and I don't know how they map to anything
else...  Is there a primer outlining all of the =* directives and how
they go together?  So far all I know is that =cut ... =cut will
conveniently comment out large chunks of code.


Arrgh!

TIA & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05312/pgp0.pgp
Description: PGP signature


Re: how to write pod (was "Re: [OT] RE: POD vs. # Comments (was Am I doing something wrong?)")

2002-06-10 Thread David T-G

drieux, et al --

Hey, is this the sort of thing that should be on the beginners list
because it isn't CGI-specific?  Do we redirect threads over to the other
list as appropriate?

...and then drieux said...
% 
% 
% On Monday, June 10, 2002, at 05:42 , John Brooking wrote:
% 
% >Well, I confess that I sometimes use POD directives to
% >write a long comment (more than about 1/2 dozen
...
% 
...
%   b) you may want to think in terms of learning to 'write pod'
%   it really is a lot simpler in most respects than writing
%   either man pages or raw html

Definitely!  Any [other] hints for how to learn it and what's the
structure?  Believe it or not, The Camel Book only mentions Pod::Text for
converting pod to ascii, but I don't have any pod yet...


% 
%   c) play with h2xs - it will give you the basic framework for
%   both a 'perl module' as well as the preliminary POD !

OK; I'll do that, too.

Wait a minnit...  I don't have a C .h file, so how will this help me?


% 
% One thing I would strongly advocate against -
% 
%   running 'code with major chunks of stuff commented out'
% 
% It's fine to do that while sorting out which way to go, as
% strictly 'test code' when doing things like CGI development,

Agreed; that's how I'm keeping track of where I want to go as I'm
hacking out the functionality of a script, but once all of the pieces
are written the big chunk has been whittled down to nothing and the
problem is solved :-)

It seems to me that I could turn that into pod structure as well, which
is another reason I'm keen to learn how to write the stuff.


% but when you get to that 'lock the source code tree down' -
% check in the code you want, and DO NOT have chunkage of dead
% code floating around - it WILL BITE YOU - someone will zone

*grin*  It sure will.


% out why this 'ugly' little '=cut' is there... and suddenly
% you are off in a new morass chasing code you forgot you
% left bloated around.

Been there, though not yet in perl (enough other screwups, but not this
one!).


TIA & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05308/pgp0.pgp
Description: PGP signature


Re: Mastering Regular Expressions?

2002-06-09 Thread David T-G

Teddy --

...and then Octavian Rasnita said...
% 
% Hi all,

Hello!


% 
% Do you know if there is an electronic version of "Mastering Regular
% Expressions" book that I can find?

Other than the CD version, also for sale from ORA, probably not; it's a
still-in-print book that I'm sure isn't licensed to be given away.

There's the perlre man page you, in case that helps...


% 
% Thank you very much!

HTH & HAND


% 
% Teddy,
% [EMAIL PROTECTED]


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05301/pgp0.pgp
Description: PGP signature


Re: Running a Perl program in background

2002-06-09 Thread David T-G

Teddy --

...and then Octavian Rasnita said...
% 
% Hi all,

Hello again!


% 
% I am a beginner in Perl, and in the first lessons of some manuals I haven't
% seen anything about how to run a Perl script in background.
% Is it something very complicated?

Well, it depends on what you want to do.  If you're at a shell prompt you
could just

  /path/to/script.pl &

and there you go (with perhaps a nohup if you're running Bourne shell).
It's in the background and, with some shell job control, you can even
exit.

Then there's the matter of forking off a process so it disassociates
itself from any terminal, which is what you want.


% 
% If it is, then I will wait a little to learn Perl better.
% If it is not too complicated, can you give me some hints about what should I
% do to run a Perl script in bacground?
% 
% I want to leave the program running on the server and to close the browser
% without closing the program.

That shouldn't be too tough.  Check the docs and the camel book for fork.
Basically what you do is you write your code so that you set up what you
need (any variables or the like) and then call the fork function, which
makes a copy of the process and sets it off on its own (with a new PID,
that is, and I think with no filehandles).  In your code you suddenly
can't tell whether you're the parent or the child, so right after the
fork you do a simple if test to see which you are; fork function returns
0 to the child process and a PID (which can never be 0) to the parent
process.

It could look about like

  ...
  code
  code
  if ( $result = fork )
  {
print "I am the parent.  Take wing, my child!\n";
print $webmessage;
exit 0
  }
  elsif (defined $result )
  {
print "I am the child; away we go\n";
code
code
loop
{
  forever
}
  }
  else
  {
print "fork bombed!\n";
exit 99
  }

according to the camel book...


% 
% Thank you.

HTH & HAND


% 
% Teddy,
% [EMAIL PROTECTED]


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05300/pgp0.pgp
Description: PGP signature


Re: At least a number of characters - regular expressions

2002-06-09 Thread David T-G

Teddy --

...and then Octavian Rasnita said...
% 
% Hi all,

Hello!


% 
% I want to check if in a string there are more than 3 capital letters.
% I've tried using:
% 
% if ($string=~ /[A-Z]{3,}/) {
...
% 
% For example, I want to match this string: "AxxxBxxxCxxx".

That's not so bad:

  [zero] [9:59pm] ~>  echo "xxAyyBzzCnn" | \
perl -e 'while (<>) { print "GOTIT\n" if /[A-Z].*[A-Z].*[A-Z]/ }'
  GOTIT

(One of the few times you'll see me use " if ".)


% 
% Thank you for any tips.

HTH & HAND


% 
% Teddy,
% [EMAIL PROTECTED]


:-D "I may not know much perl but I sure know regexps" T-G
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05299/pgp0.pgp
Description: PGP signature


Re: Printing a single quoted string

2002-06-09 Thread David T-G

Teddy --

...and then Octavian Rasnita said...
% 
% Hi all,

Hello!


% 
% I've printed a block of text using:
% 
% print <mailto:$email_address?subject=This%20is%20the%20subject";>email
% me
% eof
% 
% The problem is that using <  cat /tmp/goo
  #!/usr/bin/env perl
  $email_address = "addy";
  print <mailto:$email_address?subject=This%20is%20the%20subject";>me
  eof
  [zero] [9:53pm] ~>  ls -lF /tmp/goo
  -rwxr-xr-x   1 davidtg   135 Jun  9 21:53 /tmp/goo*
  [zero] [9:53pm] ~>  /tmp/goo
  mailto:addy?subject=This%20is%20the%20subject";>me

Is there anything else in your code that we should see?


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05298/pgp0.pgp
Description: PGP signature


Re: Am I doing something wrong?

2002-06-08 Thread David T-G

Teddy --

...and then Octavian Rasnita said...
% 
% Hi all,

Hello!


% 
% I use:
% 
% =start;
% 
% =cut
% 
% I use this statement to comment out more lines.

I've seen a trick like that used to comment out large blocks.  What
you're actually doing is using pod notation to declare a block
documentation instead of code, which works well enough.  However, the
format is

  code
  code
  =cut
  junk
  junk
  =cut
  morecode

without a "start" involved.

I'd love to tell you more about how pod is written but I don't know the
format yet :-)


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05287/pgp0.pgp
Description: PGP signature


Re: Refresh dynamic content using query_string

2002-06-07 Thread David T-G

Jason --

...and then Jason Ostrom said...
% 
% I was wondering if there was any way to refresh and have the same
% dynamically-created page viewed every 5 seconds?
% 
% I'm trying to do it like this:
% 
% my $URL2 = "ds0.cgi?$ENV{QUERY_STRING}";
% ### HTML part
% print $q->header( -Refresh=>'5; URL=$URL2' ),

Have you tried printing your header with "" instead of ''?  I believe ''
inhibits interpolation.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05272/pgp0.pgp
Description: PGP signature


Re: CGI::Graph --- description

2002-06-07 Thread David T-G

Konrad --

...and then Konrad Foerstner said...
% 
% Hi!

Hello!


% 
% I would like to write some scipts to produce plots and 
% saw CGI::Graph is a good solution for that. The problem is
% that I can't find a good introduction or description of 
% it in the web. Has anyone a good link for me?

Did you try search.cpan.org to look for it??  I did and landed at

  http://search.cpan.org/doc/MCHANG/CGIGraph-0.93/lib/CGI/Graph.pm

and that seems pretty complete to me...


% 
% Thanks

HTH & HAND


% 
% Konrad


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05268/pgp0.pgp
Description: PGP signature


Re: What database would your recommend?

2002-06-07 Thread David T-G

Paul, et al --

...and then Paul Arsenault said...
% 
% MySQL is a relational database.

I've followed up and have more information -- sort of.  My pal couldn't
provide hard data but pointed not only to extra stuff like transactions
(I don't think anyone is saying that transactions are part of what makes
up relational) but stored procedures, foreign keys, and better joins.
Perhaps the difference in "relational" and "whopping big powerful
relational".

Good news for me, though, because mysql is available out of the box at
my server and I can still learn not just DB but RDB interfacing.  Thanks
a lot for the pointer!


HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05263/pgp0.pgp
Description: PGP signature


Re: webBotting a Job Hunt

2002-06-07 Thread David T-G

drieux, et al --

...and then drieux said...
% 
% volks,

Hi!


% 
% this is probably more an ethical question
% than a technical question - since over the
% plays here I have become better at reverse engineering
% what webServers want pushed at them in the way of URI
% by get or puts

*grin*


% 
% but is it kosher to reverse engineer how various public
% web sites do this jazz - so that i merely wind up with
% a cron job that will summarize the evening search for
% jobs that are out there??? Hence in the morning review
% a single piece of email daily rather than click my
% way through all of them???

1) yes

I say that because, from your description, you're not going after
restricted content (maybe you'll get an account there to answer a login
challenge, a la techrepublic, but then you'll have done your part, too)
and not trying to break in, but merely optimizing your connection so that
you don't see the ads or read the non-matching fluff.  I already do half
of that by using lynx instead of netscape (heaven forbid ie :-) so that I
don't bother with images and am not subject to JS code and so on.

In the past I've said that it's pretty easy to have the site's search
agent go through the postings for you and then read the email that comes
in, particularly compared to writing a script that will go and get the
info for you, but it might not be easier for some :-)  That's even closer
to your stated goal; the mail I get from dice doesn't have any ads in it
(er, well, I don't think so; if it does, I now skip over them by
searching for the beginning-of-job marker and don't notice anyway :-) and
yet they're happy to send it to me.

Hacking your way around a .htaccess file, as an example, would probably
be another story, but I don't think that's within this scope.

2) i want a copy :-)


% 
% 
% ciao
% drieux


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05262/pgp0.pgp
Description: PGP signature


Re: What database would your recommend?

2002-06-07 Thread David T-G

Paul --

Thanks for the reply.

...and then Paul Arsenault said...
% 
% MySQL is a relational database.
% 
% Taken from the mysql documentation page at 
% http://www.mysql.org/documentation/mysql/bychapter/manual_Introduction.html#Features
% 
% MySQL is a relational database management system.

Hmmm...  That is a pretty compelling point :-)


% A relational database stores data in separate tables rather than putting 
% all the data in one big storeroom. This adds speed and flexibility. The 
% tables are linked by defined relations making it possible to combine data 
% from several tables on request. The SQL part of ``MySQL'' stands for 
% ``Structured Query Language''@-the most common standardised language used 
% to access databases.

OK, I get that.  I still have to figure out what relations really are
(example help but I don't deal with employees and salaries so *my*
examples would probably be more helpful :-) but I got this from a couple
of DB buddies, one of whom had been a long-time mysql lover but had
turned to pgres because he ran into problems under mysql (the other guy,
a die-hard Oracle man, will use nothing else anyway).  Now I have to go
back and pin him down on what he meant since his statement so obviously
contradicts the docs.


% 
% 
% Paul Arsenault, CCNA
% [EMAIL PROTECTED]


Thanks & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05259/pgp0.pgp
Description: PGP signature


Re: [OT] Re: What database would your recommend?

2002-06-07 Thread David T-G

John, et al --

...and then John Brooking said...
% 
% Not to be pedantic, but isn't PHP a *language*, not a
% database? So you could use almost any particular

Yes, it is; it doesn't have its own database built in.  For someone
starting out doing web stuff it wouldn't be bad to pick up, even if it
isn't a four-letter word.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05258/pgp0.pgp
Description: PGP signature


Re: What database would your recommend?

2002-06-07 Thread David T-G

Teddy --

...and then Octavian Rasnita said...
% 
% Hi all,

Hello!


% 
% I want to start learning a database that works with Perl but I would like to
% learn a database that works under Windows and Unix also.

mysql is a lean, fast, excellent choice.  I'm looking into the same sort
of question, though, and have found that mysql is not relational (and
also takes some other shortcuts), and so if you just want *a* database
it's fine but if you want to learn on one so that you can grow into
another PostgreSQL might be better; it's relational and much more like
the big guys.  It is, of course, available for Linux, and although I
don't know about a native Win32 port I do know that it's now available
under Cygwin.


% 
% Is there such a thing?

Of course :-)


% Of course, I would like to  learn something as simple as possible because I
% am a beginner in Perl.

If you *really* want to keep it simple, be sure to use DBI and do your
calls through there so that you don't go falling off into specifics of
each database.  From what I've found, DBI code is extremely portable,
while writing your own SQL gets messy.


% 
% Thank you.

HTH & HAND


% 
% Teddy,
% [EMAIL PROTECTED]


:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05240/pgp0.pgp
Description: PGP signature


Re: System test.

2002-06-06 Thread David T-G

Timothy --

...and then Timothy Brier said...
% 
% My system was rejecting e-mails from the list because of  header information.  Just 
making sure I'm still on the list.

Thank you so much for letting us all know.  I think the more efficient
way to test is to send mail to

  [EMAIL PROTECTED]

and see what the list server tells you, but we're each entitled to our
own opinion.


HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05227/pgp0.pgp
Description: PGP signature


Re: Re[2]: Dynamically creating submit buttons

2002-06-05 Thread David T-G

Jason --

I don't have answers for your other questions, but ...

...and then Jason Ostrom said...
% 
...
% 
% I always start off my code by using CGI.pm object-oriented method:
% print $q->header( "text/html" ),
% $q->start_html( -title => "eDPS1 DS0 Monitor", -bgcolor => "#ff" ),
...
% $q->end_html;
% 
% But then can't use this format again, so have to "handroll" my HTML in
% the rest of the program because If I try to go back to using it, I get
% an error.

Isn't that because you just told the module to spit out the end of the
html page?  I'd think you'd save that part for when you're done writing
to the page!


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05205/pgp0.pgp
Description: PGP signature


Re: OT - attachments (was "Re: The size of the uploaded file")

2002-06-04 Thread David T-G

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Octavian --

and then Octavian Rasnita said...
% 
% Hi, it is off topic.

Hello!


% 
% I've seen more messages including this one that I am replying to, that have
% no text in it and I need to open an attachment to read the message.
% 
% Can you tell me what is the problem?
% I have Windows 2000 and Outlook Express 6.

That's the problem :-)  Your mail program doesn't know how to deal with
PGP-MIME signatures.

This message should open for you; I've manually folded and mutilated it
so that it will work with Outhouse.  You will see an extra line at the
beginning and then some gibberish at the end.


% 
% Thank you.

HTH & HAND


% 
% Teddy,
% [EMAIL PROTECTED]


:-D
- -- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE8/XUVGb7uCXufRwARApibAJ9kTCS1ameK7mw24bYFnLOoa8c72QCfbP2Y
PkfMMu/NpLev4IURLWzGINQ=
=5JG2
-END PGP SIGNATURE-

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




Re: Content Warning from MailScan to Mail-Sender!

2002-06-04 Thread David T-G

Eric, et al --

...and then Eric Peers said...
% 
% Take a look at
% http://www.symantec.com/avcenter/venc/data/w95.hybris.gen.html for details
% about the worm.  Sadly, its no laughing matter.

*snicker*  For those of us not using Windows it is :-)


% 
% Eric


HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05152/pgp0.pgp
Description: PGP signature


Re: The Cannons of True Faith

2002-06-04 Thread David T-G

drieux, et al --

...and then drieux said...
% 
% On Tuesday, June 4, 2002, at 07:59 , David T-G wrote:
% [..]
% >%
% >% I didnt know this was such a religious topic.
% >
% >BWA HA HA HAHAHA! :-)
% 
...
% 
% Is there an official site dedicated to the True Cannons of Perl?

Don't know about that, I'm afraid.  I'd love to see some analysis of best
practices but, as has been mentioned even here as well as everywhere else
perl, there is rarely Only One Right Way.


% 
...
% Also - given the recent 'crisis of faith' here - where there
% was the 'html only' version of sending out email, without doing
...
% underneath Or was that a part of the konspirakii of actually
% showing how to write bad email in html

That was part of it; the other part was that that was what the requestor
wanted, and so that's what I wrote (comments and content notwithstanding).
Certainly if one is going to be rude enough to send HTML mail then one
should attempt to be cooperative, as perl certainly is, and send text
along as well (of course, we would argue that the HTML is the useless
baggage and not the text...).


% 
% { he said trying to keep the thread within the context of the
% group specifications }

Whoops, and I snipped your module reference...


% 
% 
% ciao
% drieux
% 
% ---


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05149/pgp0.pgp
Description: PGP signature


Re: HTML in E-mail

2002-06-04 Thread David T-G

Fred --

...and then Fred Sahakian said...
% 
% This solved it, thank you very much.  

Good deal.  For the purposes of the list, that's the important part.  Did
you use the headers as written or construct or proper MIME structure in
your message?


% 
% I didnt know this was such a religious topic.

BWA HA HA HAHAHA! :-)


HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05144/pgp0.pgp
Description: PGP signature


Re: HTML in E-mail

2002-06-04 Thread David T-G

Nikola, et al --

...and then Nikola Janceski said...
% 
% Even thought my e-mail is out on the web. It is not posted as an account to
% freely send advertising e-mails to. Spam is "unsolicited e-mail" so if I

True, and unfair, but not the fault of the list.  I thought I understood
you to say that nasty spammers sign up on lists to gather addresses, when
that certainly isn't necessary.


% didn't sign up on website that EXPLICITLY states "by disclosing your e-mail
% you agree to the Terms of our conditions", which the Terms would state some
% garble of being sent regular e-mails from them or other companies, etc. etc.
% I don't recall seeing that in the e-mail for this and other perl lists.
% (most of this only applies for the U.S.)

And, in fact, I'm willing to bet a Twinkie that the perl lists haven't
shared your email info.  The various archive sites might have, though,
by putting the posts up for all to search.  Such is the price, you might
say, of having such a resource available.  [Admittedly, it would be
nice if *all* archives out there, as well as the various list servers
that offer back copies, did some sort of address mutilation to defeat
spammers, but the problem is that it will always have to be not only
formulaic but in fact translatable by a person, and so there will always
be a programmatic way to unwrap the mess and get a valid address out,
so it's hardly worth the effort -- and, undoubtedly, why they don't.]


% 
% But I don't use this account for that. I use this account for work and
% perllists, and my other accounts for signups. Too bad I can't use

Fair enough.  You might try talking them into giving you a special
address to use for lists; have your rules wizard bounce posts from the
lists to you over to your real account and just let the aging function
autotrash whatever else lands in there.  Hmmm...  Perhaps you should make
your current account the published box and have a new, clean mailbox set
up to catch the good stuff :-)

The amazing thing is that your IT department happily accepts all of this
spam, thus accepting the load on their servers and the drain on your
time.  It would serve *them* well to implement SA at a system-wide level,
and you'd get benefits as a side effect!


% SpamAssassin since I am not admin and I am forced to use M$ LOOKout. I
% cannot filter my e-mails other than using the crappy rules wizard in Outlook
% (212 rules and counting). (no they don't allow POP3 access or any other
% way... try as I might the sysadmins say too bad sucka)

No IMAP, either?  I haven't seen anyone turn that off yet, though I'm
sure it can be done.

Hey, if your company wants to pay you to sit and sort through spam, have
fun with it; visit all the porn sites and then blame it on Outhouse.
Meanwhile, save all of the spam you get to a PST stored on the server
(or, better yet, in a folder under your INBOX if they don't have
autoaging enforced across the system).


% 
% Poor me stuck with SH1Tty mail programs at work.

Start a revolution! :-)


I should probably be quiet now; we've definitely strayed, unless you
plan to bring up writing a perl MAPI module to talk to your mail and
get rid of the spam...

HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05136/pgp0.pgp
Description: PGP signature


Re: HTML in E-mail

2002-06-04 Thread David T-G

Nikola --

...and then Nikola Janceski said...
% 
% To new perlmongers:
% 
% I hope that whoever started this thread isn't the one who is send out the
% ugliest spam (HTML attached as a txt file) to mine and others accounts. I

I just have to ask, because I'm a bit lost...  Do you mean when you get
spam in general, or did this thread include some spam to which you refer?


% don't get much spam, but the only reason I do is because people on lists,
% such as this one, take the e-mails and spam them. I fore warn all spammers

If you're talking about getting spam in general, I hate to have to be the
one to tell you that you're not quite right.  This, just like many, many
other lists, is archived.  A quick trip to google to put in the search
query 

  [EMAIL PROTECTED] archive [EMAIL PROTECTED] 

turned up

  http:[EMAIL PROTECTED]/msg24627.html

as the first of 316 results.  Clearly you're out there already, and it
doesn't take anything as bothersome as subscribing to a list to grab your
address.

If you aren't using SpamAssassin already (hey, we're back on topic, since
it's written in perl!), you should check it out.  You might also look
into TMDA (even if it is written in Python ;-) to generate controllable
return mail addresses if you can get away from LookOut! for your mail.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05133/pgp0.pgp
Description: PGP signature


Re: HTML in E-mail

2002-06-04 Thread David T-G

John, et al --

...and then John Brooking said...
% 
% --- David T-G <[EMAIL PROTECTED]>
% > 
% > ...and then Scot Robnett said...
% > % 
% > % I don't personally share the 'HTML e-mail is evil'
...
% > intimated that he had, which means we're pursuing
% > the ultimate beating of
% > a dead horse here :-)
% 
%   If I may be allowed to beat the poor dead horse a

*grin*


% little more, and at the risk of reviving this thread,

Uh oh; that certainly could happen.


% but playing devil's advocate because, after all, this
% *is* a beginners' list:
% 
%   Why is HTML mail evil? (If you believe it is.)
% 
%   Because it can be so easily hacked? That's a big
% reason, but are there others I don't know about?

First, I should say that in a different world, it probably wouldn't be so
bad.  If everyone had robust and secure MUAs (gee, mutt comes to mind,
though you can still manage to screw up even with it sometimes) then we
wouldn't have to worry about embedded javascript or VBS or whatnot
tearing open security holes because, regardless of whether or not such
holes existed, the MUA would keep the garbage in its own sandbox instead
of letting it run all over the system or send packages back to its
master.

So then we come to why someone does HTML mail in the first place...  It's
probably for just the font stuff you mention, but then people add
stationery images and buttons and email envelope icons and whatnot and
suddenly you have a very, very, very large message that says "Come to my
house on Thursday".  It's an incredible waste of space and resources.
And before you say "oh, heck, bandwidth is cheap", remember that not
everyone in the US has broadband access and much of the world outside the
US not only doesn't have fast access but also has to pay by the minute
for even local phone calls.  Imagine how happy you'd be to download
someone else's idea of stationery for an extra two and a half minutes
while dialing long distance (and, no, not the cheap LD we have here in
the States, either, but like it was in 1978 at $.25/min).

Finally, then, we come back around to another security hole: profiling
and tracking.  Even if it isn't displayed, an HTML message can embed an
img tag that goes off to a tracking site and and pips the IP address, at
the very least, of who just read the message.  What a great way to see
how far and wide your spam (or virus) is traveling and fine-tune your
marketing.

That's by no means an exhaustive overview, but I think it covers the
basics.  I would *love* to discuss this more and hear from others on the
topic, but I fear that we would quickly go far, far, off-topic and wear
thin the patience of many (most?) on the list.


% 
%   I can imagine average Joe User saying "But of
% *course* I want to be able to format my email with 10
% different font faces, sizes, and colors. Plain text is
% for geeks."

Heh.  Little does the average Joe know, too :-)  Plain text rules!

Your pseudo-quote reminds me of the Mac Font Wheel spoof of years back :-)


% 
%   Is maybe Rich Text Format the real answer?

It's certainly a better answer than HTML with its embedded images and
javascript and the like.


% 
% - John


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05129/pgp0.pgp
Description: PGP signature


Re: HTML in E-mail

2002-06-03 Thread David T-G

Scot, et al --

...and then Scot Robnett said...
% 
% I don't personally share the 'HTML e-mail is evil' philosophy. And even if

Fair enough.


% you're in the ascii-only camp, HTML mail isn't going anywhere anytime soon.

Unfortunate, I think.


% People will ask how to generate and parse it, and there are plenty of Perl
% tools and modules to do so.

Agreed.  As I said, I'm sure there's a tool.


% 
% I see that it was said "only a really cool mail reader" can handle MIME
% messages. I guess that's true if Outlook, Outlook Express, Netscape Mail,
% Eudora Light, Eudora Pro, recent versions of Lotus, popular 'web-based' mail
% readers such as Yahoo, Hotmail, Webmail, and most other popular mail readers
% would be considered really cool. The only mail readers I have seen that

Heavens, no!  Most of them wouldn't even see that bit; what I said was
that only a really cool mailreader could see that -- *not* that only a
really cool mailreader could handle MIMEd mail.  The only cool MUA out
there is mutt anyway :-)


% don't handle MIME messages very well are older copies of CCmail, Z-mail, and
% Pine.

Does PINE do anything well? 


% 
% If you want to create HTML mail or other MIME mail, the most effective way
% I've found to do it is to use the MIME::Lite module. It can also be used to
% send HTML mail or various types of attachments. If interested in learning
% more about it, just go to CPAN and search the module documentation.

As I said, I don't know how to write it but I'm sure there's a module.
I'm glad that there's now been at least one suggestion of one to get Fred
moving (if, in fact, he hasn't solved this already; Camilo's email
intimated that he had, which means we're pursuing the ultimate beating of
a dead horse here :-)


% 
% Scot Robnett
% inSite Internet Solutions
% [EMAIL PROTECTED]
% [EMAIL PROTECTED]


HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05119/pgp0.pgp
Description: PGP signature


Re: HTML in E-mail

2002-06-03 Thread David T-G

Fred --

...and then Fred Sahakian said...
% 
% What am doing wrong?  Im try to send an e-mail that will appear as formatted HTML, 
Im missing something but dont know what.  In my example below I have a hyperlink which 
I would like to appear as HTML and a font color, but they appear in the e-mail as raw 
HTML, what am I leaving out?  A Mime?:

Yes; you have to specify your text body as an HTML document instead of
just plain ascii.  You also need to skip a line between your headers and
your body, BTW.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05117/pgp0.pgp
Description: PGP signature


Re: HTML in E-mail

2002-06-03 Thread David T-G

Camilo --

...and then Camilo Gonzalez said...
% 
% David,
% 
% I admire your principles. This is something that has come up before and

Heh :-)


% after some trial and error, what I proposed to him seemed to work. I too

Well, that's good.  I'm glad he's managed to get something out the door.
I wonder how many mail readers will read it without barfing, though...


% feel HTML email is evil but some of us are stuck being prostitutes to keep
% the wolves from our door.

Not unlike myself.  I get paid by the hour, work for the highest bidder,
and tell 'em what they want to hear...  You make the call ;-)


HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05116/pgp0.pgp
Description: PGP signature


Re: HTML in E-mail

2002-06-03 Thread David T-G

Fred, Camilo, et al --

...and then Camilo Gonzalez said...
% 
% Fred,
% 
% Thank Jah this problem was recently successfully solved! Try this:
% 
% open(MAIL,"|$mailprog -t");
% print MAIL "Content-Type: text/html\n";
% print MAIL "To: $comm\@courts.state.ny.us\n";
...

Note that, although he's posted to the CGI list, he's asking about email.
In this case you've stuck on a lovely C-T: header (missing an extra
newline, though) as though you were spitting out to a web page, but
that's not what he's doing.

What he *wants* is to output something like

  To: ...
  From: ...
  Subject: ...
  Content-Type: multipart/related; boundary="HTML-email-is-really-bad"
  
  This is a MIME message.  Only a really cool mailreader can see this.
  --HTML-email-is-really-bad
  Content-Type: text/html;
  Here is your freakin' HTML mail.
  --HTML-email-is-really-bad

which properly describes the message body in the headers, leaves a blank
line to identify the header end and the body begin, and then lays out
the body pieces.

No, I don't know how to write it in perl.  I think I'd feel dirty if I
did; this is bad enough ;-)  I'm sure there's a module, though.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05114/pgp0.pgp
Description: PGP signature


Re: The size of the uploaded file

2002-06-03 Thread David T-G

Camilo, et al --

...and then Camilo Gonzalez said...
% 
% David, 
% 
% Since there are a lot of newbies here, can you please enumerate on the pains
% and differences between both FTPs and what SCP is?

Oh, dear.  Now I've stepped in it :-)

In brief, and without attempting to cover *all* of the details, some of
the biggest problems with ftp are that the passwords are sent in clear
text and that you have to either trust an account on your system or
build a sufficiently secure jail so that only what you want to go out
goes read and only where you want incoming to land gets written.  It can
be very challenging and has been hacked in many ways before.

scp (secure copy) is part of the ssh (secure shell) suite, which provides
secure (==> encrypted) communication as part of its design, thus taking
care of the cleartext problem, and which is smarter about security issues
also by design (which helps take care of the jail thing).

Yes, I know there are anon ftp daemons (wu-ftpd, proftpd, ncftpd, and
who knows how many others) that promise security with convenience, but
many of them have been hacked time and time again.

If you want to have an ftp server for download, I recommend looking at

  http://cr.yp.to/publicfile.html

and reading up on some of Dan's other references.  Alas, I do not know if
publicfile accepts files; I kind of doubt it.


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05109/pgp0.pgp
Description: PGP signature


  1   2   >