[18423] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 591 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Mar 29 18:26:43 2001

Date: Thu, 29 Mar 2001 15:26:01 -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: <985908360-v10-i591@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 29 Mar 2001     Volume: 10 Number: 591

Today's topics:
    Re: Search x keywords in a string ? <bart.lateur@skynet.be>
    Re: Search x keywords in a string ? (MAC)
    Re: Search x keywords in a string ? (Philip Lees)
    Re: Search x keywords in a string ? (Tad McClellan)
        SIGCHLD handler is installed, but never called (Stefan Haller)
        Spaces <Waarddebon@chello.nl>
    Re: Spaces <krahnj@acm.org>
    Re: Spaces <peb@bms.umist.ac.uk>
    Re: Spaces <wyzelli@yahoo.com>
    Re: Spaces (Tad McClellan)
        splitting <no_spam@nospam.com>
    Re: splitting <wyzelli@yahoo.com>
    Re: stat() or 'real' filesize of a file in an iso-files (Anno Siegel)
    Re: stat() or 'real' filesize of a file in an iso-files <pilsl_@goldfisch.at>
        Stripping path info from a filename <rhugga@yahoo.com>
    Re: Stripping path info from a filename <vmurphy@Cisco.Com>
    Re: Stripping path info from a filename <tinamue@zedat.fu-berlin.de>
    Re: Stripping path info from a filename <hillr@ugs.com>
    Re: This does not work but documentation says it should <bart.lateur@skynet.be>
    Re: This does not work but documentation says it should <uri@sysarch.com>
        topmind - Appologies if this is off topic <NOtwiner@atcableinet.you'llco.seeuk>
    Re: topmind - Appologies if this is off topic (Gary O'Keefe)
    Re: topmind - Appologies if this is off topic (Gary O'Keefe)
    Re: Using Sunfreeware's perl in place of Sun's perl (Abigail)
    Re: Using Sunfreeware's perl in place of Sun's perl <kjetilho@haey.ifi.uio.no>
    Re: where can i get Perl 4 <kstep@pepsdesign.com>
    Re: where can i get Perl 4 <kiwitter@qns.de>
    Re: where can i get Perl 4 <lauren_smith13@hotmail.com>
        why wont this work? <mail@ericmarques.net>
    Re: why wont this work? <wyzelli@yahoo.com>
    Re: Wierd new response to old CGI script <ruhl@realrates.com>
        Won't Grep Recursively (BUCK NAKED1)
    Re: Won't Grep Recursively (Anno Siegel)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Thu, 29 Mar 2001 19:05:55 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Search x keywords in a string ?
Message-Id: <um17ct85cffhokp36rgnjbagev0rdl42o4@4ax.com>

MAC wrote:

>Enter ONE or a unknown amount of keywords in a field, and compare these 
>keywords against a string. Print this string if ALL keywords are inside. 
>Tried somethings, but below is some code that will print the lines if ONE of 
>the keywords are inside, i want ALL (AND) of them in the line and only THEN 
>print the line

Here's one possible solution, and not a bad one, speedwise.

	my @search = $FORM{'keywords'} =~ /(\w+)/;
	my $searchsub = eval 'sub { ' 
	  . join(' && ', map "/$_/", @search) . ' }'
          or die "Whoops: $@";
	while(<>) {
	    print if &$searchsub;
	}

Untested, but I've used the approach before.

-- 
	Bart.


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

Date: Thu, 29 Mar 2001 10:57:34 GMT
From: macv@multiweb.nl (MAC)
Subject: Re: Search x keywords in a string ?
Message-Id: <yyEw6.17372$t9.1730982@news.soneraplaza.nl>

tadmc@augustmail.com (Tad McClellan) wrote in 
<slrn9c5cg0.jrh.tadmc@tadmc26.august.net>:

>MAC <macv@multiweb.nl> wrote:
>>
>>Enter ONE or a unknown amount of keywords in a field, and compare these 
>>keywords against a string. Print this string if ALL keywords are inside. 

Thanks for the reply, but in my original example, it shows all lines if ONE 
of the keywords are found. I need an example that ONLY shows the line if 
ALL of the keywords are in that line. This could be a pattern also so:


1:THis is a SAMple line of code in the year 2001
2:This is a SAMple line of nothing in the year 2001

Keywords: "samp" "code"

So: this example WILL show LINE 1 cause it has BOTH the keywords in it via 
pattern matching.LINE 2 isn't a full match and it will not be shown.

How to dothis ?


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

Date: Thu, 29 Mar 2001 11:49:31 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: Search x keywords in a string ?
Message-Id: <3ac31d8f.78970944@news.grnet.gr>

On Thu, 29 Mar 2001 10:57:34 GMT, macv@multiweb.nl (MAC) wrote:

>>MAC <macv@multiweb.nl> wrote:
>
>Thanks for the reply, but in my original example, it shows all lines if ONE 
>of the keywords are found. I need an example that ONLY shows the line if 
>ALL of the keywords are in that line. This could be a pattern also so:
>
>1:THis is a SAMple line of code in the year 2001
>2:This is a SAMple line of nothing in the year 2001
>
>Keywords: "samp" "code"
>
>So: this example WILL show LINE 1 cause it has BOTH the keywords in it via 
>pattern matching.LINE 2 isn't a full match and it will not be shown.

I think you're approaching this backwards. Look at it this way: the
match should fail if ANY of the keywords is NOT found. Taking your
example, the following code appears to do what you want. It also has
the advantage that if one keyword is not found, it doesn't waste time
checking for the others. (I know this could be made shorter, but at
the expense of clarity.)

my $input = 'samp code';
my @keywords = split/\s+/, $input;

while (<DATA>){
	my $missing = 0;
	chomp;
	my $line = $_;
	foreach ( @keywords ){
		unless( $line =~ /$_/i ){
			$missing++;
			last;
		}
	}
	
	if ( $missing ){
		print "Didn't find all the keywords\n";
	}else{
		print "$line\n";
	}
}

__DATA__
1:THis is a SAMple line of code in the year 2001
2:This is a SAMple line of nothing in the year 2001

Phil
--
@x=split//,'Just another Perl decoder,';split//,'*'x@x;%i=split/=/,
'AA=a=aa= =1=,';for$i(0..$#x){$_[$i]=chr($=+5);while($_[$i]ne$x[$i])
{$_[$i]=$i{$_[$i]}if$i{++$_[$i]};print@_,"\r";while(rand!=rand){}}}
Ignore coming events if you wish to send me e-mail


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

Date: Thu, 29 Mar 2001 07:10:41 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Search x keywords in a string ?
Message-Id: <slrn9c69i1.la5.tadmc@tadmc26.august.net>

MAC <macv@multiweb.nl> wrote:
>tadmc@augustmail.com (Tad McClellan) wrote in 
><slrn9c5cg0.jrh.tadmc@tadmc26.august.net>:
>
>>MAC <macv@multiweb.nl> wrote:
>>>
>>>Enter ONE or a unknown amount of keywords in a field, and compare these 
>>>keywords against a string. Print this string if ALL keywords are inside. 
>
>Thanks for the reply, 


You're welcome.


>but in my original example, it shows all lines if ONE 
>of the keywords are found. 


Yes, I understood that.


>I need an example that ONLY shows the line if 
>ALL of the keywords are in that line. 


I _gave_ you an example that only shows the line if all of the
keywords are in that line.

Did you try it?


>This could be a pattern also so:
>
>1:THis is a SAMple line of code in the year 2001
>2:This is a SAMple line of nothing in the year 2001
>
>Keywords: "samp" "code"
>
>So: this example WILL show LINE 1 cause it has BOTH the keywords in it via 
>pattern matching.LINE 2 isn't a full match and it will not be shown.
>
>How to dothis ?


The way I showed you is one way.

Did you try it?

I have already answered your question. If you don't understand the
answer then ask a question about the answer, don't just repeat
the original question.

I have already given you what you asked for. What else is it that
you want?


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: 29 Mar 2001 15:42:48 +0100
From: hals@babylon.icemark.ch (Stefan Haller)
Subject: SIGCHLD handler is installed, but never called
Message-Id: <slrn9c6doc.3e6.hals@babylon.icemark.ch>

Hi Everybody

I have some trouble with the SIGCHLD signal handler.

I got the following snipped of code:

sub sig_term {
	my $signame = shift;
	$RUNNING = 0;
}

sub sig_chld {
	my $signame = shift;
	my $pid = -1;
	do {
		my $pid = waitpid(-1, &WNOHANG);
		$CHILDREN_SEM->op(0, 1, 0) unless $pid == -1;
		# loathe sysV: it makes us not only reinstate
		# the handler, but place it after the wait
		$SIG{CHLD} = \&sig_chld;
	} until $pid == -1;
}

$SIG{TERM} = \&sig_term;
$SIG{CHLD} = \&sig_chld;

 ...do some forking

I previously used simpler handlers and after consulting the various Perl
doc sources, I somehow merged them all together into above result.
The problem is, that the SIGCHLD handler is never called if a child quits.
It is not called if I do a kill -18 <proc> manually, too.
If I send a SIGTERM, the sig_term sub is executed as expected.

$CHILDREN_SEM is a semaphore which I use to control the number of parallel
child processes running.

Does anybody know why my TERM handler works and my CHLD handler doesn't.

I'm working on Solaris 8 using Perl 5.6.0 which I compiled myself:
$ perl --version
This is perl, v5.6.0 built for sun4-solaris
$ uname -a
SunOS blade 5.8 Generic_108528-05 sun4u sparc SUNW,Sun-Blade-1000

Thanks for any help or hints.

With kind regards,
 Stefan Haller, hals@mountpoint.ch


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

Date: Thu, 29 Mar 2001 05:17:40 GMT
From: "Waarddebon" <Waarddebon@chello.nl>
Subject: Spaces
Message-Id: <Uzzw6.24562$j_4.375914@Flipper>

I've got in a variable called $x a numeric value.
lets say 4. And in an other variable called $y, I've got a random value,
always higher then 10. And
a variable called $z which contains a random number.


I want to decrease the value of $y with the value of $x. Now I want to put
'the result of $y-$x' times
a space in front of $z.

for example

$x="8";$y="14";$z="99"
will have as output:
$z="      99";
(6 spaces in front of 99)

How can I do this ?




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

Date: Thu, 29 Mar 2001 08:11:08 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Spaces
Message-Id: <3AC2EFB2.BF0C835C@acm.org>

Waarddebon wrote:
> 
> I've got in a variable called $x a numeric value.
> lets say 4.

my $x = 4;


> And in an other variable called $y, I've got a random value,
> always higher then 10.

my $y = rand( 1_000 ) + 11;


> And a variable called $z which contains a random number.

my $z = rand 1_000_000;


> I want to decrease the value of $y with the value of $x. Now I want to put
> 'the result of $y-$x' times
> a space in front of $z.

$y -= $x;
$z = ' ' x $y . $z;


> for example
> 
> $x="8";$y="14";$z="99"
     ^ ^    ^  ^    ^  ^
You don't need quotes around numbers.


> will have as output:
> $z="      99";
> (6 spaces in front of 99)

$z = ' ' x 6 . 99;



John
-- 
use Perl;
program
fulfillment


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

Date: Thu, 29 Mar 2001 09:24:40 +0100
From: Paul Boardman <peb@bms.umist.ac.uk>
Subject: Re: Spaces
Message-Id: <3AC2F148.949B3C72@bms.umist.ac.uk>

Waarddebon wrote:
> 
> I've got in a variable called $x a numeric value.
> lets say 4. And in an other variable called $y, I've got a random value,
> always higher then 10. And
> a variable called $z which contains a random number.
> 
> I want to decrease the value of $y with the value of $x. Now I want to put
> 'the result of $y-$x' times
> a space in front of $z.
> 
> for example
> 
> $x="8";$y="14";$z="99"
> will have as output:
> $z="      99";
> (6 spaces in front of 99)
> 
> How can I do this ?


$n = $y - $x;
$z = (" " x $n).$z;

Paul


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

Date: Thu, 29 Mar 2001 15:11:38 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Spaces
Message-Id: <zJzw6.31$US1.5996@vic.nntp.telstra.net>

"Waarddebon" <Waarddebon@chello.nl> wrote in message
news:Uzzw6.24562$j_4.375914@Flipper...
> I've got in a variable called $x a numeric value.
> lets say 4. And in an other variable called $y, I've got a random
value,
> always higher then 10. And
> a variable called $z which contains a random number.
>
>
> I want to decrease the value of $y with the value of $x. Now I want to
put
> 'the result of $y-$x' times
> a space in front of $z.
>
> for example
>
> $x="8";$y="14";$z="99"
> will have as output:
> $z="      99";
> (6 spaces in front of 99)
>
> How can I do this ?

$z = ' ' x ($y - $x). $z;


Look up the x operator in perlop under multipicative operators

Wyzelli
--
($a,$b,$w,$t)=(' bottle',' of beer',' on the wall','Take one down, pass
it around');
for(reverse(1..100)){$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n$_$a$s$b\n$t\n";
$_--;$s=($_!=1)?'s':'';$c.="$_$a$s$b$w\n\n";}print"$c*hic*";






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

Date: Thu, 29 Mar 2001 08:12:46 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Spaces
Message-Id: <slrn9c6d6e.la5.tadmc@tadmc26.august.net>

John W. Krahn <krahnj@acm.org> wrote:
>Waarddebon wrote:

>> $x="8";$y="14";$z="99"
>     ^ ^    ^  ^    ^  ^
>You don't need quotes around numbers.


Right.

If you do put the quotes, then they are NOT numbers, they are strings.

[ So the OP was treating strings as numbers, relying on DWIM. Much
  better to indicate to the maintenance programmer that you _intend_
  for them to be numbers.
]


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 29 Mar 2001 02:34:41 GMT
From: Borgy <no_spam@nospam.com>
Subject: splitting
Message-Id: <3AC29F30.E49F2C40@nospam.com>

This is driving me crazy. I need to split up a cookie and write it to a
file that is in this format:

1:17.99:Rolling Stones CD 1:19.99:Deep Purple CD

The annoying thing is that there is a space after the the pattern 'CD'
instead of a line break or a colon delimeter. How can I split it up so
that it writes to a file llike so:

1:17.99:Rolling Stones CD
1:19.99:Deep Purple CD

Any help would be appreciated. Please post to group.. thanks Borgy :-)

Here is what I have:
---------------

if (&GetCookies('mycart')) {

$viewcookie = "$Cookies{'mycart'}";
$tobeadded = $viewcookie;
@array = split(/\|/, $viewcookie);

$RemoveNumber=0;

open(file, "> temp.txt");
foreach $array (@array) {
 ($quantity, $price, $item) = split(/:/ , $array);
  print file("$quantity $item $price\n");   # < -does NOT work... ie
won't print to file???
  print "$quantity $item $price<br>";   # <- prints to browser just fine


open(file, "> temp.txt");
  print file ("@array\n");
  close (file);

$RemoveNumber++;

}}}



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

Date: Thu, 29 Mar 2001 15:26:43 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: splitting
Message-Id: <HXzw6.33$US1.6142@vic.nntp.telstra.net>

"Borgy" <no_spam@nospam.com> wrote in message
news:3AC29F30.E49F2C40@nospam.com...
> This is driving me crazy. I need to split up a cookie and write it to
a
> file that is in this format:
>
> 1:17.99:Rolling Stones CD 1:19.99:Deep Purple CD
>
> The annoying thing is that there is a space after the the pattern 'CD'
> instead of a line break or a colon delimeter. How can I split it up so
> that it writes to a file llike so:
>
> 1:17.99:Rolling Stones CD
> 1:19.99:Deep Purple CD
>
> Any help would be appreciated. Please post to group.. thanks Borgy :-)
>
> Here is what I have:
> ---------------
>
> if (&GetCookies('mycart')) {
>
> $viewcookie = "$Cookies{'mycart'}";
> $tobeadded = $viewcookie;
> @array = split(/\|/, $viewcookie);
>
> $RemoveNumber=0;
>
> open(file, "> temp.txt");

open (FILE, '>temp.txt') or die "cannot create file temp.txt : $!";

#By convention filehandles are all uppercase - prevents conflict with
future reserved words, and is easier to read

You check whether the file open succeeded, and if not WHY not ($! is the
error).  Hint... you may not be working where you think you are working,
so maybe you should use a full file path.

> foreach $array (@array) {
>  ($quantity, $price, $item) = split(/:/ , $array);
>   print file("$quantity $item $price\n");   # < -does NOT work... ie
won't print to file???

print FILE "$quantity $item $price\n";

Does the file exist?

>   print "$quantity $item $price<br>";   # <- prints to browser just
fine
>
>
> open(file, "> temp.txt");
>   print file ("@array\n");
>   close (file);
>
> $RemoveNumber++;
>
> }}}

