[11337] in Perl-Users-Digest
Perl-Users Digest, Issue: 4937 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Feb 19 06:07:18 1999
Date: Fri, 19 Feb 99 03:00:25 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 19 Feb 1999 Volume: 8 Number: 4937
Today's topics:
Re: Anybody get .pl scripts to run on Win32 Perl and Ap <Philip.Newton@datenrevision.de>
Apache for winblows95 (tryout)
Re: Apache htpasswd updater problem <Tony.Curtis+usenet@vcpc.univie.ac.at>
Can perl read a www page (Chinh Lam)
Re: Can perl read a www page <Tony.Curtis+usenet@vcpc.univie.ac.at>
Re: DOC: perlmodinstall.pod for 5.005_55 <matthew.sergeant@eml.ericsson.se>
Re: efficient , -> TAB substitution? <uri@home.sysarch.com>
Re: Extending perl: Advice needed (Arved Sandstrom)
FAQ 8.3: How do I do fancy stuff with the keyboard/scre <perlfaq-suggestions@perl.com>
FAQ 8.4: How do I print something out in color? <perlfaq-suggestions@perl.com>
FAQ 8.5: How do I read just one key without waiting for <perlfaq-suggestions@perl.com>
FAQ 8.6: How do I check whether input is ready on the k <perlfaq-suggestions@perl.com>
FAQ 8.7: How do I clear the screen? <perlfaq-suggestions@perl.com>
FAQ 8.8: How do I get the screen size? <perlfaq-suggestions@perl.com>
Filter and embedding <na313@fen.baynet.de>
Filter and embedding <jknaeblein@bigfoot.com>
Re: Getting a Redirected HTML Page <iragershenhorn@csi.com>
Re: Help - Perl Binaries for old SCO UNIX rel 3.2v4 ()
Re: how to see if one string is in another? <Philip.Newton@datenrevision.de>
Re: Perl Book ()
Re: Perl for Windows interface ? <greenej@my-dejanews.com>
perl in HTML pault12@postoffice.pacbell.net
Re: perl not always in /usr/bin/perl <ccr@mupad.de>
Re: Perl, PHP, Python, ColdFusion, MS Frontpage, which ghill@n2.net
Re: Perl, PHP, Python, ColdFusion, MS Frontpage, which ghill@n2.net
Returning file tests under Win95 and WinNT david.willingham@fernhart.com
The Camel? <prueegg@hsr.ch>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 19 Feb 1999 10:30:54 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Anybody get .pl scripts to run on Win32 Perl and Apache 1.3.3. &#$%*Damn MS Windoze file associations.
Message-Id: <36CD2F4E.FC54FC0E@datenrevision.de>
Rod MacBain wrote:
>
> the %* that active state tells you to use just don't work!
It does -- on NT, AFAIK. NT's CMD.EXE is a little more intelligent than
95's COMMAND.COM, and this is one of the differences. I guess they
thought everyone'd be running on NT.
Cheers,
Philip
------------------------------
Date: Fri, 19 Feb 1999 08:07:26 GMT
From: tryout666@geocities.com (tryout)
Subject: Apache for winblows95
Message-Id: <36ce1aea.23859977@news-s01.ny.us.ibm.net>
Hya ppl,
I am trying to use Apache WebServer for Win95, but i dont manage to
run perl's progms from that.. i read the help and it says to run
suEXEC to run perl scripts.. i edited some lines from httpd.conf to
get sucess on that.. but i didnt.
tks
tryout
------------------------------
Date: 19 Feb 1999 10:24:58 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Apache htpasswd updater problem
Message-Id: <83ww1esq39.fsf@vcpc.univie.ac.at>
Re: Apache htpasswd updater problem, Douglas
<ddb@crystal.uwa.edu.au> said:
Douglas> Hi, I was trying to write a very minimal
Douglas> script to generate random passwords for a
Douglas> number of web site directories with
Douglas> restricted access.
perldoc HTTPD::UserAdmin
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien. | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: 19 Feb 1999 06:42:01 GMT
From: chinh@catbert.ucdavis.edu (Chinh Lam)
Subject: Can perl read a www page
Message-Id: <7aj13p$sg2$3@mark.ucdavis.edu>
Hello, I was wondering if there was way in perl to grab a web page
off a remote server through the http protocol and store it on the
computer that is running the script?
Grabbing images is not neccessary. Any help on this would be great!
If you could email me a response it would help a lot.
Thank you!
chinh@ucdavis.edu
------------------------------
Date: 19 Feb 1999 10:25:41 +0100
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: Can perl read a www page
Message-Id: <83vhgysq22.fsf@vcpc.univie.ac.at>
Re: Can perl read a www page, Chinh
<chinh@catbert.ucdavis.edu> said:
Chinh> Hello, I was wondering if there was way in
Chinh> perl to grab a web page off a remote server
Chinh> through the http protocol and store it on the
Chinh> computer that is running the script?
perldoc LWP
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien. | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Fri, 19 Feb 1999 09:40:00 +0000
From: Matt Sergeant <matthew.sergeant@eml.ericsson.se>
Subject: Re: DOC: perlmodinstall.pod for 5.005_55
Message-Id: <36CD3170.CCD3FA9@eml.ericsson.se>
Tom Christiansen wrote:
>
[snip]
> B<If you're running Windows 95 or NT with the ActiveState port of Perl>
Since this is a lot of perl users I think it's important to correct this
part.
Should say here:
First check if a binary distribution of the module is available on
ActiveState's PPM repository. From the command line, type:
ppm search | more
And see if the module is listed. If you need to use a proxy server to
access the internet, type:
perldoc ppm
and follow the instructions in there. If your module was listed install
it with the following command:
ppm install <modulename>
If the module wasn't available, continue and follow the instructions
below.
> A. DECOMPRESS
>
> You can use the shareware Winzip ( http://www.winzip.com ) to
> decompress and unpack modules.
>
> B. UNPACK
>
> If you used WinZip, this was already done for you.
>
> C. BUILD
>
> Does the module require compilation (i.e. does it have files
> that end in .xs, .c, .h, .y, .cc, .cxx, or .C)? If it does, you're on
> your own. You can try compiling it yourself if you have a C compiler.
> If you're successful, consider uploading the resulting binary to the
> CPAN for others to use. If it doesn't, go to INSTALL.
I'm not sure exactly how to word it, but perhaps something like this:
ActivePerl is compiled with MSVC++ v5 and therefore modules need to also
be compiled with MSVC++ v5 or higher. If you have MSVC installed
ActivePerl will detect it's installation directory when it is installed
and make it quite easy for you to build modules. If you don't have
MSVC++ installed it is still possible to build modules that don't
require compilation, simply download the nmake utility from
ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe.
Go into the newly created directory tree and type:
perl Makefile.PL
nmake
nmake test
> D. INSTALL
While still in that directory, type:
nmake install
> =item *
I don't think it's worth talking about Binary packages here - if it is I
can write a bit about creating a ppd file and using ppm to install
modules. Let me know.
--
<Matt email="msergeant@ndirect.co.uk" />
| Fastnet Software Ltd | Perl in Active Server Pages |
| Perl Consultancy, Web Development | Database Design | XML |
| http://come.to/fastnet | Information Consolidation |
------------------------------
Date: 19 Feb 1999 02:09:42 -0500
From: Uri Guttman <uri@home.sysarch.com>
Subject: Re: efficient , -> TAB substitution?
Message-Id: <x7r9rmlvih.fsf@home.sysarch.com>
>>>>> "RDT" == Robert D Trent <trent@mail.utexas.edu> writes:
RDT> On Thu, 18 Feb 1999, Larry Rosler wrote:
>> In article <7ai52f$7q1@courier.xilinx.com> on 18 Feb 1999 22:43:27 GMT,
>> Jeff Stampes <stampes@xilinx.com> says...
>> > Robert D Trent <trent@mail.utexas.edu> wrote:
>> > :
>> > : sed -n -e 's/","/" "/g' -e 'p' $argv[1] > $argv[2]
RDT> perl won hands-down, by the way. While sed took close to 90
RDT> minutes, perl was done in just 9! Wow. I've gotta keep my nose
RDT> in that perl book!
i am surprised at this result. sed is fairly fast and should not be 10
time slower than perl. so my thought is why was your sed script using -n
and then the p command? why not just use sed's builtin print (remember
perl's -p loop imitates sed's default loop)? maybe the extra command
slows it down.
so benchmark this:
sed -e 's/","/" "/g' $argv[1] > $argv[2]
and see what happens.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
Perl Hacker for Hire ---------------------- Perl, Internet, UNIX Consulting
uri@sysarch.com ------------------------------------ http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Fri, 19 Feb 1999 06:51:44 -0400
From: Arved_37@chebucto.ns.ca (Arved Sandstrom)
Subject: Re: Extending perl: Advice needed
Message-Id: <Arved_37-1902990651450001@dyip-115.chebucto.ns.ca>
In article <7agk5f$m22$1@ascomax.hasler.ascom.ch>, "daniel weberhofer"
<daniel.weberhofer@broadnet.ascom.ch> wrote:
> How do I have to modify Makefile.pl so that yacc MAKES first the *.c and *.h
> files out of
> the grammar file *.y before the *.c files are compiled and linked?
>
> Does anybody has advice, pointers or examples?
Look at SQL::Statement. The man is doing stuff there that is basically
what you want to do, including Makefile.PL setup.
------------------------------
Date: 18 Feb 1999 22:34:42 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.3: How do I do fancy stuff with the keyboard/screen/mouse?
Message-Id: <36ccf7f2@csnews>
(This excerpt from perlfaq8 - System Interaction
($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)
How do I do fancy stuff with the keyboard/screen/mouse?
How you access/control keyboards, screens, and pointing devices ("mice")
is system-dependent. Try the following modules:
Keyboard
Term::Cap Standard perl distribution
Term::ReadKey CPAN
Term::ReadLine::Gnu CPAN
Term::ReadLine::Perl CPAN
Term::Screen CPAN
Screen
Term::Cap Standard perl distribution
Curses CPAN
Term::ANSIColor CPAN
Mouse
Tk CPAN
Some of these specific cases are shown below.
--
But be careful how you speak:
Say break and steak, but bleak and streak;
------------------------------
Date: 18 Feb 1999 23:34:44 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.4: How do I print something out in color?
Message-Id: <36cd0604@csnews>
(This excerpt from perlfaq8 - System Interaction
($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)
How do I print something out in color?
In general, you don't, because you don't know whether the recipient has
a color-aware display device. If you know that they have an ANSI
terminal that understands color, you can use the Term::ANSIColor module
from CPAN:
use Term::ANSIColor;
print color("red"), "Stop!\n", color("reset");
print color("green"), "Go!\n", color("reset");
Or like this:
use Term::ANSIColor qw(:constants);
print RED, "Stop!\n", RESET;
print GREEN, "Go!\n", RESET;
--
There are many times when you want it to ignore the rest of the string just
like atof() does. Oddly enough, Perl calls atof(). How convenient. :-)
--Larry Wall in <1991Jun24.231628.14446@jpl-devvax.jpl.nasa.gov>
------------------------------
Date: 19 Feb 1999 00:34:46 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.5: How do I read just one key without waiting for a return key?
Message-Id: <36cd1416@csnews>
(This excerpt from perlfaq8 - System Interaction
($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)
How do I read just one key without waiting for a return key?
Controlling input buffering is a remarkably system-dependent matter. If
most systems, you can just use the stty command as shown in the "getc"
entry in the perlfunc manpage, but as you see, that's already getting
you into portability snags.
open(TTY, "+</dev/tty") or die "no tty: $!";
system "stty cbreak </dev/tty >/dev/tty 2>&1";
$key = getc(TTY); # perhaps this works
# OR ELSE
sysread(TTY, $key, 1); # probably this does
system "stty -cbreak </dev/tty >/dev/tty 2>&1";
The Term::ReadKey module from CPAN offers an easy-to-use interface that
should be more efficient than shelling out to stty for each key. It even
includes limited support for Windows.
use Term::ReadKey;
ReadMode('cbreak');
$key = ReadKey(0);
ReadMode('normal');
However, that requires that you have a working C compiler and can use it
to build and install a CPAN module. Here's a solution using the standard
POSIX module, which is already on your systems (assuming your system
supports POSIX).
use HotKey;
$key = readkey();
And here's the HotKey module, which hides the somewhat mystifying calls
to manipulate the POSIX termios structures.
# HotKey.pm
package HotKey;
@ISA = qw(Exporter);
@EXPORT = qw(cbreak cooked readkey);
use strict;
use POSIX qw(:termios_h);
my ($term, $oterm, $echo, $noecho, $fd_stdin);
$fd_stdin = fileno(STDIN);
$term = POSIX::Termios->new();
$term->getattr($fd_stdin);
$oterm = $term->getlflag();
$echo = ECHO | ECHOK | ICANON;
$noecho = $oterm & ~$echo;
sub cbreak {
$term->setlflag($noecho); # ok, so i don't want echo either
$term->setcc(VTIME, 1);
$term->setattr($fd_stdin, TCSANOW);
}
sub cooked {
$term->setlflag($oterm);
$term->setcc(VTIME, 0);
$term->setattr($fd_stdin, TCSANOW);
}
sub readkey {
my $key = '';
cbreak();
sysread(STDIN, $key, 1);
cooked();
return $key;
}
END { cooked() }
1;
--
"...this does not mean that some of us should not want, in a rather
dispassionate sort of way, to put a bullet through csh's head."
Larry Wall in <1992Aug6.221512.5963@netlabs.com>
------------------------------
Date: 19 Feb 1999 01:34:48 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.6: How do I check whether input is ready on the keyboard?
Message-Id: <36cd2228@csnews>
(This excerpt from perlfaq8 - System Interaction
($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)
How do I check whether input is ready on the keyboard?
The easiest way to do this is to read a key in nonblocking mode with the
Term::ReadKey module from CPAN, passing it an argument of -1 to indicate
not to block:
use Term::ReadKey;
ReadMode('cbreak');
if (defined ($char = ReadKey(-1)) ) {
# input was waiting and it was $char
} else {
# no input was waiting
}
ReadMode('normal'); # restore normal tty settings
--
: I've heard that there is a shell (bourne or csh) to perl filter, does
: anyone know of this or where I can get it?
Yeah, you filter it through Tom Christiansen. :-) --Larry Wall
------------------------------
Date: 19 Feb 1999 02:34:50 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.7: How do I clear the screen?
Message-Id: <36cd303a@csnews>
(This excerpt from perlfaq8 - System Interaction
($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)
How do I clear the screen?
If you only have to so infrequently, use `system':
system("clear");
If you have to do this a lot, save the clear string so you can print it
100 times without calling a program 100 times:
$clear_string = `clear`;
print $clear_string;
If you're planning on doing other screen manipulations, like cursor
positions, etc, you might wish to use Term::Cap module:
use Term::Cap;
$terminal = Term::Cap->Tgetent( {OSPEED => 9600} );
$clear_string = $terminal->Tputs('cl');
--
"Software engineering phase plans are something you make so your manager
can explain to his manager how things are going"
--Rob Pike (On the subject of managerial "bullshit")
------------------------------
Date: 19 Feb 1999 03:34:56 -0700
From: Tom Christiansen <perlfaq-suggestions@perl.com>
Subject: FAQ 8.8: How do I get the screen size?
Message-Id: <36cd3e50@csnews>
(This excerpt from perlfaq8 - System Interaction
($Revision: 1.36 $, $Date: 1999/01/08 05:36:34 $)
part of the standard set of documentation included with every
valid Perl distribution, like the one on your system.
See also http://language.perl.com/newdocs/pod/perlfaq8.html
if your negligent system adminstrator has been remiss in his duties.)
How do I get the screen size?
If you have Term::ReadKey module installed from CPAN, you can use it to
fetch the width and height in characters and in pixels:
use Term::ReadKey;
($wchar, $hchar, $wpixels, $hpixels) = GetTerminalSize();
This is more portable than the raw `ioctl', but not as illustrative:
require 'sys/ioctl.ph';
die "no TIOCGWINSZ " unless defined &TIOCGWINSZ;
open(TTY, "+</dev/tty") or die "No tty: $!";
unless (ioctl(TTY, &TIOCGWINSZ, $winsize='')) {
die sprintf "$0: ioctl TIOCGWINSZ (%08x: $!)\n", &TIOCGWINSZ;
}
($row, $col, $xpixel, $ypixel) = unpack('S4', $winsize);
print "(row,col) = ($row,$col)";
print " (xpixel,ypixel) = ($xpixel,$ypixel)" if $xpixel || $ypixel;
print "\n";
--
"PC's are backwards ... throw them out! Linux is ok though."
--Rob Pike (on the subject of CR/LF etc)
------------------------------
Date: Fri, 19 Feb 1999 09:18:38 +0100
From: "Joachim Knaeblein" <na313@fen.baynet.de>
Subject: Filter and embedding
Message-Id: <7aj6bh$2cf$2@freenet-b.fen.baynet.de>
Hi all,
I too have a problem concerning perl embedding in connection
with the Filter package.
1.) I would like to use the Filter package to get my perl code filtered
before execution
2.) I would like to pack the whole stuff into ONE executable. The code
should be embedded statically in the executable.
And here comes the problem:
The filter function is activated by a use statement which is executed at
compile
time. The perl_parse function which evaluates the use only allows reading of
the
code from a file or from a pipe.
-> 2.) violated
The perl_eval_pv function enables reading from a C string literal, but the
use
statement does not work properly. The -e switch either.
-> 1.) violated
Finally I have to admit that I am not sure whether all my assumptions
mentioned
are true. So if there is somebody who knows it better or even knows a
solution,
he should contact me at
jknaeblein@bigfoot.com
Thanks a lot
Joachim Knaeblein
------------------------------
Date: Fri, 19 Feb 1999 09:21:03 +0100
From: Joachim Knaeblein <jknaeblein@bigfoot.com>
Subject: Filter and embedding
Message-Id: <36CD1EEF.7BFA3ADD@bigfoot.com>
Hi all,
I too have a problem concerning perl embedding in connection
with the Filter package.
1.) I would like to use the Filter package to get my perl code filtered
before execution
2.) I would like to pack the whole stuff into ONE executable. The code
should be embedded statically in the executable.
And here comes the problem:
The filter function is activated by a use statement which is executed at
compile
time. The perl_parse function which evaluates the use only allows
reading of
the
code from a file or from a pipe.
-> 2.) violated
The perl_eval_pv function enables reading from a C string literal, but
the
use
statement does not work properly. The -e switch either.
-> 1.) violated
Finally I have to admit that I am not sure whether all my assumptions
mentioned
are true. So if there is somebody who knows it better or even knows a
solution,
he should contact me at
jknaeblein@bigfoot.com
Thanks a lot
Joachim Knaeblein
------------------------------
Date: 19 Feb 1999 09:09:40 GMT
From: Ira Gershenhorn <iragershenhorn@csi.com>
To: Mike Watkins <mwatkins@promotion4free.com>
Subject: Re: Getting a Redirected HTML Page
Message-Id: <36CD2B77.43EDAC5A@csi.com>
Hi Mike,
Here's a snippet of some code I wrote. The header of a redirected page has a
Location line. You can just pick up the URL that follows it. BTW, this isn't
great code, but I think it serves to illustrate the point. I also dump the
headers so you can see what I'm talking about. Good luck.
do {
$response = $ua->request($request);
if ($response->code == 302) {
print STDOUT $response->headers_as_string;
if ($response->headers_as_string =~ /resultsScreen/) {
($simpleurl) = $response->headers_as_string =~ /Location: (.+)/;
$body = get($simpleurl);
$code = 200;
$desc = 'OK';
$headers = "";
return ($code, $desc, $headers, $body);
}
}
$cookie_jar->extract_cookies($response);
$cookie_jar->add_cookie_header($request);
} until $response->code != 302;
Mike Watkins wrote:
> Hi there,
>
> I'm currently making a URL submission script which will submit to serveral
> FFA pages. The actual submission works fine, but I would like to be able to
> verify that the link was actually submitted a little better. Most FFA
> scripts will redirect the user, instead of give any actual output, so $HTML
> = $reponse->content() doesn't really work.
>
> I've finally figured out how to tell if the script redirects the user or
> not. I do this will the following code:
>
> use HTTP::Status;
> my $scode = $response->code()
> if (is_redirect($scode)) { ... }
>
> I would like the script to check the page it gets redirected to for a
> pre-defined block of text, like "Thanks For The Link". My question is, how
> do I get the content of the web page which the FFA script redirects to?
>
> Any help would be much appreciated,
> Mike Watkins
------------------------------
Date: 19 Feb 1999 06:14:25 GMT
From: danny@lennon.postino.com ()
Subject: Re: Help - Perl Binaries for old SCO UNIX rel 3.2v4
Message-Id: <7aivg1$27a$1@lennon.postino.com>
X-Newsreader: TIN [version 1.2 PL2]
etandean (etandean@geocities.com) wrote:
: Is there somebody who could help tell me
: where I could download PERL (in BINARY) for SCO UNIX rel 3.2v4.
: And how could I install it ?
Check out www.celestial.com or ftp.celestial.com . They have binary
packages of just about anything that has ever been ported to SCO Unix.
--
Danny Aldham Postino Dotcom E-mail for Business
www.postino.com Virtual Servers, Mail Lists, Web Databases, SQL & Perl
------------------------------
Date: Fri, 19 Feb 1999 10:26:57 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: how to see if one string is in another?
Message-Id: <36CD2E61.57FB2A5@datenrevision.de>
Jay Glascoe wrote:
>
> [courtesy copy of post sent via email]
>
> Alan_Barber wrote:
> >
> > Below is sort of what i'm trying to do.
> ...
> > if ($refer contains $mysite)
>
> print "biz!\n" if $refer =~ /^$mysite/;
ITYM /$mysite/ , to find the string even if it's not at the beginning.
Or even index().
Cheers,
Philip
------------------------------
Date: 19 Feb 1999 06:16:42 GMT
From: danny@lennon.postino.com ()
Subject: Re: Perl Book
Message-Id: <7aivka$27a$2@lennon.postino.com>
X-Newsreader: TIN [version 1.2 PL2]
Stephen ZHANG (stephenz@nortelnetworks.com) wrote:
: I am looking for a free e-format Perl Book on the Internet. If someone
: the Web Site, please let me know. Thanks a lot!
Go to www.perl.com and find the perl FAQ. It is available in postscript
format, and is worth a fortune.
--
Danny Aldham Postino Dotcom E-mail for Business
www.postino.com Virtual Servers, Mail Lists, Web Databases, SQL & Perl
------------------------------
Date: Fri, 19 Feb 1999 07:41:20 GMT
From: JAG <greenej@my-dejanews.com>
Subject: Re: Perl for Windows interface ?
Message-Id: <7aj4iv$at$1@nnrp1.dejanews.com>
In article <36cab9ed.0@news1.mweb.co.za>,
"Ian Coetzee" <seccoza@mweb.co.za> wrote:
> Hi
> I am developing a Perl for Windows debugger and wonderred if anybody knew
> how to capture the output of the Perl (command line interpreter) ?
>
> This project will be released as freeware .
>
> Ian Coetzee
> email: seccoza@mweb.co.za
>
>
TMTOWTDI...
1) I would start by reading the perlembed document, which explains how to
embed the perl interpreter into a C program. Then you'll have a C program
(the Windoze debugger) that calls the perl interpreter, and stores the output
to a Window.
2)
#!/usr/bin/perl
@text = `$^X -w somescript.pl`;
print @text;
3)
#!/usr/bin/perl
open(PL,"<somescript.pl") || die "Can't open somescript.pl: $!";
$script = join('',<PL>);
close PL;
$output = eval $script;
print $@ if $@;
print $output;
HTH,
# James Greene - Informatics Consulting - D-79539 Loerrach, Germany
# Internet: www.gucc.org/greene/consult - greene@gucc.org
# PGP Fingerprint: CA88 9BE2 92B3 3162 DF6B 7080 2F9E A97E F25C 5972
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 18 Feb 1999 23:03:12 -0800
From: pault12@postoffice.pacbell.net
Subject: perl in HTML
Message-Id: <36CD0CB0.797344A3@postoffice.pacbell.net>
1. Look at Text::Template module on CPAN - from my point of view it is
it is the best approach for embedding perl code into HTML pages.
1.a It works.
1.b It works good.
2. If you don't like it for some reason, look at Text::BasicTemplate
3. If you want more flexible templates - look at Perl Application Server
(www.pault.com) - it combines both modules.
4. Search CPAN - there are many other template / embedded perl approaches.
Rgds.Paul.
Kevin Howe wrote:
> k wrote in message <_J1z2.7407$134.63040@tor-nn1.netcom.ca>...
> >Hi, I am in the process of writing a script which that allows for embedding
> >perl into a webpage using a template.
> >
> >I have run into a problem with the s// and m// functions that I can't
> figure
> >out. The process is like this:
> >
> >1. Read/Open the template file
> >2. Join it into one big string
> >3. Locate the embedded <fmEVAL> tags.
> >(In the template, you embed the perl like so:
> > <fmEVAL> $title </fmEVAL>)
> > The plan is to find these tags, and eval() the value between the tags.)
> >
> >4. Evaluate the value.
> >
> >SO FAR, EVERYTHING IS OK UP TO HERE.
> >The problem occurs when I attempt to replace the embedded tags with the
> >eval()'ed values.
> >ex: $value =~ s/$tag/$tagvalue/
> >($tag being the embedded tag, and $tagvalue being the eval() value.)
> >
> >It just doesn't want to find the pattern. Even if I do: $value = $tag
> >It will tell me that $value IS EQUAL TO $tag, but $value DOES NOT CONTAIN
> >the pattern $tag!
> >
> >i.e. $value=~m/$tag/ doesn't find the value of $tag, despite the face that
> >$value = $tag.
> >
> >Can anybody help me?
> >(I've attached the template and script, I hope that is not inappropriate
> >behavior for this newsgroup)
> >
> >I'd appreciate it if you could reply to me via email,
> >
> >Much thanks,
> >Sincerely,
> >Kevin Howe
> >
> >
> >
------------------------------
Date: 19 Feb 1999 11:52:08 +0100
From: Christopher Creutzig <ccr@mupad.de>
Subject: Re: perl not always in /usr/bin/perl
Message-Id: <wqsg182d5t3.fsf@mupad.de>
Jonathan Stowe <gellyfish@btinternet.com> writes:
> > #!/bin/sh -- # -*- perl -*- -p
> > eval 'exec /usr/bin/perl -wS $0 ${1+"$@"}'
> > if $running_under_some_shell;
> >
>
> Except of course the original poster had said that he was distributing
> applications in an environment where he couldnt guarantee that he had
> /usr/bin/perl .
Ups - sorry, cut and waste error. That should have been
#!/bin/sh -- # -*- perl -*- -p
eval 'exec perl -wS $0 ${1+"$@"}'
if $running_under_some_shell;
since exec honors $PATH...
--
+--+
+--+|
|+-|+ Christopher Creutzig (ccr@mupad.de)
+--+ Tel.: 05251-60-3203
------------------------------
Date: Fri, 19 Feb 1999 09:47:32 GMT
From: ghill@n2.net
Subject: Re: Perl, PHP, Python, ColdFusion, MS Frontpage, which one for beginner
Message-Id: <7ajbvi$750$1@nnrp1.dejanews.com>
In article <7a50ee$jc5$1@srv38s4u.cas.org>,
lvirden@cas.org wrote:
>
> According to <ghill@n2.net>:
> :I need to interact with all the popular databases without re-inventing the
> :wheel (so to speak).
>
> :experience, I'm trying to decide from one of the following:
> :- Cold Fusion (real high, Windows only)
> :- MS FrontPage (real high, Windows only)
> :- PHP (med high, multiplatform)
> :- Python (med high, multiplatform)
> :- Perl (high/low, multiplatform)
> :
> :I do want to end up with a multiplatform product and I know that Perl will
run
> ^^^^^^^^^^^^^^^^^^^^^
> Given the potential compatibility problems in MS FrontPage if you don't
> exert a lot of expertise, caution, and care, I would drop that one.
> I've been told that many sites avoid PHP due to security concerns.
>
> Of the other 3, Cold Fusion is designed around getting data out of any
> ODBC supported database. It runs on Windows, Solaris, and a few other
> platforms - with Linux coming soon I am told.
>
> You may have to face one thing with ColdFusion, Perl, and Python - there
> comes a point in developing with all 3 languages where either because
> of performance needs, or because of the need for a specialty function, you
> are going to have to also deal with C and/or C++ compilers (to
> compile someone's extension, etc.). And, if the performance or
> specialty function need is great enough, you may have to write some C
> code yourself.
>
> --
> <URL: mailto:lvirden@cas.org> Quote: Saving the world before bedtime.
> <*> O- <URL: http://www.purl.org/NET/lvirden/>
> Unless explicitly stated to the contrary, nothing in this posting
> should be construed as representing my employer's opinions.
>
All right!
This is extremely helpful. I'm making a little progress with the help
of Perl, ODBIC.EXE..which might be a mistake based on not learning how to
connect to different databases using Perl. Over all I'm starting to see
the basics of what is going on in this area of development and I'm wishing I
would of got in to it a few years back because it seems to be a strong field.
My gut says stay away from MS FrontPage(especially this one <g>), ColdFusion,
PHP, ect... I'm not sure if I can define my reasons yet, it's just a carry
over from what I've learned in the database arena.
> specialty function need is great enough, you may have to write some C
> code yourself.
Do you have any URL's of WebSites that required C for specialty functions?
C scares me. I hope that is something I can avoid.
Thanks for you help.
Greg Hill
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 19 Feb 1999 09:53:04 GMT
From: ghill@n2.net
Subject: Re: Perl, PHP, Python, ColdFusion, MS Frontpage, which one for beginner
Message-Id: <7ajc9t$7fo$1@nnrp1.dejanews.com>
> > but I'm still very green to it, I just know I like what I see so far.
> > BUT do I really need to know Perl to get the jog done efficiently?
>
> You have to know anything real well to get the job done efficiently.
>
> Dzuy
I didn't ask how well I need to know something. I asked if it was really a
need to know Perl to get the job done.
Thanks
Greg Hill
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 19 Feb 1999 09:31:51 GMT
From: david.willingham@fernhart.com
Subject: Returning file tests under Win95 and WinNT
Message-Id: <7ajb27$6b7$1@nnrp1.dejanews.com>
I'm just starting to code in Perl and have come across the following problem.
I'm trying to read the created, modified and accessed date/time of a
collection of files for sorting puposes. Using the code detailed below, I can
read the list of files in the selected directory, but can only read the -C,
-M, -A file tests for the pseudo files "." and "..", and not for the
remaining files in the selected directory, the ones I'm interested in.
I'm running Perl 5 on a Win95 system. I'm aware that running Perl on Win95
gives me different functionality to running it on WinNT. I've tried the code
on both systems, but still get the same results. Eventually the code is to be
installed on a UNIX box, but unfortunately, I do not have a UNIX envirnoment
on which to develop.
The code is as follows:
my $news_dir = "C:/temp";
my $news="", $created="", $modified="", $accessed="";
my $cnt=0;
opendir (NEWS, $news_dir) || die "Cannot open $!";
while($news[$cnt] = readdir(NEWS)) {
open(NEWS);
$created = (-C $news[$cnt]);
$modified = (-M $news[$cnt]);
$accessed = (-A $news[$cnt]);
print("Filename:$news[$cnt], Created:$created, Modified:$modified,
Accessed:$accessed\n");
close(NEWS);
$cnt++;
}
closedir(NEWS);
Is the problem with my coding or is it environment specific? Can anyone
suggest a way forward?
Thanks in advance.
DJW
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 19 Feb 1999 10:49:40 +0100
From: " Patrick Rueegg," <prueegg@hsr.ch>
Subject: The Camel?
Message-Id: <36CD33B3.EE5D3A74@hsr.ch>
Who knows why there is always a camel whith Perl?
Please answer direkt to prueegg@hsr.ch
Thanks for your help
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
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.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
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 V8 Issue 4937
**************************************