Re: Mailing Script

2004-07-08 Thread Camilo Gonzalez
Gunnar Hjalmarsson wrote:
Randal L. Schwartz wrote:
Werner Otto writes:
Randal L. Schwartz wrote:
Do *not* send email to addresses taken from forms.  Ever.

why is that?

Because you have no authentication of the requestor.  Any fool can go
to your website, enter [EMAIL PROTECTED], and all of a sudden, I
get a big PDF shoved down my email box.  Repeatedly.  And yet it
wasn't *me* that requested that.  And yet I'll have no clue, except
it came from you and you'll have no clue except it came from this
IP addr.
No.  Do not go from web to mail.  Bad idea, unless you've fully
round-tripped the web requestor from a real mail address.

I think you are exaggerating, Randal. How much convenience are you 
ready to sacrifice in order to fight possible abusers?

If you want to contact me privately, you can click the link below. If 
you fill the form, including your own email address, and submit it, 
you'll receive a copy of the message. That's for your record, for your 
convenience. Personally I think that makes sense.

That said, spammers and other abusers should certainly be taken into 
consideration when dealing with mail via the web.

I think Randall has a point. It may behoove you to send a confirmation 
email with a link that when clicked will opt in a user. This double 
opt-in procedure has become standard operating procedure for 
considerate marketers and an integral part of customer relations management.

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



Re: use CGI qw(:standard);

2004-06-11 Thread Camilo Gonzalez
Owen Cook wrote:
On Fri, 11 Jun 2004, Werner Otto wrote:
 

I am making use of use CGI qw(:standard); to create my form. I need to 
amend the size of a submit button and need to tell the button which script 
to call (ie. action=test.cgi). Where can I find documentation on all the 
attributes of the components, or an example for my two queries would be 
appreciated.
   


perldoc CGI
look for HOW TO CREATE A SUBMIT BUTTON etc.

Owen 

 

Methinks you may need to use style sheets to force the type size and 
thus the overall size smaller. Make sure to specify type size as pixels. 
See the CGI documentation for using style sheets with the CGI module.

As an alternative, you can always make the submit button an image.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



Re: CGI and mySQL book, any recommendation.

2004-06-01 Thread Camilo Gonzalez
Randal L. Schwartz wrote:
Wiggins == Wiggins D'Anconia [EMAIL PROTECTED] writes:
   

Wiggins Agreed. I have requested this from him before, but didn't get much.
I haven't responded because I've been using the net at 40 cents per
minute from a satellite link on a ship this past week, and right now
I'm using a 10 cents per minute cellphone modem.  When I get back to a
free link, I'll post more.
But in short, MySQL was great when it was the only game in town.
But PostgreSQL has leapfrogged MySQL now in every area including
features, performance, *and* license.  There's no point in starting
a new project with MySQL, *except* for legacy.
 

Mr. Schwartz,
As I stated before, I have a non-trivial amount of admiration for your 
work, but in sounding the death knell for MySQL, I feel you ignore real 
world factors that may make it's use advantageous. First of all is the 
large installed basethe legacy you mentioned. Portability is not a 
small issue.

Secondly, every review or comparison I have read touts MySQL as an 
easier database to learn. Yes, ease of use may come at the expense of a 
larger featureset, but not everyone needs every feature. IMO simplicity 
is a virtue.

Thirdly, you seem to look at MySQL as a dead language, like Latin. Who 
is to say that the next versiom won't leapfrog PostgreSQL in some areas?

Finally, Sir you are dealing with a group that thinks empiracly. Are we 
to take your word that PostgreSQL is faster? Give us some benchmarks. 
Back up your claims with unbiased third party testing.

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



Re: CGI and mySQL book, any recommendation.

2004-05-30 Thread Camilo Gonzalez
Randal L. Schwartz wrote:
Remko == Remko Lodder [EMAIL PROTECTED] writes:
   

Remko I have the book MySQL and Perl from Paul Dubois,
By the way... it's consensus amongst experts that MySQL has hit
nearly end-of-life.  If you're starting a new project, use PostgreSQL
instead.  A real Database... not a database wannabe.
The only reason to use MySQL these days is ignorance or legacy.
 

Hey, is this right? I respect Randal quite a bit but he has expressed a 
bias towards PostgreSQL. I'm studying MySQL and the vast majority of 
LAMP jobs I see still call for an expertise in MySQL. Am I wasting my 
time? Should I abandon Perl and go with PHP as well?

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



Re: Uploading file

2004-03-19 Thread Camilo Gonzalez
Ash Singh wrote:

Use this as an example, it converts the file to binary mode just in case its
not.  It also strips out the path of the file coming from the user's local
machine.
#!/usr/bin/perl

use CGI;
use strict;
my $cgi = new CGI; print $cgi-header;
my $query = CGI::new();
use CGI qw(param);
my ($bytesread,$buffer);

my $filename = $query-param('uploaded_file');
my $submit = $query-param('Submit');
#path on the server where the file will be saved
my $path = 'D:\webs\test\UploadFolder';
my $newFileName = $filename;
$newFileName =~ s/^.*(\\|\/)//;  #get file name only (strip path)
my $FiletoWrite = $path\\$newFileName;
if (defined($filename)) {
 open (OUTFILE,$FiletoWrite) || die print can't create file;
 binmode $filename;
 binmode OUTFILE;
 while ($bytesread=read($filename,$buffer,1024)) {
 print OUTFILE $buffer;
 }
 close(OUTFILE);
 $filename = undef;
 $path = undef;
 $newFileName = undef;
 $FiletoWrite = undef;
}
 

Thank you sir for your help. Evidently to compound matters, the FTP 
program I was using to check on the success of my uploads had a bug in 
it as well. However, your script is solid and works swimmingly.

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



Uploading file

2004-03-18 Thread Camilo Gonzalez
Okay, I'm totally stumped. I'm trying to upload a file using a browser 
and a file upload field and saving the file to my server. The code is as 
follows:

my $filename = $cgiobj-param('uploaded_file');
  my $fh = $cgiobj-upload('uploaded_file');
  open (OUTFILE, ../featImages/$filename) or die Can't open 
featImages $filename $!;
  while ($fh) {
print OUTFILE $fh or die Can't print to OUTFILE $!;
}
  close OUTFILE;

The file will be binary. I can get it to print out to STDOUT just fine 
but I don't want it in my webpage, I want it in the featImages directory.

Remember, I'm still a newbie so please be gentle. If you are a crabby 
person, please don't reply to this.

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



Standarized tests

2004-03-17 Thread Camilo Gonzalez
Are there any standarized tests one can take to measure one's Perl 
prowess? How much are they and where can I find them?

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



Re: matching newline

2004-03-02 Thread Camilo Gonzalez
zsdc wrote:

Camilo Gonzalez wrote:

zsdc wrote:

Tracy Hurley wrote:

Camilo,

I don't think you need to put $email in quotes to do the check, but 
it works if you do.  Try this:

if $email =~/@.*@/g || $email =~ /\n/s;


It still might not be secure depanding on how $email is being used 
later. Is it used in a system() call? In open()? In backticks? What 
about the whitespace? What if there is \r in $email? What about 
;? \0?

I would suggest to match safe characters, not the unsafe ones, 
because it's easy to overlook something. Camilo, it's very good that 
you use the taint mode here. Check out CGI::Untaint::email, this is 
exactly what you need:

http://search.cpan.org/search?module=CGI::Untaint::email
http://search.cpan.org/search?module=CGI::Untaint
It's used like this:

use CGI::Untaint;
my $untaint = CGI::Untaint-new($cgiobj-Vars);
my $email = $untaint-extract(-as_email = 'email');
You should do the same with other parameters, like name and address. 
You might need to write your own handler, but it's very easy. Here's 
an example from the CGI::Untaint documentation, to match a single 
digit:

package Mysite::CGI::Untaint::digit;
use base 'CGI::Untaint::object';
sub _untaint_re { qr/^(\d)$/ }
1;
Seems like a tad bit of overkill for my purpose. Thanks for the 
caveat about other unsafe characters and I'll keep the CGI::Untaint 
module in mind in the future.

It seems I needed to escape the backslash in '\n'. Here'smy new code

#!/usr/local/bin/perl -wT
use CGI::Carp qw(fatalsToBrowser);
use strict;
use CGI;
my $cgiobj = new CGI;
$ENV{PATH} = ;
#Get parameters
my $name = $cgiobj-param('name');
my $address = $cgiobj-param('address');
my $email = $cgiobj-param('email');
die Print_Error if $email =~ /@.*@|\\n|;|\0|,/gs;


My advise about unsafe characters was to match _safe_ characters 
instead of unsafe ones, i.e.:

  die unless $email =~ /$ safe pattern ^/;

and never:

  die if $email =~ /$ unsafe pattern ^/;

I haven't even showed every potentially dangerous character, those 
were only few examples. To be honest I can't understand why this is an 
overkill:

use CGI::Untaint;
my $untaint = CGI::Untaint-new($cgiobj-Vars);
my $email = $untaint-extract(-as_email = 'email');
while this isn't:

my $email = $cgiobj-param('email');
die Print_Error if $email =~ /@.*@|\\n|;|\0|,/gs;
especially when your regular expression has to be much longer, because 
it still is unsafe. (By the way, it doesn't match a newline, only a 
backslash followed by n).

How do you use the $mail variable later in your program? How do you 
actually send the email? I'll tell you how it can be dangerous, but 
only when I know how it is used.

My concern is to prevent a spammer from sending BCC messages using the 
email field of my contact form. I figure if I can prevent him from 
sending a line with more than one asterisk and/or a slash followed by an 
n, I can prevent him from sending BCC messages. I realise there are lots 
more dangerous characters out there but frankly, I'm too damn lazy to 
look for them. I truly do appreciate your help and I apoligize if you've 
taken umbrage with anything I've said, but TMTOWTDO, man. Chill. More of 
my code follows if you've got the time and inclination to rip it further.

#!/usr/local/bin/perl -wT
#use CGI::Carp qw(fatalsToBrowser);
use strict;
use CGI;
my $cgiobj = new CGI;
$ENV{PATH} = ;
#Get parameters
my $name = $cgiobj-param('name');
my $address = $cgiobj-param('address');
my $email = $cgiobj-param('email');
die Print_Error if $email =~ /@.*@|\\n|;|\0|,/gs;
my $comments = $cgiobj-param('comments');
#send emails to Camilo and sender
my $from ='Opensourceman';
my $subject = 'Contact Confirmation from Opensourceman';
my $reply = '[EMAIL PROTECTED]';
my $sendmail = '/usr/lib/sendmail -i -t';
open (SENDMAIL, |$sendmail) or die Cannot open sendmail: $!;
print SENDMAIL To: $email, $reply\n;
print SENDMAIL From: $from\n;
print SENDMAIL Reply-to: $reply\n;
print SENDMAIL Subject: $subject;
print SENDMAIL \n\n;
print SENDMAIL Thanks for contacting Opensourceman. Below is what you 
submitted to us:\n
   Name: $name\n
   Address: $address\n
   Email: $email\n
   Comments: $comments \n\n 
   We will be contacting you shortly;
close(SENDMAIL);

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



Re: matching newline

