[13937] in Perl-Users-Digest
Perl-Users Digest, Issue: 1347 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 11 06:05:54 1999
Date: Thu, 11 Nov 1999 03:05:10 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942318309-v9-i1347@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 11 Nov 1999 Volume: 9 Number: 1347
Today's topics:
Re: ActivePerl from a network drive? <gellyfish@gellyfish.com>
Backquotes bug? <liberty@eskimo.com>
Re: communicating with another process (Abigail)
Help needed fast please <chris@chrismail.connectfree.co.uk>
Re: Help woth perl <gellyfish@gellyfish.com>
Re: Hiding Perl Scripts? <mehkri@yahoo.com>
Re: Hiding Perl Scripts? (Simon Cozens)
Re: Image type conversion??? <gellyfish@gellyfish.com>
Re: Implementing persistence in Perl <jll@skynet.be>
IO::Pty problem (EXCHANGE:RICH1:2146)
Re: Is $$variable allowed like in PHP ? <gellyfish@gellyfish.com>
Re: list (array) programming question <skilchen@swissonline.ch>
Re: perl & permission (Simon Cozens)
Re: perl as first language? <jmn.ac.delete@abanet.it>
Re: perl_call_method and method existance <gellyfish@gellyfish.com>
Re: regular expression to parse html out <gellyfish@gellyfish.com>
Re: Splitting at 255 bytes <gellyfish@gellyfish.com>
use overload -- "0+" takes the place of "bool" <johnlin@chttl.com.tw>
Win32::FileOp BUG? <h.petrich@ebv.com>
Re: Win32::Internet FTP List problem <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 11 Nov 1999 09:05:14 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: ActivePerl from a network drive?
Message-Id: <80e0sa$isp$1@gellyfish.btinternet.com>
On Wed, 10 Nov 1999 20:45:15 GMT cs2400@my-deja.com wrote:
> hello,
>
> At the school i attend, Perl 4 is installed on a
> "network drive" (U:\) that has a number of
> utilities on it, you can get to perl by typing
> "perl" at the command prompt since all workstation
> have the U: drive in their PATH.
>
> As it is now, Perl 4 is just a single binary file
> at the root of the U: drive. There are no perl
> directory.
>
> I would like to ask the network admin to upgrade
> to Perl 5. But that would require "U:\perl\bin" to
> by added to the PATH of all machines.
>
> So my question is, can ActivePerl be installed
> like so:
>
> A few perl files at the root...
> U:\perl.exe
> U:\perldoc.bat
> U:\ppm.bat
>
> *all* other perl files in a subdirectory...
> U:\perl\whatever\...
>
I believe that the ActivePerl prompts you for the installation directory
although it shouldnt be too difficult for a competent system administrator
to set up a global path configuration ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Thu, 11 Nov 1999 01:38:40 -0800 (PST)
From: Michael Justice <liberty@eskimo.com>
Subject: Backquotes bug?
Message-Id: <199911110938.BAA29224@eskimo.com>
My environment:
Win95 OSR2
Perl 5.005_03 built for MSWin32-x86-object
Binary build 515 provided by ActiveState [...] Built 19:53:14 Apr 9 1999
I use the following script to delete files that I've archived off to CD from
a data-collection directory. The backquoting fails for a reason that I have
not been able to determine, but it is dependent on the path name and length
to the directory from which I run the script. The failure is that the output
>from the backquoted command does not get assigned to the variable "$string";
instead, it shows up in stdout or maybe stderr (I'm not sure how to tell).
I am running the script from an MS-DOS Prompt window by typing "perl c:ds.pl".
Although it is not the only case where it happens, one where it definitely
fails is, if the name of any directory in the path ends in ".com", such as
"c:\collected\eskimoo.com\liberty\pages" (note the "eskimoo.com" in it),
the backquotes operator fails as described. If I rename the directory to
"eskimoo.org" or "eskimoo.net", it works.
I couldn't believe it, but There It Was. And here's the script:
#! c:\perl\bin\perl.exe
opendir (DIR, ".") ;
@list = readdir(DIR) ;
closedir(DIR) ;
$listsize = $#list ;
print "in loop size = $listsize\n" ;
foreach $item (@list) {
$string = `fc /a /lb1 \"$item\" \"g:$item\"` ;
if ($string =~ m/FC: no differences encountered/)
{ print "unlinking $item\n" ; unlink ($item) ; }
else
{ print "$item not unlinked -- not the same\n"; }
}
Any ideas?? Yeah, I know, switch to Linux -- I can't, the data collection
software is for Win95 only. :-(
Thanks,
-- Michael.
--
Michael A. Justice |"Hey, wait a minute! You guys are CONSULTANTS!
liberty@eskimo.com | You're not supposed to insult me, you're supposed
Libertarian Party | to KISS MY ASS! What is WRONG with you people?!?!"
FIJA, WCW, NRA, AMA| -- Glenn, having a bad day.
------------------------------
Date: 11 Nov 1999 02:35:38 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: communicating with another process
Message-Id: <slrn82l05i.lmh.abigail@alexandra.delanet.com>
Dan Mills (dm@cs.duke.edu) wrote on MMCCLXIII September MCMXCIII in
<URL:news:87ogd1fqr8.fsf@majikthise.adsl.duke.edu>:
&&
&& I need to communicate with another process in the simplest way
&& possible. It needs to be interactive, sending/receiving a few chars
&& at a time. What is the best way to do this? Named pipes?
man perlipc
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== 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: Thu, 11 Nov 1999 08:10:11 -0000
From: "Chris" <chris@chrismail.connectfree.co.uk>
Subject: Help needed fast please
Message-Id: <382a87d4.0@news2.cluster1.telinco.net>
I have made some changes to the help I was last given like putting html in
and it dosen't work plus the other file hasn't been helped with the files
are below ( I have maked my changes) HELP ME PLEASE!!
sign_up.pl ----
#########################
#!/usr/bin/perl -wT
use strict;
use CGI qw(:standard);
use Fcntl qw(:flock);
$ENV{qw(PATH IFS)} = '' x 2;
my $url = param('url');
my $forward = param('forward');
my $email = param('email');
open(success,"success.fil")
{
flock(success,LOCK_SH) || die "Can't lock 'success.fil - $!\n"; #
opening a html file in fil form
my $success= do { local $/; <success> }; # and putting in to $success
close(success);
}
open(taken,"taken.fil")
{
flock(taken,LOCK_SH) || die "Can't lock 'taken.fil - $!\n"; # same but
with different
my $unvailible= do { local $/; <taken> }; # file and putting into
$unvailible
close(taken);
}
open(message,"message.fil")
{
flock(message,LOCK_SH) || die "Can't lock 'fils/$url.fil - $!\n"; # same
again
my $message= do { local $/; <message> };
close(message);
}
if ( open(UINFO,"fils/$url.fil") )
{
flock(UINFO,LOCK_SH) || die "Can't lock 'fils/$url.fil - $!\n";
my $test= do { local $/; <UINFO> };
close(UINFO);
if ($test eq ":-:\n$forward")
{
print"$unvailible"; # printing what read from file above
}
}
else
open(URLS,">fils/$url.fil") || die "Can't open 'fils/$url.fil - $!\n";
flock(URLS,LOCK_EX) || die "Can't flock 'fils/$url.fil - $!\n";
print URLS ":-:\n$forward";
close(URLS);
my $from = 'kieran@bl-soft.com';
my $sub = 'Your Exclamation website is up and running';
email($email,$from,$sub,$message);
print "$success"; # printing from file above
}
sub email
{
my ($to,$from,$sub,$message) = @_;
open(MAIL, "|/var/qmail/bin/qmail-inject -t") || die
"Content-type: text/plain\n\nCan't open
qmail-inject -$!\n";
print MAIL <<EOMAIL;
To: $to
From: $from
Subject: $sub
$message
EOMAIL
return close(MAIL);
}
forward.pl --------
#####################
#!/usr/local/bin/perl
&readparse;
###############################################
$forsite=$value[0];
open(BOOK,"</fils/$forsite.fil");
$redir=<BOOK>;
close(BOOK);
if ($redir eq "") {
print '
<HTML>
<HEAD>
<TITLE>EXCLAMATION!</TITLE>
</HEAD>
<BODY BGCOLOR="BLACK">
<center>
<FONT COLOR="ORANGE">
EXCLAMATION!<p>
<H1>Sorry page not found</H1><p>
To register this domain with EXCLAMATION <A
HREF="http://blsoftpart.hypermart.net/sign_up.html">Click Here</A><p>
<A HREF="exclamation.html">Click Here</A> to go to exclamations main
site.<p>
<A HREF="http://www.bl-soft.com/">Click Here</A> to visit Bl-Soft (The
company who made this).<p>
<A HREF="http://www.free-address.com/">Click Here</A> to visit free-address
(Another part of the company).
</FONT>
</BODY>
</HTML>
';
}
else {
print "Location: $redir\n\n";
}
###############################################
sub readparse {
read(STDIN,$user_string,$ENV{'CONTENT_LENGTH'});
if (length($ENV{'QUERY_STRING'})>0) {$user_string=$ENV{'QUERY_STRING'}};
$user_string =~ s/\+/ /g;
@name_value_pairs = split(/&/,$user_string);
foreach $name_value_pair (@name_value_pairs) {
($keyword,$value) = split(/=/,$name_value_pair);
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/ge;
push(@value, "$value");
$user_data{$keyword} = $value;
if ($value=~/<!--\#exec/) {
print "Content-type: text/html\n\nNo SSI permitted";
exit;
};
};
};
--
Chris
chris@chrismail.connectfree.co.uk
www.bl-soft.com/chrissite
------------------------------
Date: 11 Nov 1999 09:29:06 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help woth perl
Message-Id: <80e292$itd$1@gellyfish.btinternet.com>
On Wed, 10 Nov 1999 17:09:16 -0000 Chris wrote:
> I have made some changes to the help I was last given like putting html in
> and it dosen't work plus the other file hasn't been helped with the files
> are below ( I have maked my changes) HELP ME PLEASE!!
>
>
<snipped all but the obvious mistakes>
#> open(success,"success.fil")
if(open(SUCCESS,'success.fil'))
> {
> flock(SUCCESS,LOCK_SH) || die "Can't lock 'success.fil - $!\n"; #
> opening a html file in fil form
> my $success= do { local $/; <SUCCESS> }; # and putting in to $success
> close(SUCCESS);
> }
>
#> open(taken,"taken.fil")
if (open(TAKEN,'taken.fil'))
> {
> flock(TAKEN,LOCK_SH) || die "Can't lock 'taken.fil - $!\n"; # same but
> with different
> my $unvailible= do { local $/; <TAKEN> }; # file and putting into
> $unvailible
> close(TAKEN);
> }
>
#> open(message,"message.fil")
if (open(MESSAGE,'message.fil'))
> {
> flock(MESSAGE,LOCK_SH) || die "Can't lock 'fils/$url.fil - $!\n"; # same
> again
> my $message= do { local $/; <MESSAGE> };
> close(MESSAGE);
> }
But you still dont say *what* is wrong with it and what its supposed to do ..
As for the other program - you could start by applying some of the changes
I made to the first including:
use -w flag
use taint checking (-T flag)
use CGI
flocking of files
checking of file opens
use 'here documents' for blocks of text ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Thu, 11 Nov 1999 01:10:20 -0800 (PST)
From: Mohammad Akram Ali Mehkri <mehkri@yahoo.com>
To: "comp.lang.perl.misc@list.deja.com" <comp.lang.perl.misc@list.deja.com>
Subject: Re: Hiding Perl Scripts?
Message-Id: <19991111091020.8528.rocketmail@web215.mail.yahoo.com>
why dont u use perlcc to compile to the script to a bin code.
--- Tad McClellan <tadmc@metronet.com> wrote:
> Message from the Deja.com forum:
> comp.lang.perl.misc
> Your subscription is set to individual email delivery
> >
> LorainCounty.com Webmaster (webmaster@LorainCounty.com) wrote:
>
> : How could I hide the source code of a Perl Script so
> : it can't be modified or viewed? I might have to place the script on a
> : server I have no control over but would like to keep the Perl Script
> : intact.
>
>
> What does "intact" mean there?
>
> Are you worried that someone will be able to modify your program?
>
> That should not be possible on a correctly configured server.
>
>
> : I have read the FAQ (3 & 8) about compiling the code but as I read
> : them
> : that didn't seem to be the answer.
>
>
>
> That _is_ the answer.
>
> The answer is that it cannot be done.
>
> You may not like the answer, but it is an answer nonetheless.
>
>
>
>
> Put a license on your code.
>
>
> --
> Tad McClellan SGML Consulting
> tadmc@metronet.com Perl programming
> Fort Worth, Texas
>
>
>
> _____________________________________________________________
> Deja.com: Before you buy.
> http://www.deja.com/
> * To modify or remove your subscription, go to
> http://www.deja.com/edit_sub.xp?group=comp.lang.perl.misc
> * Read this thread at
> http://www.deja.com/thread/%3Ceahpv7.26a.ln%40magna.metronet.com%3E
>
>
=====
Mohammad Akram Ali Mehkri
System Admin Saehan India
Webmaster www.prizeclub.com
__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 11 Nov 1999 10:32:30 GMT
From: simon@brecon.co.uk (Simon Cozens)
Subject: Re: Hiding Perl Scripts?
Message-Id: <slrn82l6pu.2np.simon@othersideofthe.earth.li>
Mohammad Akram Ali Mehkri (comp.lang.perl.misc):
>why dont u use perlcc to compile to the script to a bin code.
1) Jeopardy quoting
2) Misleading answer
3) Haven't read the FAQ.
Next?
--
Avoid the Gates of Hell. Use Linux
(Unknown source)
------------------------------
Date: 11 Nov 1999 09:01:17 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Image type conversion???
Message-Id: <80e0kt$ism$1@gellyfish.btinternet.com>
On Wed, 10 Nov 1999 13:18:47 -0800 Darrell wrote:
>
> I noticed a module that uses ImageMagick to perform the conversion, but
> I don't have ImageMagick. Does anyone know of a standalone module for
> performing this task?
>
Any reason why you cant get ImageMagick ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 11 Nov 1999 12:00:00 +0100
From: Jean-Louis Leroy <jll@skynet.be>
Subject: Re: Implementing persistence in Perl
Message-Id: <m3zowlmgy7.fsf@enterprise.newedgeconcept>
ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
> You can use them [wekrefs] from C, and I think there is a module on
> CPAN too.
The only entry I find on the module list that contains 'weak' is your
one year old Softref.
Re accessing from C: will they be accessible from Perl as well in 5.6?
Tangram is pure Perl and I prefer it to remain that way.
--
V
VLR Jean-Louis Leroy
F http://users.skynet.be/jll
------------------------------
Date: Tue, 09 Nov 1999 13:13:10 -0600
From: "Nguyen, Hat-Van (EXCHANGE:RICH1:2146)" <htnguyen@americasm01.nt.com>
Subject: IO::Pty problem
Message-Id: <38287245.90C0F769@americasm01.nt.com>
I am using Expect.pm on a HP server. Lately, I saw the following
message so many times : "Expect: Could not assign a pty at
/opt/perl5/lib/site_perl/Expect.pm line 60." I changed the number of
pty devices on our server but the problem did not go away.
Would somebody please help me to figure out what going on?
Thanks.
------------------------------
Date: 11 Nov 1999 08:26:09 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Is $$variable allowed like in PHP ?
Message-Id: <80duj1$isa$1@gellyfish.btinternet.com>
On 10 Nov 1999 10:55:57 +0000 (GMT) Ben Evans wrote:
> In article <3804ef5f.247014768@news.ford.com>,
> Clinton Pierce <cpierce1@ford.com> wrote:
>>
>>Yes, they're called soft references (or symbolic references).
>>
>>Using them is generally considered a Bad Idea, which is one reason why
>>"use strict" won't put up with them. Other syntax like hashes of hashes,
>>or hard references should be used instead.
>
> Admittedly, most of the perl I write is for CGI, but I find it really
> handy to be able to set a form parameter called mode, check that $in{'mode'}
> is in some list of valid modes, then set $mode = $in{'mode'} and call
> &$mode.
>
Well I would do that like:
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
my $default_action = 'display';
my %dispatch = (
display => \&display,
add => \&add,
remove => \&remove
);
my $action = param('action') || $default_action;
if( ref( $dispatch{$action} ) eq 'CODE')
{
$dispatch{$action}->();
}
else
{
$dispatch{$default_action}->();
}
sub display
{
# blah
}
sub add
{
#blah
}
sub remove
{
#blah
}
No symbolic references there ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Thu, 11 Nov 1999 11:43:03 +0100
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: list (array) programming question
Message-Id: <80e6tf$qsu0$1@fu-berlin.de>
Paul Heinrich <heinrich@bucknell.edu> wrote in message
news:382833BF.DBBBC626@bucknell.edu...
>
> I need to be able to have the perl script create a superset of all
> possible unique combinations of elements of a list. For example, if
> I have a list including the three elements 'one', 'two', and
> 'three'.
> I'd like the program to return the following:
>
> one
> one two
> one three
> one two three
> two
> two three
> three
>
One more recursive WTDI but still not producing the order you are
looking for. Its only advantage: if you have more disk
space than memory, then you can simply output the subsets without the
need to accumulate the entire power set in memory. I don't know who
invented this algorithm:
#!wherever/perl -w
use strict;
sub create_powerset_rec {
my @set = @_;
my @pset = ([]);
my $n = @set;
my $count = 1;
my $helper;
$helper = sub {
my $k = shift;
for (my $i = $k; $i < $n; $i++) {
# if you want to get the powerset in memory
# push(@pset, [@_, $set[$i]]);
# if you simply want to print each
# nonempty element of the powerset
my @tmp = (@_, $set[$i]);
print "@tmp", "\n";
$count++;
if ($k < $n) {
$helper->($i+1, @_, $set[$i]);
}
}
};
$helper->(0,());
# return \@pset;
return $count;
}
#my $pset_ref = create_powerset_rec(@ARGV);
#foreach my $elt (@$pset_ref) {
# print "@$elt" , "\n";
#}
my $count = create_powerset_rec(@ARGV);
print STDERR "Number of subsets: ", $count, "\n";
__END__
And another iterative WTDI using some kind of backtracking. It still
has no need to accumulate the power set in memory. As above: i don't
know who invented this algorithm. Even if does not use recursion it is
usually significantly slower than the one above.
#!wherever/perl -w
use strict;
sub create_powerset_iter {
my @set = @_;
my $n = $#set;
my @pset = ([]);
my %track = ();
my $count = 1;
REPEAT:
while(1) {
my $i = 0;
while (exists($track{$i})) {
delete($track{$i});
$i++;
last REPEAT if $i > $n;
}
$track{$i} = 1;
# push(@pset, [@set[keys %track]]);
my @tmp = @set[keys %track];
print "@tmp", "\n";
$count++;
}
# return \@pset;
return $count;
}
#my $pset_ref = create_powerset_iter(1..$ARGV[0]);
#foreach my $elt (@$pset_ref) {
# print "@$elt", "\n";
#}
my $count = create_powerset_iter(1..$ARGV[0]);
print STDERR "Number of subsets: ", $count, "\n";
__END__
------------------------------
Date: 11 Nov 1999 10:50:05 GMT
From: simon@brecon.co.uk (Simon Cozens)
Subject: Re: perl & permission
Message-Id: <slrn82l7qt.2np.simon@othersideofthe.earth.li>
Abigail (comp.lang.perl.misc):
>"" You might also consider that doing successive stats on the same file is
>"" costly. The magic identifier _ obviates this.
>Hmmm, that's less than 4.5 microseconds per stat on average.
>Not really something to worry about.
Unless you're going over NFS.
Down a modem.
From the moon.
--
Behind every great computer sits a skinny little geek.
------------------------------
Date: Thu, 11 Nov 1999 09:05:44 +0100
From: John McNamara <jmn.ac.delete@abanet.it>
Subject: Re: perl as first language?
Message-Id: <OngqOKjRMcTbCl1YBPbL9DxURDEq@4ax.com>
On Wed, 10 Nov 1999 14:24:15 -0800, David Cassell
<cassell@mail.cor.epa.gov> wrote:
>Damian Conway wrote:
>>
>> Canoes? We don't coddle them with "looxuries" like canoes!
>>
>> She'll be *swimming* back!
>
>First thought: love the reference
>
>Second thought: so you're the *typical* major prof...
>
>David, "...and you tell them that today, and they won't believe you!"
Careful not to mention Python ;)
John McNamara
--
------------------------------
Date: 11 Nov 1999 09:13:13 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: perl_call_method and method existance
Message-Id: <80e1b9$it9$1@gellyfish.btinternet.com>
On Wed, 10 Nov 1999 18:43:57 GMT Daniel Yacob wrote:
> Greetings,
>
> Is there a way to check if a method exists before calling it with
> "perl_call_method"? I would like to not call the method and get warns
> if the user didn't provide the callback.
>
I'm probably being thick but I dont know what pperl_call_method is -
however you can check if something is a valid CODEREF with ref().
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 11 Nov 1999 08:59:49 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: regular expression to parse html out
Message-Id: <80e0i5$ish$1@gellyfish.btinternet.com>
On Thu, 11 Nov 1999 00:35:54 +0530 vod wrote:
> Hello,
>
> Before u say anything, i want to say that
> i know it may not be wise but never the less i am trying to make a
> small search script for my web-site. I want the script to search
> thru the .htm* pages but only the text that is outside the html tags,
> i.e. that is outside < > tags.
> At the moment i have the script ready that searches all the page
> blindly what i was hoping to make a regular expression that could
> eliminate html tags < >.
> Basically i think the reg ex has to look for any word starting
> with "<" followed by anything and ending with ">".
>
> I am not very good at reg exes so i was hoping to find a
> a reg exes from anyone of u guys/girls that would do the needfull
> i.e. elimiate html tags in a .html page.
If you simply want to remove the HTML from a string then you should read
perlfaq9 which has a section about this - if you want to search through
a documents text then you might search Deja news <http://www.deja.com>
from an example that I posted a couple of weeks ago that uses HTML::Parser
to do this. I guess I ought to put this on a web page somewhere ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 11 Nov 1999 08:56:35 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Splitting at 255 bytes
Message-Id: <80e0c3$ise$1@gellyfish.btinternet.com>
On Wed, 10 Nov 1999 14:00:17 -0500 Thomas Brian Holdren wrote:
>
> All I want to do is... I have a big long $string. I want to break it up into
> an @array, every 255 bytes for entry into mySQL. I have tried unpack with A,
> but it only gets the first section (which the perl book said it would) like so:
>
@array = ($string =~ /(.{1,255})/g);
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Thu, 11 Nov 1999 16:38:06 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: use overload -- "0+" takes the place of "bool"
Message-Id: <80dv9r$psq@netnews.hinet.net>
Here is the code:
package A;
use overload bool => \&test, "0+" => \&value;
sub new { bless [] }
sub test { 0 }
sub value { 1 }
package main;
my $a=new A;
if($a) { print "true " } else { print "false " }
unless($a) { print "false " } else { print "true " }
if(not $a) { print "false " } else { print "true " }
unless(not $a) { print "true " } else { print "false " }
--------------------------------------------------- I expected the result to
be
false false false false
--------------------------------------------------- but it came out to be
false true true true
because the "unless", "if not" and "unless not"
used "0+" => \&value instead of "bool" => \&test
I think this behavior is not good.
If "0+" is overloaded then overloading "bool" is
either redundant or bug-making.
In my case, I use "bool" to check whether the object is good and
can be converted into a value or not. The code will be like:
if($a) { print $a+3 } else { print 'computation got a bad result' }
The code above is OK, but becomes a bug in
if(not $a) { print 'computation got a bad result' } else { print $a+3 }
I think it is worthy revise the overloading behavior in this case.
------------------------------
Date: Thu, 11 Nov 1999 11:05:11 +0100
From: "Hans-Jürgen Petrich" <h.petrich@ebv.com>
Subject: Win32::FileOp BUG?
Message-Id: <80e48k$gdn@as.ebv.com>
Who know why Win32::FileOp don't work with WIN98
use Win32::FileOp;
$searchDir = BrowseForFolder('Select Folder');
Thanxxx all
--
Hans-Jürgen Petrich
------------------------------
Date: 11 Nov 1999 09:10:32 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Win32::Internet FTP List problem
Message-Id: <80e168$it6$1@gellyfish.btinternet.com>
On Wed, 10 Nov 1999 19:56:21 GMT Joris Lenior wrote:
> Hi,
>
> I'm trying to write a perl script which downloads a set of files from
> an HP3000 and converts them to excelsheets. Everything is working
> except the FTP part. In the line @msfiles = $FTP->List("MS51*"), I try
> to create an array containing the filenames I need. But instead of
> having only the filenames, the array exists
> of the following lines.
> 239B FA 4501 50000 1 4384 3 32 MS51R149
> 239B FA 3851 50000 1 4384 3 32 MS51R151
> 239B FA 165 50000 1 1472 1 32 MS51R152
> 239B FA 844 50000 1 1472 1 32 MS51R160
>
@msfiles = map { (split / /)[8] } $FTP->List("MS51*");
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
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 1347
**************************************