[10892] in Perl-Users-Digest
Perl-Users Digest, Issue: 4493 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Dec 24 15:07:21 1998
Date: Thu, 24 Dec 98 12:00:22 -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 Thu, 24 Dec 1998 Volume: 8 Number: 4493
Today's topics:
Re: Can I change a varible on the fly. (Tad McClellan)
Embedded Perl Linking Trouble Under NT 4.0 unxgroup@nyct.net
ftp <slybw@cc.usu.edu>
Re: ftp (Clay Irving)
Re: help with indirect reference for pattern match (Tad McClellan)
Re: help with indirect reference for pattern match (Mark-Jason Dominus)
Re: Is Perl as multifunctional as I've heard\read? (Cameron Laird)
Re: Is Perl as multifunctional as I've heard\read? <uri@ibnets.com>
Re: link checker help <ebohlman@netcom.com>
Re: Mail from PERL using variable mail address (Clay Irving)
Need to output a file starting at a specified line colemac@sce.com
NEWBIE: Question about $ENV in scripts <briwillis@yahoo.com>
Perl for win32 user friendly? <sangin@cam.org>
Perl script to help in downloading web books/faqs (Corey)
Problem with Text files with my Program. <niall_wallace@yahoo.com>
Re: Q: is srand(time()); good enough? wyndo@cxo.com
Reading a gif file. (Bruschi Tiziano)
Reading a gif file. (Bruschi Tiziano)
Re: Reading a gif file. (Larry Rosler)
Re: Regex question - removing HTML tags.... (Tad McClellan)
Re: Regex question - removing HTML tags.... (Abigail)
removing "Tk" from Perl/Tk under Win uncle_remus@my-dejanews.com
Re: require & use (Mark-Jason Dominus)
Script for Paradox? (John )
Re: sizeof() function? (Abigail)
Sockets and remote host <carvdawg@patriot.net>
Storing images into MS Access 97 database (peter)
Re: string problem (Mark-Jason Dominus)
Re: The quine page (Mark-Jason Dominus)
Re: The quine page (Mark-Jason Dominus)
Re: The quine page <uri@sysarch.com>
Re: The quine page (Abigail)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 24 Dec 1998 08:06:46 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Can I change a varible on the fly.
Message-Id: <mpht57.sh.ln@magna.metronet.com>
Rich Grise (off-duty@entheosengineering.com) wrote:
: Larry Rosler wrote:
: > Rich Grise wrote
: > > Double-quoting your "EOC" for your here document will make
: > > it interpolate variables on the way.
: >
: > So will not quoting the EOC at all, which is more usual.
: This here document stuff is entirely new to those of us who came "up"
: from the
: dos/windows environment. I spent some time looking through all the perl
: doc's
: I have (the full set that came with perl 5.004_04, that came with
: Slackware
: Linux 3.3.0), and found very minimal information on the here document.
>From my 5.005_02 perldata.pod (looks the same as 5.004_04, I think):
-----------------------------
A line-oriented form of quoting is based on the shell "here-doc"
syntax. Following a C<E<lt>E<lt>> you specify a string to terminate
the quoted material, and all lines following the current line down to
the terminating string are the value of the item. The terminating
string may be either an identifier (a word), or some quoted text. If
quoted, the type of quotes you use determines the treatment of the
text, just as in regular quoting. An unquoted identifier works like
double quotes. There must be no space between the C<E<lt>E<lt>> and
the identifier. (If you put a space it will be treated as a null
identifier, which is valid, and matches the first empty line.) The
terminating string must appear by itself (unquoted and with no
surrounding whitespace) on the terminating line.
-----------------------------
That seems to cover EOC vs. 'EOC' vs. "EOC".
I agree that finding it may be Not So Easy though.
Once found, I think it provides what is necesary.
Please make suggestions for improvements if you notice anything missing.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 24 Dec 1998 18:25:30 GMT
From: unxgroup@nyct.net
Subject: Embedded Perl Linking Trouble Under NT 4.0
Message-Id: <75u0up$15d$1@nnrp1.dejanews.com>
I am having trouble successfully linking an embedded Perl C++ (MS 5.0)
routine when I added code to push arguments onto the Perl stack. I've
read all I can find, tried adding in all libs used to compile Perl and
still have unresolved refs as follows:
Linking...
broker.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
int __cdecl win32_printf(char const *,...)" (__imp_?win32_printf@@YAHPBDZZ)
broker.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
struct sv * Perl_Sv" (__imp_?Perl_Sv@@3PAUsv@@A)
broker.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
struct sv * * Perl_stack_max" (__imp_?Perl_stack_max@@3PAPAUsv@@A)
broker.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
struct sv * * Perl_stack_base" (__imp_?Perl_stack_base@@3PAPAUsv@@A)
broker.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
long * Perl_markstack_max" (__imp_?Perl_markstack_max@@3PAJA)
broker.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
long * Perl_markstack_ptr" (__imp_?Perl_markstack_ptr@@3PAJA)
broker.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
long Perl_tmps_ix" (__imp_?Perl_tmps_ix@@3JA)
broker.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
long Perl_tmps_floor" (__imp_?Perl_tmps_floor@@3JA)
broker.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
struct sv * * Perl_stack_sp" (__imp_?Perl_stack_sp@@3PAPAUsv@@A)
Debug/Broker.exe : fatal error LNK1120: 9 unresolved externals
Error executing link.exe.
Thanks for the help!
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 24 Dec 1998 11:14:08 -0700
From: Dustin Zwonitzer <slybw@cc.usu.edu>
Subject: ftp
Message-Id: <3682846F.22E09397@cc.usu.edu>
In my program I need to ftp a whole directory onto a clients machine.
Right now I just use html links to each file to allow client download.
This becomes slow and tiresome if the directory is big.
I'm on a unix server.
Is this possible to do in Perl?
If so please point me in the right direction.
Dustin Zwonitzer
"Indecision Kills"
------------------------------
Date: 24 Dec 1998 14:34:36 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: ftp
Message-Id: <75u50c$g9k@panix.com>
In <3682846F.22E09397@cc.usu.edu> Dustin Zwonitzer <slybw@cc.usu.edu> writes:
>In my program I need to ftp a whole directory onto a clients machine.
>Right now I just use html links to each file to allow client download.
>This becomes slow and tiresome if the directory is big.
>I'm on a unix server.
>Is this possible to do in Perl?
>If so please point me in the right direction.
Perl Modules are your friend. Try the Net::FTP module:
Net::FTP
http://www.perl.com/CPAN/modules/by-module/Net
(part of the libnet bundle)
--
Clay Irving
clay@panix.com
------------------------------
Date: Thu, 24 Dec 1998 08:16:28 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: help with indirect reference for pattern match
Message-Id: <sbit57.sh.ln@magna.metronet.com>
Steven Barbash (stevenba@ccpl.carr.org) wrote:
: I must apologize. My earlier follow up had a typo :-(
: I wrote:
: > : I'm back to my original question -- with the qualifier that I need to do
: > : this in perl version 5.005
: when I meant to write version 5.003. (that is: PRE 5.005)
: So again, is there a way in 5.003?
------------------------
#!/usr/bin/perl5.003 -w
$x = 'this has my pattern in it';
$re = 'my pattern';
if ( $x =~ /$re/ )
{ print "matched my pattern\n" }
else
{ print "did NOT match my pattern\n" }
------------------------
'zat do it?
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 24 Dec 1998 11:37:48 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: help with indirect reference for pattern match
Message-Id: <75tqks$nm6$1@monet.op.net>
In article <MPG.10eb82bd989f5658989682@www.siast.sk.ca>,
Steven Barbash <stevenba@ccpl.carr.org> wrote:
>Matthew,
>
>Thanks for your response.
>But,
>>What you want is qr//.
>
>I can't find this.
>What version of perl is it in?
Not until 5.005, sorry.
But I'm puzzled, because the application you seemed to be describing
dodn't appear to require qr//. Did you know that variables in a
pattern match are interpolated, so that you can write
$pattern = <INPUT>;
while (<FILE>) {
print if /$pattern/;
}
and print out all the lines from the file that match the pattern that
the user entered?
------------------------------
Date: 24 Dec 1998 11:31:37 -0600
From: claird@Starbase.NeoSoft.COM (Cameron Laird)
Subject: Re: Is Perl as multifunctional as I've heard\read?
Message-Id: <75ttpp$5c4$1@Starbase.NeoSoft.COM>
In article <01be2eff$408a5ba0$606084a9@nec>, sp <x@y.com> wrote:
>I have always had an interest in programming, but I am a tech support\net
>admin person
>primarily. I have been looking for a language that would span between
>different computer
>disciplines. It seems as though Perl more than any other language is able
>to do this.
>I've read that it could be used for network admin, web\internet
>programming, Unix\mainframe,
>graphics purposes, databases, etc.
.
.
.
Without particular comparison to alternatives, yes, Perl's span is wide.
<URL:http://www.sunworld.com/sunworldonline/swol-05-1998/swol-05-perl.html>
details some of the breadth hidden in your "etc."
--
Cameron Laird http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com +1 281 996 8546 FAX
------------------------------
Date: 24 Dec 1998 14:40:12 -0500
From: Uri Guttman <uri@ibnets.com>
Subject: Re: Is Perl as multifunctional as I've heard\read?
Message-Id: <39k8zh2usj.fsf@ibnets.com>
>>>>> "CL" == Cameron Laird <claird@Starbase.NeoSoft.COM> writes:
CL> URL:http://www.sunworld.com/sunworldonline/swol-05-1998/swol-05-perl.html
i am looking at the article and immediately noticed some improvements
that could be made in the first program.
you convert all non alphas and ' to space and thn sqeeze the spaces with
this code:
s/[^\w']/ /g;
s/ +/ /g;
but that could be done just by adding the + to the char class of the
first s///.
s/[^\w']+/ /g;
or the squeeze could be done faster with tr
tr/ //s;
or even the split could do it and you could skip null words:
foreach $word ( split /[^\w']+/ ) {
next unless $word ;
blah blah
}
and when looping over a list, i like foreach rather than for. i reserve
for for for loops as in c. (3 fors in a row, wanna try for four?)
also the formatting got ruined in the html. use <PRE> or something to
maintain the proper indenting. it looks really poor to see this:
# Print the most frequently-used words first.
foreach $word (sort {$frequency{$b} <=> $frequency{$a}}
keys %frequency) {
print "$frequency{$word}: $word\n";
}
finally, you mention in-process scripting without mentioning the fastcgi
protocol which is a public protocol to speed up cgi programs which
supports multiple languages. check out www.fastcgi.com for more
info. perl is prominent in the fastcgi world.
uri
--
Uri Guttman Hacking Perl for Ironbridge Networks
uri@sysarch.com uri@ironbridgenetworks.com
------------------------------
Date: Thu, 24 Dec 1998 14:24:16 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: link checker help
Message-Id: <ebohlmanF4H40G.5px@netcom.com>
Clay Irving <clay@panix.com> wrote:
: Yeah, but its still simple -- You don't have to beat your head against the
: wall as some folks are so prone to doing. Try a GET also:
: use LWP::Simple;
: $url = "http://www.perl.com";
: if((!head($url)) or (!get($url))) {
Paging Mr. DeMorgan...
: print "Bad URL: $url\n";
: }
------------------------------
Date: 24 Dec 1998 11:23:36 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Mail from PERL using variable mail address
Message-Id: <75tpq8$rh1@panix.com>
In <75tfc0$ig6$1@nnrp1.dejanews.com> nemanij@hotmail.com writes:
>Hello, I have this problem where I have to mail using the perl script from
>my UNIX system. The mailing address that I have to mail to will also come
>from the perl script. So can anyone pls tell me how I can do that? I tried
>something like this but this did not work.
>open(MAIL, '|mail "$address"') || die" unable to mail $!\n";
> print MAIL <<"endofmail";
> text
> endofmail
>close(MAIL) || die "error closing mail $!\n";
>Thanks for you reffort
The subject has been discussed in this newsgroup bazillions of times.
Try this:
http://www.dejanews.com/dnquery.xp?QRY=sendmail&DBS=2&ST=PS&defaultOp=AND&LNG=ALL&format=terse&showsort=score&maxhits=25&subjects=&groups=comp.lang.perl.misc&authors=&fromdate=&todate=
You'll get about 1,600 hits. :)
--
Clay Irving
clay@panix.com
------------------------------
Date: Thu, 24 Dec 1998 18:49:47 GMT
From: colemac@sce.com
Subject: Need to output a file starting at a specified line
Message-Id: <75u2cb$269$1@nnrp1.dejanews.com>
I am relatively new to perl. I have a need to read in a file, present it
with line numbers to a user, allow a line number selection and based on that
criteria, output the file beginning with that selected line number to the end
of file. I can read in the file alright, but selecting the line number based
on user input and outputing till the EOF is evading me. Any clues? Thanx,
Chris
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 24 Dec 1998 15:58:27 GMT
From: "Brian Willis" <briwillis@yahoo.com>
Subject: NEWBIE: Question about $ENV in scripts
Message-Id: <01be2f70$6fa0bbc0$2c3837a6@main>
Hello,
I was woundering if someone could explain the different $ENV's that I see
in CGI scripts. I'm sure that there are a few different ones, but here are
the ones I've seen the most.
$ENV{'CONTENT_LENGHT'}
$ENV{'QUERY_STING'}
$ENV{'PATH_INFO'}
I'm kinda new to scripting (trying my hand out on perl now) and I get
confused how and why to use the different $ENV's. Are they related only to
the web server? Can you list the ENV's for a web server? I've worked
quite a bit on SunOS and Solaris and I'm familar with the "env" of those
OS's.
Excuse the ignorance...
--
Brian Willis
bigkingwillie@bigfoot.com
------------------------------
Date: Thu, 24 Dec 1998 13:27:33 -0500
From: Jean-Pierre Sangin <sangin@cam.org>
Subject: Perl for win32 user friendly?
Message-Id: <36828795.81FB7299@cam.org>
Hello
Last year I used perl for Macintosh. I clicked on the perl icon and I
could test my script in the perl interpreter. It was very user friendly.
Now I own a powerfull PC, I just download perl for win32 and I spent
several hours to find an perl icon to click into. I was wondering if
download was bad.
After websurfing I found a wonderful hidden text from Allan M. Due on
how to succeed to print "Hello world".
Is it possible to use easily perl on a PC?
Jean-Pierre Sangin sangin@cam.org Montr?al Canada
http://www.cam.org/~sangin/
http://www.geocities.com/TimesSquare/Hangar/9497/
------------------------------
Date: 24 Dec 1998 20:29:21 GMT
From: cjc@sdf.lonestar.org (Corey)
Subject: Perl script to help in downloading web books/faqs
Message-Id: <75u871$82u$1@news.metronet.com>
I hope this gets through. Never posted news on this server yet..
I found a neat site, www.mcp.com, which lets you browse books online.
Not one to consume net bandwitdh, I have been downloading each chapter
manually, along with the associated figures (gifs).
This gets pretty boring after a while. Is there a program that can help me
with this task? One problem I forsee is, some of the books contain links
to other websites.
Hence, I don't want this 'spider' to venture off into those sites..only
to download the book, and its associated images.
If there isn't a program like this, pointers to a perl module which helps in
parsing out the links in a web page woul help me out. I had used shell
scripting before for simple cases, but it's too inflexible -- it looks
to me like <a href>... could span multiple lines, thus fooling grep..
This would help me with the on-line FAQs which are broken up..
P.S. you people who put this type of stuff up on the web, please include an
optin to
download the whole thing as a tarball/zipfile for local browsing..I can't
stand starting up PPP just to read a multi-page html document.
--
cjc@fang.ml.org http://fang.ml.org/~cjc
------------------------------
Date: Thu, 24 Dec 1998 19:41:27 -0000
From: "Wallace" <niall_wallace@yahoo.com>
Subject: Problem with Text files with my Program.
Message-Id: <75u5id$1b8$1@newnews.global.net.uk>
Hi,
Im using Perl to produce my CSYS Computing Project.
The Program is to read in a Web Server Log from an Apache Server.
While reading in lines from Text files, I noticed that it was only reading
in half the file,
I tested this by changing the number of Logs in the file and every time it
gave half of the total lines in the output,
$records and $len = @hosts.
both produced half of the number of logs in the file, I tried this with
another Log file and the same happened.
The Prg is below:
# Do the file stuff
print "What file do you want to open\n";
$filename = <STDIN>;
# Create the lists
chomp ($filename);
open(LOGFILE,$filename) or die "Sorry. \n The file $filename does not exist.
\n Program Terminated. \n";
while(<LOGFILE>) {
$line = <LOGFILE>;
chomp ($line);
($hostin,$identin,$userin,$datein,$timezonein,$typein,$requestin,$HTTPin,$st
atusin,$bytesin,$reffererin,$browserin) = split / / , $line;
# Put the retreived values in to an Array
$len = @hosts;
@hosts[$len] = $hostin;
$len = @idents;
@idents[$len] = $identin;
$len = @users;
@users[$len] = $userin;
$len = @dates;
@dates[$len] = $datein;
$len = @timezones;
@timezones[$len] = $timezonein;
$len = @types;
@types[$len] = $typein;
$len = @requests;
@requests[$len] = $requestin;
$len = @HTTPS;
@HTTPS[$len] = $HTTPin;
$len = @status;
@status[$len] = $statusin;
$len = @bytes;
@bytes[$len] = $bytesin;
$len = @refferers;
@refferers[$len] = reffererin;
$len = @browsers;
@browsers[$len] = browserin;
# Count number of records
$records = $records + 1
}
close(LOGFILE);
$len = @hosts;
print $len;
print $records;
Some of the LOG file: (Three Lines in fact) :
198.112.165.147 - - [20/Jul/1998:17:17:15 +0100] "GET / HTTP/1.0" 200 675
"-" "libwww-perl/5.33"
195.147.25.71 - - [20/Jul/1998:17:46:14 +0100] "GET / HTTP/1.1" 200 687 "-"
"Mozilla/4.0 (compatible; MSIE 4.01; Windows 95)"
195.147.25.205 - - [28/Jul/1998:20:36:55 +0100] "GET /insure.gif HTTP/1.1"
200 3962 "http://www.saabclub.co.uk/main.htm" "Mozilla/4.0 (compatible; MSIE
4.01; Windows 95)"
195.147.25.205 - - [28/Jul/1998:20:36:57 +0100] "GET /driver2.gif HTTP/1.1"
200 4069 "http://www.saabclub.co.uk/main.htm" "Mozilla/4.0 (compatible; MSIE
4.01; Windows 95)"
Anybody know what is wrong,
Is it me / some thing to do with Txt files in Dos or Something else
Please Help.
Thanx in advance
N. Wallace
(PArt time idiot)
------------------------------
Date: Thu, 24 Dec 1998 17:46:07 GMT
From: wyndo@cxo.com
Subject: Re: Q: is srand(time()); good enough?
Message-Id: <75tukv$vb8$1@nnrp1.dejanews.com>
> > I have a dim and distant recollection of Randall Schwartz posting advice
> > along the lines of "don't seed with just 'time' -- use 'time ^^ $$'",
> > ie. mix another predictably-varying value (the process id) in with an
> > XOR. Of course, both the time and the process id vary in an extremely
> > predictable way, and only in the lower couple of bits. For serious
> > random number applications (eg. Monte Carlo simulation), I don't think
> > they're enough.
I'm testing with Perl 5.004 build for NT. My web host is running a different
Perl for NT (it has a "name" but I can't recall). I've used srand(time) and
I've used srand(time ^ $$). I don't have a problem. For me, the random's are
pretty much distributed. I don't really mind that it's not *truly* random
just so long as it "appears to be" random given the results of running the
same program repeatedly and noting the results. For me, it does "appear to
be" random (picking a random number from 1 to 9 gives a fairly even
distribution of results for any given run) however I have some players saying
that when running the program 30 times, it may only pick 2 and 9... or just
pick 3 almost every time. I really don't know what to think, since I can't
reproduce it and they're running the same program on the same server.
Thanks for the help!
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 24 Dec 1998 17:46:21 GMT
From: tizianob@usa.net (Bruschi Tiziano)
Subject: Reading a gif file.
Message-Id: <36827dc7.21516878@news.nettuno.it>
I try to read a gif file to print it in STDOUT but i can read only 4
or 5 caracters. I think that perl find a EOF and stop reading.
How to read all the file?..
i'm using a simple :
while (file, $buf, 16384) {
print $buf;
}
Reply also in email.
Many thanks.
------------------------------
Date: Thu, 24 Dec 1998 17:40:54 GMT
From: tizianob@usa.net (Bruschi Tiziano)
Subject: Reading a gif file.
Message-Id: <36827c98.21213565@news.nettuno.it>
I try to read a gif file to print it in STDOUT but i can read only 4
or 5 caracters. I think that perl find a EOF and stop reading.
How to read all the file?..
Reply also in email.
Many thanks.
------------------------------
Date: Thu, 24 Dec 1998 10:31:28 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Reading a gif file.
Message-Id: <MPG.10ec285f4cd0675e9898f3@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <36827dc7.21516878@news.nettuno.it> on Thu, 24 Dec 1998
17:46:21 GMT, Bruschi Tiziano <tizianob@usa.net> says...
> I try to read a gif file to print it in STDOUT but i can read only 4
> or 5 caracters. I think that perl find a EOF and stop reading.
> How to read all the file?..
> i'm using a simple :
>
> while (file, $buf, 16384) {
^read
> print $buf;
> }
Use binmode() on both the input and the output file handle.
`perldoc -f binmode`
With the ever-increasing number of POB Perl installations, 'premature
EOF' must be a candidate for a FAQ. But a search on perlfaq5 fails to
turn up 'binmode'. Does this reflect a particular orientation of the
authors of the FAQ, he asked disingenuously?
> Reply also in email.
No munge, no problem.
> Many thanks.
You're welcome.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 24 Dec 1998 08:11:55 -0600
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Regex question - removing HTML tags....
Message-Id: <b3it57.sh.ln@magna.metronet.com>
GiLLY (hklife@soback.kornet21.net) wrote:
: :<!-- So, what about this? --
: :>
: s/<!\s*-\s*-.*?-\s*-\s*>//gs;
^^^ ^^^ ^^^
I don't think spaces are allowed there (I know they are not in
SGML, but if we want to call what is accepted by popular browsers
"real HTML", then I don't know ;-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 24 Dec 1998 17:16:49 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Regex question - removing HTML tags....
Message-Id: <75tsu1$t$1@client3.news.psi.net>
GiLLY (hklife@soback.kornet21.net) wrote on MCMXLI September MCMXCIII in
<URL:news:3681e0f3.25474765@news.snu.ac.kr>:
++ :<!-- So, what about this? --
++ :>
++
++ s/<!\s*-\s*-.*?-\s*-\s*>//gs;
<!-- So, what - - > about this then? -->
Abigail
------------------------------
Date: Thu, 24 Dec 1998 17:39:18 GMT
From: uncle_remus@my-dejanews.com
Subject: removing "Tk" from Perl/Tk under Win
Message-Id: <75tu86$utc$1@nnrp1.dejanews.com>
Does anyone know how to remove the "Tk" icon (and replace it with s.t. else)
from windows generated under Perl/Tk on Windows??
Thanks!
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 24 Dec 1998 11:52:39 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: require & use
Message-Id: <75trgn$ooa$1@monet.op.net>
In article <36822F0E.4DA1396B@catnmoose.com>,
Marty Landman <marty@catnmoose.com> wrote:
>My understanding though is that use executes at
>compile time whereas require is a run time thing.
Yup.
>Shouldn't require be used only when the thing to be required is
>determined at run-time?
Should, should. I don't know; I guess it depends on the application.
>Else if it's a static reference I'd rather do a use so I get the
>benefit of forewarning. Yes?
Turning on `strict' in the main file won't affect the require'd or use'd files.
It has lexical scope.
>But require allows me to specify the file while use allows individual
>sub names. Right?
Well, sort of. If you do
use X 'Y', 'Z';
That's the same as
BEGIN {
require X;
X::import('X', 'Y', 'Z');
}
and the `import' function could do anything at all. Typically, it
installs subs Y and Z into the package from which you did the `use',
but it might do something peculiar.
> How can I use use to not require require
Using use always requires require. But if you want to use use as if
it were require, use use this way:
use X ();
That suppresses the `import' part.
------------------------------
Date: Thu, 24 Dec 1998 15:36:06 GMT
From: John@melon17.freeserve.co.uk (John )
Subject: Script for Paradox?
Message-Id: <36825f13.10405929@news.freeserve.net>
Is there a perl script taht will enable you to search a
Paradox database via SQL?
John
------------------------------
Date: 24 Dec 1998 17:18:50 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: sizeof() function?
Message-Id: <75tt1q$t$2@client3.news.psi.net>
Bart Lateur (bart.lateur@skynet.be) wrote on MCMXLI September MCMXCIII in
<URL:news:368e1450.10211326@news.skynet.be>:
++ Paul Makepeace wrote:
++
++ >Abigail wrote in message <75rac2$ht4$3@client3.news.psi.net>...
++ >> print $foo, "\n";
++ >
++ >I see this construct a lot. What's the appeal?
++ >
++ >print "$foo\n";
++
++ Another alternative:
++
++ $\ = "\n";
++ print $foo;
++
++ Very readable, and in my mind the nicest option if ALL print statements
++ need to be terminated with a newline.
I usually prefer -l then.
Abigail
------------------------------
Date: Thu, 24 Dec 1998 09:29:23 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Sockets and remote host
Message-Id: <36820973.BCC77EFD@patriot.net>
I am using AS build 507 on NT 4.0 w/ SP4. I have a small server
that runs nicely, and I want to add the functionality of determining
the connecting IP. I am using IO::Socket, and have tried peeraddr()
and peerhost(), neither of which work...I get an error message from
Socket.pm about the length of the argument being 0 instead of 16.
Any ideas?
Thanks
Carv
------------------------------
Date: Thu, 24 Dec 1998 15:17:25 GMT
From: pdroogma@netscape.net (peter)
Subject: Storing images into MS Access 97 database
Message-Id: <368259e6.2595261@news.pandora.be>
Hello,
I want to be able to upload pictures using a browser and store the
images in a ms access database.
I've come this far :
I can upload the picture (gif), display it at the same time, store it
into the database using a memo field, but when i try to display the
picture I get a lot of other stuff out of the database.
I make the connection using OLE en ADO and it's working fine for text
data.
The problem - according to me - is with the storing and/or retrieving
of the data. Any suggestions
I'm using ActivePerl 507, IIS 4.0 on NT Server
Thanks a lot
Peter
pdroogma@netscape.net
------------------------------
Date: 24 Dec 1998 12:13:35 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: string problem
Message-Id: <75tsnv$qah$1@monet.op.net>
In article <ebohlmanF4GM5M.6vy@netcom.com>,
Eric Bohlman <ebohlman@netcom.com> wrote:
> Index: 1 secs ( 0.78 usr 0.02 sys = 0.80 cpu)
> Regex: 1 secs ( 0.88 usr 0.12 sys = 1.00 cpu)
> Tr: 3 secs ( 1.82 usr 0.23 sys = 2.05 cpu)
>
>Tr seems to be the loser here. IIRC, index() and regex matching use the
>same algorithm (Boyer-Moore, which is quite fast) for matching literal
>strings, so the similar times aren't surprising.
Boyer-Moore on a one-character target string is just linear search.
Probably the big win of index/regex over tr here is that index and
regex can both stop when they find the target string, but tr has to go
all the way to the end in case the target appears again.
In your example, the target was in the exact middle of the search
space, so it's not surprising that tr took about twice as long as the
others. Try it on ('|' . ('a' x 1000)) and you'll see a huge
difference.
------------------------------
Date: 24 Dec 1998 11:58:49 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: The quine page
Message-Id: <75trs9$p9o$1@monet.op.net>
In article <3681E060.C4E2626E@sun.iwu.edu>,
Gary Thompson II <gthompso@sun.iwu.edu> wrote:
> I thought this group might be interested in my new page, The Quine
>Page.
Thanks.
>It's a collection of all the self-reproducing programs I've been
>able to find.
You left out my favorite one:
open+0;print<0>
Also, I don't think Jef Pinyan nvented the one you credited to him.
Also, you might want to look at mine, which is at
http://www.plover.com/~mjd/perl/quine.html
------------------------------
Date: 24 Dec 1998 12:08:21 -0500
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: The quine page
Message-Id: <75tse5$pum$1@monet.op.net>
In article <75trs9$p9o$1@monet.op.net>, Mark-Jason Dominus <mjd@op.net> wrote:
> open+0;print<0>
This is a cheat, by the way.
------------------------------
Date: 24 Dec 1998 12:58:10 -0500
From: Uri Guttman <uri@sysarch.com>
Subject: Re: The quine page
Message-Id: <x73e65jubx.fsf@sysarch.com>
>>>>> "MD" == Mark-Jason Dominus <mjd@op.net> writes:
MD> In article <75trs9$p9o$1@monet.op.net>, Mark-Jason Dominus
MD> <mjd@op.net> wrote:
>> open+0;print<0>
MD> This is a cheat, by the way.
i wonder if a perl quine must be runnable with -e to filter out
cheats. i am sure some use <DATA> but other than that they should run
under -e and then you can't get at $0 or stdin.
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: 24 Dec 1998 19:07:15 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: The quine page
Message-Id: <75u3d3$t0$1@client3.news.psi.net>
Gary Thompson II (gthompso@sun.iwu.edu) wrote on MCMXLI September
MCMXCIII in <URL:news:3681E060.C4E2626E@sun.iwu.edu>:
++ Hi there,
++ I thought this group might be interested in my new page, The Quine
++ Page. It's a collection of all the self-reproducing programs I've been
++ able to find. I have quite a few in Perl, but I don't know it very
++ well. I
++ would love some input on which are 'cheats'. Come and see, though, as
++ it's
++ a pretty neat concept. Just drop on by at
++ http://www.nyx.net/~gthompso/quine.htm
Here's another "cheat":
#!/usr/local/bin/perl -w
print `cat $0`;
Abigail
------------------------------
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 4493
**************************************