2004-02-29 Thread Camilo Gonzalez
Tracy Hurley wrote:

Camilo,

I don't think you need to put $email in quotes to do the check, but it 
works if you do.  Try this:

if $email =~/@.*@/g || $email =~ /\n/s;

Hope it helps,
Tracy
New to the list, so apologies if I post incorrectly.

On Feb 28, 2004, at 11:50 PM, Camilo Gonzalez wrote:

Perl dudes,

I'm trying to match a newline to dissuade spammers from hijacking my 
script. This is what I have

#!/usr/local/bin/perl -wT
use CGI::Carp qw(fatalsToBrowser);
use strict;
use CGI;
my $cgiobj = new CGI;
$ENV{PATH} = ;
#Get parameters
my $name = $cgiobj-param('name');
my $address = $cgiobj-param('address');
my $email = $cgiobj-param('email');
die Print_Error if $email =~ /@.*@/g || /\n/s;
It finds the extra '@' but ignores any \n I put in the email field. 
Any ideas?

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




Sorry really didn't work. Didn't make much of a difference.

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



Re: matching newline

2004-02-29 Thread Camilo Gonzalez
zsdc wrote:

Tracy Hurley wrote:

Camilo,

I don't think you need to put $email in quotes to do the check, but 
it works if you do.  Try this:

if $email =~/@.*@/g || $email =~ /\n/s;


It still might not be secure depanding on how $email is being used 
later. Is it used in a system() call? In open()? In backticks? What 
about the whitespace? What if there is \r in $email? What about ;? 
\0?

I would suggest to match safe characters, not the unsafe ones, because 
it's easy to overlook something. Camilo, it's very good that you use 
the taint mode here. Check out CGI::Untaint::email, this is exactly 
what you need:

http://search.cpan.org/search?module=CGI::Untaint::email
http://search.cpan.org/search?module=CGI::Untaint
It's used like this:

use CGI::Untaint;
my $untaint = CGI::Untaint-new($cgiobj-Vars);
my $email = $untaint-extract(-as_email = 'email');
You should do the same with other parameters, like name and address. 
You might need to write your own handler, but it's very easy. Here's 
an example from the CGI::Untaint documentation, to match a single digit:

package Mysite::CGI::Untaint::digit;
use base 'CGI::Untaint::object';
sub _untaint_re { qr/^(\d)$/ }
1;
Seems like a tad bit of overkill for my purpose. Thanks for the caveat 
about other unsafe characters and I'll keep the CGI::Untaint module in 
mind in the future.

It seems I needed to escape the backslash in '\n'. Here'smy new code

#!/usr/local/bin/perl -wT
use CGI::Carp qw(fatalsToBrowser);
use strict;
use CGI;
my $cgiobj = new CGI;
$ENV{PATH} = ;
#Get parameters
my $name = $cgiobj-param('name');
my $address = $cgiobj-param('address');
my $email = $cgiobj-param('email');
die Print_Error if $email =~ /@.*@|\\n|;|\0|,/gs;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response



matching newline

2004-02-28 Thread Camilo Gonzalez
Perl dudes,

I'm trying to match a newline to dissuade spammers from hijacking my 
script. This is what I have

#!/usr/local/bin/perl -wT
use CGI::Carp qw(fatalsToBrowser);
use strict;
use CGI;
my $cgiobj = new CGI;
$ENV{PATH} = ;
#Get parameters
my $name = $cgiobj-param('name');
my $address = $cgiobj-param('address');
my $email = $cgiobj-param('email');
die Print_Error if $email =~ /@.*@/g || /\n/s;
It finds the extra '@' but ignores any \n I put in the email field. Any 
ideas?

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



Re: Email text encoding

2004-02-11 Thread Camilo Gonzalez
Eek! I've been told by my ISP that my Perl script to email myself and 
the user of my form the contents on my contact form has been hijacked by 
a spammer. My ISP has been deluged by recipients with complaints. Where 
have I gone wrong? Please be kind, this is a beginners' list after all.

#!/usr/local/bin/perl -wT
use CGI::Carp qw(fatalsToBrowser);
use strict;
use CGI;
my $cgiobj = new CGI;
$ENV{PATH} = ;
#Get parameters
my $name = $cgiobj-param('name');
my $address = $cgiobj-param('address');
my $email = $cgiobj-param('email');
my $comments = $cgiobj-param('comments');
#send emails to Camilo and sender
my $from ='Opensourceman';
my $subject = 'Contact Confirmation from Opensourceman';
my $reply = '[EMAIL PROTECTED]';
my $sendmail = '/usr/lib/sendmail -i -t';
open (SENDMAIL, |$sendmail) or die Cannot open sendmail: $!;
print SENDMAIL To: $email, $reply\n;
print SENDMAIL From: $from\n;
print SENDMAIL Reply-to: $reply\n;
print SENDMAIL Subject: $subject;
print SENDMAIL \n\n;
print SENDMAIL Thanks for contacting Opensourceman. Below is what you 
submitted to us:\n
   Name: $name\n
   Address: $address\n
   Email: $email\n
   Comments: $comments \n\n 
   We will be contacting you shortly;
close(SENDMAIL);

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



Re: special characters

2003-12-27 Thread Camilo Gonzalez
J.,

In my experience, the numeric escapes where available seem to be more 
universal between browsers.

J. Alejandro Ceballos Z. wrote:

