Re: Non-caching META-tags

2002-11-21 Thread Nick Malden

Thanks for the suggestions.

The problem is that for these META-tags to work, they have to be in the
header, not the body of the HTML. Thus if I use 

#*** Start HTML stuff *** 
print $q-header,
  $q-start_html(-title='New page',
 -style={'src'='mystyle.css'});

and then do the suggested:

print _META_TAGS_; 

the META tags appear in the body of the text and are then ineffective.

Seeing as CGI.pm doesn't support http-equiv meta-tags, as you found out,
perhaps the answer is not to be generating the header using CGI.pm at all,
but simply using standard print statements.

Nick

On Wed, 20 Nov 2002, Michael Kelly wrote:

 On Wed, Nov 20, 2002 at 02:02:05PM +, Nick Malden wrote:
 
 Hi Nick,
 
  When writing HTML, the trick I normally use to ensure that images etc are
  definitely the latest version, and not the cached version, is the
  following:
  
  META http-equiv=Cache-Control content=no-cache, must-revalidate
  META http-equiv=Pragma: no-cache
 [snip]
  How does one get perl produce the equivalent of the META tags above?
 
 CGI.pm doesn't support http-equiv meta-tags, according to the documentation.
 What about something as simple as:
 
 print _META_TAGS_;
 META http-equiv=Cache-Control content=no-cache, must-revalidate
 META http-equiv=Pragma: no-cache
 _META_TAGS_
 
 IMNSHO, CGI.pm shines when you're getting form input, printing forms or tables
 dynamically, or messing with cookies. With something as straight-forward as
 printing out meta-tags and headers, though, I personally feel it's drastic
 overkill.


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




Re: Non-caching META-tags

2002-11-21 Thread fliptop
On Wed, 20 Nov 2002 at 13:58, Michael Kelly opined:

MK:On Wed, Nov 20, 2002 at 02:02:05PM +, Nick Malden wrote:
MK:
MK:CGI.pm doesn't support http-equiv meta-tags, according to the documentation.
MK:What about something as simple as:

what?  snippet from perldoc CGI:

To create an HTTP-EQUIV type of meta tag, use -head, described below.



And here's how to create an HTTP-EQUIV meta tag:

print start_html(-head=meta({-http_equiv = 'Content-Type',
  -content= 'text/html'}))


the error associated with the original post's code was due to the fact 
that the syntax was not correct.  the solution that CGI.pm provides means 
that, even if the syntax is corrected, it still won't work.  use the -head 
method described in the CGI docs.


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




Weekly list FAQ posting

2002-11-21 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 updated in 

Re: Non-caching META-tags

2002-11-21 Thread Nick Malden

Perl/CGI really doesn't seem to like this way of doing META tags. I've
trimmed the irrelevant stuff, am the core of what I'm trying is the
following:

#!/usr/local/bin/perl
use POSIX;  
use CGI; 
$q = new CGI; 
print $q-header,
  $q-start_html(-title='New page',
 -head=meta({-http_equiv = 'Content-Type',
  -content = 'text/html'}));
print EOT;
This is the generated HTML. 
/body 
/html
EOT

In my browser (netscape) I get a 500 Internal Server error, or run from
a shell I get:

Undefined subroutine main::meta called at test.pl line 7.

Any ideas? Thanks.

Nick


On Thu, 21 Nov 2002, fliptop wrote:

 On Wed, 20 Nov 2002 at 13:58, Michael Kelly opined:
 
 MK:On Wed, Nov 20, 2002 at 02:02:05PM +, Nick Malden wrote:
 MK:
 MK:CGI.pm doesn't support http-equiv meta-tags, according to the documentation.
 MK:What about something as simple as:
 
 what?  snippet from perldoc CGI:
 
 To create an HTTP-EQUIV type of meta tag, use -head, described below.
 
 ...
 
 And here's how to create an HTTP-EQUIV meta tag:
 
 print start_html(-head=meta({-http_equiv = 'Content-Type',
   -content= 'text/html'}))
 
 
 the error associated with the original post's code was due to the fact 
 that the syntax was not correct.  the solution that CGI.pm provides means 
 that, even if the syntax is corrected, it still won't work.  use the -head 
 method described in the CGI docs.
 


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




Re: Non-caching META-tags

