[11623] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5223 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 25 08:07:38 1999

Date: Thu, 25 Mar 99 05:00:51 -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, 25 Mar 1999     Volume: 8 Number: 5223

Today's topics:
    Re: Appending one DBM file to another <mikedoug@texas.net>
    Re: choping off whitespace <Philip.Newton@datenrevision.de>
        DBI and Oracle LONGs <kevin.white@blackwell.co.uk>
        different ideas about the architecture <hvermeulen@correctnl.com>
    Re: I have a question about a search script> <vvb@xibm.net>
        index contents of text files to corresponding html file <seugenio@man.amis.com>
    Re: index contents of text files to corresponding html  <Philip.Newton@datenrevision.de>
    Re: New Bee Alert <Philip.Newton@datenrevision.de>
    Re: newbe: to find the highest entry in group jas888@my-dejanews.com
    Re: Not possible in Perl?? <Philip.Newton@datenrevision.de>
        Output to a new HTML file. <lemmen@support.nl>
    Re: Perl processes <Wm.Blasius@ks.sel.alcatel.de>
    Re: Premature end of script headers (Jonathan Stowe)
    Re: RegExp problem, can't see wood for trees (I.J. Garlick)
    Re: RegExp problem, can't see wood for trees (I.J. Garlick)
    Re: regular expression (Bart Lateur)
    Re: Remove HTML codes (Jonathan Stowe)
        threaded perl <mikedoug@texas.net>
    Re: Tk extensions for PERL on WinNT <carvdawg@patriot.net>
    Re: Values of 'true' and 'false'? <Philip.Newton@datenrevision.de>
        Way to find out if a regex matched? <Philip.Newton@datenrevision.de>
    Re: Way to find out if a regex matched? (Jonathan Stowe)
    Re: What to use for X gui? <zenin@bawdycaste.org>
    Re: What to use instead of rename <Philip.Newton@datenrevision.de>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 25 Mar 1999 09:11:04 GMT
From: Michael Douglass <mikedoug@texas.net>
Subject: Re: Appending one DBM file to another
Message-Id: <I4nK2.92$FV2.467851@news1.giganews.com>

india_invest@my-dejanews.com wrote:
: I want to append an existing DBM file to another. Can any one help explain in
: simple terms how to do it. I have limited knowledge of perl. Also, can I
: append part of the data file.

Simplistic approach:  (replace NDBM_File with whichever DBM you need)

tie (%dbm1, 'NDBM_File', $filename1, O_RDWR|O_CREAT, 0640) || die;
tie (%dbm2, 'NDBM_File', $filename2, O_RDWR|O_CREAT, 0640) || die;

while( my($key,$val) = each %dbm2 ) {
  $dbm1{$key} = $val;
}


This will copy all key/value pairs from dbm2 into dbm1.

USE THIS CODE AT YOUR OWN RISK.

-- 
Michael Douglass
Texas Networking, Inc.

  Any sufficiently advanced bug is indistinguishable for a feature.
    -- from some indian guy


------------------------------

Date: Thu, 25 Mar 1999 12:01:47 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: choping off whitespace
Message-Id: <36FA179B.A3F1F682@datenrevision.de>

Larry Rosler wrote:
> 
> > Just for fun, I tried your script out with some whitespace (spaces and
> > tabs, FWIW) in front of and after the row of x's. Plus still was about
> > five times as fast as Star/Bad/Or (which were all roughly the same).
> 
> That is no surprise.  If you copied the benchmark exactly, whatever
> whitespace is in the string is deleted on the first iteration.

True <blush>. Oops.

Cheers,
Philip


------------------------------

Date: Thu, 25 Mar 1999 11:35:24 +0000
From: Kevin White <kevin.white@blackwell.co.uk>
Subject: DBI and Oracle LONGs
Message-Id: <36FA1F7C.50B6AE@blackwell.co.uk>

Hi All,

I am trying to fetch some column values from an Oracle Database and am
running into some problems with one column which is of type LONG.

Has anyone else experienced similar difficulties? Is there a way round
this? Is it blatantly obvious and I am being stupid?

Any help would be helpful!

Cheers

Kevin



------------------------------

Date: 25 Mar 1999 12:18:14 GMT
From: Henry Vermeulen <hvermeulen@correctnl.com>
Subject: different ideas about the architecture
Message-Id: <36FA2A0B.FF3491AD@correctnl.com>

