[13653] in Perl-Users-Digest
Perl-Users Digest, Issue: 1063 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 15 14:41:59 1999
Date: Fri, 15 Oct 1999 11:41:37 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <940012896-v9-i1063@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 15 Oct 1999 Volume: 9 Number: 1063
Today's topics:
help with Net::LDAP (Jared Evans)
Re: help with Net::LDAP (Russell)
Re: help with Net::LDAP (Jared Evans)
HELP: set $ENV variable via eval in CGI script??? <dblaisde@top.mitre.org>
Re: HELP: set $ENV variable via eval in CGI script??? <cassell@mail.cor.epa.gov>
Re: HELP: set $ENV variable via eval in CGI script??? (Larry Rosler)
hide source <iolalla@nmp.es>
Re: hide source <samay1NOsaSPAM@hotmail.com.invalid>
Re: hide source <cmcurtin@interhack.net>
Re: hide source <sariq@texas.net>
Re: hide source <amonotod@netscape.net>
Re: hide source (Abigail)
Re: hide source (Craig Berry)
Re: hide source (Greg Bacon)
Re: hide source <makkulka@cisco.com>
Re: hide source <gellyfish@gellyfish.com>
Re: hide source (Tad McClellan)
Re: hide source <iolalla@nmp.es>
Re: hide source <NukeEmUp@ThePentagon.com>
Re: hide source <gellyfish@gellyfish.com>
how call html page from perl script sparky21@my-deja.com
Re: how call html page from perl script (Brett W. McCoy)
Re: how call html page from perl script <dchristensen@california.com>
Re: how call html page from perl script <jeff@vpservices.com>
Re: how call html page from perl script <rasmusr@online.no>
Re: how call html page from perl script <jeff@vpservices.com>
How can I get data from Web source? <Jing.Shi@usa.alcatel.com>
Re: How can I get data from Web source? <marcel.grunauer@lovely.net>
Re: How can I get data from Web source? <rootbeer@redcat.com>
Re: How confidential is Perl? (Ilya Zakharevich)
Re: how do i open a new window from a cgi script <rootbeer@redcat.com>
Re: how do i open a new window from a cgi script <dove@synopsys.com>
Re: how do i open a new window from a cgi script <ceesbakk@casema.nl>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Oct 1999 17:34:42 GMT
From: jared@frontiernet.net (Jared Evans)
Subject: help with Net::LDAP
Message-Id: <7u547i$otq$1@node17.cwnet.frontiernet.net>
Hi,
I'm having a hard time coming up with a perl script to do a typical
ldap search and printing the search results:
Basically I need to do something like:
ldapsearch -h "10.1.16.2" -b "o=Gleason, c=US" "cn=*" mail
then printing out each entry that show up.
Jared
------------------------------
Date: 15 Oct 1999 01:09:31 GMT
From: r@itwol.bhp.com.au (Russell)
Subject: Re: help with Net::LDAP
Message-Id: <slrn80cvmd.17vt.r@r.itntl.bhp.com.au>
On 14 Oct 1999 17:34:42 GMT, Jared Evans <jared@frontiernet.net> wrote:
+
+ Hi,
+ I'm having a hard time coming up with a perl script to do a typical
+ ldap search and printing the search results:
+
+ Basically I need to do something like:
+
+ ldapsearch -h "10.1.16.2" -b "o=Gleason, c=US" "cn=*" mail
+
+ then printing out each entry that show up.
+
Here is a script that does something sort of like that.. but you'll need
to modify it for your needs..anyway here it is,
-- begin
#!/usr/bin/env perl5
use strict;
use Net::LDAP;
use Getopt::Std;
use vars qw($ALL $a $options $qmap $ldap $LDAPHOST);
# Search the global address list, build structure for further
# processing into text, html, whatever.
# Russell Davies <r@itntl.bhp.com.au> - Thursday March 4 16:12:50 EST 1999
@ARGV or usage();
init() => doit();
sub usage {
$0 =~ s,.*/,,;
(my $a = <<EOF) =~ s/^\s//gm;
usage: $0 option(s)
options: (multiple options are logically ANDed)
Search by,
-r rdn
-u uid
-m email
-l location
-i initials
-s surname
-n first name
-p postaladdress
-t telephonenumber
-a # dump *everything* for matching entries.
examples:
gg -s thompson # All Thompsons.
gg -s thompson -a # more information.
gg -s thompson -l newcastle # As above limited to Newcastle.
gg -s 'robert*' -n chris # roberts? robertson?
gg -m '*russell*\@bhp.com.au' # what was that email address?
EOF
print "$a\n\n";
exit(1);
}
sub init {
getopts("p:l:i:t:m:u:s:n:c:r:a",$options = {}) or usage();
$LDAPHOST = q/itntl-msg02.itntl.bhp.com.au/;
$ALL++ if $options->{a}; # this is necessary because of
delete $options->{a}; # the way we build $filter.
$qmap = {
'l' => q/l/,
's' => q/sn/,
'c' => q/co/,
'u' => q/uid/,
'r' => q/rdn/,
'm' => q/mail/,
'i' => q/initials/,
'n' => q/givenName/,
'p' => q/postaladdress/,
't' => q/telephonenumber/,
};
}
sub doit {
my @largs = ( qq[$LDAPHOST],qw(DN '' Password '' Port 389 Debug 3));
$ldap = Net::LDAP->new(@largs) or die $@;
my $filter = join '',(
q[(&],
( map { qq/($qmap->{$_}=$options->{$_})/ } keys %$options),
q[)]);
my @args = ( base => q/c=AU/, filter => $filter );
my $m = $ldap->search(@args) or die $@;
textout($m);
}
sub textout {
my $h = shift;
for my $e ($h->all_entries) {
my @p = qw[
cn s m t uid rdn
telephonenumber
co st l
postaladdress
postalcode
department
company
title
];
my @l = $ALL ? keys %{$e->{attrs}} : @p;
for my $k (@l) {
my $rk = $qmap->{$k} ? $qmap->{$k} : $k;
$e->{attrs}{$rk} && do {
printf "%25s => %s\n",$rk, @{$e->{attrs}{$rk}};
};
}
print "\n" if $h->all_entries > 1;
}
}
------------------------------
Date: 15 Oct 1999 14:57:44 GMT
From: jared@frontiernet.net (Jared Evans)
Subject: Re: help with Net::LDAP
Message-Id: <7u7fd8$9ju$1@node17.cwnet.frontiernet.net>
Thanks!!! It works like a charm!!
Jared
------------------------------
Date: Tue, 12 Oct 1999 17:53:10 -0400
From: Doug Blaisdell <dblaisde@top.mitre.org>
Subject: HELP: set $ENV variable via eval in CGI script???
Message-Id: <3803ADC5.C6D00C2C@top.mitre.org>
Hi all,
Is it possible to set a CGI environment variable via an eval, eg
--------------
cat /tmp/data
$ENV{ 'DEBUG' } = 'YES';
--------------
cat doit.pl
#!/usr/bin/perl
@l = `cat /tmp/data`;
for(@l) {
eval $_;
}
print "$ENV{'DEBUG'}\n";
---------------
Then enter: "localhost/cgi-bin/doit.pl" into a browser window.
---
I've noticed it gets set from the command line, but not from the
browser.
Anybody know what's going on?
thanks
------------------------------
Date: Tue, 12 Oct 1999 15:50:19 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: HELP: set $ENV variable via eval in CGI script???
Message-Id: <3803BB2B.D06B9DCA@mail.cor.epa.gov>
Doug Blaisdell wrote:
>
> Hi all,
> Is it possible to set a CGI environment variable via an eval, eg
Yes, it is.
> --------------
> cat /tmp/data
> $ENV{ 'DEBUG' } = 'YES';
>
> --------------
> cat doit.pl
> #!/usr/bin/perl
Uh-oh. You are not using the -w flag, and you are not
using the 'use strict' pragma. Since you mention CGI,
you should have the -T flag in the first line of your program
also:
#!/usr/bin/perl -wT
use strict;
> @l = `cat /tmp/data`;
This is asking for trouble unless you check the error.
On a webserver, you are almost always running in a
different environment, with different privileges and a
different username. So your server may be cutting you
off from accessing your file. But you didn't check the
error, so you can't tell. If `` fails, the Perl variable
$? will hold the status value. Print it.
> for(@l) {
> eval $_;
> }
> print "$ENV{'DEBUG'}\n";
This is probably not what you want to do. eval() is slower
than other options. Look into the Perl functions do() and
require().
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Tue, 12 Oct 1999 16:14:15 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: HELP: set $ENV variable via eval in CGI script???
Message-Id: <MPG.126d60a6ff1a3ae198a087@nntp.hpl.hp.com>
In article <3803BB2B.D06B9DCA@mail.cor.epa.gov> on Tue, 12 Oct 1999
15:50:19 -0700, David Cassell <cassell@mail.cor.epa.gov> says...
...
> > for(@l) {
> > eval $_;
> > }
> > print "$ENV{'DEBUG'}\n";
>
> This is probably not what you want to do. eval() is slower
> than other options. Look into the Perl functions do() and
> require().
Huh? Both do() and require() use eval().
That's the only way to interpret strings as Perl expressions.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 13 Oct 1999 18:17:13 +0200
From: Israel Olalla <iolalla@nmp.es>
Subject: hide source
Message-Id: <3804B089.D78652C0@nmp.es>
Hello,
How can source be hidden?
I want to get smth like :
#!/usr/bin/perl
æðßæðßæðßæðßðßææßð@¶@#~¬½½¬¶¶¶e6r736
sqwafadsfadsfasdfq53465345q35143rfefqwetqrtqtq
;-)
Thanks for your attention.
------------------------------
Date: Wed, 13 Oct 1999 10:16:27 -0700
From: Samay <samay1NOsaSPAM@hotmail.com.invalid>
Subject: Re: hide source
Message-Id: <17599f0b.38a1116b@usw-ex0102-016.remarq.com>
You can encrypt the source code and put it in a file.
Everytime you want to run program you can open the program and decrpyt
it and eval it.
This is not the standard, just came out of my mind.
See if it becomes a solution for you.
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: 13 Oct 1999 13:32:36 -0400
From: Matt Curtin <cmcurtin@interhack.net>
Subject: Re: hide source
Message-Id: <xlxemezupxn.fsf@gold.cis.ohio-state.edu>
>>>>> On Wed, 13 Oct 1999 18:17:13 +0200, Israel Olalla <iolalla@nmp.es> said:
Israel> How can source be hidden?
It can't be hidden effectively. Don't try. It's lame.
--
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/
------------------------------
Date: Wed, 13 Oct 1999 12:48:08 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: hide source
Message-Id: <3804C5D8.7A88BB87@texas.net>
Israel Olalla wrote:
>
> Hello,
>
> How can source be hidden?
>
perlfaq3 addresses this *exactly*. Please do a *little* bit of work
before posting here.
- Tom
------------------------------
Date: Wed, 13 Oct 1999 18:47:21 GMT
From: amonotod <amonotod@netscape.net>
Subject: Re: hide source
Message-Id: <7u2k3k$4rl$1@nnrp1.deja.com>
In article <3804B089.D78652C0@nmp.es>,
iolalla@nmp.es wrote:
> Hello,
>
> How can source be hidden?
>
> I want to get smth like :
>
> #!/usr/bin/perl
> æðßæðßæðßæðßðßææßð@¶@#~¬½½¬¶¶¶e6r736
> sqwafadsfadsfasdfq53465345q35143rfefqwetqrtqtq
>
> ;-)
>
> Thanks for your attention.
>
>
WTHIT?
Hide what source from whom? Do you mean hide the perl source code from
a web browser? They dont see it anyway... All a browser would see
the following :
#!perl
print "Content-type: text/html\n\n";
print "<html><head><title>My
webpage!</title></head><body>Welcome!</body><html>\n";
exit;
is
Content-type: text/html
<html><head><title>My webpage!</title></head><body>Welcome!</body><html>
and all the user would is see is
Welcome!
with the browser titlebar showing "My webpage!"
So, like I said, WTHIT?
HTH,
amonotod
--
`\|||/ amonotod@
(@@) netscape.net
ooO_(_)_Ooo________________________________
_____|_____|_____|_____|_____|_____|_____|_____|
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 13 Oct 1999 14:38:45 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: hide source
Message-Id: <slrn809ntl.nk2.abigail@alexandra.delanet.com>
Israel Olalla (iolalla@nmp.es) wrote on MMCCXXXIV September MCMXCIII in
<URL:news:3804B089.D78652C0@nmp.es>:
<>
<> How can source be hidden?
I know the answer, but I won't tell you. I've hidden it!
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 13 Oct 1999 19:58:27 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: hide source
Message-Id: <s09p33h0bhk40@corp.supernews.com>
Israel Olalla (iolalla@nmp.es) wrote:
: How can source be hidden?
Under a fallen log deep in the forest has often worked well for me.
: I want to get smth like :
:
: #!/usr/bin/perl
: æðßæðßæðßæðßðßææßð@¶@#~¬½½¬¶¶¶e6r736
: sqwafadsfadsfasdfq53465345q35143rfefqwetqrtqtq
Looks pretty much like ordinary Randal code to me...
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "They do not preach that their God will rouse them
a little before the nuts work loose." - Kipling
------------------------------
Date: 13 Oct 1999 20:07:06 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: hide source
Message-Id: <7u2opa$6u6$1@info2.uah.edu>
In article <3804B089.D78652C0@nmp.es>,
Israel Olalla <iolalla@nmp.es> writes:
: How can source be hidden?
<URL:http://www.cs.uah.edu/~gbacon/perl/encrypt>
Greg
--
One disadvantage of the Univac system is that it does not use Unix, a
recently developed program which translates from one computer language to
another and has a built-in editing system which identifies errors in the
original program.
------------------------------
Date: Wed, 13 Oct 1999 12:59:15 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: hide source
Message-Id: <3804E493.D6E296A4@cisco.com>
{ Israel Olalla wrote:
> How can source be hidden?
Perl FAQ (3).
How can I hide the source for my Perl program?
--
------------------------------
Date: 13 Oct 1999 20:46:40 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: hide source
Message-Id: <7u2r3g$cb$1@gellyfish.btinternet.com>
On Wed, 13 Oct 1999 18:47:21 GMT amonotod wrote:
> In article <3804B089.D78652C0@nmp.es>,
> iolalla@nmp.es wrote:
>> Hello,
>>
>> How can source be hidden?
>>
>> I want to get smth like :
>>
>> #!/usr/bin/perl
>> æðßæðßæðßæðßðßææßð@¶@#~¬½½¬¶¶¶e6r736
>> sqwafadsfadsfasdfq53465345q35143rfefqwetqrtqtq
>>
>
> Hide what source from whom? Do you mean hide the perl source code from
> a web browser? They dont see it anyway... All a browser would see
> the following :
>
What makes you think the original poster was interested in CGI ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Wed, 13 Oct 1999 12:46:58 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: hide source
Message-Id: <22d2u7.gn1.ln@magna.metronet.com>
Israel Olalla (iolalla@nmp.es) wrote:
: Subject: hide source
^^^^ ^^^^^^
^^^^ ^^^^^^
: How can source be hidden?
Perl FAQ, part 3:
"How can I hide the source for my Perl program?"
^^^^ ^^^^^^
: I want to get smth like :
[ snip stuff that does not look like Smith ]
: Thanks for your attention.
You will not get my attention ever again.
I think you asked a Perl question without checking the Perl FAQs
first.
I prefer to give my attention to people with *good* manners,
which lets you out.
Sorry.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 14 Oct 1999 11:25:01 +0200
From: Israel Olalla <iolalla@nmp.es>
Subject: Re: hide source
Message-Id: <3805A16D.8216E4E9@nmp.es>
Thanks to all for your help and patience.
Excuseme if my manners and my english were not the right ones.
Sincerilly thanks.
> Hello,
>
> How can source be hidden?
>
> I want to get smth like :
>
> #!/usr/bin/perl
> æðßæðßæðßæðßðßææßð@¶@#~¬½½¬¶¶¶e6r736
> sqwafadsfadsfasdfq53465345q35143rfefqwetqrtqtq
>
> ;-)
>
> Thanks for your attention.
------------------------------
Date: Thu, 14 Oct 1999 11:53:18 +0100
From: David Cantrell <NukeEmUp@ThePentagon.com>
Subject: Re: hide source
Message-Id: <6rUFOOTOph1+2Sp6b8l6UeoYd+5C@4ax.com>
On 13 Oct 1999 20:46:40 -0000, Jonathan Stowe
<gellyfish@gellyfish.com> said:
>What makes you think the original poster was interested in CGI ?
Perhaps because it was a really stupid question just like 99.9% of
CGI-related questions?
:-)
[Copying newsgroup posts to me by mail is considered rude]
--
David Cantrell, part-time Unix/perl/SQL/java techie
full-time chef/musician/homebrewer
http://www.ThePentagon.com/NukeEmUp
------------------------------
Date: 14 Oct 1999 14:29:02 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: hide source
Message-Id: <3805da9e_2@newsread3.dircon.co.uk>
David Cantrell <NukeEmUp@ThePentagon.com> wrote:
> On 13 Oct 1999 20:46:40 -0000, Jonathan Stowe
> <gellyfish@gellyfish.com> said:
>
>>What makes you think the original poster was interested in CGI ?
>
> Perhaps because it was a really stupid question just like 99.9% of
> CGI-related questions?
>
Well there is that of course ...
/J\
--
"I'm not Carol Vorderman - you wouldn't see me getting drunk in a kebab
shop" - Lily Savage
------------------------------
Date: Thu, 14 Oct 1999 20:24:40 GMT
From: sparky21@my-deja.com
Subject: how call html page from perl script
Message-Id: <7u5e5n$6fr$1@nnrp1.deja.com>
I create an html file via a perl script. How can I call that html script
from within the perl script that created it, so the html appears on the
browser when the perl script is executed??
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Thu, 14 Oct 1999 20:41:02 GMT
From: bmccoy@foiservices.com (Brett W. McCoy)
Subject: Re: how call html page from perl script
Message-Id: <slrn80cg6v.ng.bmccoy@moebius.foiservices.com>
Also Sprach sparky21@my-deja.com <sparky21@my-deja.com>:
>I create an html file via a perl script. How can I call that html script
>from within the perl script that created it, so the html appears on the
>browser when the perl script is executed??
Say what? What are you trying to accomplish? Is this a CGI program?
Have you even looked at the documentation that comes with Perl, like
perlfaq9?
--
Brett W. McCoy bmccoy@foiservices.com
Computer Operations Manager (Alpha Geek) http://www.foiservices.com
FOI Services, Inc./DIOGENES 301-975-0110
---------------------------------------------------------------------------
------------------------------
Date: Thu, 14 Oct 1999 14:11:58 -0700
From: "David Christensen" <dchristensen@california.com>
Subject: Re: how call html page from perl script
Message-Id: <380643a6_7@news5.newsfeeds.com>
sparky:
On Win98 ActivePerl519 in a DOS box:
C:\david>type foo.pl
#! perl -w
use strict;
my $line = '"C:\Program Files\Internet Explorer\Iexplore.exe"';
$line .= ' c:\david\foo.html';
system($line);
C:\david>perl foo.pl
In a DJGPP Bash box:
~$ cat foo.pl
#! perl -w
use strict;
my $line = '"C:\Program Files\Internet Explorer\Iexplore.exe"';
$line .= ' c:\david\foo.html';
system($line);
~$ foo.pl
Note the quotes around the path to IE.
--
David Christensen
dchristensen@california.com
sparky21@my-deja.com wrote in message
<7u5e5n$6fr$1@nnrp1.deja.com>...
>I create an html file via a perl script. How can I call that html
script
>from within the perl script that created it, so the html appears
on the
>browser when the perl script is executed??
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 14 Oct 1999 21:27:07 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: how call html page from perl script
Message-Id: <38064A60.98060E58@vpservices.com>
sparky21@my-deja.com wrote:
>
> I create an html file via a perl script. How can I call that html script
> from within the perl script that created it, so the html appears on the
> browser when the perl script is executed??
You can't really "call" an html page. What you do is print it to STDOUT
(the default place that print statements go to) and that sends it to the
browser. You have to start with the proper content-type header followed
by a blank line, otherwise you can print whatever you want.
#!/usr/local/bin/perl -Tw
use strict;
# ... any perl code that doesn't print to STDOUT goes here ...
my $page = <<"EOP";
... any amount of text for the HTML page goes here ...
EOP
$| = 1;
print "Content-Type: text/html\n\n$page";
__END__
--
Jeff
------------------------------
Date: Fri, 15 Oct 1999 07:35:46 +0100
From: "Rasmus Rimestad" <rasmusr@online.no>
Subject: Re: how call html page from perl script
Message-Id: <43zN3.3246$7G2.16167@news1.online.no>
Or... the easiest way:
#!usr/bin/perl
print("Content-type: text/html\n");
print("Location somehtmlfile.html\n\n");
--
Vennlig hilsen
Rasmus Rimestad, den blå hønas første disippel
rasmusr@online.no
http://dikt.cjb.net
http://bullshitprod.virtualave.net
sparky21@my-deja.com wrote in message <7u5e5n$6fr$1@nnrp1.deja.com>...
>I create an html file via a perl script. How can I call that html script
>from within the perl script that created it, so the html appears on the
>browser when the perl script is executed??
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
------------------------------
Date: 15 Oct 1999 06:24:10 GMT
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: how call html page from perl script
Message-Id: <3806C841.47BDC9C3@vpservices.com>
Rasmus Rimestad wrote:
>
> Or... the easiest way:
>
> #!usr/bin/perl
> print("Content-type: text/html\n");
> print("Location somehtmlfile.html\n\n");
Did you try that out before you sent it?
1) The path to perl is wrong, it doesn't have a slash in front of it
2) There is only one \n after the content header
3) There is no colon after the word Location
And even if you fixed those things, what your script does is print the
words "Location somehtmlfile.html" on the browser because
4) If you are sending a Location to redirect, you can't print anything
before or after it
But don't worry, that is only 1.33 errors per line, I have done worse
than that many times.
I guess what you meant to say is:
#!/usr/bin/perl
print "Location: somehtmlfile.html\n\n";
--
Jeff
------------------------------
Date: Tue, 12 Oct 1999 15:22:18 -0400
From: Jing Shi <Jing.Shi@usa.alcatel.com>
Subject: How can I get data from Web source?
Message-Id: <38038A6A.A8C042D8@usa.alcatel.com>
I was wondering if I can write a Perl script to get data from a site on
the World Wide Web. For example, send query toYahoo to get the stock
quote and format the result as I like? Or how can I collect the data I
need from a web page?
Thanks
------------------------------
Date: Tue, 12 Oct 1999 21:38:06 GMT
From: Marcel Grunauer <marcel.grunauer@lovely.net>
Subject: Re: How can I get data from Web source?
Message-Id: <=bcDOM=CJVqwlCWsNohKwgII4pMj@4ax.com>
On Tue, 12 Oct 1999 15:22:18 -0400, Jing Shi
<Jing.Shi@usa.alcatel.com> wrote:
> I was wondering if I can write a Perl script to get data from a site on
> the World Wide Web. For example, send query toYahoo to get the stock
> quote and format the result as I like? Or how can I collect the data I
> need from a web page?
You can use the LWP modules (in the libwww distribution) to do that.
Check on CPAN.
--
Marcel, Perl Padawan
sub AUTOLOAD{$_=$AUTOLOAD;s;.*::;;;y;_; ;;print}&Just_Another_Perl_Hacker;
------------------------------
Date: Tue, 12 Oct 1999 14:40:46 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: How can I get data from Web source?
Message-Id: <Pine.GSO.4.10.9910121439570.19155-100000@user2.teleport.com>
On Tue, 12 Oct 1999, Jing Shi wrote:
> I was wondering if I can write a Perl script to get data from a site on
> the World Wide Web.
You should be able to stop wondering once you read the FAQ. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 12 Oct 1999 23:12:44 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: How confidential is Perl?
Message-Id: <7u0f9c$qks$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Robert C. Helling
<helling@x4u2.desy.de>],
who wrote in article <slrn805t9l.213gd.helling@x4u2.desy.de>:
> i am thinking to write a passwd wrapper in perl and wonder how confidential
> Pel keeps my data. More specifiaclly, since Perl does all memory
> management for me i have no control over when a variable is moved in
> memory and the original location free'ed. I couldn't find out (w/o working
> my way thru the source) if Perl zeroes memory before feeing it (under
> normal circumstances this would influence performance) or some evil
> C program could randomly malloc memory and search it for Perl's leftovers.
This is not a question about Perl. This is about how the "fresh"
memory processes get looks like. On most systems it looks like a
sequence of 0s (at least for sbrk()-implementation of malloc(),
similarly for mmap()ing to /dev/zero). So a process will not get a
leftover of another process.
Causing a core dump and inspecting it is entirely different topic.
Ilya
------------------------------
Date: Tue, 12 Oct 1999 13:53:30 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: how do i open a new window from a cgi script
Message-Id: <Pine.GSO.4.10.9910121352210.19155-100000@user2.teleport.com>
On Tue, 12 Oct 1999 eleedumas@my-deja.com wrote:
> Subject: how do i open a new window from a cgi script
It sounds as if you want to request something from a remote web browser.
You should probably search for the docs, FAQs, and newsgroups about web
browsers and how to make requests of them. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 12 Oct 1999 14:40:54 -0700
From: David Amann <dove@synopsys.com>
Subject: Re: how do i open a new window from a cgi script
Message-Id: <3803AAE6.C9568258@synopsys.com>
Hi Elee,
eleedumas@my-deja.com wrote:
> I would like to return the form query in the
> original page, but put the results into a new
> window. How do I do that?
You'll want to send back the Server header "Window-target". For
example,
print "Window-target: new_window\n";
print "Content-type: text/html\n\n";
Or if you are using CGI.pm (which you should. It's real cool),
use CGI qw/:all/;
print header("-target" => "new_window");
Hope this helps,
-=dav
------------------------------
Date: Wed, 13 Oct 1999 08:35:08 +0200
From: "Mark Bakker" <ceesbakk@casema.nl>
Subject: Re: how do i open a new window from a cgi script
Message-Id: <380427ed$0$8862@reader1.casema.net>
You can also give an HTML statement TARGET into your <FORM> TAG I think.
<eleedumas@my-deja.com> schreef in berichtnieuws
7u0380$9n2$1@nnrp1.deja.com...
> I have a CGI perl script that gets some data via a
> form from the user, queries a database, and
> generates some results, which I pass back to the
> user via the same page with the initial form. I
> would like to return the form query in the
> original page, but put the results into a new
> window. How do I do that? I have looked in the
> O'reilly books as well as several other perl
> resourses and can't find how to do this. Thank
> you in advance for your help
>
> elee
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1063
**************************************