Wyzelli
--
@x='07411711511603209711011111610410111403208010111410803210409709910710
1114'=~/(...)/g;
print chr for @x;




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

Date: 29 Mar 2001 12:21:35 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: stat() or 'real' filesize of a file in an iso-filesystem
Message-Id: <99v9cf$ncl$1@mamenchi.zrz.TU-Berlin.DE>

Gregory Toomey <gtoomey@usa.net> quoted all 60 lines of Chris' article
(including sig), just to add at the top:

> The corollary to this is that if you have a fast algorithm, it is only an
> approximation
> or a 'heuristic'.

Have you read Chris' article?  Understood it?  Realized that NP problems
are not *known* to have a polynomial solution?  And arrived at your
corollary just how?

Jeopardy posting at its best.

Anno

[excessive quote snipped]


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

Date: Thu, 29 Mar 2001 15:55:13 +0200
From: peter pilsl <pilsl_@goldfisch.at>
Subject: Re: stat() or 'real' filesize of a file in an iso-filesystem
Message-Id: <MPG.152d5d2d58b484bb9897d0@news.inode.at>

In article <%Zbw6.4684$45.24172@newsfeeds.bigpond.com>, gtoomey@usa.net 
says...
> The corollary to this is that if you have a fast algorithm, it is only an
> approximation
> or a 'heuristic'.
>