Hi all,
I,m receiving the following message when doing a make.
Didn't ran into any trouble yet but it's still an error.
I assume the thoughts of perl came from a config file but i don't know
wich one.
The config files mentioned below are exactly the same. The're written at
the same time during installation.
I recently installed the latest.tar but didn't use my old config files.

Henry Vermeulen

[root@penta URI-1.01]# perl Makefile.PL
Have /usr/bin/perl5.005_02/lib/Config.pm expected
/usr/lib/perl5/5.00502/i586-linux/Config.pm
Your perl and your Config.pm seem to have different ideas about the
architecture
they are running on.
Perl thinks: [lib]
Config says: [i586-linux]
This may or may not cause problems. Please check your installation of
perl if you
have problems building this extension.
Writing Makefile for URI




------------------------------

Date: Thu, 25 Mar 1999 12:17:52 +0100
From: "Vincent Vanbiervliet" <vvb@xibm.net>
Subject: Re: I have a question about a search script>
Message-Id: <36fa1b2c@news.uk.ibm.net>

Add this code after the push(@doclist, $file); statement:

  if (($body=~/<title>/i) & ($body=~/<\/title>/i)) {
   $body=~ s/.+<title>(.+)<\/title>.+/$1/is;
   push(@titles, $body);
  }
  else {push(@titles, "no title");}


