[7639] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1265 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 3 12:17:09 1997

Date: Mon, 3 Nov 97 09:00:27 -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           Mon, 3 Nov 1997     Volume: 8 Number: 1265

Today's topics:
     Re: AUTOLOAD and sort (Andrew M. Langmead)
     Re: Can I confess run-time taint errors? <rootbeer@teleport.com>
     Re: Creating a new file each day?? <merlyn@stonehenge.com>
     emulating lockf(3) with fcntl <griffin@ccis.adisys.com.au>
     Re: emulating lockf(3) with fcntl <rootbeer@teleport.com>
     Re: Fun with pipes <rootbeer@teleport.com>
     Re: Fun with pipes <rootbeer@teleport.com>
     Re: Grabbing Pixels <rootbeer@teleport.com>
     HELP - HOW TO WRITE FILES IF NOT ROOT SUPER USER? <vidals@etica-entertainment.com>
     Re: HELP - HOW TO WRITE FILES IF NOT ROOT SUPER USER? (Shawn Wagner)
     Re: HELP - HOW TO WRITE FILES IF NOT ROOT SUPER USER? <kperrier@Starbase.NeoSoft.COM>
     Re: HELP - HOW TO WRITE FILES IF NOT ROOT SUPER USER? (Tad McClellan)
     Looking for a script (nospam)
     Man pages for Activestate port on Win32 (Pete Barker)
     Re: Man pages for Activestate port on Win32 <rootbeer@teleport.com>
     open() and pipes (Roy Culley)
     open() redirection failing under NT/CGI. <Steve_Kilbane@cegelecproj.co.uk>
     Perl debug <lavigne@houston.wireline.slb.com>
     Perl question: Subroutine tt@ws6391.at
     Re: problem about win32::odbc <allaires@ctcdist.com>
     problem with Win32::ODBC <allaires@ctcdist.com>
     Re: Problems with H2ph <rootbeer@teleport.com>
     Re: realtime output - HELP ME PLEASE!!! <rootbeer@teleport.com>
     Re: Reference to class method (\&{$foo->you}) (Andrew M. Langmead)
     Re: Replacing a string in several files. <cplank@scotland.net>
     Statistics for comp.lang.perl.misc <gbacon@cs.uah.edu>
     Re: THE POP module! <rootbeer@teleport.com>
     trouble with 'application/octet-stream' script (Erik Symonds)
     udp server <Jan.Vajda@somi.sk>
     Re: What to do with Bitwise operators? <rootbeer@teleport.com>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Mon, 3 Nov 1997 14:45:39 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: AUTOLOAD and sort
Message-Id: <EJ2ro3.C02@world.std.com>

hermit@cats.ucsc.edu (William R. Ward) writes:

>aml@world.std.com (Andrew M. Langmead) writes:
>> One way around it that I can think of is to give sort a bare code
>> block that calls your autoloaded sub.
>> 
>> @sorted = sort { _sort_subroutine() } @list;
>> 
>> You will pay a small performance penalty for the extra subroutine
>> call.

>Better to pay that penalty once, at the beginning, than every time it
>is called, no?

Yes, but I would feel uncomfortable making a "throwaway" call to a
subroutine just to autoload it. I doubt that a sort subroutine would
have side effects, but I'd make sure I'd document that it can't.

On the other hand, the block or subroutine get called so many times, a
little overhead like an extra subroutine call would add up quickly. I
just ran this code:

    use Benchmark;
 
    @in = `cat  /usr/src/linux/CHANGES`;
 
    timethese(1000,{
       subname => q/@out = sort by_sub @in/,
       by_block => q/@out = sort { by_sub() } @in/
    });
 
    sub by_sub {
      $a cmp $b;
    }

Its amazing how much overhead the extra subroutine call makes.


-- 
Andrew Langmead


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

Date: Mon, 3 Nov 1997 08:06:11 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: gtuckerkellogg@genetics.com
Subject: Re: Can I confess run-time taint errors?
Message-Id: <Pine.GSO.3.96.971103075747.10568H-100000@usertest.teleport.com>

On Sun, 2 Nov 1997 gtuckerkellogg@genetics.com wrote:

> I'm working with a program using the -T flag, which I haven't used
> much before.  

You may find my (still experimental) Taint module helpful. 

    http://www.perl.org/CPAN/authors/id/PHOENIX/

> When I'm testing the script, and I get fatal errors like
> 
> Insecure dependency in eval while running with -T switch
>              at/usr2/users/gtk/lib/perl5//MLDBM.pm line 70.
> 
> I'd *really* like to see the call stack.  I know how to use the
> debugger to get this, but is there a way of getting a fatal
> run-time error to print the call stack?