Or if I somebody has a fast algorithm, he has solved a big mathematical 
problem ;)
 
But my algorithm is quite fast and of course not exact, so your corollary 
is no corollary, but a true for my work.

> The time to find an exact solution would at least rise exponentially,
> depending on the number of songs.
> 


I would not spend so much time in this, if it were napster-songs ;)

peter


-- 
pilsl@
goldfisch.at


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

Date: Thu, 29 Mar 2001 11:55:43 -0800
From: Rhugga <rhugga@yahoo.com>
Subject: Stripping path info from a filename
Message-Id: <pn47ctopmqo687e6rk6qc5vnvksbmkcgf1@4ax.com>




What is the easiest way to strip the path leading to a file name,
regardless of how many directories it contins?

ex.

/some/long/path/somefile.txt

I want a variable to contain only somefile.txt

Thanks,
CC


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

Date: 29 Mar 2001 15:16:54 -0500
From: Vinny Murphy <vmurphy@Cisco.Com>
Subject: Re: Stripping path info from a filename
Message-Id: <m34rwcwcsp.fsf@vpnrel.cisco.com>

Rhugga <rhugga@yahoo.com> writes:

> What is the easiest way to strip the path leading to a file name,
> regardless of how many directories it contins?
> 
> ex.
> 
> /some/long/path/somefile.txt
> 
> I want a variable to contain only somefile.txt
> 
From the _Perl Cookbook_