2002-11-21 Thread Mark Bergeron
sub mainHeader{
print $q-header( -type = text/html, -expires = now ),
  $q-start_html( -title = Your Title);

This has always worked for me. I don't know if will do everything for you.

-Original Message-
From: Nick Malden[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date: Wed Nov 20 06:02:05 PST 2002
Subject: Non-caching META-tags


When writing HTML, the trick I normally use to ensure that images etc are
definitely the latest version, and not the cached version, is the
following:

META http-equiv=Cache-Control content=no-cache, must-revalidate
META http-equiv=Pragma: no-cache

I want to do the same thing in a page generated by perl/cgi, i.e something
like:

print $q-header,
  $q-start_html(-title='My new page',
-meta={'http-equiv'='Cache-Control' 
'content'='no-cache,must-revalidate'})
-meta={'http-equiv'='Pragma: no-cache'});

but this gives 

String found where operator expected at test.pl line 20, near
'Cache-Control' 'content'

How does one get perl produce the equivalent of the META tags above?


Nick 

_

Nick Malden, Manchester Gruppe, DESY, Notkestrasse 85, 22607
Hamburg.




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



___
GO.com Mail
Get Your Free, Private E-mail at http://mail.go.com



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




RE: Non-caching META-tags

2002-11-21 Thread VERHAEGHE Koen (BMB)
Hi,

Try using

use CGI qw/:standard/;

Works for me

Cheers
Koen

-Original Message-
From: Nick Malden [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, November 21, 2002 2:39 PM
To: fliptop
Cc: Michael Kelly; Perl Beginners CGI List
Subject: Re: Non-caching META-tags



Perl/CGI really doesn't seem to like this way of doing META tags. I've
trimmed the irrelevant stuff, am the core of what I'm trying is the
following:

#!/usr/local/bin/perl
use POSIX;  
use CGI; 
$q = new CGI; 
print $q-header,
  $q-start_html(-title='New page',
 -head=meta({-http_equiv = 'Content-Type',
  -content = 'text/html'}));
print EOT;
This is the generated HTML. 
/body 
/html
EOT

In my browser (netscape) I get a 500 Internal Server error, or run
from a shell I get:

Undefined subroutine main::meta called at test.pl line 7.

Any ideas? Thanks.

Nick


On Thu, 21 Nov 2002, fliptop wrote:

 On Wed, 20 Nov 2002 at 13:58, Michael Kelly opined:
 
 MK:On Wed, Nov 20, 2002 at 02:02:05PM +, Nick Malden wrote:
 MK:
 MK:CGI.pm doesn't support http-equiv meta-tags, according to the 
 documentation. MK:What about something as simple as:
 
 what?  snippet from perldoc CGI:
 
 To create an HTTP-EQUIV type of meta tag, use -head, described 
 below.
 
 ...
 
 And here's how to create an HTTP-EQUIV meta tag:
 
 print start_html(-head=meta({-http_equiv = 'Content-Type',
   -content= 'text/html'}))
 
 
 the error associated with the original post's code was due to the fact
 that the syntax was not correct.  the solution that CGI.pm provides
means 
 that, even if the syntax is corrected, it still won't work.  use the
-head 
 method described in the CGI docs.
 


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



 DISCLAIMER 

This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer.

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


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




Error when using the LWP module

2002-11-21 Thread Octavian Rasnita
Hello all,

I've made a spider which gets cookies from web sites, then it sends it back
to the next pages.

The script works for some pages, but for others it gives me the following
error message:

[Thu Nov 21 19:10:31 2002] [error] [client 127.0.0.1] Can't locate object
method host via package URI::_generic at
C:/Perl/site/lib/HTTP/Cookies.pm line 682.

Please tell me what could be the problem.

Thank you.

The code I've used is:

use strict;
use LWP::UserAgent;
use HTTP::Cookies;
my $ua = LWP::UserAgent - new (env_proxy = 0,
timeout = 30,
keep_alive = 1,
);

#...

my $cookie_jar = HTTP::Cookies - new(3, $cookies_file);

my $request = HTTP::Request - new('GET', $page);
$request - header('REFERER' = $page);

#Send the cookies to the site:
$cookie_jar - load($cookies_file);
$cookie_jar-add_cookie_header($request);

my $response = $ua - request($request);
$cookie_jar-extract_cookies($response);
$cookie_jar-save($cookies_file);

if ($response - is_success 
($response - header(content-type) =~ /text\/html/i
or
$response - header(Content-type) =~ /text\/plain/i)) {





Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]



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




Re: listing perl modues on system

2002-11-21 Thread Jason Purdy
One easy way is to run the command:
perldoc perllocal

Jason

Jerry M . Howell II [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello there,

I was wondering if there is an easy way to list the perl modules that
are
 installed on a system?

 --
 Jerry M. Howell II



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




Re: console window

2002-11-21 Thread Jason Purdy
At the end of your perl program, add the line:
system( PAUSE );

http://www.computing.net/programming/wwwboard/forum/3270.html

HTH,

Jason

Gary Rocco [EMAIL PROTECTED] wrote in message
001301c290f9$02bad3d0$93b500c7@hppavilion">news:001301c290f9$02bad3d0$93b500c7@hppavilion...
when i ran perl programs using windows 98 operating system, i double clicked
on the program name in windows explorer.  i kept the program files right in
the C:\Perl directory.  the programs would open a command prompt type
console window and execute.  the console window remained open until i
clicked on the X to close it.

now i have a new hp pavilion pc running windows xp. everything else being
the same, when i run the perl programs from windows explorer, the console
window opens, executes and closes before i can see anything in it.  i
realize that if i open the command prompt, i can see the program results but
i would like to be able to run the programs directly from windows.  i have
tried changing the suffix from .pl to .bat(using pl2.bat).  the results are
the same either way.

thank you

gary rocco

[EMAIL PROTECTED]



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




Re: Non-caching META-tags

2002-11-21 Thread fliptop
On Thu, 21 Nov 2002 at 08:09, Michael Kelly opined:

MK:On Thu, Nov 21, 2002 at 07:19:37AM -0500, fliptop wrote:
MK: On Wed, 20 Nov 2002 at 13:58, Michael Kelly opined:
MK: 
MK: MK:On Wed, Nov 20, 2002 at 02:02:05PM +, Nick Malden wrote:
MK: MK:
MK: MK:CGI.pm doesn't support http-equiv meta-tags, according to the documentation.
MK: MK:What about something as simple as:
MK: 
MK: what?  snippet from perldoc CGI:
MK: 
MK: To create an HTTP-EQUIV type of meta tag, use -head, described below.
MK:
MK:Hrm, I must have an old version (2.56). From perldoc CGI, line 1013:
MK:
MK: There is no support for the HTTP-EQUIV type of META tag.
MK:
MK:Looks like I need to update. Sorry for the misinformation!

yeah - the latest version is 2.89, released october 16th.

http://search.cpan.org/author/LDS/CGI.pm-2.89/


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




RE: console window

2002-11-21 Thread Peter Kappus
Another quick dirty trick is to just put a 
STDIN;
at the end of your script.  This makes yours script wait for input.  When
you hit enter it will terminate and the window will close.  Of course,
this only works if your script gets to the end.  If it runs into a compile
error, you'll see the error message for 3 microseconds before the window
closes... Many editors let you execute commands from the IDE.  I like gVim
(steep learning curve but oh-so-snappy once your fingers learn a few simple
commands) Anybody know how to do more sophistocated error trapping or
console execution?  Yes, I know, this isn't really even a CGI question.  Who
uses a console for CGI development anyway?

-p


-Original Message-
From: Jason Purdy [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 21, 2002 8:08 AM
To: [EMAIL PROTECTED]
Subject: Re: console window


At the end of your perl program, add the line:
system( PAUSE );

http://www.computing.net/programming/wwwboard/forum/3270.html

HTH,

when i run the perl programs from windows explorer, the console
window opens, executes and closes before i can see anything in it.

thank you

gary rocco

[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: listing perl modues on system

2002-11-21 Thread wiggins
I get no documentation found for this method (solaris w/ 5.6.1), but I would imagine 
that would only list the base modules. If you are on unix the following is more 
elegant, from the perldoc perlmodlib page (not sure why it took me so long to find 
again, grr..)

To find out all modules installed on your system, including those without 
documentation or outside the standard release, just do this:

   % find `perl -e 'print @INC'` -name '*.pm' -print

Ah the beauty of find with a perl one liner, don't even need a pipe ;-)

http://danconia.org




On Thu, 21 Nov 2002 10:59:08 -0500, Jason Purdy [EMAIL PROTECTED] 
wrote:

 One easy way is to run the command:
 perldoc perllocal
 
 Jason
 
 Jerry M . Howell II [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello there,
 
 I was wondering if there is an easy way to list the perl modules that
 are
  installed on a system?
 
  --
  Jerry M. Howell II
 
 
 
 -- 
 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]