You should be able to install a handler for the __DIE__ pseudo-signal to
trap this error and examine the call stack. Hope this helps!

    $SIG{'__DIE__'} =
	sub { require Carp; &Carp::confess("Died: @_"); };

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 03 Nov 1997 07:49:54 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: "Creede Lambard" <fearless@io.com>
Subject: Re: Creating a new file each day??
Message-Id: <8c67qa3uct.fsf@gadget.cscaper.com>

>>>>> "Creede" == Creede Lambard <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print> writes:

Creede> $newlog = sprintf("%4.4d%2.2d%2.2d.log",$year, $month, $dom);
[...]

Creede> This should give you files with names like 19971102.log that will change

No... I think you want:

	$newlog = sprintf("%04d%02d%02d.log", $year, $month, $dom);

The .4 doesn't do much good on decimal integers. :-)  But the leading
"0" does.

print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 302 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details

-- 
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me


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

Date: Mon, 3 Nov 1997 09:20:13 GMT
From: Rebecca Griffin <griffin@ccis.adisys.com.au>
Subject: emulating lockf(3) with fcntl
Message-Id: <345D974D.454F@ccis.adisys.com.au>

I am trying to lock a file on a hp-ux machine (hence cannot use flock),
and according to "Programming Perl" 2nd Edition - page 166, I can use
fcntl to emulate lockf(3).

Can anyone help me with how to pass the locking control structure
argument required when using command F_GETLK.  According to fcntl(5),
the file segment locking control structure "struct flock" contains the
following members:

     short l_type;            /* F_RDLCK, F_WRLCK or F_UNLCK */
     short l_whence;          /* Flag - see lseek(2) */
     off_t l_start;           /* Relative offset in bytes */
     off_t l_len;             /* Size; if 0 then until EOF */
     pid_t l_pid;             /* By F_GETLK - process holding lock */


Thanks in advance.
R.Griffin


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

Date: Mon, 3 Nov 1997 08:37:11 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Rebecca Griffin <griffin@ccis.adisys.com.au>
Subject: Re: emulating lockf(3) with fcntl
Message-Id: <Pine.GSO.3.96.971103083546.10568S-100000@usertest.teleport.com>

On Mon, 3 Nov 1997, Rebecca Griffin wrote:

> I am trying to lock a file on a hp-ux machine (hence cannot use flock),
> and according to "Programming Perl" 2nd Edition - page 166, I can use
> fcntl to emulate lockf(3).

You can also use flock() to emulate lockf(3). :-)  That is, in recent
versions of Perl, you can use flock on machines with lockf(3). No muss, no
fuss, no hassles. Enjoy!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Mon, 3 Nov 1997 08:27:42 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Amias <amias@mindless.com>
Subject: Re: Fun with pipes
Message-Id: <Pine.GSO.3.96.971103082708.10568M-100000@usertest.teleport.com>

On Mon, 3 Nov 1997, Amias wrote:

> i'm trying to get perl to send information to PGP

Why aren't you using the PGP modules from CPAN? Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Mon, 3 Nov 1997 08:30:00 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Amias <amias@mindless.com>
Subject: Re: Fun with pipes
Message-Id: <Pine.GSO.3.96.971103082934.10568O-100000@usertest.teleport.com>

On Mon, 3 Nov 1997, Amias wrote:

> print OUTPUT, "This is the email message";

Doesn't Perl's diagnostic message for this line tell you what's wrong with
it? :-)

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Mon, 3 Nov 1997 08:26:40 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Ryan Rose <ryanr@poolpros.com>
Subject: Re: Grabbing Pixels
Message-Id: <Pine.GSO.3.96.971103082536.10568L-100000@usertest.teleport.com>

On Mon, 3 Nov 1997, Ryan Rose wrote:

> I'm looking to open up a graphic file (either jpg, or gif), grab a few
> pixels, and determine the average RGB value.  Is there anyway to do
> something like this?

Yes. You may find some helpful modules on CPAN, or you may use Perl to
work directly with binary files. Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Mon, 03 Nov 1997 07:06:04 +0000
From: Gil Vidals <vidals@etica-entertainment.com>
Subject: HELP - HOW TO WRITE FILES IF NOT ROOT SUPER USER?
Message-Id: <345D77DC.487FFC3B@etica-entertainment.com>

I've written a small test program to write to a file. I can only get the
program to work when I'm logged in as the root superuser (LINUX);