Removing leading path from filename
s(^.*/)()

Thus 
$f="/home/vmurphy/tmp";
print $f, "\n"; 
$f =~ s(^.*/)(); 
print $f, "\n";

gives :

/home/vmurphy/tmp
tmp


You may also want to do a upfront check to see if $f is really a
file by:

if ( -f $f ) { 
    # it's a file - strip leading path
    :
} else {
    # it's not a file
}        

-- 
Vinny


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

Date: 29 Mar 2001 20:20:07 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: Stripping path info from a filename
Message-Id: <9a05dn$2vq7a$2@fu-berlin.de>

hi,
Rhugga <rhugga@yahoo.com> wrote:

> What is the easiest way to strip the path leading to a file name,
> regardless of how many directories it contins?

> ex.

> /some/long/path/somefile.txt

> I want a variable to contain only somefile.txt

perldoc File::Basename:

use File::Basename;
$basename = basename("/some/long/path/somefile.txt");

regards,
tina
-- 
http://tinita.de    \  enter__| |__the___ _ _ ___
tina's moviedatabase \     / _` / _ \/ _ \ '_(_-< of
search & add comments \    \ _,_\ __/\ __/_| /__/ perception
please don't email unless offtopic or followup is set. thanx


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

Date: Thu, 29 Mar 2001 12:12:40 -0800
From: Ron Hill <hillr@ugs.com>
Subject: Re: Stripping path info from a filename
Message-Id: <3AC39738.C677F6C9@ugs.com>

Rhugga wrote:
> 
> What is the easiest way to strip the path leading to a file name,
> regardless of how many directories it contins?
> 
[snipped]

try something like this

use File::Basename;

    ($name,$path,$suffix) = fileparse($fullname,@suffixlist)
    fileparse_set_fstype($os_string);
    $basename = basename($fullname,@suffixlist);
    $dirname = dirname($fullname);

    ($name,$path,$suffix) = fileparse("lib/File/Basename.pm","\.pm");
    fileparse_set_fstype("VMS");
    $basename = basename("lib/File/Basename.pm",".pm");
    $dirname = dirname("lib/File/Basename.pm");


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

Date: Thu, 29 Mar 2001 02:59:01 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: This does not work but documentation says it should
Message-Id: <r695ct0cu6livfvnp386bdqnr3habdq26v@4ax.com>

Uri Guttman wrote:

>for other people who will listen, print takes a dynamic filehandle ONLY
>IN A SINGLE SCALAR VARIABLE. 

Or in a block. Unless I'm very mistaking. No, it's there, right at the
end of "perldoc -f print".

-- 
	Bart.


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

Date: Thu, 29 Mar 2001 04:43:42 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: This does not work but documentation says it should
Message-Id: <x7elvhxk01.fsf@home.sysarch.com>

>>>>> "BL" == Bart Lateur <bart.lateur@skynet.be> writes:

  BL> Uri Guttman wrote:
  >> for other people who will listen, print takes a dynamic filehandle ONLY
  >> IN A SINGLE SCALAR VARIABLE. 

  BL> Or in a block. Unless I'm very mistaking. No, it's there, right at the
  BL> end of "perldoc -f print".

true, that works too. but the OP didn't even read the print docs to see
why his code was not the same as in FileHandle. that was my main point.

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Thu, 29 Mar 2001 13:02:04 GMT
From: "Chris Twiner" <NOtwiner@atcableinet.you'llco.seeuk>
Subject: topmind - Appologies if this is off topic
Message-Id: <gnGw6.3636$ye1.1128623@news2.cableinet.net>

Hi All,

I am sorry if this seems a bit off topic but...

I am a regular poster on comp.object, and for some time now topmind/bryce
jacobs has been making posts on the newsgroup.  I have been lead to beleive
that he was a troll here.

If possible could you please give examples of the way's he trolled here?

The reason I want this is that many of us are getting tired of his commentry
for the sake of conflict.

What did you do, that made him stop posting here?

Whilst I don't wish him to stop posting usefull things (which he has done on
more than one occasion), I'd like to know if there was a way to stop him
harping on about proving one thing better than another.  I found one thread
in google that suggested he'd been doing it for a while here, but I could
not find anymore evidence.