I may try with nueric equivalents (like #046;) or htmlspecialchars() 
or htmlentities()

Octavian Rasnita wrote:

Hi all,

I want to create some web pages that use special characters for foreign
languages (romanian), like staîâSTAÎÂ.
Please tell me what can I do to make them show right in the visitors'
browser.
I've seen that if I just print them, they appear like a question mark
instead (?).
I've seen that other sites can print them right and I don't know how.

Is there an HTTP header I need to set?
Or are there any special Apache settings I need to make?
Thank you for your help.

Teddy,
teddy.fcc.ro [EMAIL PROTECTED]





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



Re: Counter triggered on download

2003-08-24 Thread Camilo Gonzalez
This is the sort of stuff I was talking about. Modules are great but 
sometimes you just have to wrest back control.

zsdc wrote:

fliptop wrote:

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

my $cgi = new CGI;
print $cgi-header('application/pdf');


Actually, it's the same as just:

  print Content-Type: application/pdf\n\n;

CGI.pm is great but it's an overkill for just printing HTTP 
Content-Type header.

-zsdc.




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


Re: Counter triggered on download

2003-08-21 Thread Camilo Gonzalez
I would solve this by using the link to invoke a Perl script that would 
trip a counter and serve up the PDF document, shift-click be damned. Who 
uses shift-click anyway?

Merrill Oakes wrote:

I have a link to a PDF file on a web page.  I want to count how many 
times that someone clicks on the link (i.e. downloads the PDF).  The 
easy way (at least for me) would be to make them go to a download 
page first, and I could put a counter in the page, BUT this requires 
an extra step for the user.

SO, is there any way to:#1. monitor how many a times a file has been 
downloaded, or maybe #2. have them click on a link (that is really a 
cgi script, that then increments the counter then starts the 
download/open of the PDF?  Of course this last method will disable the 
ability to do a shift-click to download the doc.

Thoughts, or pointers would be appreciated,

Thanks,
MO.
[EMAIL PROTECTED]



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


Re: Perl line breaks

2003-08-14 Thread Camilo Gonzalez
Yech, what a mess. I think you may need to escape the question mark and 
or dots. In any case, why try to escape such an unwieldy string? Why not 
use a heredoc? Laziness is the mark of a good programmer.

Mike Harrison wrote:

I was trying to find a log file to look at.  I guess half the problem is I
am using a hosting service, and it is on a Microsoft IIS server (Windows
NT-based I think, but definitely not UNIX).  I will have to ask the hosting
admin where I might find a log file...
Here is the part of the perl script that I start printing things to the
browser (see previous message for the html.pm script that contains the
HTML_header and HTML_ender subroutines):
my $header = 'Successful update';
my $msg = h2Your preferences have been updated
successfully.../h2hrbrbrbr;
# Finally, put up a HTML document announcing that the update was successful.
HTML_header($header);
print body\n;
print center\n;
print $msg\n;
print pReturn to the a href=\amtest.pl?uname=$uname\
onMouseover=\window.status='Back to account management'; return true\
onMouseout=\window.status=''; return true\Account Management/a
page/p\n;
print /center\n;
HTML_ender;
Note that I have also tried using print qq| ... | code as well.

I am now getting a CGI error message along the lines of
Cannot find a string terminator '' in ... line ... (the line above starting
with print p... .  I can't find a problem with that line???
Thanks for your help so far guys!  I am losing a bit of sleep on this one :(
Regards,
Mike.
-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 06 August, 2003 2:30 AM
To: Jon Hogue
Cc: Mike Harrison; 'Andrew Brosnan'; [EMAIL PROTECTED]
Subject: Re: Perl line breaks
For troubleshooting a script you can take a look in the server's log file
and you will find there any error.
Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]
- Original Message -
From: Jon Hogue [EMAIL PROTECTED]
To: Octavian Rasnita [EMAIL PROTECTED]
Cc: Mike Harrison [EMAIL PROTECTED]; 'Andrew Brosnan'
[EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 4:19 PM
Subject: Re: Perl line breaks


 

...and you don't need to print the HTML header in the BEGIN {} block.
You can just print it at the top of the perl program or in the middle of
   

the
 

program but before anything else is printed.
   

if something is dieing in a module you are loading, you will never know
about it because it will never get to the Content-Type and therefore never
send anything good to your browser. if you use a BEGIN block, you might
catch things that happen in modules you load. i wouldn't recommend doing
that for your normal script, but it is a useful troubleshooting tool.


 



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


Re: Why executable?

2003-08-14 Thread Camilo Gonzalez
Okay then, how should scripts be called? Let's say I'm using a form. 
What would the action be?

Kristofer Hoch wrote:

You should never be able to guess the implementation language by
looking at a URL.  Wrong.  Wrong.
   

I couldn't agree more.  None of my scripts are executed directly...IE
there is not script called 'index.pl'.  Alternatly, I use HTML::Mason
for dynamic web content.  The Mason handler calls the scripts and does
something meaningful with the information it gets back.
 

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



=
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GIT d s+:++ a C++ UL++ US+ P+++ L++ 
W+++ w PS PE t++ b+ G e r+++ z
--END GEEK CODE BLOCK--

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
 



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


Re: Perl line breaks

2003-08-10 Thread Camilo Gonzalez
Mike Harrison wrote:

Hello all,

Well, I have spent the last few nights messing around trying to work out why
one of my PERL programs doesn't work.  If anybody can shed some light on
this, I might be able to get some sleep :)
I am using a hosting service to host my web site, and they use a Microsoft
NT-based server system (sorry, I don't know the nitty-gritty details).  They
allow user cgi programs (PERL, PHP etc.), and until now most of my PERL
programs have worked as expected.  I am using NTEmacs as a text editor for
my HTML  PERL programming.
With one program, I am getting an error message as follows:

CGI Error
The specified CGI application misbehaved by not returning a complete set
of HTTP headers. The headers it did return are:
(nothing else is printed to the screen after 'The headers it did return
are:')
My question is:  Are line breaks important with PERL programs, and if so,
any tips?  If line breaks are not likely to be the problem in this case,
does anybody know why I am getting this error?
Note that I have a similar PERL program in the same directory that works
fine.  So I think it is my program and not the web server...  It might be I
have overlooked an important detail that I can't see on the screen - such as
line breaks or other non-printable characters???
Thanks in advance for any help,
Mike.
 

How are you generating your HTTP headers? Can you post some code?

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


Re: Mail::Send question

2003-08-04 Thread Camilo Gonzalez
Todd W. wrote:

Camilo Gonzalez [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 

Definitely avoid this if possible, there are numerous mail message
modules, one of them is bound to provide what you need.
 

Why is sendmail held in such low regard by this group?

   

Most on this list will agree sendmail is one of the Internet's first killer
apps. But because interfacing directly with the sendmail binary can be
confusing and bug prone there are modules on the CPAN that use sendmail as
the transport mechanism. These modules abstract sendmail's intricacies from
the user, providing a simple API to send mail. Therefore, modules are the
preferred way to send mail from a perl program.
Todd W.



 

I sometimes wonder if all this shielding of intricacies is necessarly a 
good thing. Shouldn't I know how to use sendmail? I guess I'm a DIY kind 
of guy and I want to know how sendmail works. Fine, if a module makes it 
all easier, I'll certainly use it. But I want to know how the 
abstraction occurs. What happens if the module I'm using in lieu of 
sendmail is buggy and I have no idea why or how to circumvent the 
problem? Do I have control issues?

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


Re: Mail::Send question

2003-08-01 Thread Camilo Gonzalez
Wiggins d'Anconia wrote:

Scot Robnett wrote:

Is there any way to force Mail::Send to accept a From name, as 
opposed to
simply sending and using the hostname by default? I don't see 
anything in
the docs about setting the From field in the headers.

(of course, I can just open a pipe to sendmail, but I want to see if 
there's
a way to pull this off first...)

Definitely avoid this if possible, there are numerous mail message 
modules, one of them is bound to provide what you need. 
Why is sendmail held in such low regard by this group?



example:

#!/usr/bin/perl -w

require Mail::Send;

my $mailbody = blah blah blah;
my $to = '[EMAIL PROTECTED]';
my $from = '[EMAIL PROTECTED]';
my $msg = new Mail::Send;

# $msg-from($from) # doesn't work and mail
# doesn't get sent if you
# use it
It appears that 'from' isn't one of the proper header methods, you 
should try using the 'set' or 'add' methods to add the header you 
want. For instance:

$msg-set('From' = $from);

$msg-to($to);
$msg-subject('Mail from SomeBusiness.com');
my $fh = $msg-open;
print $fh $mailbody;
$fh-close;
# When this mail comes in, it comes from
# mywebaccountuserID@mywebhostdomain


If this doesn't suffice you might try one of the other mail modules 
that is slightly more robust.

http://danconia.org




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


Where's the Perl jobs, baby?

2003-07-30 Thread Camilo Gonzalez
I'm not sure if this question has been asked before but it may never be 
as relevant. I'm a Perl programmer trying to survive the Bush recession. 
What's a good resource for finding jobs? All I ever see are job listings 
for that icky Microsoft stuff. What options are open to the nattering 
contrarian? Has anyone on this list been affected by outsourcing yet? 
Are Perl people as vulnerable?

If this query is totally off base, please don't hesitate to tell me so 
(somehow, I don't think that will be a problem). However, I believe this 
list is supposed to be a resource and I don't think the employment issue 
is necessarily off base.

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


Re: saving a textarea to a text file

2003-06-26 Thread Camilo Gonzalez
Wrong. Try:

   use CGI;
   my $q = new CGI;
   my $record = $q-param('text_field');
   open(OUTFILE, output.txt) or die Can't open output.txt: $!;
   print OUTFILE $record;
   close OUTFILE;


Andrew Brosnan wrote:

On 6/26/03 at 10:14 PM, [EMAIL PROTECTED] (Bob X) wrote:

 

How would I go about saving the textarea of an HTML page to a text
   

file?
 

   use CGI;
   my $q = new CGI;
   my $record = $q-param('text_field');
   open(OUTFILE, output.txt) or die Can't open output.txt: $!;
   print OUTFILE $record;
send donations to TPF:
http://donate.yetanother.org/
read:
perldoc perlintro
perldoc CGI
perldoc perlopentut
Regards,
Andrew
--

 This post is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  Any code 
 contained herein is likely UNTESTED and may cause your system 
 to explode upon execution.  Furthermore, please be advised that
 I am really just a Perl ninny, and you probably should not be 
 taking my advice in the first place.

 



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


Memory shortage

2003-06-05 Thread Camilo Gonzalez
Okay, I'm still struggling here. My problem is I have a client who has a 
rather large tab delimited text file I am attempting to slurp up and 
place in a MySQL table. The file is almost 6 megs large but my ISP only 
allows 2 megs of RAM per user. I can slurp up only about 1.5 megs before 
I get an error message. I would like to read in only about 1.5 megs at a 
time but if I use the following I exceed memory limits:

while (sysread (TEMP,  $temp, 1_500_000))
 {
  # read into MySQL
  }
Is there a way to step through a large file and process only what I read 
in? I'm so stymied I wanna puke.

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


Need more memory

2003-05-30 Thread Camilo Gonzalez
Help,

How do I flush out the memory so I can start with a fresh allotment?

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


RE: uninitialized values

2002-09-11 Thread Camilo Gonzalez

I'm kinda a stupid moronic idiot, but it seems to me you're calling a
variable out of its scope. Try declaring it globally. If it doesn't work use
sarcasm on me 

-Original Message-
From: t [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 2:26 PM
To: [EMAIL PROTECTED]
Subject: uninitialized values


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]

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




RE: retain same file name when uploading

2002-09-09 Thread Camilo Gonzalez

Naomi,

The purpose of this list is not for us to write programs for you but to help
you overcome any specific problems you may have. Please post specifically
what you think the problem(s) are and the kind Perl gurus here will be all
too happy to assist you.

-Original Message-
From: Naomi Arries [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 2:42 PM
To: [EMAIL PROTECTED]
Subject: retain same file name when uploading


I have noticed that when uploading a file (say
c:\input.txt)
to the upload directory on my apache server
  then that file gets uploaded with another name(
C__input.txt.
  See below the script called upload.pl.
  Could you someone modify it such that the same name
remain consistant during (client to server) upload.

Thanks in advance

Naomi
 
==
Find businesses and have your business found: http://www.brabys.com

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




RE: retain same file name when uploading

2002-09-09 Thread Camilo Gonzalez

Nevermind.

-Original Message-
From: Christopher G Tantalo [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 09, 2002 3:11 PM
To: Camilo Gonzalez
Cc: 'Naomi Arries'; [EMAIL PROTECTED]
Subject: Re: retain same file name when uploading


Camilo Gonzalez wrote:

 Naomi,

 The purpose of this list is not for us to write programs for you but to
help
 you overcome any specific problems you may have. Please post specifically
 what you think the problem(s) are and the kind Perl gurus here will be all
 too happy to assist you.

Camilo,
umm, didnt he post his code and ask for help with a specific part of it?
bob
seemed to answer his question after looking at the problem.
Chris

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




RE: Viruses

2002-07-18 Thread Camilo Gonzalez

Antibiotics won't work against viruses. Like the anti-windows message
though.

-Original Message-
From: Shawn [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 18, 2002 9:21 AM
To: [EMAIL PROTECTED]
Subject: Re: Viruses


zentara [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Wed, 17 Jul 2002 23:21:06 -0400, [EMAIL PROTECTED] (Admin)
 wrote:
 
 Please ensure your computers are virus free before sending attachments
 through this mailing list.  In the past 2 weeks I have received
 notification from my Microtrend PC-cillin of no less than 6 worm/trojan
 infected files sent through this group.  If others on this list do not
have
 adequate virus protection please beware of possible viruses circulating
 through this email list.
 
 I havn't received any viruii thru this list, exactly which messages are
 you talking about. Maybe you should get rid of MS Windows.

Hey, while your at it, why not stop breathing, since they come that way
too...

Or maybe that is a bit harsh, I guess you could get an antibiotic instead.

Norton has seemed to work quite well for the past several years.

Shawn


-- 
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]




Benchmarking

2002-07-15 Thread Camilo Gonzalez

Good Kind Perl Gurus,
 
I see mention of benchmarking CGI scripts to see how quickly they run.
What's the best way to do this? I'm in a hosted Unix IRIX environment so may
not have access to the shell and other areas. 

#!/usr/local/bin/perl
print ' EOF'
 Camilo Gonzalez
 Web Developer
 Taylor Johnson Associates
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
  www.taylorjohnson.com http://www.taylorjohnson.com/ 
 

 EOF


 



RE: Subroutines

2002-07-15 Thread Camilo Gonzalez

Theresa,

Paul Duboise in his book Perl and MySQL puts all connection schemes in a
library. Would that work for you?

-Original Message-
From: Theresa Mullin [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 15, 2002 2:31 PM
To: [EMAIL PROTECTED]
Subject: Subroutines


Hi Everyone,
 
I am writing a program in which I am connecting to an oracle database.
I would like to put the environment variables and the connection routine
into a separate subroutine, so I don't have to keep re-copying the code.
What's the best way to go about this?
 
Thanks,
Theresa
 
Theresa M. Mullin
Programmer/Analyst
Administrative Computing
Northern Essex Community College
100 Elliott Way
Haverhill, MA  01830
(978) 556-3757
[EMAIL PROTECTED]
 

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




RE: Displaying counter

2002-07-15 Thread Camilo Gonzalez

Dude,

Make it easy on yourself, use an animated GIF. It's close enough. You don't
really mean 600 seconds do you?

-Original Message-
From: Jim Lundeen [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 15, 2002 2:58 PM
To: begin begin
Subject: Displaying counter


Hello all,

I know this probably isn't the appropriate list for my question, but I
don't want to receive email on other lists too!

So, if you know the answer, I'd appreciate your help...

I have the following in my HTML output:

head
  meta http-equiv=refresh content=600;URL=program.cgi
/head

Question:   Is there a way to display the counter?  I want to have my
page say You will be transferred to blah in NNN seconds...  I want
the message to actually show the active counter...   600 changes to 599,
then 598, and so on...

Thanks!





-- 
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: tail -f with cgi

2002-07-12 Thread Camilo Gonzalez

Alright, what's a tail -f?

-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 12, 2002 11:09 AM
To: 'Max Clark'; '[EMAIL PROTECTED]'
Subject: RE: tail -f with cgi


 -Original Message-
 From: Max Clark [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 11, 2002 7:44 PM
 To: '[EMAIL PROTECTED]'
 Subject: tail -f with cgi
 
 
 Hi,
 
 I am trying to write a cgi program to tail -f a log file. I 
 have a perl
 script that will open and print the log file, however it 
 closes as soon as
 it reads whatever is in the file at that particular time. How 
 do I mimic
 tail -f functionality?

CPAN has a File::Tail module.

But a CGI script isn't designed to be long-running like this. The
web server will eventually time out the request and kill your script.

-- 
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: Accessing Extra Information in die()

2002-07-11 Thread Camilo Gonzalez

Will $! suffice for you?

-Original Message-
From: John Pitchko [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 11, 2002 10:21 AM
To: [EMAIL PROTECTED]
Subject: Accessing Extra Information in die()


Hello,

I wrote a custom error message to be displayed in my CGI pages instead of
the standard die. It works fine, but I was wondering if there was a way I
could access all the special/extra information that is included in a die
message, such as line number and filename of the error.

Thanks,

John Pitchko
Data Services
Saskatchewan Government Insurance

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




RE: Using strict and configuration files

2002-06-11 Thread Camilo Gonzalez

Bob,

Exactly what does our do? I understand my and even local but have yet
to grasp the our concept.

-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 11, 2002 9:12 AM
To: 'Octavian Rasnita'; [EMAIL PROTECTED]
Subject: RE: Using strict and configuration files


 -Original Message-
 From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, May 28, 2000 4:32 AM
 To: [EMAIL PROTECTED]
 Subject: Using strict and configuration files
 
 
 Hi all,
 
 I want to use:
 
 use strict;
 
 And I want to use a configuration file in a Perl script.
 The configuration file uses:
 %page1=(
 
 );
 
 %page2=(
 
 );
 
 This way I get errors if I run the script because the 
 variables are not
 defined with my.
 
 I've tried putting in the configuration file:
 
 my %page1=(
 
 );
 
 But this method doesn't work.
 
 I use a configuration file and I would like to put the 
 settings only in this
 file without modifying the script.
 
 Is it possible?

Yes.

In your main program:

   use strict;
   require config.pl;
   our ($foo);

   print foo is $foo\n;

In your config file:

   $foo = Hello, world;

use strict applies only to the current file, so you don't need to
change your config file. You need to add the our declaration to
your main program to make use strict happy.

A more formal way to handle this would be to use a module and import
symbols:

File MyConfig.pm:

   package MyConfig;

   use strict;
   require Exporter;
   our @ISA = qw(Exporter);
   our @EXPORT = qw($foo);

   our $foo = Hello, world;   

   1;

Main program:

   use strict;
   use MyConfig;

   print foo is $foo\n;

If you import a symbol with use, you don't need the our declaration.

-- 
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: Using strict and configuration files

2002-06-11 Thread Camilo Gonzalez

So the following are equivalent:

use vars qw(foo)

our $foo = 

-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 11, 2002 9:17 AM
To: 'Camilo Gonzalez'; [EMAIL PROTECTED]
Subject: RE: Using strict and configuration files


 -Original Message-
 From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 11, 2002 10:16 AM
 To: 'Bob Showalter'; 'Octavian Rasnita'; [EMAIL PROTECTED]
 Subject: RE: Using strict and configuration files
 
 
 Bob,
 
 Exactly what does our do? I understand my and even 
 local but have yet
 to grasp the our concept.

It just declares that a global variable will be used without a
qualifying package name. Basically, it makes use strict happy.

perldoc -f our

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




RE: What database would your recommend?

2002-06-07 Thread Camilo Gonzalez

That's a good point. Are there still advantages to using Perl over using
PHP? I'd be bummed to hear I'm using a dying language.

-Original Message-
From: Fred Sahakian [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 10:52 AM
To: [EMAIL PROTECTED]
Cc: 
Subject: Re: What database would your recommend?


depends what you need to do, PHP has become VERY popular

 Octavian Rasnita [EMAIL PROTECTED] 06/05/02 10:58PM 
Hi all,

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.

Is there such a thing?
Of course, I would like to  learn something as simple as possible because I
am a beginner in Perl.

Thank you.

Teddy,
[EMAIL PROTECTED]



-- 
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: What database would your recommend?

2002-06-07 Thread Camilo Gonzalez

Forgive me Nikola. In this business you need to stay as marketable as
possible. I don't want to go to a potential employer with six years of Perl
on my resume, to be beaten out by somebody with 2 years of PHP on theirs. 

-Original Message-
From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 07, 2002 11:06 AM
To: 'Camilo Gonzalez'; 'Fred Sahakian'; [EMAIL PROTECTED]
Cc: 
Subject: RE: What database would your recommend?


Perl a dying language?

are you nutz?!?!?!

Haven't you been reading the Apocalypse pages for PERL 6??!?!?
http://dev.perl.org/perl6/apocalypse/  apocalypse 1-4
http://www.perl.com/pub/a/2002/06/04/apo5.html apocalypse 5 (pattern
matching will never be the same)

I get a w**dy just thinking about it.



 -Original Message-
 From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 07, 2002 11:57 AM
 To: 'Fred Sahakian'; [EMAIL PROTECTED]
 Cc: 
 Subject: RE: What database would your recommend?
 
 
 That's a good point. Are there still advantages to using Perl 
 over using
 PHP? I'd be bummed to hear I'm using a dying language.
 
 -Original Message-
 From: Fred Sahakian [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 07, 2002 10:52 AM
 To: [EMAIL PROTECTED]
 Cc: 
 Subject: Re: What database would your recommend?
 
 
 depends what you need to do, PHP has become VERY popular
 
  Octavian Rasnita [EMAIL PROTECTED] 06/05/02 10:58PM 
 Hi all,
 
 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.
 
 Is there such a thing?
 Of course, I would like to  learn something as simple as 
 possible because I
 am a beginner in Perl.
 
 Thank you.
 
 Teddy,
 [EMAIL PROTECTED]
 
 
 
 -- 
 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]
 



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

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




RE: subroutine or subroutine

2002-06-06 Thread Camilo Gonzalez

Janek,

Wouldn't it print:
foo:
foo:A B C

Also, I believe that you must declare the subroutine before you are allowed
to reference it without the . Am I right about that?

-Original Message-
From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 5:10 AM
To: [EMAIL PROTECTED]
Subject: Re: subroutine or subroutine


Kevin Christopher wrote at Wed, 05 Jun 2002 04:58:38 +0200:

 Yes, you can call subroutines either way, with or without the . The
only case when the
 subroutine must be prefixed with an ampersand is, I believe, when you're
assigning a reference
 variable, eg:
 
 $reference_x = \subroutine_y;
 
 But that's another story.
 

Oh, I'm afraid that's not the truth :-)

subroutine without any arguments calls the subroutine with the implicit @_
array,
while subroutine only calls subroutine() without any argument.

Look at this snippet:
@_ = qw(A B C);

print 'foo:'; foo; print \n;
print 'foo:'; foo; print \n;

sub foo {
   print @_;
}

It prints:
foo:
foo:ABC


Greetings,
Janek

-- 
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: subroutine or subroutine

2002-06-06 Thread Camilo Gonzalez

Bob,

Since this is a list for newbies, can you please be a bit more specific why
you are opposed to those things you list. I'm quite fond of using the foo
or foo(args) calling styles. Is this just a personal preference?

-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 8:30 AM
To: 'Octavian Rasnita'; [EMAIL PROTECTED]
Subject: RE: subroutine or subroutine


 -Original Message-
 From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 04, 2002 2:06 PM
 To: [EMAIL PROTECTED]
 Subject: subroutine or subroutine
 
 
 Hi all,
 
 I've seen some subroutines are ran without the  sign in front of the
 subroutine name, like:
 
 subroutine_name;
 instead of
 subroutine_name;
 
 Is it the same thing or there is a difference?

Janek gave you the difference, and it's fully documented in perldoc perlsub.

Note that the first is not allowed under use strict unless the sub has
been declared or defined above the usage, or imported.

Here are my recommendations for new code (others may want to debate these):

1. Always use strict;

2. Don't use prototypes.

3. Don't use the foo or foo(args) calling styles.

4. To call a sub with no arguments, use an empty set of
   parens: foo() (Exception: method calls can leave
   off the parens, e.g: $sth-execute; since there is
   no ambiguity with a method call).

-- 
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: website keywords

2002-06-06 Thread Camilo Gonzalez

Hytham,

This a HTML question, not a CGI one but here goes:

Keywords are usually stored in the meta tags at the top of a page. They
follow the form meta name=keywords content=some list of keywords

-Original Message-
From: Hytham Shehab [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 06, 2002 6:05 AM
To: [EMAIL PROTECTED]
Subject: website keywords


hi guys,
how can i access the keyword section of any web page?

thx

--
Hytham Shehab


-- 
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: Content Warning from MailScan to Mail-Sender!

2002-06-04 Thread Camilo Gonzalez

I think 'HAHAHA' is one of the subject lines used by a virus.

-Original Message-
From: drieux [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 04, 2002 11:15 AM
To: cgi cgi-list
Subject: Fwd: Content Warning from MailScan to Mail-Sender!



can one of the more elegantly enabled in our world
explain to me why and/or how

HAHAHA

became a 'restricted content'

I am aware that the American Attorney General has turned up
the heat on the pro-terrorist fellow travellor types who are
not fully backing the war against evil - but, uh, is
the following simply a badly designed piece of software
run amuck for want of any competent driver at the wheel

Begin forwarded message:

 From: [EMAIL PROTECTED]
 Date: Tue Jun 04, 2002  08:38:32  US/Pacific
 To: [EMAIL PROTECTED]
 Subject: Content Warning from MailScan to Mail-Sender!
 Return-Path: [EMAIL PROTECTED]
 Received: from gatekeeper2.mahindrabt.com([203.197.15.67]) (1625 bytes) 
 by wetware.wetware.com via sendmail with P:esmtp/D:user/T:local (sender: 
 [EMAIL PROTECTED])  id 
 [EMAIL PROTECTED] for [EMAIL PROTECTED]; Tue, 4 
 Jun 2002 09:05:12 -0700 (PDT) (Smail-3.2.0.114 2001-Aug-6 #1 built 
 2002-Jan-4)
 Received: from mahindrabt.com (mailscan.mahindrabt.com [10.2.0.50]) by 
 gatekeeper2.mahindrabt.com (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP 
 id VAA11589 for [EMAIL PROTECTED]; Tue, 4 Jun 2002 21:25:22 +0530
 Received: from mahindrabt.com by mahindrabt.com ; 4 Jun 2002 21:08:39 
 +0530
 X-Smtp-Sending-Ip: 127.0.0.1
 X-Originator: MailScan
 Message-Id: [EMAIL PROTECTED]
 Mime-Version: 1.0
 Content-Type: multipart/mixed; boundary=MailScanBoundary0
 Content-Transfer-Encoding: 7bit

 The following email you sent was not delivered to the
 intended recipients as it had restricted contents in it!
 The restricted content present was HAHAHA.

 Action taken: The email was Deleted.

 =
 The Mail came from: [EMAIL PROTECTED]
 The Mail recipient: [EMAIL PROTECTED]
 Subject of the Mail   : The Cannons of True Faith
 Message-ID: [EMAIL PROTECTED]
 =

 Use  MailScan on your  EMail  Servers  and  eScan on your
 Windows-based PCs and Servers for maximum protection from
 Internet-borne viruses.



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: The size of the uploaded file

2002-06-03 Thread Camilo Gonzalez

Why not just set up a FTP site? I assume the people who want to upload those
large files will be familiar with FTP.

-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 02, 2002 11:55 AM
To: [EMAIL PROTECTED]
Subject: The size of the uploaded file


Hi all,

I've seen for more times that it is not recommended to upload big files with
a web form.
I know that if the connection brokes down, the file will be probably lost,
but are there any other problems?

I would like to make a form for uploading big files on my server.
Not for the public, but I want to be able to upload files that have 30 MB or
even more.

Do I create special problems for the server?

Thanks.

Teddy,
[EMAIL PROTECTED]



-- 
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]




What is cat?

2002-06-03 Thread Camilo Gonzalez

I see the word 'cat' being used an awful lot lately here and have
encountered it in other readings. What is cat and what is it used for?

#!/usr/local/bin/perl
print ' EOF'
 Camilo Gonzalez
 Web Developer
 Taylor Johnson Associates
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
  www.taylorjohnson.com http://www.taylorjohnson.com/ 
 EOF


 



RE: The size of the uploaded file

2002-06-03 Thread Camilo Gonzalez

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?

-Original Message-
From: David T-G [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 9:17 AM
To: [EMAIL PROTECTED]
Cc: Camilo Gonzalez
Subject: Re: The size of the uploaded file


Camilo, et al --

and then Camilo Gonzalez said...
% 
% Why not just set up a FTP site? I assume the people who want to upload
those

Well, anon ftp has its own pains, as does non-anon ftp to some guest
account...  It's good to move away from ftp to anonymous scp or http
puts or such when you can.


% large files will be familiar with FTP.

Typically true, but web browsers are pretty ubiquitous these days and
many folks, believe it or not, don't know a thing about ftp :-)/2


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!


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




RE: HTML in E-mail

2002-06-03 Thread Camilo Gonzalez

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;
print MAIL From: fsahakia\
@courts.state.ny.us\n;
print MAIL Subject: Forwarded \n\n;
print MAIL This person has requested \n;

etc...

-Original Message-
From: Fred Sahakian [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 2:19 PM
To: 
Subject: HTML in E-mail


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?:

open(MAIL,|$mailprog -t);
print MAIL To: $comm\@courts.state.ny.us\n;
print MAIL From: fsahakia\
@courts.state.ny.us\n;
print MAIL Subject: Forwarded \n;
print MAIL This person has requested \n;

print MAIL font color=redtest text/fonta
href=http://www.SOMETHING.COM;LINK/A\n;


print MAIL County: $contents{'county'}
Name: $contents{'first'} $contents{'last'}
Address: $contents{'street'} $contents{'city'} 
$contents{'zip'}
Date of Birth: $contents{'month'} 
$contents{'day'} $contents{'year'}
Home Telephone: $contents{'htel'}
close MAIL;

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




RE: HTML in E-mail

2002-06-03 Thread Camilo Gonzalez

David,

I admire your principles. This is something that has come up before and
after some trial and error, what I proposed to him seemed to work. I too
feel HTML email is evil but some of us are stuck being prostitutes to keep
the wolves from our door.

-Original Message-
From: David T-G [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 03, 2002 3:11 PM
To: perl beginners cgi
Cc: Camilo Gonzalez; 'Fred Sahakian'
Subject: Re: HTML in E-mail


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 boldfreakin'/bold 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!


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




RE: Counter and scoping(?) issue

2002-05-29 Thread Camilo Gonzalez

Gack, you Perl Lords once again save my butt. Thanks Roberto, it worked like
a charm.

-Original Message-
From: Kevin Meltzer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 29, 2002 7:30 AM
To: Roberto Ruiz
Cc: Camilo Gonzalez; [EMAIL PROTECTED]
Subject: Re: Counter and scoping(?) issue


On Wed, May 29, 2002 at 03:05:36AM -0500, Roberto Ruiz
([EMAIL PROTECTED]) said something similar to:
 Hi, God bless you.
 
 On Tue, May 28, 2002 at 12:45:53PM -0500, Camilo Gonzalez wrote:
if ( $confirm_counter = 1){
   ^ May be this your problem?
 
 In the indicated if condition below you are allways assigning 1 to
 $confirm_counter instead of comparing it to 1. Should be:
 
 if($confirm_counter==1) {
 ...
 }
 

You don't need the quotes if you are doing a numeric check.

if($confirm_counter == 1) {
...
}

Cheers,
Kevin

-- 
[Writing CGI Applications with Perl - http://perlcgi-book.com]
Down that path lies madness.  On the other hand, the road to hell is
paved with melting snowballs. 
--Larry Wall in [EMAIL PROTECTED]

-- 
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]




Opening Filehandles under taint check

2002-05-22 Thread Camilo Gonzalez

Dudes,

Someone has to have some inkling how to open filehandles for writing whilst
running in taint mode (-T). C'mon there are some of the best Perl minds in
the world here. Is it impossible?

I've tried untainting the data I'm using to write with this snippet:

   #untaint $count 
   if ($count =~ /^([-\@\w.]+)$/){
$count = $1;
   }

but kept getting this error, Insecure dependency in open while running with
-T switch at /u/web/lega63/cgi-local/SecureMail.pl line 455. HELP! I don't
want to run this program without taint checks.

The full filehandle portion is:

 if ($mailPrefix[0]) {
open (COUNTER,$mailPrefix[0]Counter.txt) or die Couldn't read
counter, $! \n;
$count=COUNTER;
++$count;
close (COUNTER);

   #untaint $count 
   if ($count =~ /^([-\@\w.]+)$/){
$count = $1;
   }
   else {
   die Bad data in $count;
   }  
#The next line is line 455
open (COUNTER,$mailPrefix[0]Counter.txt) or die Couldn't write
counter, $! \n;
print COUNTER $count;
close (COUNTER);

unless ($skip eq yes){
open (COUNTER,$mailPrefix[0]Report.txt) or die Couldn't write
Report, $! \n;
print (COUNTER ${count}. $Config{'email'} on $date\n);
close (COUNTER);


}
}
} 

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




RE: Matt Wright's formMail

2002-05-15 Thread Camilo Gonzalez

Verio, the world's largest ISP.

-Original Message-
From: Dave Cross [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 12:37 PM
To: [EMAIL PROTECTED]
Subject: Re: Matt Wright's formMail


On Mon, 13 May 2002 16:07:54 +0100, Camilo Gonzalez wrote:

 I've just been informned by my ISP that Matt Wright's formMail will no
 longer be allowed on any of their servers due to glaring security
 concerns. I know now I shouldn't have used it but back then I was stupid
 and not a subscriber to this fine list. Let this serve as a warning to
 those still using his crap. Does anyone have the URL of that site that
 offers alternatives to Matt's scripts?

Can you please tell me which ISP this is. I'm tring to keep a list of
ISPs that have come to their senses and banned Matt's scripts.

Dave...

-- 
  Don't you boys know any _nice_ songs?

-- 
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: yahoo mail did't compile HTML mail

2002-05-14 Thread Camilo Gonzalez

Doh! Sorry, try this:

--- START source---
open(MAIL,|$mailp -t);
  print MAIL Content-Type: text/html\n\n;
  print MAIL To: $email\n;
  print MAIL From: $wemail\n;
  print MAIL Subject: $subject\n\n;
  print MAIL $contents\n;
  close (MAIL);
--- END source---

-Original Message-
From: messag from ESS [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 4:07 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: yahoo mail did't compile HTML mail


Thanks to all these brains which give a help to us,

1- I tried this with many options but didnt work,
Content-Type: text/html; charset=iso-8859-1

2-This and give me error not for simicolon only,
--- START source---
open(MAIL,|$mailp -t);
  print MAIL Content-Type: text/html\n\n;
  print MAIL To: $email\n;
  print MAIL From: $wemail\n;
  print MAIL Subject: $subject\n\n;
  print MAIL $contents\n;
  close (MAIL);
--- END source---

anyone try to make like me before?

Thankx again

From: Camilo Gonzalez [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED], messag from ESS  
[EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: RE: yahoo mail did't compile HTML mail
Date: Tue, 14 May 2002 11:47:32 -0500

Dude,

Try this

  --- START source---
  My source is:open(MAIL,|$mailp -t);
  print MAIL Content-Type: text/html\n\n;
  print MAIL To: $email\n;
  print MAIL From: $wemail\n;
  print MAIL Subject: $subject\n\n;
  print MAIL $contents\n;
  close (MAIL);
  --- END source---

-Original Message-
From: Kevin Meltzer [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 14, 2002 9:35 AM
To: messag from ESS
Cc: [EMAIL PROTECTED]
Subject: Re: yahoo mail did't compile HTML mail


You need a Content-Type header.
Content-Type: text/html; charset=iso-8859-1
(or whatever your charset is)

Cheers,
Kevin

On Tue, May 14, 2002 at 04:28:44PM +0300, messag from ESS
([EMAIL PROTECTED]) said something similar to:
  hi all
  I konw you havn't much time then I will begain directly
  Probem is:
  1- I make a program to send a mail.
  2- I send an HTML mail normaly to yahoo and hotmail.
  3- The hotmail compile it and display as a web bage.
  4- The yahoo did't compile it and display the HTML source !.
 
  Needed:
  1- why yahoo mail did not compile it.
  2- solve of this problem, or a way to solve it.
 
  --- START source---
  My source is:open(MAIL,|$mailp -t);
  print MAIL To: $email\n;
  print MAIL From: $wemail\n;
  print MAIL Subject: $subject\n\n;
  print MAIL $contents\n;
  close (MAIL);
  --- END source---
 
  THANKS FOR YOUR HELP

--
[Writing CGI Applications with Perl - http://perlcgi-book.com]
Life Is Pain, Highness.  Anyone who says otherwise is selling something.
 -- The Dread Pirate Wesley, in the Princess Bride.

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




_
Send and receive Hotmail on your mobile device: http://mobile.msn.com

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




Matt Wright's formMail

2002-05-13 Thread Camilo Gonzalez

I've just been informned by my ISP that Matt Wright's formMail will no
longer be allowed on any of their servers due to glaring security concerns.
I know now I shouldn't have used it but back then I was stupid and not a
subscriber to this fine list. Let this serve as a warning to those still
using his crap. Does anyone have the URL of that site that offers
alternatives to Matt's scripts?

#!/usr/local/bin/perl
print ' EOF'
 Camilo Gonzalez
 Web Developer
 Taylor Johnson Associates
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
  www.taylorjohnson.com http://www.taylorjohnson.com/ 
 EOF


 



RE: Matt Wright's formMail

2002-05-13 Thread Camilo Gonzalez

Thank you all for this link.

-Original Message-
From: Kevin Meltzer [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:53 AM
To: Camilo Gonzalez
Cc: [EMAIL PROTECTED]
Subject: Re: Matt Wright's formMail


try the rewrite from NMS:

http://nms-cgi.sourceforge.net/

Cheers,
Kevin

On Mon, May 13, 2002 at 10:07:54AM -0500, Camilo Gonzalez
([EMAIL PROTECTED]) said something similar to:
 I've just been informned by my ISP that Matt Wright's formMail will no
 longer be allowed on any of their servers due to glaring security
concerns.
 I know now I shouldn't have used it but back then I was stupid and not a
 subscriber to this fine list. Let this serve as a warning to those still
 using his crap. Does anyone have the URL of that site that offers
 alternatives to Matt's scripts?
 
 #!/usr/local/bin/perl
 print ' EOF'
  Camilo Gonzalez
  Web Developer
  Taylor Johnson Associates
   [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]

   www.taylorjohnson.com http://www.taylorjohnson.com/ 
  EOF
 
 
  

-- 
[Writing CGI Applications with Perl - http://perlcgi-book.com]
Disciple   - Master, why isn't everything perfect?
Zen Master - It is.

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




RE: Matt Wright's formMail

2002-05-13 Thread Camilo Gonzalez

The problems seem to be that it uses the Referer environmental variable to
exclude spammers and it gives the option of encoding data in the URL. I've
been told both are considered security risks. My ISP does not think even the
latest release addresses these issues and refuses to let Formmail on its
servers. 

-Original Message-
From: drieux [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 11:14 AM
To: cgi
Subject: Re: Matt Wright's formMail



On Monday, May 13, 2002, at 08:52 , Kevin Meltzer wrote:


 try the rewrite from NMS:

 http://nms-cgi.sourceforge.net/

 Cheers,
 Kevin

which version of the code is the 'problem' version?

what is the current specific 'security' issue?

there was a security update to v1.92 on 04/21/02
has there been some new issue arise??? since then?


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: Matt Wright's formMail

2002-05-13 Thread Camilo Gonzalez

After a quick perusal it seems the replacement form's greatest contribution
seems to be to limit the number of recipients that may be emailed at any one
time. There seem to a number of other improvements and it looks like the
code is updated more to what is recommended here. I do understand the
objections to Matt's style, after all he wrote this stuff when he was just
14 and Perl has come a long way since then. I don't share the animosity,
after all he has done a great deal to popularize Perl. It's just too bad he
did it with poor code and continues to write bad code.

-Original Message-
From: John Brooking [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 3:53 PM
To: cgi
Subject: Re: Matt Wright's formMail


I must confess I'm not intimately familiar with the
script in question, so I don't completely understand
what the code snippet that drieux included does,
therefore how it is or is not sufficiently secure.
However, I have some more general comments in the way
of clarification.

It seems to me that the *fact* of using the referers
environment variable is not the security risk, but
that relying on it *only* is the risk. My introduction
to this issue was getting publicly flamed on perl
beginners last summer partially for not knowing this.
(Don't worry, the burns healed quickly.) Since then,
I've at least read enough to know that anyone with the
LWP module or any other HTTP API in any language can
build a web client with any referer header they want.
But I would think that means that using referers in
itself is not inherently dangerous, only thinking that
it's doing you any good security-wise is. The danger
that this ignorance makes possible depends on what the
rest of your script does with the input it gets.

Encoding data in the URL - well, all GET parameters
work that way, in the broadest definition of the term
data. The question is, what does the script *do*
with that data? As all good readers of the security
chapter of O'Reilly's CGI Programming with Perl
(among others) will know, the biggest security hole
with user input is when that data is used for input to
a shell process. Is that what Matt's script does? If
so, is the generally approved work-around one of the
two fix-ups recommended by that book: (1) filter the
input string to disallow bad characters such as
shell escapes, or better yet, (2) use a combination of
fork and exec rather simply opening a pipe to a
process? How does the NMS replacement code handle
this, and what do you all do in similar cases?

- John

--- drieux [EMAIL PROTECTED] wrote:
 
 On Monday, May 13, 2002, at 09:21 , Camilo Gonzalez
 wrote:
 [..]
  The problems seem to be that it uses the Referer
 environmental variable to
  exclude spammers and it gives the option of
 encoding data in the URL. I've
  been told both are considered security risks. My
 ISP does not think even 
  the
  latest release addresses these issues and refuses
 to let Formmail on its
  servers.
 [..]
 
 in the main I have heard the same things - I can
 appreciate that
 ISP's are at liberty to do as they will - I was just
 trying to
 track down my exposure - given as our ISP is running
 v1.92
 
 it could be that if one's ISP is doing a lot of
 virtual hosting
 then the simplification of
 
   @referers = ('wetware.com','199.108.16.17');
 
 could get messy hence the following guard code:
 
   sub check_url {
 
   # Localize the check_referer flag which
 determines if user is 
 valid.local($check_referer) = 0;
 
  # If a referring URL was specified, for each
 valid referer, make sure 
 #
  # that a valid referring URL was passed to
 FormMail.  
 #
 
   if ($ENV{'HTTP_REFERER'}) {
   foreach $referer (@referers) {
   if ($ENV{'HTTP_REFERER'} =~
 m|https?://([^/]*)$referer|i) {
   $check_referer = 1;
   last;
   }
   }
   } else { $check_referer = 1; }
 
   # If the HTTP_REFERER was invalid, send back
 an 
 error.if ($check_referer != 1) 
 { error('bad_referer') }
   }
 
 is not sufficiently robust enough
 
 where that code is preventing spamming is with:
 
   @recipients = fill_recipients(@referers);
 
   sub fill_recipients {
   local(@domains) = @_;
   local($domain,@return_recips);
 
   foreach $domain (@domains) {
   if ($domain =~ /^\d+\.\d+\.\d+\.\d+$/) {
   $domain =~ s/\./\\\./g;
   push(@return_recips,'^[\w\-\.]+\@\[' .
 $domain . '\]');
   } else {
   $domain =~ s/\./\\\./g;
   $domain =~ s/\-/\\\-/g;
   push(@return_recips,'^[\w\-\.]+\@' .
 $domain);
   }
   }
 
   return @return_recips;
   }
 
 and I have tested this anti-spam piece - and the
 only thing that survives is aimed where it is
 suppose to go.
 
 As for 'using old perl' - I'm

RE: Matching string (here I am again)

2002-05-07 Thread Camilo Gonzalez

Try /[a-z]*\d[2]/

-Original Message-
From: Rafael Cotta [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 07, 2002 12:16 PM
To: [EMAIL PROTECTED]
Subject: Matching string (here I am again)


First of all, special thanks to Drieux.

I need to check if a string with the following patern:

lowercase charactersnumbernumber.html

Like cae01.html or djavan10.html (without quotes).

I tryied

$musica =~ /([a-z]*)[0-9][0-9]\.html/

but this matches djavan001.html, when this should not.

Wich regexpr can I use? This time a link to a howto will be very welcome,
once this is not the unique regexpr I'll need to build myself.

Rafael





-- 
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: Does CGI.pm have escapeURL?

2002-05-01 Thread Camilo Gonzalez

Try 'escapeHTML()'.

-Original Message-
From: John Brooking [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 01, 2002 12:49 PM
To: Beginners CGI
Subject: Does CGI.pm have escapeURL?


Does CGI.pm have some kind of URL escape function,
similar to escapeHTML? I couldn't find any
documentation on it in perldoc CGI, and I tried the
obvious, escapeURL, with negative results.

I suppose that the reason there is no obvious function
for this is if you have a form submitted with GET, the
escaping happens automatically. But what I need to do
is build my own query string to redirect to, so I need
to do the escaping myself. I know what the algorithm
is and have even done it before, but if CGI.pm
provides it, I should be using that one, right?

- John


__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

-- 
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: html in a cgi script

2002-03-21 Thread Camilo Gonzalez

Can someone resend the regex they formulated for checking for valid emails?
I seem to have accidently deleted it. Thanks


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




RE: Camel Book

2002-03-20 Thread Camilo Gonzalez

The one you seek is called Programming Perl and is indeed an O'Reilly
book. However, if you're new to programming you may want to consider first
reading Learning Perl which has a gentler learning curve.

-Original Message-
From: matt stewart [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 8:33 AM
To: [EMAIL PROTECTED]
Subject: RE: Camel Book


i'd imagine it'll be an o'reilly book - all their books have some kind of
animal on the front.

-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
Sent: 20 March 2002 12:29
To: [EMAIL PROTECTED]
Subject: Camel Book


Hi all,

I heard about that famous Camel Book for Perl but I don't know its real
name.
Please tell me if you know.
Thank you.
Teddy,
My dear email address is [EMAIL PROTECTED]



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.338 / Virus Database: 189 - Release Date: 14/03/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.338 / Virus Database: 189 - Release Date: 14/03/02
 

-- 
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]




Regex fro email addresses

2002-02-19 Thread Camilo Gonzalez

Does anyone have a regex handy that will extract email adresses and nothing
but? I have a large document with email addresses scattered throughout. The
addresses are preceeded and followed by a space.

#!/usr/local/bin/perl
print ' EOF'
 Camilo Gonzalez
 Web Developer
 Taylor Johnson Associates
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
  www.taylorjohnson.com http://www.taylorjohnson.com/ 
 EOF


 



RE: buton names

2002-02-13 Thread Camilo Gonzalez

You're asking for a peck of trouble. One solution I would consider is
JavaScript's onSubmit() method.

-Original Message-
From: GsuLinuX [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 2:22 PM
To: [EMAIL PROTECTED]
Subject: buton names


Hola! , 

There are 2 submit butons under my form and the information entered to the
form will be send to different cgi's. How can i do this?

One idea i thougt is to give names to the buttons and in the cgi :
if buton name is buton1
{ code1 }
if buton name is buton2
{code2 }

how can i do that if it's possible

thanx
funky
Istanbul


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




RE: buton names

2002-02-13 Thread Camilo Gonzalez

I understood his request differently, that he wanted to send the parameters
to different scripts depending on the submit button pushed.

-Original Message-
From: Hanson, Robert [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 3:44 PM
To: 'GsuLinuX'; [EMAIL PROTECTED]
Subject: RE: buton names


You can do it just like that.

Given this HTML form:

form action=/cgi-bin/test.cgi
input type=submit name=button1 value=This is button 1
input type=submit name=button2 value=This is button 2
/form

You can use this script:

#!/usr/bin/perl

use CGI qw/:standard/;

print header();

if ( param('button1') ) {
print Button 1 was pushed!;
}
elsif ( param('button2') ) {
print Button 2 was pushed!;
}

Camilo, why is that a problem?  Is there inconsistencies between how
browsers handle that info?  I don't know of any problems with it offhand,
and I have used it in the past (a long, long, time ago... nothing recent).

Rob

-Original Message-
From: GsuLinuX [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 13, 2002 3:22 PM
To: [EMAIL PROTECTED]
Subject: buton names


Hola! , 

There are 2 submit butons under my form and the information entered to the
form will be send to different cgi's. How can i do this?

One idea i thougt is to give names to the buttons and in the cgi :
if buton name is buton1
{ code1 }
if buton name is buton2
{code2 }

how can i do that if it's possible

thanx
funky
Istanbul


-- 
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]




Career

2002-02-04 Thread Camilo Gonzalez

I'm an open source freak and I was wondering about my prospects for finding

a job. Are there like-minded companies or am I doomed to Windoze? Are Perl

programmers in great demand?

#!/usr/local/bin/perl
print ' EOF'
 Camilo Gonzalez
 Web Developer
 Taylor Johnson Associates
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
  www.taylorjohnson.com http://www.taylorjohnson.com/ 
 EOF


 



RE: Using SSI in a CGI program

2002-01-21 Thread Camilo Gonzalez

Troy,

Not sure why you're doing that. SSI won't work on parsed pages. You're
already generating a page so why not include header.html in your template or
as a heredoc or open it as a filehandle and print it?

-Original Message-
From: Troy May [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 21, 2002 4:52 PM
To: Beginners CGI List
Subject: Using SSI in a CGI program


Hello,

I have an HTML template which gets inserted into a CGI program.  I need to
insert an SSI into it, but when the page is created it will not show up like
it does with a standard HTML file.  Do I need to do anything different to
this to execute it correctly so it will work like a standard SSI on my page?
Here's what I need to insert:

!--#include virtual=/path/to/header.html --

When I view source on the ending page of the CGI program I can see it there,
but it doesn't execute like it should.

Any ideas?

Thanks!


-- 
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: 2 Q's, Google and Me - can you spell it out?

2002-01-09 Thread Camilo Gonzalez

This is a common problem. The heredoc terminator must be on a line all by
itself, no spaces, no tabs. Here you have it preceeded by spaces.

-Original Message-
From: Henk van Ess [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 9:22 AM
To: Bob Showalter; [EMAIL PROTECTED]
Subject: Re: 2 Q's, Google and Me - can you spell it out?


Dear Bob, dear all,

I followed your suggestion and installed Active Perl for a local test. If I
run the script below, I get the following error:

Too late for -T option at C:\spriet.nl

When I remove the first line #!/usr/bin/perl -wT
i get the error:

Can't find string terminator  END_HTMLanywhere before EOF at C:\spriet.pl
line 31

Hope you can help ...

Henk van Ess



#!/usr/bin/perl -wT
use strict;
use CGI qw/:standard/;
use URI::Escape;

# if we came from the form, grab the values and create the URL
if ( param )
{
# get the form data
# see perldoc CGI
my $_prefix = param( 'prefix' ) || '';
my $_search = param( 'search' ) || '';

# untaint it
# see perldoc perlsec
my ( $prefix ) = ( $_prefix =~ /^([a-zA-Z\d\s_:]+)$/ ); #create
appropriate regex
my ( $search ) = ( $_search =~ /^([a-zA-Z\d\s_:]+)$/ ); #create
appropriate regex

# escape characters with special meaning in URIs
# see perldoc URI::Escape
$prefix = uri_escape( $prefix );
$search = uri_escape( $search );
print redirect(
http://www.google.com/search?q=$prefix%20$search; );
}
# otherwise, print the Web page
else
{
print header;
print END_HTML;
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

html
head
titleTest page/title
/head
body
form action=spriet.cgi method=get
input type=checkbox name=prefix value=allintitle: /
All in titlebr /
input type=text name=search /
input type=submit   name=Submit /
/form
/body
/html
END_HTML
}





-- 
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: 2 Q's, Google and Me - can you spell it out?

2002-01-09 Thread Camilo Gonzalez

The last part of your script looks like this

/form
/body
/html
END_HTML
}

It should look like this

/form
/body
/html
END_HTML
}

In other words, the END_HTML token needs to be on its own line with a return
immediately before and after it and no extraneous characters, including
spaces. Does that make sense?

-Original Message-
From: Henk van Ess [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 9:49 AM
To: Camilo Gonzalez; Bob Showalter; [EMAIL PROTECTED]
Subject: Re: 2 Q's, Google and Me - can you spell it out?


Ty for your fast answer, but I;m still puzzled. Could you paste the script
and add the proper syntax?  You really would help me with that

Henk van Ess

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




scheduling

2002-01-07 Thread Camilo Gonzalez

Anyone know of a module or method that will run a Perl script on a given
time each day? I need to FTP a file from one site to another daily and I was
hoping to automate it.

if ( $Camilo_Gonzalez  $Web_Developer ) {
 Taylor Johnson Associates;
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ;
 www.taylorjohnson.com http://www.taylorjohnson.com/ ;
}

 



RE: scheduling

2002-01-07 Thread Camilo Gonzalez

How can I find out about cron?

-Original Message-
From: fliptop [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 07, 2002 4:30 PM
To: Camilo Gonzalez
Cc: [EMAIL PROTECTED]
Subject: Re: scheduling


Camilo Gonzalez wrote:

 Anyone know of a module or method that will run a Perl script on a given
 time each day? I need to FTP a file from one site to another daily and I
was
 hoping to automate it.


can you write a cron job to do it?

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




Docs

2001-10-15 Thread Camilo Gonzalez

Where's a good place to find documentation in HTML of the CGI and DBI
modules?

if ( $Camilo_Gonzalez  $Web_Developer ) {
 Taylor Johnson Associates;
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ;
 www.taylorjohnson.com http://www.taylorjohnson.com/ ;
}

 



RE: Easy way to get output from system()

2001-10-11 Thread Camilo Gonzalez

Dude, assign it to a variable.

$tempdir = system(ls -l /tmp)

-Original Message-
From: Chuck [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 11, 2001 3:42 PM
To: PERL-CGI List
Subject: Easy way to get output from system()



I have several CGI's that use system() to get various OS details.

What is the most reliable way to glean this information after using this
command:

For example:

#!/bin/perl

system(ls -l /tmp)

How can I get that data?

Thanks,
CC



-- 
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: ultimate stupidity

2001-10-05 Thread Camilo Gonzalez

Yeah, don't worry about it. We're all bozos on this bus.

-Original Message-
From: Brett W. McCoy [mailto:[EMAIL PROTECTED]]
Sent: Friday, October 05, 2001 10:43 AM
To: Francesco Scaglioni
Cc: [EMAIL PROTECTED]
Subject: Re: ultimate stupidity


On Fri, 5 Oct 2001, Francesco Scaglioni wrote:

 Answer:
 I had inadvertently put a space in front of the # at the beginning of
 the #!.  The space is, of course covered by the cursor when I visit
 the beginning of the file an I had failed to notice the implied space
 ( implied because I could still see the # ).  Is this a record for the
 most stupid mistake ever made?  Boy have I got much to learn.

Don't feel bad -- we've all done similar things.  You know why programmers
have flat foreheads.  Beacuse they are constantly slapping their forehead
and going 'Doh!'

Being able to admit an error (even one you think is stupid) is a good
quality to have.

-- Brett
  http://www.chapelperilous.net/

Sir, it's very possible this asteroid is not stable.
-- C3P0


-- 
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 save and retreive form

2001-09-26 Thread Camilo Gonzalez

Doesn't PostgreSQL have a reputation as being somewhat pokey? Is it open
source?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 26, 2001 4:39 PM
To: [EMAIL PROTECTED]
Subject: Re: How to save and retreive form


 Brett == Brett W McCoy [EMAIL PROTECTED] writes:

Brett   MySQL is very simple to set up and easy to use.

/me whispers in 2001 and beyond, MySQL is spelled p o s t g r e s q l

MySQL is dead.  Long Live PostgreSQL.

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

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

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




foreach loop scoping

2001-08-17 Thread Camilo Gonzalez

Ack!

Fellow programmers,

I have what is probably a rudimentary problem I hope some one can solve. I'm
trying to construct a hash of hashes from a form. The relevant code is as
follows:

for $modelkey (@model) {
$datum = shift @data;
@fields = (split //, $datum); 
 for $field(@fields) {
 ($key, $value) = split /=/, $field;

 $bigData{$modelkey}{$key} = $value;
 print
$modelkeyBR$keyBR$bigData{$modelkey}{$key}P;
}  
if ($bigData{$modelkey}{deleting} =~
/delete/) {
$trash = shift @data;
$trash = shift @model; 
   }   
}

A sample of the results are as follow:

301
Sqft
900

301
Type
1br/1ba

301
Price
$194,900

301
Assesments
$223.12

302
Sqft
1084

302
Type
2br/2ba

302
Price
Sold

302
Assesments
$286.08

The problem is that I can print while the print statement is where its at
now but once I try to print outside the second foreach loop, nothing prints.
I'll eventually need to sort %bigData by the outer hash keys which means
%bigData's scope needs to extend beyound the second foreach loop. 

Does anyone have any ideas why this scoping problem occurs? Does anyone have
any ideas on how to overcome it?


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




RE: search and return a value from a table

2001-08-09 Thread Camilo Gonzalez

Hmmm, didn't we cover overly general questions recently? Are you new to this
group, Cynhsieh? Have you read any Perl books or taken any Perl classes?

I apoligize if I sound a bit harsh. I'm no Perl expert by any means. I
applaud you for choosing Perl for this task. You must realise however, that
what you are asking would take some time to explain and judging from your
question, one would wonder whether you have any experience with Perl at all.
Even amoung newbies, a certain level of knowledge must be presumed. What you
are asking this group to do is write a program for you. In the long run,
this would cheat you out of learning. 

-Original Message-
From: cynhsieh [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 07, 2001 10:48 PM
To: [EMAIL PROTECTED]
Subject: search and return a value from a table


Hi, I am trying to create a database program. I want to search and
return a value from a table. How do I do that?

eg.

Name  ID  Age
zzz  2389   28
yyy 7653   40


how do I use zzz to search zzz's age?

please email me at [EMAIL PROTECTED] Thanx!


-- 
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 open a http or https url, as if it was a file

2001-08-08 Thread Camilo Gonzalez

Why not open the file itself? In other words, try:

open (FILE, 'somefile.html') or die Can't open HTML document $!;

I don't think you can open and search an entire site.  

-Original Message-
From: Gael PEGLIASCO [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 8:15 AM
To: [EMAIL PROTECTED]
Subject: How to open a http or https url, as if it was a file


Hello,

I'm looking for a way to open a http url, in order to retrieve parts of its
content and display it in a cgi script.

I'd like to do things like :

open (FILE, 'http://www.myurl.com'); or
open (FILE, 'https://www.myurl.com');

Do you know how I could do that ?

Thanks for your reply,

With kind regards,

Gael,
[EMAIL PROTECTED]

-- 
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: Hash of hashes

2001-07-31 Thread Camilo Gonzalez

The @model array is composed of condo unit numbers, 301-627ish. The values
may later be names so I'm treating them as strings.

-Original Message-
From: fliptop [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 7:02 PM
To: Camilo Gonzalez
Cc: [EMAIL PROTECTED]
Subject: Re: Hash of hashes


[reply posted to list]

Camilo Gonzalez wrote:
 
 Yes, Fliptop. I wrote that in my orignal email. Would appreciate any
advice
 in that regard.

ok, good.  now, what is in the @model array?

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




RE: Hash of hashes

2001-07-30 Thread Camilo Gonzalez

Fliptop,

Haven't studied all of CGI.pm's capability's yet. Is there an easier way to
build a hash of hashes using it?

-Original Message-
From: fliptop [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 11:46 AM
To: Camilo Gonzalez
Cc: '[EMAIL PROTECTED]'
Subject: Re: Hash of hashes


Camilo Gonzalez wrote:
 
   $i=0;
   for $fields(split //, @data) {
   ($key, $value) = split /=/, $fields;
   $bigData{$model[$i]}{$key} = $value;
   $i++;
   }

why do i get the feeling when i look at this code that this person is
trying to parse a cgi query string without using cgi.pm?

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




RE: Copy and past HTML into a perl script

2001-07-13 Thread Camilo Gonzalez

Bradley,

I'm not sure your second example would work. I don't think single quotes
block interpolation

-Original Message-
From: Bradley M. Handy [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 13, 2001 12:56 PM
To: Tony Paterra; [EMAIL PROTECTED]
Subject: RE: Copy and past HTML into a perl script


Your quotes may be mismatched.  Meaning that you are enclosing the entire
HTML source with double quotes and you have unescaped double quotes in your
HTML source.  That would confuse perl.

For example:

print img src=image.gif;  # in this line image.gif is
a bareword.

You should do this:

print 'img src=image.gif';  # this does not interpolate
variables
though.

or

print img src='image.igf';  # this does interpolate
variables.

or

print HTML; # this does interpolate variables if
you use double
quotes.
img src=image.gif
HTML

But if you're looking for a longer term solution.  Here are my suggestions:

1. Use the Template Toolkit set of modules available at:
http://search.cpan.org/search?module=Template
2. Use the HTML::Template module available at:
http://search.cpan.org/search?module=HTML::Template
3. Put your HTML in a separate file, open it and the print the lines
as you
read them.

If you do one of the above then you can modify your HTML source and not
worry about screwing up your code.  Plus it makes your code more readable.

Brad Handy

--www.jack-of-all-trades.net
[EMAIL PROTECTED]


 -Original Message-
 From: Tony Paterra [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 1:45 PM
 To: [EMAIL PROTECTED]
 Subject: Copy and past HTML into a perl script


 I have a cgi script that I need to past approx 40 lines of HTML
 into.  I was
 hoping I could just get away with having a

 print paste HTML here;

 and get away with that but sadly no, I get incomplete set of
 headers errors.

 Any suggestions?

 Thanks,
 Tony


 --
 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]

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




RE: Copy and past HTML into a perl script

2001-07-13 Thread Camilo Gonzalez

That's true, but if you have double quotes inside of single quotes, the
double quotes will still interpolate. In other words, the enclosing single
quotes will not block the mighty interpolative power of the enclosed double
quotes. Please let me know if you believe this yo be incorrect.

-Original Message-
From: Brett W. McCoy [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 13, 2001 2:35 PM
To: Camilo Gonzalez
Cc: 'Bradley M. Handy'; Tony Paterra; [EMAIL PROTECTED]
Subject: RE: Copy and past HTML into a perl script


On Fri, 13 Jul 2001, Camilo Gonzalez wrote:

 I'm not sure your second example would work. I don't think single quotes
 block interpolation

What do you mean by that?  Variables do not interpolate if the string is
delimited by single quotes or q();

-- Brett
   http://www.chapelperilous.net/btfwk/

It is the wisdom of crocodiles, that shed tears when they would devour.
-- Francis Bacon

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




RE: Copy and past HTML into a perl script

2001-07-13 Thread Camilo Gonzalez

So let's clarify this. You believe the following to be equivalent:

print ( 'The rain in $Spain' );
print ( 'The rain in $Spain' );

-Original Message-
From: Bradley M. Handy [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 13, 2001 2:58 PM
To: Camilo Gonzalez; 'Brett W. McCoy'
Cc: Tony Paterra; [EMAIL PROTECTED]
Subject: RE: Copy and past HTML into a perl script


I believe that to be incorrect.  The outermost quotes win.

Brad

--www.jack-of-all-trades.net
[EMAIL PROTECTED]


 -Original Message-
 From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 3:55 PM
 To: 'Brett W. McCoy'; Camilo Gonzalez
 Cc: 'Bradley M. Handy'; Tony Paterra; [EMAIL PROTECTED]
 Subject: RE: Copy and past HTML into a perl script


 That's true, but if you have double quotes inside of single quotes, the
 double quotes will still interpolate. In other words, the enclosing single
 quotes will not block the mighty interpolative power of the
 enclosed double
 quotes. Please let me know if you believe this yo be incorrect.

 -Original Message-
 From: Brett W. McCoy [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 2:35 PM
 To: Camilo Gonzalez
 Cc: 'Bradley M. Handy'; Tony Paterra; [EMAIL PROTECTED]
 Subject: RE: Copy and past HTML into a perl script


 On Fri, 13 Jul 2001, Camilo Gonzalez wrote:

  I'm not sure your second example would work. I don't think single quotes
  block interpolation

 What do you mean by that?  Variables do not interpolate if the string is
 delimited by single quotes or q();

 -- Brett
  http://www.chapelperilous.net/btfwk/
 
 It is the wisdom of crocodiles, that shed tears when they would devour.
   -- Francis Bacon



-- 
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: Copy and past HTML into a perl script

2001-07-13 Thread Camilo Gonzalez

Yes it does, thank you. I'm afraid I'll have to disagree with you. My
Programming Perl book tells me otherwise. I still consider myself a newbie,
however and welcome other comments.

-Original Message-
From: Bradley M. Handy [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 13, 2001 3:10 PM
To: Camilo Gonzalez; 'Brett W. McCoy'
Cc: Tony Paterra; [EMAIL PROTECTED]
Subject: RE: Copy and past HTML into a perl script


No they aren't equivalent.

The first prints out - The rain in $Spain

The second prints out - The rain in $Spain

Does that clarify things?


 -Original Message-
 From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 4:08 PM
 To: 'Bradley M. Handy'; Camilo Gonzalez; 'Brett W. McCoy'
 Cc: Tony Paterra; [EMAIL PROTECTED]
 Subject: RE: Copy and past HTML into a perl script


 So let's clarify this. You believe the following to be equivalent:

 print ( 'The rain in $Spain' );
 print ( 'The rain in $Spain' );

 -Original Message-
 From: Bradley M. Handy [mailto:[EMAIL PROTECTED]]
 Sent: Friday, July 13, 2001 2:58 PM
 To: Camilo Gonzalez; 'Brett W. McCoy'
 Cc: Tony Paterra; [EMAIL PROTECTED]
 Subject: RE: Copy and past HTML into a perl script


 I believe that to be incorrect.  The outermost quotes win.

 Brad

 --www.jack-of-all-trades.net
 [EMAIL PROTECTED]


  -Original Message-
  From: Camilo Gonzalez [mailto:[EMAIL PROTECTED]]
  Sent: Friday, July 13, 2001 3:55 PM
  To: 'Brett W. McCoy'; Camilo Gonzalez
  Cc: 'Bradley M. Handy'; Tony Paterra; [EMAIL PROTECTED]
  Subject: RE: Copy and past HTML into a perl script
 
 
  That's true, but if you have double quotes inside of single quotes, the
  double quotes will still interpolate. In other words, the
 enclosing single
  quotes will not block the mighty interpolative power of the
  enclosed double
  quotes. Please let me know if you believe this yo be incorrect.
 
  -Original Message-
  From: Brett W. McCoy [mailto:[EMAIL PROTECTED]]
  Sent: Friday, July 13, 2001 2:35 PM
  To: Camilo Gonzalez
  Cc: 'Bradley M. Handy'; Tony Paterra; [EMAIL PROTECTED]
  Subject: RE: Copy and past HTML into a perl script
 
 
  On Fri, 13 Jul 2001, Camilo Gonzalez wrote:
 
   I'm not sure your second example would work. I don't think
 single quotes
   block interpolation
 
  What do you mean by that?  Variables do not interpolate if the string is
  delimited by single quotes or q();
 
  -- Brett
 http://www.chapelperilous.net/btfwk/
  
  It is the wisdom of crocodiles, that shed tears when they would devour.
  -- Francis Bacon
 


 --
 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]




Nasty

2001-07-13 Thread Camilo Gonzalez

I don't work with a lot of programmers. I hope to get into a situation where
I do. Is it fair to say the majority are *holes?

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




Bucks

2001-07-11 Thread Camilo Gonzalez

I've been writing PERL scripts for over two years now. It's the only type of
CGI I know. Would any of you more seasoned programmers say that there's
still a market for PERL programmers? I've read of Python and possibly PHP
taking over PERL's place as THE CGI language. I've also heard ASP takes up
fewer server resources than PERL and is easier to write. Do you see ASP
replacing PERL?

I'm a web designer and developer who knows PERL, Javascript and HTML. What
else should I learn? What do you guys think I should be making?



RE: Script written HTML won

2001-07-10 Thread Camilo Gonzalez

Mine too. See if you have an unclosed table tag or even a missing /HTML or
/FORM tag

-Original Message-
From: Bradley M. Handy [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 10, 2001 12:53 PM
To: Mark Bergeron; Samuel Brown; [EMAIL PROTECTED]
Subject: RE: Script written HTML won


It can happen.  Generally the reason is an unclosed literal string somewhere
in the HTML source.  At least that's been my experience with that problem.

Brad Handy

--www.jack-of-all-trades.net
[EMAIL PROTECTED]


 -Original Message-
 From: Mark Bergeron [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 10, 2001 1:48 PM
 To: Samuel Brown; [EMAIL PROTECTED]
 Subject: Re: Script written HTML won


 Let me get this straight. You can see the source but not the HTML
 output in the browser?

 Mark Bergeron

 -Original Message-
 From: Samuel Brown[EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Date: Tue Jul 10 10:20:57 PDT 2001
 Subject: Script written HTML won't display

 
   Here's a wierd problem for the gurus:
 
   I've just set up a fresh install of Active State
 Perl on this Win2k box, and have written a quick test
 script for the web server.  The script runs correctly
 from the command prompt, without reporting errors.
 The script runs for a web browser without reporting
 errors, likewise.  I can 'view source' and see that it
 returned everything correctly, even. (Well, I can't
 see the header in the source, natch.  But yes, i did
 make sure to include one; yes, one with TWO carriage
 returns.)
   The issue is that of the computers and web browsers
 I've tried to run this script from, none of them
 display the text!  Netscape displays a portion of the
 first body character, and nothing else.  IE doesn't
 even display that.  Again, a 'view source' in either
 will show a perfectly mundanely formatted little block
 of HTML text.
   Because i try not to go whining to mailing lists, I
 have taken the time to read over a half dozen FAQs,
 and short of chasing down every 400 page book they
 cross reference, I think I've fulfilled the
 obligations of researching this one on my own before
 taking up you all's valuable time and bandwidth.
 Anybody with more experience than me know the answer
 to my little connundrum?
 
 S.
 
 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail
 http://personal.mail.yahoo.com/

 /~_. _ | _ _  _  _
 \_/|(_||| | |(_)| |
  _|
 ___
 GO.com Mail
 Get Your Free, Private E-mail at http://mail.go.com





RE: Shifting bits

2001-07-09 Thread Camilo Gonzalez

Yes,

 and 

-Original Message-
From: Brian Jackson [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 12:26 PM
To: [EMAIL PROTECTED]
Subject: Shifting bits


Unfortunately I don't have any Perl books available to me at this time
and I am trying to find the answer to this on the web, but have had no
luck thus far...does anyone know if there is a shift operator in Perl
that allow me to shift bits.



RE: floor

2001-07-09 Thread Camilo Gonzalez

Use integer, e.g.

print her age is integer($age);

The function will round up to the next highest number.

-Original Message-
From: Thomas Jakub [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 3:36 PM
To: [EMAIL PROTECTED]
Subject: floor


in c++ you can floor a variable to drop the decimal
points.  How can you do this with perl?

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/