Rollo Lawson <rollo@enter.net> wrote in message
news:36f87fc4@news3.enter.net...
> Below I have a Perl Script I wrote to search a directory for html files
> containing particular words.
> The script works fine and everything and spits back the results.  My
> question to you is I would also like to extract the words contained
between
> the <title>  Descriptive Text</title> tags for only the matches so I could
> place a brief description with each match.  I cannot figure out how to do
> this with the script I have enclosed below.  Please Help!
>
> Heres the script  Please e-mail me if you have any answers Thanks
> rollo lawson
> rollo_lawson@yahoo.com
>
> #!/perl/bin/perl
> #Marc's Search.pl
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> @pairs=split(/&/, $buffer);
> #Split the Values
> foreach $pair (@pairs)
> {
> ($name,$value)=split(/=/,$pair);
> $value =~tr/+/ /;
> $value =~s/%(..)/pack("C",hex($1))/eg;
> $FORM{$name}=$value;
> }
> $i=0;
> foreach $file (</apache/htdocs/*.htm>)
> {
> print $file;
> open(HTML, $file);
> undef $/;
> $body=<HTML>;
>
> $/="\n";
> close(HTML);
> if ($body=~/$FORM{key}/i)
> {
> push(@doclist, $file);
> }
> }
>
> print "Content-type: text/html\n\n";
> print "<HTML>\n<HEAD>\n<TITLE>Your Search results</TITLE></HEAD>\n";
> print "<BODY><CENTER><H1>Your Search Results</H1></CENTER>\n<HR><P>\n";
> print "The following documents contain the word:
<B>$FORM{key}</B>\n<P>\n";
>
>
> print "<UL>\n";
> print "Hello World";
>
> foreach $name (@doclist){
>
> print "<LI><a href=\"$name\">$name</a>\n";
>
> }
> print "</UL>\n";
> print "</BODY>\n</HTML>\n";
>
>
>
>
>




------------------------------

Date: Thu, 25 Mar 1999 10:29:36 GMT
From: "Sheila  Eugenio" <seugenio@man.amis.com>
Subject: index contents of text files to corresponding html files
Message-Id: <01be76aa$541e6ab0$2bbe10ac@amipnet>

Hi everyone!
	I apologize for the long posting. I am having trouble with this code. What
I want to do is index from the contents of text files in a directory to
corresponding HTML files in another directory. So if I have back.txt, all
of its contents will appear in back.htm.

I am encountering the ff problems:
	1. The contents of the previous files are indexed to the succeeding files
so that the last file, toas.txt, has the largest size!
	2. I cannot change the HTML filename so that it will trim the .txt ending,
like so, back.txt.htm instead of back.htm. I have tried using chomp but to
no avail. 

Forgive me, I am just starting with Perl. Thank you for all your help! 
*********************************

$html_dir = 'F:/actl/html';

$date = localtime(time);

opendir (DIR, "E:/inet/actlspec") or die "Cannot open directory: $!\n";
@filenames = sort readdir(DIR);

foreach $file (@filenames) 
{
	
	if ($file
=~/(^assy|back|fras|frnt|mbxs|mdbkd|mdbkw|pdie|slow|sort|toas)\.txt/i)
#####  files ending in .txt
			
	{ 
		
		open (INFILE, "E:/inet/actlspec/$file") or die "No $file file: $!\n";
		print ("Parsing $file file\n");
		
		while ($line = <INFILE>) 
		{
			if (($line =~/^Q-/) || ($line=~/^T-/) || ($line =~/^S-/) || ($line
=~/^V-/))
			{			
				$stage	  = substr($line, 0,  10);
				$partid   = substr($line, 11, 16);
				$lotid    = substr($line, 28, 12);
				$lotstate = substr($line, 41,  6);
				$location = substr($line, 48, 10);
				$curmainq = substr($line, 78,  6);
				$cursubq  = substr($line, 86,  6);
				$curmainm = substr($line, 93,  2);
				$cursubm  = substr($line, 96,  2);
				$age 	  = substr($line,100,  6);
				$stagetime= substr($line,107,  9);	
				 	
				if ($cursubm == "{O") {$cursubm =~tr/\{O/ /;}
	
				@part1 = ($stage,$partid,$lotid,$lotstate,$location,$curmainq,
$curmainm, $cursubq, $cursubm, $age,$stagetime);
				
				$part1 = join(" ",@part1);	

				$actl{$inv} = $part1 . "\n";
				
open (HTML, ">$html_dir/$file.htm");
print HTML "
<HTML>
<HEAD>
<TITLE>PROMIS Inventory for $file</TITLE>
</HEAD>
<BODY bgcolor=\"FFFFFF\">
<H3>PROMIS Inventory for $file Location</H3>
<H5>As of $date, Manila</H5>
<hr>
<pre>
                                         LOT                  MAIN      SUB
      STAGE
STAGE      PARTID           LOTID       STATE   LOCATION      QTY MT    QTY
MT   AGE  STARTTIME 
";                                                                         
                                    


print HTML $actl{$inv};

print HTML '

</pre>
<HR>
</BODY>
</HTML>
';

close (HTML);
		
			}
		}
	}
}

closedir (DIR);


------------------------------

Date: Thu, 25 Mar 1999 13:42:44 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: index contents of text files to corresponding html files
Message-Id: <36FA2F44.95186372@datenrevision.de>

Sheila Eugenio wrote:
> 
> Hi everyone!
>         I apologize for the long posting. I am having trouble with this code. What
> I want to do is index from the contents of text files in a directory to
> corresponding HTML files in another directory. So if I have back.txt, all
> of its contents will appear in back.htm.
> 
> I am encountering the ff problems:
>         1. The contents of the previous files are indexed to the succeeding files
> so that the last file, toas.txt, has the largest size!

I don't know why this would happen. Your code doesn't look to me as if
that would be the case.

>         2. I cannot change the HTML filename so that it will trim the .txt ending,
> like so, back.txt.htm instead of back.htm. I have tried using chomp but to
> no avail.

chomp just deletes stuff which is equal to $/ (by default: "\n"); it
doesn't delete arbitrary characters. chop always deletes the last
character, regardless of what it is, but this is probably not what you
want to use here.

    ($htmlfile = $file) =~ s/\.txt$/.htm/;

should do what you want -- replace .txt by .htm.

> opendir (DIR, "E:/inet/actlspec") or die "Cannot open directory: $!\n";
> @filenames = sort readdir(DIR);
> 
> foreach $file (@filenames)
> {
> 
>         if ($file
> =~/(^assy|back|fras|frnt|mbxs|mdbkd|mdbkw|pdie|slow|sort|toas)\.txt/i)
> #####  files ending in .txt

You could probably do the readdir and matching in one line. Plus the ^
needs to be in front of the brackets, not inside them.

    @filenames = sort(grep /^(assy| ... |toas)\.txt$/i, readdir DIR);

>                         if (($line =~/^Q-/) || ($line=~/^T-/) || ($line =~/^S-/) || ($line
> =~/^V-/))

                          if ($line =~ /^[QTSV]-/)

is probably quicker (minor point)

>                                 $stage    = substr($line, 0,  10);
[etc.]

You may wish to look into unpack() for something like this. (perldoc -f
unpack).

> open (HTML, ">$html_dir/$file.htm");

see above for an example of how to change .txt into .htm


------------------------------

Date: Thu, 25 Mar 1999 12:49:34 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: New Bee Alert
Message-Id: <36FA22CE.26791886@datenrevision.de>

William H. Asquith wrote:
> 
> Also if($_ eq "\n") is a preferred idiom instead of if($_ eq \n)

What do you mean by "preferred idiom"? Does the second variant work? It
seems to take a reference to something called 'n' (a file handle
maybe?); I don't think it has much to do with the end-of-line value. The
first variant is not "preferred", it's "correct".

Cheers,
Philip


------------------------------

Date: Thu, 25 Mar 1999 09:25:37 GMT
From: jas888@my-dejanews.com
Subject: Re: newbe: to find the highest entry in group
Message-Id: <7dcvea$2r$1@nnrp1.dejanews.com>

Hi Vincent,

The scripts works for me...

Thanks a lot !

In article <7dausd$6t3$1@client2.news.psi.net>,
  "Vincent P. Mautone" <vince@oxxfordinfo.com> wrote:
> Jason,
>
> Try the following(should work with any number of entries as long as comma
> separated). Program worked with ActiveState. Good luck.
>
> Vince
>
> # Assume entries in file 'things'
> open(fpInput,"things") or die("Unable to open things");
>
> %hThings = ();
>
> while( $line = <fpInput>)
> {
> 	chop($line);
> 	# get the left side and right side of comma using split
> 	@aTokens = split(",",$line);
> 	if( !exists($hThings{$aTokens[0]}) )
> 	{
> 	# Here we have not seen the left side before
> 	$hThings{$aTokens[0]} = $aTokens[1];
> 	}
> 	else
> 	{
> 	# here we have seen the left side before
> 	if( $hThings{$aTokens[0]} < $aTokens[1] )
> 		{
> 		$hThings{$aTokens[0]} = $aTokens[1];
> 		}
> 	}
>
> }
>
> # print out results
> foreach $key (keys %hThings)
> {
> 	print "$key,$hThings{$key}\n";
> }
>

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


------------------------------

Date: Thu, 25 Mar 1999 12:59:45 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
To: painter@Cybernex.Net
Subject: Re: Not possible in Perl??
Message-Id: <36FA2531.14B3A697@datenrevision.de>

Joe wrote:
> 
> [our email address is 'painter2000@Cybernex.Net' but WITHOUT
>  the numbers and with all letters lowercase. Very sorry about
>  that but I am trying to avoid all those spammers.]

AFAIK domain names are not case-sensitive. Cybernex.Net and cybernex.net
(and even cYbeRNeX.nEt) are the same. This bit is a completely useless
spam-trap. Local-parts (the bit before the @) can by case-sensitive, but
often are not (it's up to the system, though).

Cheers,
Philip

P.S. I am sending this to your address with capital 'C' and 'N' -- it
should make it anyway.


------------------------------

Date: Thu, 25 Mar 1999 10:10:57 +0100
From: "Marcel Lemmen" <lemmen@support.nl>
Subject: Output to a new HTML file.
Message-Id: <7dcugm$gtg$1@news.news-service.com>

Hi all,

I know, this is a simple question, but I can't find the awnser (yet).
I made a script which reads something from a form (the form is created by
the script) and then shows the output to the same html file.
I wan't the output to a new html file, how can I do that?

Thnx in advance,

--

---------------------------------------
Marcel Lemmen

Support Net B.V.
Kruislaan 419
1098 VA AMSTERDAM
tel: (+31) 20 - 6935454
fax: (+31) 20 - 6886166
e-mail: lemmen@support.nl
Internet: www.support.nl




------------------------------

Date: Thu, 25 Mar 1999 12:50:45 +0100
From: William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de>
To: Neil Prater <neil.prater@ype.gmpt.gmeds.com>
Subject: Re: Perl processes
Message-Id: <36FA2315.2781E494@ks.sel.alcatel.de>

Neil Prater wrote:
> 
> I have a perl program running from the netscape command action line inside
> my index.html file. Inside my perl program I
> run a few unix commands. When the submit button is clicked, the perl program
> executes but will not go forth until the unix
> command is dead. Is there any way to fork the process within perl? If so
> how? Any help would be greatly appreciated.

Forking to a new process is easy enough. Try
   perldoc ipc
   perldoc -f fork
   perldoc -f exec

There seems to a gotcha, though, that causes the symptoms you describe.
I ran
into it myself. It seems that perl will not DESTROY a filehandle while a
pipe
is still connected to a running process. This DESTROY can happen
unexpectedly
if the variable holding the filehandle is localized. The code below
starts up
several children and they all do something trivial (sleep) and then
exit. The
@fh array is local to the for loop and is cleared every time through.
Without
the assignment to the persistent @fgh, the for loop stalls at the my
until it
can DESTROY the FileHandle - running the processes serially instead of
in the
expected parallel fashion.

__CODE__

#!/tools/gnu/bin/perl5 -w
use strict;

use FileHandle;

my $j = 0;
my @fhg;

for ( my $i=1; $i<5; $i++) {
    my @fh;
    $j = $i;                                # without this, the open
waits
    $fhg[$j] = $fh[$i] = new FileHandle;    # without $fhg[$j]=, open
waits

    my $pid = open( $fh[$i], "-|");         # start the child process
    next unless (defined $pid);

    if ($pid == 0){                                         # child
        $SIG{ALRM} = sub { die "Oops, pid $$ has bad plumbing" };
	open OUTPUT, '>/dev/tty';           # hack a path to terminal
	printf OUTPUT "%02d:%02d:%02d: new process %d online (number %d)\n",
	(gmtime)[reverse 0..2], $$, $i;
	sleep 60;                           # or exec, or whatever
	exit(0);
    }
    else {                                                   # parent
	printf "%02d:%02d:%02d: child %d started with pipe on fd(%d)\n",
	(gmtime)[reverse 0..2], $pid, fileno($fh[$i]);
	for my $k (1..$i) { print " \$fh[$k]=", $fh[$k]  if defined $fh[$k] }; 
print "\n";
	for my $k (0..$j) { print " \$fhg[$k]=", $fhg[$k] if defined $fhg[$k]
}; print "\n";
    }
};


until (-1 == (my $zombie = wait)) { print "exit: $zombie was dead\n" };

__END__

 ...hope that helps ;-)
---
Wm Blasius
Stuttgart
-- 
 ...now I'm <wm.blasius@ks.sel.alcatel.de> - no matter what my mail
server says!


------------------------------

Date: Thu, 25 Mar 1999 12:28:16 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: Premature end of script headers
Message-Id: <36fa2a4e.12511342@news.dircon.co.uk>

On Thu, 25 Mar 1999 08:31:01 GMT, solidice@my-dejanews.com wrote:

>I'm trying to get this guestbook CGI script to work. I've put the script in
>it's own directory called guestbook along with the .htm files and images.
>I've chmod 755 guest.cgi the script. Then went to the add.htm so I could see
>if it would work. I get a 500 Internal Server Error saying this
>
<etc etc etc>

>

>
>So if anyone can give me some ideas. I'd appreciate it. I have no clue what
>I'm really doing.
>

No we have no clue what you're really doing either - Unfortunately
we've had to curtail our research into remote debugging after the
government withdrew our funding - apparently they were concerned about
one particular experiment where subjects were locked in a darkened
room without a computer and attempted to alter hundreds of CGI
programs to use CGI.pm by the power of their minds alone.

/J\


------------------------------

Date: Thu, 25 Mar 1999 08:54:27 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: RegExp problem, can't see wood for trees
Message-Id: <F957Er.FHB@csc.liv.ac.uk>

In article <m92bd7.a63.ln@magna.metronet.com>,
tadmc@metronet.com (Tad McClellan) writes:
> I.J. Garlick (ijg@csc.liv.ac.uk) wrote:
> 
>: Any way here goes, have tried the following
>: 	$name =~ /name="?([^"]+)/i;
>: 	$fn   = $1;
>: and
>: 	($fn = $name) =~ /^.*name="?(.+)"?.*$/$1/i;
> 
>: with the first I get a " on the end of $1 sometimes, but not others.
> 
> 
>    I don't believe you there.
> 
>    Please post a bit of code that does that.

Hmmmm, that's what confused me I was sure it would work as well, and why
I posted the question. I will agree with you I can't get it to happen now,
I must have had the code slightly different (did try an awful lot of
combinations yesterday)

> 
> 
>: The second one works sometimes 
> 
> 
>    I don't believe you there either, since it doesn't even compile...
> 

Drat I knew I should have cut and pasted it, but no I thought "don't be mad
you have typed/read that line so many times how can you possibly get it
wrong".

Ok lesson learnt.

>    You should never try and type code into a posting, use cut/paste,
>    else you'll just get a bunch of comments about the typos instead
>    of about your real problem.

> 
> while (<DATA>) {
>    while ( /name=("[^"]+|[^; \n]+)/g ) {
>       ($fn = $1) =~ s/^"//;
>       print "found '$fn'\n";
>    }
> }
> 

Thanks Tad. Just shows how blinkered you can get though, didn't even think
of trying to remove the " afterwards, I just kept trying for the single
line regexp.

-- 
Ian J. Garlick
ijg@csc.liv.ac.uk

A lack of leadership is no substitute for inaction.


------------------------------

Date: Thu, 25 Mar 1999 09:02:48 GMT
From: ijg@csc.liv.ac.uk (I.J. Garlick)
Subject: Re: RegExp problem, can't see wood for trees
Message-Id: <F957so.G2q@csc.liv.ac.uk>

In article <F93yIq.45u@csc.liv.ac.uk>,
ijg@csc.liv.ac.uk (I.J. Garlick) writes:

Thanks to all those who replied (by email as well). I knew it was going to
be easy to solve I just couldn't see it.

I now have a couple of them under test with the production version of the
code.

To all those who say I couldn't have got what I did with what I posted, I
appologise, you are right. I did get the problem as posted, I just can't
find the code that did produce it, which is nearly as frustrating as the
original problem.

Again thanks to all, and I am going to blame temporary insanity for not
being able to see something as obvious as the solution is.

-- 
Ian J. Garlick
ijg@csc.liv.ac.uk

"To vacillate or not to vacillate, that is the question ... or is it?"



------------------------------

Date: Thu, 25 Mar 1999 09:53:35 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: regular expression
Message-Id: <36fa06b6.419627@news.skynet.be>

Bob Trieger wrote:

>print HH map { s/brown/red/g } <FH>;

That will print '1' or '' for every line, depending on if the
replacement succeeded, or not. Is that what's really wanted? I guess
not. Though the original script did pretty much the same.

	print HH  map { s/brown/red/g; $_ } <FH>;

As for the original question:

>while (defined($inline = <FH>)){
Reading into $inline

>   $value = s/brown/red/g;

Substituting in $_ ! This is the cause of the warnings.

>   select HH; # and write record

You don't need to do this every time...

>   print "$value \n";

Printing '1' or '', for success of failure. Hmm...

>}

	Bart.


------------------------------

Date: Thu, 25 Mar 1999 11:49:39 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: Remove HTML codes
Message-Id: <36fa2250.10464945@news.dircon.co.uk>

On Wed, 24 Mar 1999 17:37:45 -0500, "tavi" <tavi367@ibm.net> wrote:

>
>Michael Rau wrote in message <7d03pe$as8$1@surz18.HRZ.Uni-Marburg.DE>...
>>Rollo Chan Ka Chun schrieb in Nachricht ...
>>>Sorry that I can't use the HTML::Filter. Any other method?...Thanks...
>>
>>
>>Use STRIPHTML.PL (by t.christiansen).
>>I can mail it to you. Just give me a sign if you want to.
>

striphtml can be found at :


<http://www.perl.com/CPAN/authors/Tom_Christiansen/scripts/striphtml.gz>

But you still really want to be using one of the modules related to
HTML::Parser in the end of the day ...

/J\


------------------------------

Date: Thu, 25 Mar 1999 09:14:10 GMT
From: Michael Douglass <mikedoug@texas.net>
Subject: threaded perl
Message-Id: <C7nK2.93$FV2.467851@news1.giganews.com>

Any new word on threads under perl?  I've tried perls under 5.005_02
on my Solaris 2.6 box and I can core dump it with just a test script
that starts up X threads and has them each spit out numbers while they
sleep random amounts of time.

-- 
Michael Douglass
Texas Networking, Inc.

  Any sufficiently advanced bug is indistinguishable for a feature.
    -- from some indian guy


------------------------------

Date: Thu, 25 Mar 1999 06:44:21 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: Tk extensions for PERL on WinNT
Message-Id: <36F9DB45.E7279A65@patriot.net>

I use ActiveState's Perl...I got the Tk stuff from:

http://www.activestate.com/packages/zips

Ramanujam Parthasarathi wrote:

> Hi,
>
> Where can I get the binary for TK extension to PERL for WinNT platform?
> Right now I'm developing a PERL-TK application on UNIX(Solaris). I would
> like to see if its portable on to NT.
>
> Thanks,
> Partha





------------------------------

Date: Thu, 25 Mar 1999 12:21:57 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Values of 'true' and 'false'?
Message-Id: <36FA1C55.B443EF60@datenrevision.de>

Larry Rosler wrote:
> 
> Of course.  But as I read the question, he wants to do further
> manipulation on the value returned by a Boolean operator.

Sort of. Basically, I wanted to put the value returned by a Boolean
operator into a variable and make sure it was a meaningful value. But
manipulation might have come along at one point or another, too.

> The Camel says (p. 87): 'These operators return 1 for true, and "" for
> false.'

Ah.

Thanks for your answers, everyone.

Cheers,
Philip


------------------------------

Date: Thu, 25 Mar 1999 11:56:48 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Way to find out if a regex matched?
Message-Id: <36FA1670.B1BB6F1A@datenrevision.de>

I have a regex in a module to calculate die rolls. I'm not sure how to
satisfy both of the following simultaneously: (1) I want to assign $1 ..
$4 from capturing parens, and (2) I want to see whether the regex
matched at all (and return undef if not). At the moment I have code like
this:

    $line =~ m{ (some (regex) with (capturing parens)) }x;
    return undef if not defined $+;

This works for me -- the =~ m// causes $1 .. $4 to be filled with the
appropriate values (or undef, if that subexpression didn't match) if the
whole expression matches, and $+ is then the contents of $4. If the
whole expression doesn't match, $+ is undef, so I can test 'defined $+'
if I want to know whether the whole expression matches.

I suppose I could also test whether the whole expression matches using
something like

    return undef unless $line =~ m{ bla bla }x;

but I am not sure whether this will fill in $1 .. $4. So for now, I am
using the way I described above, which seems to work.

Is there a way to get both of my goals at once? Thanks in advance for
your help.

Cheers,
Philip


------------------------------

Date: Thu, 25 Mar 1999 12:19:08 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: Way to find out if a regex matched?
Message-Id: <36fa296f.12287683@news.dircon.co.uk>

On Thu, 25 Mar 1999 11:56:48 +0100, Philip Newton
<Philip.Newton@datenrevision.de> wrote:

>I have a regex in a module to calculate die rolls. I'm not sure how to
>satisfy both of the following simultaneously: (1) I want to assign $1 ..
>$4 from capturing parens, and (2) I want to see whether the regex
>matched at all (and return undef if not). At the moment I have code like
>this:
>
>    $line =~ m{ (some (regex) with (capturing parens)) }x;
>    return undef if not defined $+;
>

Why not :

if ($line =~ m{ (some (regex) with (capturing parens)) }x)
  {
    # do some stuff with $1 etc 
  }
else
  {
    # no match
  }

?

/J\


------------------------------

Date: 25 Mar 1999 10:13:54 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: What to use for X gui?
Message-Id: <922356872.8860@thrush.omix.com>

Rodney Clang <rclang@rclangtos.lewan.com> wrote:
: Is there anyone doing X apps in Perl out there? I am attempting Tk and all
: looks OK so far, ...  but I keep seeing references to PerlQT and Perl
: XForms and have no clue (obviously). My users are Linux workstations with 
: KDE as desktop. That's primarily why I'm interested in the benefits of
: PerlQT.   I make nothing out of the FAQ or anything else as far as reasons,
: features, and what-to-use-where when writing X applications.
:
: What is being used???

	Most GUI Perl is currently done using Tk.  See comp.lang.perl.tk.

	There is also some movement in the Gtk area, with a fair number of
	modules already avaliable.  It's a moving target however and so may
	break from release to release.  I wouldn't use it for production
	code yet.

	I haven't seen PerlQt yet, but I'd be *really* interested in it.
	-Frankly, I like working in Tk but *hate* the look. :-/

-- 
-Zenin (zenin@archive.rhps.org)

        Yah, Emacs is a good OS, but I prefer FreeBSD.


------------------------------

Date: Thu, 25 Mar 1999 12:27:28 +0100
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: What to use instead of rename
Message-Id: <36FA1DA0.37E6307B@datenrevision.de>

Eric Williams wrote:
> 
> I am writing a script that sorts files based on part of the filename,
> and moves the file across filesystems. rename doesn't seem to work
> across filesystems.
> 
> I did try File::copy but that didn't seem to work either, and I would
> have to unlink the file after the copy.

File::Copy (capital 'C') also exports a function move().

Cheers,
Philip


------------------------------

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 5223
**************************************

home help back first fref pref prev next nref lref last post