Any help would be greatfully recieved.

Thanks

Chris

NB ( I don't want to start a flame war with him in comp.object, many of us
there (including myself) have tried to reason and he'll have none of it.  I
merely want to show evidence of him doing this elsewhere, rather than the
conjecture that exists about it at present.)




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

Date: Thu, 29 Mar 2001 14:01:36 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: topmind - Appologies if this is off topic
Message-Id: <3ac33a03.277683447@news.gssec.bt.co.uk>

On Thu, 29 Mar 2001 13:02:04 GMT, "Chris Twiner"
<NOtwiner@atcableinet.you'llco.seeuk> wrote:

>Hi All,
>
>I am sorry if this seems a bit off topic but...
>
>I am a regular poster on comp.object, and for some time now topmind/bryce
>jacobs has been making posts on the newsgroup.  I have been lead to beleive
>that he was a troll here.
>
>If possible could you please give examples of the way's he trolled here?

You want us to squeal on him? Did I get you right?

>The reason I want this is that many of us are getting tired of his commentry
>for the sake of conflict.

And it's impossible that he's challenging you in order to: a) keep you
sharp, and b) keep himself sharp (loudmouths tend to check their facts
in order to avoid losing an argument)? Not the most pleasant way to
conduct yourself, but effective sometimes. When I was at university I
was always getting into debates and arguments for the fun of it,
because I knew that the constant challenge offered by other people in
these forums, and the desire to win them, kept driving me to expand my
intellectual horizons.