The program is:

   $dir = "/tmp";
   $file = "test_file;

   open (FILE, ">>" . $dir.$file) ||
        &return_error(500, Cannot open file [$file]");

   print FILE "this is a test on how to  write files", "\n";

   close (FILE);

The above program works find when Im logged in as the root super-user.
However, when I log in as webuser, the program creates the file, but
does not write to it. The created file has permissions as -rw-r--r--.  I
changed the permissions of "/tmp" to -rwxrwxrwx, but that didn't help
any.  I even changed the owner of /tmp to "webuser", but the program
still refuses to write the file.


Please help! What am I doing wrong. BTW, I'm running Perl 5 on Linux.

Thanks.

Gil




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

Date: 3 Nov 1997 10:15:37 -0500
From: shawnw@bigwpi.WPI.EDU (Shawn Wagner)
Subject: Re: HELP - HOW TO WRITE FILES IF NOT ROOT SUPER USER?
Message-Id: <63kpqp$raq$1@bigwpi.WPI.EDU>

In article <345D77DC.487FFC3B@etica-entertainment.com>,
Gil Vidals  <vidals@etica-entertainment.com> wrote:
>I've written a small test program to write to a file. I can only get the
>program to work when I'm logged in as the root superuser (LINUX);
>
>The program is:
>
>   $dir = "/tmp";
>   $file = "test_file;
>
>   open (FILE, ">>" . $dir.$file) ||
>        &return_error(500, Cannot open file [$file]");
>
It looks like the problem is in the above lines. Unless you left 
out a / in the post, perl creates a file called tmptest_file in /, 
which (probably) no-one but root has permissions to write to. As 
a side note, you don't need all those concatenation operators. Try 
something like:

open FILE, ">>$dir/$file" or 
     &return_error 500, "Cannot open file [$file]";


Hope this helps.

-- 
Shawn Wagner - shawnw@wpi.edu
http://mycroft.res.wpi.net/shawnw/
Nifty sig wanted - ASCII art need not apply


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

Date: 03 Nov 1997 09:31:14 -0600
From: Kent Perrier <kperrier@Starbase.NeoSoft.COM>
Subject: Re: HELP - HOW TO WRITE FILES IF NOT ROOT SUPER USER?
Message-Id: <cs7maqro3h.fsf@Starbase.NeoSoft.COM>

Gil Vidals <vidals@etica-entertainment.com> writes:

> I've written a small test program to write to a file. I can only get the
> program to work when I'm logged in as the root superuser (LINUX);
> 
> The program is:
> 
>    $dir = "/tmp";
>    $file = "test_file;
> 
>    open (FILE, ">>" . $dir.$file) ||
                        ^^^^^^^^^^

If you printed this out you would see that this file is /tmptestfile not
/tmp/testfile (which is probably what you wanted).  Set $dir to /tmp/ OR
set $file to /test_file and your problems should go away.

Note:  this is an untested, off the hip response and it may not be 100%
correct.

<SNIPPAGE>

Kent
-- 
Kent Perrier                             kperrier@neosoft.com 
Corporations don't have opinions, people do.  These are mine.


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

Date: Mon, 3 Nov 1997 09:59:01 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: HELP - HOW TO WRITE FILES IF NOT ROOT SUPER USER?
Message-Id: <5csk36.qb5.ln@localhost>

Shawn Wagner (shawnw@bigwpi.WPI.EDU) wrote:
: As 
: a side note, you don't need all those concatenation operators. Try 
: something like:

: open FILE, ">>$dir/$file" or 
:      &return_error 500, "Cannot open file [$file]";


And say in the error message what you were _really_ trying to open:

       &return_error 500, "Cannot open file [$dir/$file]";
                                             ^^^^

And get some (sometimes) helpful info about why the open() failed
from the OS:

       &return_error 500, "Cannot open file [$dir/$file]  $!";
                                                          ^^
                                                          ^^

--
    Tad McClellan                          SGML Consulting
    tadmc@flash.net                        Perl programming
    Fort Worth, Texas


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

Date: Mon, 03 Nov 1997 13:36:50 GMT
From: internetworks1@juno(nospam).com
Subject: Looking for a script
Message-Id: <345dd320.3435064@news.erols.com>

Hi,
I'm looking for a perl script that will allow me to announce the
number of visitors I have on a site at any given time. 

One of my sites has two separate chat systems.  I would like to be
able to announce on the FIRST page, the number of visitors that occupy
each chat room at any given time.  

Any help would be greatly appreciated.

Bruce Zubee
internetWORKS1@juno.com


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

Date: 3 Nov 1997 15:06:47 GMT
From: on.maps.barker@cix.co.uk (Pete Barker)
Subject: Man pages for Activestate port on Win32
Message-Id: <memo.19971103150534.112D@mt.cix.co.uk>

Hello,

I've got perl for Win32 version 5.003_07, and would very much like
to make use of the man help system. From reading replies here, it
appears *very* useful.

I don't think my distribution came with man pages, so can I get
them from somewhere, for use on a Windows NT machine? I guess I
would also need "man"?

Thanks,

Pete Barker
P.S. Please remove on.maps. to mail me.



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

Date: Mon, 3 Nov 1997 08:40:30 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Pete Barker <on.maps.barker@cix.co.uk>
Subject: Re: Man pages for Activestate port on Win32
Message-Id: <Pine.GSO.3.96.971103083811.10568T-100000@usertest.teleport.com>

On 3 Nov 1997, Pete Barker wrote:

> I don't think my distribution came with man pages,

Then it's broken. :-)  Complain to whoever gave it to you, and get a
better distribution which includes everything. 

    http://www.perl.com/CPAN/ports/win32/Standard/x86/

Hope this helps!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 3 Nov 1997 16:31:05 GMT
From: tgdcuro1@gd2.swissptt.ch (Roy Culley)
Subject: open() and pipes
Message-Id: <63ku89$b11@gd2inews.swissptt.ch>

Hello everyone,

>From the FAQ:

  Why doesn't open() return an error when a pipe open fails? 

  It does, but probably not how you expect it to. On systems that follow
  the standard fork/exec paradigm (eg, Unix), it works like this: open
  causes a fork. In the parent, open returns with the process ID of the
  child. The child execs the command to be piped to/from. The parent
  can't know whether the exec was successful or not - all it can return
  is whether the fork succeeded or not. To find out if the command
  succeeded, you have to catch SIGCHLD and wait to get the exit status.

Does anyone have a package that handles opening pipes in a 'clean'
way? I have to read several hundred MBytes from a program to produce
a report. Opening a pipe seems the only obvious way to do it but I
would like to know if the open has failed. Is seeting up a handler
for SIGCHLD the only way? Should the script just sleep for a short
time and then check if a SIGCHLD had happened?

Regards,
Roy
-- 
Roy G. Culley                   Tel: +41 31 342 56 62
Dept. IS-B-53                   Fax: +41 31 342 04 62
Swisscom                      Email: Roy.Culley@acm.org
Key fingerprint = 6B AD 68 79 30 0B C0 5F  16 BC 90 57 35 E9 FC 40


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

Date: Mon, 03 Nov 1997 15:59:07 GMT
From: Steve Kilbane <Steve_Kilbane@cegelecproj.co.uk>
Subject: open() redirection failing under NT/CGI.
Message-Id: <b37cd$f3b7.2ac@news.cegelecproj.co.uk>

System: Windows NT 4.0, Perl 5.004_01, compiled with M$ VC++.

I'm using the open(F,"cmd|") construct, and while it works fine
from the command line, it's not working when invoked as a
CGI script by M$ IIS. "Not working" in this case means that
the open() seems to work (doesn't invoke the associated "or die"),
but that the redirection doesn't happen - following loop doesn't
read any data under the CGI environment.

The command itself is fine. I'm also invoking it using
system("cmd > testfile.txt") to check actual execution, and this
test output file gets created in both environments.

Based on TC's CGI FAQ, I suspect two possibilities:
(a) the redirection involves a temporary file, and the web server's
invoking the script as a user which doesn't have permissions for
this temporary file. If this is the case, I'd love suggestions on how
to prove it or identify the path being used....
(b) this is a bug in the 5.004_01 win32 port, and therefore I'd hope
it is fixed in the just-announced maintenance release. Right now,
I don't want to do a rebuilt of Perl just on the off-chance, though.
-- 
<Steve_Kilbane@cegelecproj.co.uk> - All opinions are mine alone.
Kilbane's law of integration: standardise on protocols and file
formats, and the applications take care of themselves.



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

Date: Mon, 03 Nov 1997 21:14:13 -0800
From: Jack LaVigne <lavigne@houston.wireline.slb.com>
Subject: Perl debug
Message-Id: <345EAF25.ECB@houston.wireline.slb.com>

When I read perl documentaiton it talks about debug
support in emacs.

I have perl-mode.el in my emacs path. It appears to
be related to writing perl code; similar to c-mode, etc.

Where can I get documentation that explains how to set up
and run perl in debug controlled by emacs?


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

Date: Mon, 03 Nov 1997 15:54:21 +0100
From: tt@ws6391.at
Subject: Perl question: Subroutine
Message-Id: <345DE59D.2BF4@ws6391.at>

Hi,

I am a perl novice and I need help writing a subroutine which
should meet the following needs:
Opening a module, passing arguments to it and executing the module.


Here is the code I was able to write by my own:

sub callsub
    {
    $i = 0;
    @p = "";
    $file = shift (@_);

    while (@_)
        {
        $p[$i] = shift (@_);
        $i++;
        }
        print "$file @p\n";

    open (FILE, "/home3/tt/perl5/lib/$file.pm") || die "Can't
open               module $file.pm: $!\n";
    }

This code works but my problem is, that I can't figure out how to pass
the arguments to the opened Module nor how to execute it.

Thanks, Bernd


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

Date: Mon, 3 Nov 1997 09:58:51 -0600
From: "Scott Allaire" <allaires@ctcdist.com>
Subject: Re: problem about win32::odbc
Message-Id: <63ksdi$pqg$1@darla.visi.com>

David wrote in message <01bce27a$06ba6e60$511e09a8@weixiao.income.com.sg>...

>When I ran it under perl for win32 ver 5.001, Error: Parse exception
>appeared, but not under ver 5.003.


I encountered the same problem and was able to fix it.  If you go to
http://www.roth.net/odbc/odbcfaq.htm you will find an explanation of the
problem.





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

Date: Mon, 3 Nov 1997 10:04:05 -0600
From: "Scott Allaire" <allaires@ctcdist.com>
Subject: problem with Win32::ODBC
Message-Id: <63kt5r$qft$1@darla.visi.com>

I am having a problem with the following code.  I get the error

Can't call method "Sql" without a package or object reference.

use Win32::ODBC;
$Db = new Win32::ODBC(DATASOURCE);
$SqlStatement = "SELECT * FROM table";
if ($Db->Sql($SqlStatement)) {
     while ($Db->FetchRow()) {
          ($field1, $field2) = $Db->Data("field1", "field2");
          print "$poitno, $name";
     }
}
else {
    print "SQL failed.\n";
    print "Error: " . $db->Error() . "\n";
}
$Db->Close();


Thanks for any help in advance.
allaires@ctcdist.com







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

Date: Mon, 3 Nov 1997 08:14:28 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Nicco <niccotnt@mbox.vol.it>
Subject: Re: Problems with H2ph
Message-Id: <Pine.GSO.3.96.971103080648.10568I-100000@usertest.teleport.com>

On Sun, 2 Nov 1997, Nicco wrote:

> I converted the ipc.h and sem.h libraries, and all the others, using the
> H2Ph tool. But when I call the libraries in my program (require
> "sys/ipc.ph"; require "sys/sem.ph"), the compiler finds many errors, due
> to the fact that the h2ph tool doesn't work correctly. Where can I find
> all the *.ph files without errors?  Where can I find the original *.ph
> files? (Without using converting utilities?) 

There are no "original" files; these files are created from the .h files
on your system - which may have different definitions than another system
has, alas. 

If you can see why h2ph is having troubles, you may be able to fix it.
Send your patches to the Perl developers using the perlbug program.

You may be able to fix up the .ph files by hand. This can be tedious and
error-prone, which is one reason why h2ph was created. 

You may be able to use the IPC::SysV module or other modules from CPAN. 
This is probably the best way.

    http://www.perl.com/CPAN/

If all else fails, you might be able to use h2xs to make a module of your
own. 

Good luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Mon, 3 Nov 1997 08:19:05 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Matthias Hellmund <matthias.hellmund@nienburg-weser.de>
Subject: Re: realtime output - HELP ME PLEASE!!!
Message-Id: <Pine.GSO.3.96.971103081531.10568J-100000@usertest.teleport.com>

On 2 Nov 1997, Matthias Hellmund wrote:

> I know there must be a way to get this realtime line-by-line output
> running with MS IE. The chatcafe at http://www.west.de makes it. 

Then all you need to do is make your server (not your script) use the same
behavior as that server does. You may be able to see what that server is
doing by using HTTPeek. 

    http://www.computerdog.com/httpeek/

If you're still having trouble after checking the docs and FAQs, check
with a newsgroup about servers and browsers. Good luck! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Mon, 3 Nov 1997 14:56:09 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: Reference to class method (\&{$foo->you})
Message-Id: <EJ2s5M.ILJ@world.std.com>

mjtg@cus.cam.ac.uk (M.J.T. Guy) writes:

>Andrew M. Langmead <aml@world.std.com> wrote:
>>How about if you create an anonymous subroutine that calls the method?
>>
>>$subref = sub { $foo->you() };

>No need to do that.  Use the built-in function:

> $subref = $foo->can('you');

Slightly different. For the subref you get from can(), you still need
to remember the object whose method you've got. Then you can say:

  &$subref($foo);

Imagine if you want a list different methods from different objects,
You'd have to keep track of which goes with what.

If you make $subref an anonymous function where the object $foo
calling the method you(), you can then ignore where the method came
from and just call it.

   &$subref();
-- 
Andrew Langmead


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

Date: Mon, 03 Nov 1997 13:09:58 +0000
From: Chris Plank <cplank@scotland.net>
Subject: Re: Replacing a string in several files.
Message-Id: <345DCD26.591F@scotland.net>

Uwe Hauck wrote:
> 
> Hello !
> I am searching for a routine that will go through all files an a
> directory and its subdirectories
> and search for string A to replace it with string B in all the files.
> Anyone has such a perl script ?
> Where can I find it ?
> Can anyone give me hints on writing it ?
> 
> Uwe Hauck
> 

perl -p -i -e 's|www.aa.com|www.bb.com|g' `find ./ -name '*.htm' -print`

Simple one liner to replace all occurances of www.aa.com with www.bb.com
in all .htm files from the present working directory down.


Chris

Chris Plank
webmaster@scotland.net


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

Date: 3 Nov 1997 15:26:37 GMT
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: Statistics for comp.lang.perl.misc
Message-Id: <63kqfd$mg0$1@info.uah.edu>

Following is a summary of articles spanning a 7 day period,
beginning at 25 Oct 1997 10:41:27 GMT and ending at
01 Nov 1997 05:34:26 GMT.

Notes
=====

    - A line in the body of a post is considered to be original if it
      does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
    - All text after the last cut line (/^-- $/) in the body is
      considered to be the author's signature.
    - The scanner prefers the Reply-To: header over the From: header
      in determining the "real" e-mail address and name.
    - Original Content Rating is the ratio of the original content volume
      to the total body volume.
    - Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.

Excluded Posters
================

perlfaq-suggestions@mox.perl.com

Totals
======

Total number of posters:  369
Total number of articles: 783 (290 with cutlined signatures)
Total number of threads:  307
Total volume generated:   1278.6 kb
    - headers:    536.6 kb (10,917 lines)
    - bodies:     677.6 kb (21,711 lines)
    - original:   484.8 kb (15,980 lines)
    - signatures: 62.5 kb (1,522 lines)
Original Content Rating: 0.7154

Averages
========

Number of posts per poster: 2.12
    median: 1 post
    mode:   1 post - 243 posters
    s:      3.99 posts
Number of posts per thread: 2.55
    median: 2 posts
    mode:   1 post - 123 threads
    s:      2.18 posts
Message size: 1672.1 bytes
    - header:     701.7 bytes (13.9 lines)
    - body:       886.2 bytes (27.7 lines)
    - original:   634.0 bytes (20.4 lines)
    - signature:  81.7 bytes (1.9 lines)

Top 10 Posters by Number of Posts
=================================

         (kb)   (kb)  (kb)  (kb)
Posts  Volume (  hdr/ body/ orig)  Address
-----  --------------------------  -------

   59    97.9 ( 49.4/ 35.3/ 24.4)  Tom Phoenix <rootbeer@teleport.com>
   28    45.8 ( 19.4/ 20.5/ 12.6)  brian d foy <comdog@computerdog.com>
   24    34.2 ( 17.1/ 17.0/ 10.3)  Doug Seay <seay@absyss.fr>
   19    33.3 ( 11.3/ 22.0/ 13.1)  Tad McClellan <tadmc@flash.net>
   14    17.5 (  9.8/  7.4/  3.8)  Toutatis <toutatis@_SPAMTRAP_toutatis.net>
   13    18.6 (  8.5/ 10.1/  4.5)  Jason Gloudon <jgloudon@bbn.com>
   11    15.6 (  8.8/  6.9/  2.7)  rjk@coos.dartmouth.edu
   10    15.0 (  6.1/  8.9/  5.1)  Honza Pazdziora <adelton@fi.muni.cz>
   10    17.7 (  6.9/ 10.8/  6.8)  faust@wwa.com
   10    19.0 (  5.4/ 10.4/  7.0)  Mike Stok <mike@stok.co.uk>

Top 10 Posters by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Address
--------------------------  -----  -------

  97.9 ( 49.4/ 35.3/ 24.4)     59  Tom Phoenix <rootbeer@teleport.com>
  45.8 ( 19.4/ 20.5/ 12.6)     28  brian d foy <comdog@computerdog.com>
  34.2 ( 17.1/ 17.0/ 10.3)     24  Doug Seay <seay@absyss.fr>
  33.3 ( 11.3/ 22.0/ 13.1)     19  Tad McClellan <tadmc@flash.net>
  19.0 (  5.4/ 10.4/  7.0)     10  Mike Stok <mike@stok.co.uk>
  18.6 (  8.5/ 10.1/  4.5)     13  Jason Gloudon <jgloudon@bbn.com>
  17.7 (  6.9/ 10.8/  6.8)     10  faust@wwa.com
  17.5 (  9.8/  7.4/  3.8)     14  Toutatis <toutatis@_SPAMTRAP_toutatis.net>
  16.6 (  7.0/  7.5/  5.3)     10  Martien Verbruggen <mgjv@comdyn.com.au>
  15.7 (  8.4/  7.3/  4.4)      7  Eli the Bearded <usenet-tag@qz.little-neck.ny.us>

Top 10 Posters by OCR (minimum of five posts)
==============================================

          (kb)    (kb)
OCR       orig /  body  Posts  Address
------  --------------  -----  -------

0.9855     2.7 /   2.7      5  Brandon S. Allbery KF8NH; to reply, change "void" to "kf8nh" <bsa@void.apk.net>
0.9763     7.4 /   7.6      6  John Moreno <phenix@interpath.com>
0.8123     5.8 /   7.1      6  Lloyd Zusman <ljz@asfast.com>
0.7218     4.2 /   5.8      6  Andrew M. Langmead <aml@world.std.com>
0.7185     2.9 /   4.0      6  Casper K. Clausen <ckc@dmi.min.dk>
0.7125     5.3 /   7.5     10  Martien Verbruggen <mgjv@comdyn.com.au>
0.6930    24.4 /  35.3     59  Tom Phoenix <rootbeer@teleport.com>
0.6748     7.0 /  10.4     10  Mike Stok <mike@stok.co.uk>
0.6367     4.7 /   7.4      7  Zenin <zenin@best.com>
0.6284     6.8 /  10.8     10  faust@wwa.com

Bottom 10 Posters by OCR (minimum of five posts)
=================================================

          (kb)    (kb)
OCR       orig /  body  Posts  Address
------  --------------  -----  -------

0.5045     3.8 /   7.4     14  Toutatis <toutatis@_SPAMTRAP_toutatis.net>
0.4969     2.5 /   5.1      7  Eric Bohlman <ebohlman@netcom.com>
0.4855     3.4 /   7.0      7  "Creede Lambard" <fearless@io.com>
0.4743     2.3 /   4.9      5  Mike Heins <mheins@prairienet.org>
0.4676     1.7 /   3.6      5  blintz@com.nicorinc
0.4445     4.5 /  10.1     13  Jason Gloudon <jgloudon@bbn.com>
0.4415     1.9 /   4.4      5  abigail@fnx.com
0.4380     2.5 /   5.7      5  Ilya Zakharevich <ilya@math.ohio-state.edu>
0.4028     2.9 /   7.3      7  "John Bokma" <jbokma@caiw.nl>
0.4001     2.7 /   6.9     11  rjk@coos.dartmouth.edu

Top 10 Threads by Number of Posts
=================================

Posts  Subject
-----  -------

   16  Year2000 problem with localtime();
   14  if (0<= $hun < 250) doesn't compile
   12  Better ways to...
   11  Your opinion on The Perl Journal (TPJ) ?
   10  Help me optimize this functionality?
    9  Memory problems - how can I fix?
    9  Perl Suffix (Was: Can perl be maken to Compiler instead of interpreter?)
    9  In-Line images and perl
    9  using -s to get file size
    8  detection of first execution since login

Top 10 Threads by Volume
========================

  (kb)   (kb)  (kb)  (kb)
Volume (  hdr/ body/ orig)  Posts  Subject
--------------------------  -----  -------

  29.0 ( 13.1/ 14.5/  9.8)     16  Year2000 problem with localtime();
  20.6 (  9.5/  9.7/  6.9)     14  if (0<= $hun < 250) doesn't compile
  18.7 (  9.1/  7.7/  4.2)     12  Better ways to...
  18.4 (  7.5/  9.7/  5.8)     11  Your opinion on The Perl Journal (TPJ) ?
  16.2 (  5.2/ 10.3/  6.5)      7  ARGV question
  15.4 (  8.1/  6.4/  4.2)      9  Perl Suffix (Was: Can perl be maken to Compiler instead of interpreter?)
  14.8 (  7.4/  6.3/  3.9)      9  In-Line images and perl
  14.5 (  5.3/  8.6/  5.8)      8  A little help, please.
  14.1 (  5.7/  7.9/  4.7)      9  using -s to get file size
  14.0 (  6.1/  7.0/  4.5)      9  Memory problems - how can I fix?

Top 10 Targets for Crossposts
=============================

Articles  Newsgroup
--------  ---------

      23  comp.lang.perl.modules
      16  comp.lang.perl
      12  alt.fan.e-t-b
       7  comp.lang.postscript
       7  comp.infosystems.www.authoring.misc
       7  comp.text.pdf
       7  comp.infosystems.www.authoring.html
       4  comp.databases.oracle
       4  pl.comp.lang.perl
       3  comp.lang.perl.announce

Top 10 Crossposters
===================

Articles  Address
--------  -------

       9  mmwxdoft@force1.net
       7  Eli the Bearded <usenet-tag@qz.little-neck.ny.us>
       6  Martien Verbruggen <mgjv@comdyn.com.au>
       6  nathan@cyberservices.com
       5  YOSHIFUJI, Hideaki <yoshfuji@ecei.tohoku.ac.jp>
       3  marduk <marduk@gte.net>
       3  Malcolm Reeves <mreeves@dial.pipex.com>
       3  dparrott@ford.com
       3  Larry Mulcahy <lmulcahy@nyx.net>
       3  Aandi Inston <quite@dial.pipex.com>


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

Date: Mon, 3 Nov 1997 08:31:55 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Gustaf Edgren <gurra@imneverwrong.com>
Subject: Re: THE POP module!
Message-Id: <Pine.GSO.3.96.971103083040.10568Q-100000@usertest.teleport.com>

On Mon, 3 Nov 1997, Gustaf Edgren wrote:

> Anyway I haven't got any problems with the module itself, but how do you
> get who its from? 

Any module should come with complete docs, including a way to contact the
author. If it doesn't, complain to whoever gave you the module. :-)  Good
luck!

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: Mon, 3 Nov 1997 10:21:30 -0500
From: eriks@haestad.com (Erik Symonds)
Subject: trouble with 'application/octet-stream' script
Message-Id: <MPG.ec7b60790f127ff989681@news.pcnet.com>

I am trying to create a script in PERL that will send the contents of a 
binary file when called from a form.  It seems to 'work' with the 
exception being that the name of the file that I am sending is not being 
displayed. Is there a header, or other method, that I can use to send a 
name to the browser to use upon bringing up the save dialog box?

Here is the code:
--------------------------
$file='file.bin';

print "Content-type: application/octet-stream\n\n";
open(OPENFILE, $file) || die "Cannot open $file: $!";
open(STDOUT);

binmode(OPENFILE);
binmode(STDOUT);

while(<OPENFILE>) {
    print;
}

close(OPENFILE);
close(STDOUT);

exit
--------------------------

If anyone can lend me a hand I would appreciate it!

Thanks In Advance,
Erik


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

Date: 3 Nov 1997 14:03:20 GMT
From: Kozo <Jan.Vajda@somi.sk>
Subject: udp server
Message-Id: <63klj8$7u8@gringo.somi.sk>

I mean write an UDP server for my aplication, but
I don't know how ..
I know how to write TCP server like inetd service, but I 
cannot find any manual about UDP ..
can U help me ?
any template ?

thanx ..	Kozo


            ----------------------------------------------------
                       posted by WWWNews gateway v1.12
               (c) 1997 Somi Systems Ltd. http://www.somi.sk/
               somi.sk is NOT the originators of the articles 
                 and are NOT responsible for their content.


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

Date: Mon, 3 Nov 1997 08:24:08 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Dean Inada <dmi@delta1.deltanet.com>
Subject: Re: What to do with Bitwise operators?
Message-Id: <Pine.GSO.3.96.971103082126.10568K-100000@usertest.teleport.com>

On 3 Nov 1997, Dean Inada wrote:

> (BTW, the documentation doesn't seem to specify exactly what this does,
> so I'm not sure if it will continue to work with new versions of perl)

Your message doesn't seem to specify exactly what "this" refers to. :-) 
But if the Perl docs are insufficient for your needs, please file a bug
report (via the perlbug program). Documentation bugs are bugs, too! 

-- 
Tom Phoenix           http://www.teleport.com/~rootbeer/
rootbeer@teleport.com  PGP   Skribu al mi per Esperanto!
Randal Schwartz Case:  http://www.rahul.net/jeffrey/ovs/
              Ask me about Perl trainings!



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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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

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