Re: perl?

2001-09-13 Thread lc-brian_d_foy

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:

> Server: Apache/1.3.14 (Unix) mod_perl/1.24 PHP/4.0.3pl1 FrontPage/4.0.4.3 
> mod_ssl/2.7.1 OpenSSL/0.9.6

>  Does' this tell you what version of perl is installed & what mod? I,m trying 
> to upload a script but having no luck.

it only tells you which version of mod_perl is installed, but it
might also lie about that.

what problem are you having?
-- 
brian d foy <[EMAIL PROTECTED]> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html

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




editing script

2001-09-13 Thread Wagner

Hello,

I'm editing a script that produces a .png image, i want it to turn it into a
.html doc.

My first doubt is that i can't put the image in the html doc. The image is
stored in $im and i don't know how to put it in the doc.

ex:
print "Content-type text/html\n\n";
print ";

I'm also trying to put this image in a file this way:

$file = 'c:\image.png';
open (INFO, ">$file");
print INFO "$im->png";
close (INFO);

But it doesn't work...

The second doubt is how can i put the content of a variable in the doc. For
example, if i have a valiable:

$file = 'c:\dir\asdf.asd',

Then i try to put in the doc this way:

print "$file";

But when i run it apears $file in the .html doc and i wanted to see
c:\dir\asdf.asd

Thanks in advance,
Wagner


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




Re: Forward slash in regex pattern

2001-09-13 Thread Mark Murphy

Alan -

Your problem are the "$" in $path and $url. You need to escape them
somehow or just remove them out of your test script if you don't need
them. Also

if ($url !~ /$path/){
 $url = $path.$url;
 }

worked fine for me, no need for the m,^, or !.

Mark