>What did you do, that made him stop posting here?

Gee whiz. Just killfile the sucker and you never have to hear anything
from him again.

>Whilst I don't wish him to stop posting usefull things (which he has done on
>more than one occasion), I'd like to know if there was a way to stop him
>harping on about proving one thing better than another.  I found one thread
>in google that suggested he'd been doing it for a while here, but I could
>not find anymore evidence.

Ooops. You still want to talk to him, but you'd prefer if he was more
docile and compliant? Short of psychosurgery (e.g a nice lobotomy) I
can't see how you can possibly accomplish that.

How about a regime of positive behavioural reinforcement? Every time
he posts something funny, germaine, and constructive you give him a
pat on the head and a doggy biscuit, and you ignore him every time he
pees on the carpet.

>Any help would be greatfully recieved.

Short of an amendment to the Constitution (or the European Bill of
Human Rights or whatever enumerated bill of rights exists in your
region) to ban free speech for anyone you disagree with I can't see
that anyone can help you. Funnily enough they all pretty much start
with the sentiment that the right to free speech isn't to be
infringed, so you'd be fighting an uphill battle there.

>NB ( I don't want to start a flame war with him in comp.object, many of us
>there (including myself) have tried to reason and he'll have none of it.  I
>merely want to show evidence of him doing this elsewhere, rather than the
>conjecture that exists about it at present.)

We've been over this ground so many times in this group it's not funny
anymore. Any attempts to suppress the trolls are usually so
reprehensible that its the case that the cure is worse that the
disease. Just do what you're mum told you to do and ignore him - he'll
go away.

Or you could ask him for his home address and post him a copy of Dale
Carnegie's "How to Win Friends and Influence People".

Gary
--
Gary O'Keefe
gary@onegoodidea.com
+44 (0) 7976 614 336


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

Date: Thu, 29 Mar 2001 14:47:31 GMT
From: gary@onegoodidea.com (Gary O'Keefe)
Subject: Re: topmind - Appologies if this is off topic
Message-Id: <3ac34a8b.281915302@news.gssec.bt.co.uk>

On Thu, 29 Mar 2001 14:01:36 GMT, gary@onegoodidea.com (Gary O'Keefe)
wrote:

[ a whole load of crap ]

>Or you could ask him for his home address and post him a copy of Dale
>Carnegie's "How to Win Friends and Influence People".

Or just get him to stick it on his Amazon wishlist and pay for it for
him. In case he feels threatened by the implications of giving his
home address out to the world...

Gary
--
Gary O'Keefe
gary@onegoodidea.com
+44 (0) 7976 614 336


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

Date: Thu, 29 Mar 2001 17:22:28 +0000 (UTC)
From: abigail@foad.org (Abigail)
Subject: Re: Using Sunfreeware's perl in place of Sun's perl
Message-Id: <slrn9c6rqk.4bl.abigail@tsathoggua.rlyeh.net>

Kjetil Torgrim Homme (kjetilho@haey.ifi.uio.no) wrote on MMDCCLXVII
September MCMXCIII in <URL:news:1rk858dg5x.fsf@haey.ifi.uio.no>:
^^ 
^^ I guess Michael Wang was too subtle.  If you need to do disaster
^^ recovery and mount the real / as /mnt on the disaster root disk, you
^^ will also mount the real /opt as /mnt/opt to make Perl available.
^^ That won't work with an absolute path.


All my disaster recovery tools start with

    #!/mnt/opt/perl/bin/perl -w



Abigail


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

Date: 29 Mar 2001 12:26:50 +0200
From: Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no>
Subject: Re: Using Sunfreeware's perl in place of Sun's perl
Message-Id: <1rk858dg5x.fsf@haey.ifi.uio.no>

[Kenneth Simpson]

(please don't jumble up the quotes by putting your reply on top)

>   Michael Wang wrote:
>   > The correct way is:
>   > 
>   > # rm /usr/bin/perl
>   > # cd /usr/bin
>   > # ln -s ../../opt/perl/bin/perl perl
>
>   Hi - there are a lot of correct answers. 
>   
>   Note, 
>   
>   	# rm /usr/bin/perl
>   	# cd /usr/bin
>   	# ln -s /opt/perl/bin/perl perl 
>   
>   is also a correct answer.

I guess Michael Wang was too subtle.  If you need to do disaster
recovery and mount the real / as /mnt on the disaster root disk, you
will also mount the real /opt as /mnt/opt to make Perl available.
That won't work with an absolute path.


Kjetil T.



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

Date: Thu, 29 Mar 2001 03:02:11 -0500
From: "Kurt Stephens" <kstep@pepsdesign.com>
Subject: Re: where can i get Perl 4
Message-Id: <99uq7j$ehk$1@slb2.atl.mindspring.net>

"Patrick Kiwitter" <kiwitter@qns.de> wrote in message
news:3AC2E2CE.62C67BEB@qns.de...
> Hi @ all
>
> i want to download perl 4 for red hat linux .. Where can i find it ?
> please give me the absolutly path of the file.

I sincerely hope that you will be using this for historical, educational or
amusement purposes only, and not to install some canned script that actually
uses it.

According to the CPAN site:

This is where we hid the source for perl4, which was superseded by perl5
years ago. We would really much rather that you didn't use it. It is
definitely obsolete and has security and other bugs. And, since it's
unsupported, it will continue to have them.

http://www.perl.com/CPAN-local/src/unsupported/4.036/perl-4.036.tar.gz

This is a source distribution, so you will need to build it yourself.

Kurt Stephens





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

Date: Thu, 29 Mar 2001 10:25:15 +0200
From: Patrick Kiwitter <kiwitter@qns.de>
Subject: Re: where can i get Perl 4
Message-Id: <3AC2F16B.8CA8C74B@qns.de>

Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------968750653D6E6C0EAD311610
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

thx for helpin me !

bye


Kurt Stephens schrieb:

> "Patrick Kiwitter" <kiwitter@qns.de> wrote in message
> news:3AC2E2CE.62C67BEB@qns.de...
> > Hi @ all
> >
> > i want to download perl 4 for red hat linux .. Where can i find it ?
> > please give me the absolutly path of the file.
>
> I sincerely hope that you will be using this for historical, educational or
> amusement purposes only, and not to install some canned script that actually
> uses it.
>
> According to the CPAN site:
>
> This is where we hid the source for perl4, which was superseded by perl5
> years ago. We would really much rather that you didn't use it. It is
> definitely obsolete and has security and other bugs. And, since it's
> unsupported, it will continue to have them.
>
> http://www.perl.com/CPAN-local/src/unsupported/4.036/perl-4.036.tar.gz
>
> This is a source distribution, so you will need to build it yourself.
>
> Kurt Stephens

--------------968750653D6E6C0EAD311610
Content-Type: text/x-vcard; charset=us-ascii;
 name="kiwitter.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Visitenkarte für Patrick Kiwitter
Content-Disposition: attachment;
 filename="kiwitter.vcf"

begin:vcard 
n:Kiwitter;Patrick
tel;work:02 34 - 9 35 14 30
x-mozilla-html:FALSE
url:www.qns.de
org:Fa. QNS - quattro network solutions
adr:;;Werner Hellweg 27		;44869 Bochum;NRW;;Deutschland
version:2.1
email;internet:Kiwitter@qns.de
x-mozilla-cpt:;-23328
fn:Patrick Kiwitter
end:vcard

--------------968750653D6E6C0EAD311610--



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

Date: Thu, 29 Mar 2001 07:43:58 GMT
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: where can i get Perl 4
Message-Id: <2JBw6.3163$0H2.561879@dfiatx1-snr1.gtei.net>


"Patrick Kiwitter" <kiwitter@qns.de> wrote in message
news:3AC2E2CE.62C67BEB@qns.de...
> Hi @ all
>
> i want to download perl 4 for red hat linux .. Where can i find it ?
> please give me the absolutly path of the file.
>
> HELP please tell me

You probably want to download a newer version of whatever program is
requiring that version of Perl.

Lauren




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

Date: Thu, 29 Mar 2001 02:32:26 GMT
From: "Eric" <mail@ericmarques.net>
Subject: why wont this work?
Message-Id: <_8xw6.22113$PF4.32100@news.iol.ie>

i am using the following code in the sub callback of LWP
this code is most of what calculates the KB/sec speed of the download
whenever i use this code the download never completes
cuts off in the middle for no reason with no error
please help


if ($waitsec eq "5"){
$time = time;
$changes = $time - $starttime;
$newbytes = $dlbytes - $dobytes;
$speed = $newbytes / $changes;
$speed = $speed / 10;
($speed,$x) = split(/\./,$speed);
$speed = $speed / 100;

$starttime = time;
$dobytes = "$dlbytes";
$waitsec = "0";
}





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

Date: Thu, 29 Mar 2001 14:25:19 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: why wont this work?
Message-Id: <62zw6.27$US1.5334@vic.nntp.telstra.net>

"Eric" <mail@ericmarques.net> wrote in message
news:_8xw6.22113$PF4.32100@news.iol.ie...
> i am using the following code in the sub callback of LWP
> this code is most of what calculates the KB/sec speed of the download
> whenever i use this code the download never completes
> cuts off in the middle for no reason with no error
> please help
>
>
> if ($waitsec eq "5"){
> $time = time;
> $changes = $time - $starttime;
> $newbytes = $dlbytes - $dobytes;
> $speed = $newbytes / $changes;
> $speed = $speed / 10;
> ($speed,$x) = split(/\./,$speed);
> $speed = $speed / 100;
>
> $starttime = time;
> $dobytes = "$dlbytes";
> $waitsec = "0";
> }
>

Are you getting any errors?  What do you mean by 'won't work'?

It compiles OK, so either the variables aren't what you think they are,
or because they are not scoped (my) they are affecting something else
which is maybe using the same name.

BTW you could shorten some of that...

$time = time;
$changes = $time - $starttime;

could become:

$changes = time - $startime;

and

$speed = $speed / 10;
($speed,$x) = split(/\./,$speed);
$speed = $speed / 100;

could become

$speed = (int ($speed /= 10)) / 100;

or even

$speed = sprintf "%.2f", $speed / 1000;

Note that there may be some rounding differences with the last one.

I would suspect lack of scoping as your probable culprit.  Declare all
your variables with 'my'.

Wyzelli
--
#Modified from the original by Jim Menard
for(reverse(1..100)){$s=($_!=1)? 's':'';print"$_ bottle$s of beer on the
wall,\n";
print"$_ bottle$s of beer,\nTake one down, pass it around,\n";
$_--;$s=($_==1)?'':'s';print"$_ bottle$s of beer on the
wall\n\n";}print'*burp*';





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

Date: Thu, 29 Mar 2001 09:02:23 -0500
From: "Janet Ruhl" <ruhl@realrates.com>
Subject: Re: Wierd new response to old CGI script
Message-Id: <99vfg7$kug$1@bob.news.rcn.net>

>Except, of course, it is a false example.  If I understand the
>situation correctly this is an old script.  The original author did
>not "write his own" he used what was the standard library at the time.

Good point that using a standard library--even an outdated one-- made the
fix a whole lot easier. However "he" is a "she" in this case. <g>





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

Date: Thu, 29 Mar 2001 01:51:34 -0600 (CST)
From: dennis100@webtv.net (BUCK NAKED1)
Subject: Won't Grep Recursively
Message-Id: <25299-3AC2E986-84@storefull-247.iap.bryant.webtv.net>

Why won't this 'grep' and 'put' recursively on sub-directories of
'b-bin/recurse'?

# change the directory on the ftp site 
$ftp->cwd('/b-bin/recurse') or die "Can't change directories: $!\n"; 

opendir TEST, "../wkdir/4757" or die "Can't open directory: $!\n"; 
@files = grep !/^\.\.?$/, readdir TEST or die "Can't grep dir: $!\n";
closedir TEST or die "cannot close directory: $!\n"; 
foreach $file(@files) { 
$ftp->put($file) or warn $ftp->message; } ;

Regards,
--Dennis



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

Date: 29 Mar 2001 09:13:45 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Won't Grep Recursively
Message-Id: <99uuc9$ev8$1@mamenchi.zrz.TU-Berlin.DE>

According to BUCK NAKED1 <dennis100@webtv.net>:
> Why won't this 'grep' and 'put' recursively on sub-directories of
> 'b-bin/recurse'?

This has nothing to do with grep or recursion.  You are looking for
the files in the wrong directory.
 
> # change the directory on the ftp site 
> $ftp->cwd('/b-bin/recurse') or die "Can't change directories: $!\n"; 
> 
> opendir TEST, "../wkdir/4757" or die "Can't open directory: $!\n"; 

You are opening a directory that isn't your current directory.

> @files = grep !/^\.\.?$/, readdir TEST or die "Can't grep dir: $!\n";

This reads the names (and only the names) of files in ../wkdir/4757
into @files.

> closedir TEST or die "cannot close directory: $!\n"; 
> foreach $file(@files) { 
> $ftp->put($file) or warn $ftp->message; } ;

$file contains nothing to indicate that it resides in ../wkdir/4757.
It can't be found.

You will either have to prepend the path "../wkdir/4757" to each
filename, or change your working directory to where the files reside.
In the latter case don't forget to switch back before the next recursive
step.  This isn't always trivial, in particular if some directories are
symlinks.

Anno


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

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 V10 Issue 591
**************************************


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