Alan Hulley wrote:
> 
> Hello.  I'm new to Perl and CGI and seem to have dropped in the deep end with this 
>particular problem!
> 
> The basic requirement is:  if a string doesn't begin with a sequence of characters 
>then prepend that sequence to the string.  Seems simple enough, but this is 
>complicated (it would seem from my limited knowledge of Perl) by the fact that both 
>strings contain '/' characters).
> 
> Here is my code, which attempts to prepend $path to $url if $url doesn't begin with 
>$path:
> 
> $path = q {//serv12/share_dir$/App Dir/};
> $url =  q {//serv12/share_dir$/App Dir/My Dir/My Name/file.htm#20010109};
> $oldurl = $url;
> if ($url !~ m!^$path!)
> {
>  $url = "${path}${url}";
> }
> print "path=$path\n";
> print "oldurl=$oldurl\n";
> print "url=$url\n";
> 
> When run, the resultant $url is wrong because it originally started with $path and 
>$path should not have been prepended to it:
> 
> path=//serv12/share_dir$/App Dir/
> oldurl=//serv12/share_dir$/App Dir/My Dir/My Name/file.htm#20010109
> url=//serv12/share_dir$/App Dir///serv12/share_dir$/App Dir/My Dir/My 
>Name/file.htm#20010109
> 
> I've just read about Leaning Toothpick Syndrome, and I understand that m! etc. is 
>used instead of m/ to avoid the problem of
> '/' characters in the pattern, but it hasn't worked above.
> 
> Thanks for any replies.
> 
> cheers, Alan
> 
> --
> 
> This e-mail may contain confidential and/or privileged information. If you are not 
>the intended recipient (or have received this e-mail in error) please notify the 
>sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
>distribution of the material in this e-mail is strictly forbidden.

-- 
Mark Murphy

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




Re: editing script

2001-09-13 Thread Gunther Birznieks

At 08:44 AM 9/13/2001 -0300, Wagner wrote:
>Hello,
>
>I'm editing a script that produces a .png image, i want it to turn it into a
>.html doc.
>
>My first doubt is that i can't put the image in the html doc. The image is
>stored in $im and i don't know how to put it in the doc.
>
>ex:
>print "Content-type text/html\n\n";
>print ";

Not unless $im is a URL and even then you may want to consider quoting it. 
You can't just dump binary data inside an HTML document. So $im must be a 
URL not the binary data of an image.

>I'm also trying to put this image in a file this way:
>
>$file = 'c:\image.png';
>open (INFO, ">$file");
>print INFO "$im->png";
>close (INFO);
>
>But it doesn't work...

It's possible that you want to turn binmode on INFO...

binmode(INFO) before printing a binary image to it.

>The second doubt is how can i put the content of a variable in the doc. For
>example, if i have a valiable:
>
>$file = 'c:\dir\asdf.asd',
>
>Then i try to put in the doc this way:
>
>print "$file";
>
>But when i run it apears $file in the .html doc and i wanted to see
>c:\dir\asdf.asd

$file should interpolate fine if you truly did use double-quotes in your 
print statement, but I think it is possible that you should cut and paste 
exactly what you used because you seem a bit confused, and I am afraid that 
it's possible that you're information is not relayed exactly as you say you 
typed your tests out.



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




gui development

2001-09-13 Thread charles

sorry that this question isnt directly cgi associated. up until recently,
i've been developing my cgi scripts straight away using vi or a clone. i
just came upon activestate's visual perl a few days ago and wondered if
anyone knew of a similar product available for the *nix platform?

regards -charles


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




problem using script as ssi

2001-09-13 Thread charles

i have the following script:

#!/usr/bin/perl -w

use strict;

my $file = /path/to/pancho-unstable";

print "";
open(FH, $file);
while() {
  s/\\\@/@/g;
  s/>/\>/g;
  s/";


when i include this script as an ssi through:



nothing prints except for the html included in the .shtml file.
however, when i rewrite the above script as follows:

#!/usr/bin/perl -w

use strict;
use CGI ':standard';

my $file = "/path/to/pancho-unstable";

print header;
print start_html("Pancho Man Page");
print "";
open(FH, $file);
while() {
  s/\\\@/@/g;
  s/>/\>/g;
  s/";
print end_html;


the desired results occur. can someone explain why i am seeing these
results?

thanks -c


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




RE: problem using script as ssi

2001-09-13 Thread Bob Showalter

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 13, 2001 11:23 AM
> To: CGI Beginners
> Subject: problem using script as ssi
> 
> 
> i have the following script:
> 
> #!/usr/bin/perl -w
> 
> use strict;
> 
> my $file = /path/to/pancho-unstable";
> 
> print "";
> open(FH, $file);
> while() {
>   s/\\\@/@/g;
>   s/>/\>/g;
>   s/   print if /USE/.../USE/ and !/USE/;
> }
> close(FH);
> print "";
> 
> 
> when i include this script as an ssi through:
> 
> 
> 
> nothing prints except for the html included in the .shtml file.
> however, when i rewrite the above script as follows:
> 
> #!/usr/bin/perl -w
> 
> use strict;
> use CGI ':standard';
> 
> my $file = "/path/to/pancho-unstable";
> 
> print header;
> print start_html("Pancho Man Page");
> print "";
> open(FH, $file);
> while() {
>   s/\\\@/@/g;
>   s/>/\>/g;
>   s/   print if /USE/.../USE/ and !/USE/;
> }
> close(FH);
> print "";
> print end_html;
> 
> 
> the desired results occur. can someone explain why i am seeing these
> results?

Because the former is not a valid CGI script, while the latter is?

You can use the directive:

   

To execute the script with /bin/sh, which would allow your first
script to work as you intend.

(Also note that mod_include docs recommend using #include virtual
instead of #exec cgi)

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




Complete beginner can't get Sendmail to work

2001-09-13 Thread Andrew Cocks

my sendmail.pm file (stored in the SYS\Perl\lib\Mail directory) has the following line:

$default_smtp_server = '192.9.200.222';

my formmail.pl file refers to the sendmail file with the following line:

$mailprog = '/perl/lib/Mail';

Can anyone see anything wrong with these lines of code?

Is it possible to test sendmail.pm without using another script?







**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

[EMAIL PROTECTED]
**

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




RE: editing script

2001-09-13 Thread Wagner

Hi Gunther;

I've tryed to save the picture in the file but it didn't work.

The script is going as an attachment for you to take a look. My
modifications are in the end of the file.

Thank for your help in advance,
Wagner

-Original Message-
From: Gunther Birznieks [mailto:[EMAIL PROTECTED]]
Sent: quinta-feira, 13 de setembro de 2001 10:26
To: Wagner; [EMAIL PROTECTED]
Subject: Re: editing script


At 08:44 AM 9/13/2001 -0300, Wagner wrote:
>Hello,
>
>I'm editing a script that produces a .png image, i want it to turn it into
a
>.html doc.
>
>My first doubt is that i can't put the image in the html doc. The image is
>stored in $im and i don't know how to put it in the doc.
>
>ex:
>print "Content-type text/html\n\n";
>print ";

Not unless $im is a URL and even then you may want to consider quoting it.
You can't just dump binary data inside an HTML document. So $im must be a
URL not the binary data of an image.

>I'm also trying to put this image in a file this way:
>
>$file = 'c:\image.png';
>open (INFO, ">$file");
>print INFO "$im->png";
>close (INFO);
>
>But it doesn't work...

It's possible that you want to turn binmode on INFO...

binmode(INFO) before printing a binary image to it.

>The second doubt is how can i put the content of a variable in the doc. For
>example, if i have a valiable:
>
>$file = 'c:\dir\asdf.asd',
>
>Then i try to put in the doc this way:
>
>print "$file";
>
>But when i run it apears $file in the .html doc and i wanted to see
>c:\dir\asdf.asd

$file should interpolate fine if you truly did use double-quotes in your
print statement, but I think it is possible that you should cut and paste
exactly what you used because you seem a bit confused, and I am afraid that
it's possible that you're information is not relayed exactly as you say you
typed your tests out.


 gb.pl

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


Weekly list FAQ posting

2001-09-13 Thread casey

NAME
beginners-faq - FAQ for the beginners-cgi mailing list

1 -  Administriva
  1.1 - I'm not subscribed - how do I subscribe?

Send mail to <[EMAIL PROTECTED]>

You can also specify your subscription email address by sending email to
(assuming [EMAIL PROTECTED] is your email address):

<[EMAIL PROTECTED]>.

  1.2 -  How do I unsubscribe?

Now, why would you want to do that? Send mail to
<[EMAIL PROTECTED]>, and wait for a response. Once you
reply to the response, you'll be unsubscribed. If that doesn't work,
find the email address which you are subscribed from and send an email
like the following (let's assume your email is [EMAIL PROTECTED]):

<[EMAIL PROTECTED]>

  1.3 - There is too much traffic on this list. Is there a digest?

Yes. To subscribe to the digest version of this list send an email to:

<[EMAIL PROTECTED]>

To unsubscribe from the digest, send an email to:

<[EMAIL PROTECTED]>

  1.4 - Is there an archive on the web?

Yes, there is. It is located at:

http://archive.develooper.com/beginners-cgi%40perl.org/

  1.5 - How can I get this FAQ?

This document will be emailed to the list once a month, and will be
available online in the archives, and at http://beginners.perl.org/

  1.6 - I don't see something in the FAQ, how can I make a suggestion?

Send an email to <[EMAIL PROTECTED]> with your suggestion.

  1.7 - Is there a supporting website for this list?

Yes, there is. It is located at:

http://beginners.perl.org/

  1.8 - Who owns this list?  Who do I complain to?

Casey West owns the beginners-cgi list. You can contact him at
[EMAIL PROTECTED]

  1.9 - Who currently maintains the FAQ?

Kevin Meltzer, who can be reached at the email address (for FAQ
suggestions only) in question 1.6

  1.10 - Who will maintain peace and flow on the list?

Casey West, Kevin Meltzer and Ask Bjoern Hansen currently carry large,
yet padded, clue-sticks to maintain peace and order on the list. If you
are privately emailed by one of these folks for flaming, being
off-topic, etc... please listen to what they say. If you see a message
sent to the list by one of these people saying that a thread is closed,
do not continue to post to the list on that thread! If you do, you will
not only meet face to face with a XQJ-37 nuclear powered pansexual
roto-plooker, but you may also be taken off of the list. These people
simply want to make sure the list stays topical, and above-all, useful
to Perl/CGI beginners.

  1.11 - When was this FAQ last updated?

Sept 07, 2001

2 -  Questions about the 'beginners-cgi' list.
  2.1 - What is the list for?

A list for beginning Perl programmers to ask questions in a friendly
atmosphere. The topic of the list is, of course, CGI with Perl.

  2.2 - What is this list _not_ for?

* SPAM
* Homework
* Solicitation
* Things that aren't Perl related
* Non Perl/CGI questions or issues
* Lemurs
  2.3 - Are there any rules?

Yes. As with most communities, there are rules. Not many, and ones that
shouldn't need to be mentioned, but they are.

* Be nice
* No flaming
* Have fun
  2.4 - What topics are allowed on this list?

Basically, if it has to do with Perl/CGI , then it is allowed. If your
question has nothing at all to do with Perl/CGI, it will likely be
ignored.

  2.5 - I want to help, what should I do?

Subscribe to the list! If you see a question which you can give an
idiomatic and Good answer to, answer away! If you do not know the
answer, wait for someone to answer, and learn a little.

  2.6 - Is there anything I should keep in mind while answering?

We don't want to see 'RTFM'. That isn't very helpful. Instead, guide the
beginner to the place in the FM they should R :)

  2.7 - I don't want to post a question if it is in an FAQ. Where should I
look first?

Look in the FAQ! Get acquainted with the 'perldoc' utility, and use it.
It can save everyone time if you look in the Perl FAQs first, instead of
having a list of people refer you to the Perl FAQs :) You can learn
about 'perldoc' by typing:

`perldoc perldoc'

At your command prompt. You can also view documentation online at:

http://www.perldoc.com and http://www.perl.com

3 - Other Resources
  3.1 - What other websites may be useful to a beginner ?

* Perl Home Page - http://www.perl.com
* PerlMonks - http://www.perlmonks.org
* Perldoc - http://www.perldoc.com
* Perl Archives - http://www.perlarchives.com
  3.2 - What resources may be harmful to a beginner?

Beware of Perl4-like code-- You might find some script archives and
unauthorized mirrors with old Perl4 versions of Selena Sol and Matt
Wright scripts. Don't use those scripts. They are outdated and may even
in some cases contain bugs or security problems since many may not have
been 

Re: Complete beginner can't get Sendmail to work

2001-09-13 Thread Gunther Birznieks

Please do a search on the archives of this list from the past couple weeks 
having to do with mail and you'll see many good, verbose suggestions on 
some good alternatives

At 04:49 PM 9/13/2001 +0100, Andrew Cocks wrote:
>my sendmail.pm file (stored in the SYS\Perl\lib\Mail directory) has the 
>following line:
>
>$default_smtp_server = '192.9.200.222';
>
>my formmail.pl file refers to the sendmail file with the following line:
>
>$mailprog = '/perl/lib/Mail';
>
>Can anyone see anything wrong with these lines of code?
>
>Is it possible to test sendmail.pm without using another script?
>
>
>
>
>
>
>
>**
>This email and any files transmitted with it are confidential and
>intended solely for the use of the individual or entity to whom they
>are addressed. If you have received this email in error please notify
>the system manager.
>
>This footnote also confirms that this email message has been swept by
>MIMEsweeper for the presence of computer viruses.
>
>[EMAIL PROTECTED]
>**
>
>--
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]

__
Gunther Birznieks ([EMAIL PROTECTED])
eXtropia - The Open Web Technology Company
http://www.eXtropia.com/


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