[17472] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4892 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 15 09:05:38 2000

Date: Wed, 15 Nov 2000 06:05:11 -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: <974297111-v9-i4892@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 15 Nov 2000     Volume: 9 Number: 4892

Today's topics:
    Re: activeperl: reading registry <carvdawg@patriot.net>
        byteperl program icct@my-deja.com
    Re: byteperl program (Martien Verbruggen)
    Re: Converting Troff to Jpeg (Martien Verbruggen)
    Re: CR LF to <br> in REGEX <19wlr@globalnet.co.uk>
    Re: CR LF to <br> in REGEX (Martien Verbruggen)
    Re: Date <dave@dave.org.uk>
    Re: Date (Ameen Dausha)
    Re: Date <jeffp@crusoe.net>
        debugger: { p "\n\nLINE: $_\n" if source code line == 3 (EED)
    Re: debugger: { p "\n\nLINE: $_\n" if source code line  (Ilya Zakharevich)
        Delete empty directories <bart.lateur@skynet.be>
    Re: Delete empty directories (Gwyn Judd)
    Re: getting the real virtual host <newsgroups@mail.ru>
    Re: giving , another name, like "and" for && (Yitzchak Scott-Thoennes)
        How can a SMTP mail be deleted from a Unix mailbox by a <ELF@Messer.de>
        how to use perlcc with boot_DynaLoader problem <news@#nospam#althepal.com>
        I need a fork example, please <news@#nospam#althepal.com>
    Re: IP geography (Gwyn Judd)
    Re: IP geography <nospam@david-steuber.com>
        Is a function/class library for processing of SMTP-mail <ELF@Messer.de>
    Re: Is a function/class library for processing of SMTP- <jsaunier@my-deja.com>
        Is there something like "exe2perl"? <dj.peppone@gmx.net>
    Re: Is there something like "exe2perl"? <nospam@david-steuber.com>
    Re: Perl syntax and beyond (was: Re: Perl style and mod (Tom Christiansen)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 15 Nov 2000 05:37:13 -0500
From: H C <carvdawg@patriot.net>
Subject: Re: activeperl: reading registry
Message-Id: <3A126759.152117BF@patriot.net>

I'm working on a program to do integrity checking of the Registry by
generating
checksums for user-selected keys.  Inherent to that functionality is the
ability to read
the Registry.

If you send me your email address, I'll send you a copy of the script when
it's ready
(sometime this week).

EM wrote:

> that code doesnt work
> heres what i got
>
> C:\WINDOWS\Desktop>d:\perl\bin\perl.exe -w registry.pl
> syntax error at registry.pl line 10, near ") ="
> Execution of registry.pl aborted due to compilation errors.
>         (in cleanup) Can't call method "FETCH" on an undefined value at
> D:/Perl/
> site/lib/Win32/TieRegistry.pm line 1486 during global destruction.
>
> "Marshall Thomas" <mmthoma@attglobal.net> wrote in message
> news:3A11376F.2044C0A4@attglobal.net...
> > EM wrote:
> > >
> > > i have windows me with activeperl installed
> > > is there a way to read/write a key from the windows registry?
> > >
> > > thanks in advance
> >
> > Since you are running in the Winbloze environment, you should
> > check out the Active State port - www.activestate.com
> >
> > You want the Win32::TieRegistry module.
> >
> > something like this should work fine:
> >
> > my $Registry;
> > use Win32::TieRegistry 0.20 (
> >         TiedRef => \$Registry, Delimiter => "/", ArrayValues => 0,
> >         SplitMultis => 1, AllowLoad => 1, AllowSave => 1,
> >         qw ( REG_SZ REG_EXPAND_SZ REG_DWORD REG_BINARY REG_MULTI_SZ
> >            KEY_READ KEY_WRITE KEY_ALL_ACCESS ),
> > );
> > my $somevariable;
> > #a read of a string value is like this:
> > unless ($somevariable) =
> > $Registry->{"HKEY_LOCAL_MACHINE/blah/blah//subkey"})
> >           {do what you want if the key doesn't exit};
> >
> > #a write of a string value is like this:
> > $Registry->{"HKEY_LOCAL_MACHINE/blah/blah//subkey"}="$somevariable"
> >          || some_error_routine();
> >
> > reading and writing dwords is more tricky. The HTML documentation for
> > TieRegistry is something like 30 pages. This subject can get really
> > complicated. You've got a start here.
> >
> > Good Luck,
> > /Marshall

--
Q: Why is Batman better than Bill Gates?
A: Batman was able to beat the Penguin.




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

Date: Wed, 15 Nov 2000 10:12:06 GMT
From: icct@my-deja.com
Subject: byteperl program
Message-Id: <8utnhj$qs4$1@nnrp1.deja.com>

there was some mumbling about byteperl program but nobody
actually have pointed to it...

thank you, icct.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 15 Nov 2000 21:39:02 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: byteperl program
Message-Id: <slrn914pu6.6sn.mgjv@martien.heliotrope.home>

On Wed, 15 Nov 2000 10:12:06 GMT,
	icct@my-deja.com <icct@my-deja.com> wrote:
> there was some mumbling about byteperl program but nobody
> actually have pointed to it...

What do you mean, byteperl program? Are you talking about the
B::ByteCode module?

# man B::ByteCode
# man perlcompile

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Failure is not an option. It comes
Commercial Dynamics Pty. Ltd.   | bundled with your Microsoft product.
NSW, Australia                  | 


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

Date: Wed, 15 Nov 2000 20:57:06 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Converting Troff to Jpeg
Message-Id: <slrn914nfi.gs3.mgjv@martien.heliotrope.home>

On Wed, 15 Nov 2000 06:56:38 GMT,
	Chris Fedde <cfedde@fedde.littleton.co.us> wrote:
> In article <3A11B429.53EB2736@_ANTISPAM_.lucent.com>,
> Jeff H  <jeffahill@_ANTISPAM_.lucent.com> wrote:
>>Does anyone out there know of a Perl utility that would convert a Troff file
>>into a Jpeg image for web display?  The Jpeg part is not especially important,
>>it could be Gif or Png for all I care, as long as I can put it on a webpage.  
>>
>>Jeff
> 
> Perl is not the best tool for everything.
> 
>     man -t LWP | gs -sDEVICE=pngmono -sOutputFile=op%d.png -
> 
> Isn't unix great!

Yep. It's dandy.

But, if you have a regular troff file, which is potentially not
palatable by man, you might need to call *roff yourself. The GNU version
of *roff outputs PostScript, so someting like

# groff -Tps document | gs -sDEVICE=pngmono -sOutputFile=op%d.png -

and you might need a preprocessor argument there. But since you have
troff files, I suspect that you know how to work with them.

If you have ImageMagick:

# groff -Tps document | convert - doc.%d.png

I tend to prefer the latter, for obvious reasons :). It also allows a
lot of control over what your output images will look like.

Martien
-- 
Martien Verbruggen              | Since light travels faster than
Interactive Media Division      | sound, isn't that why some people
Commercial Dynamics Pty. Ltd.   | appear bright until you hear them
NSW, Australia                  | speak?


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

Date: Wed, 15 Nov 2000 10:12:49 -0000
From: "John Plaxton" <19wlr@globalnet.co.uk>
Subject: Re: CR LF to <br> in REGEX
Message-Id: <8utra8$oq8$1@gxsn.com>

Think I've found the answer for myself, but correct me if I'm wrong, ie to
remove carriage returns and insert <br> instead.

$string =~ s/\n/<br>/g;

or

@lines=split /\n/,$string
for $line (@lines) {
$newstr = ($newstr.$line."<br>");
}




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

Date: Wed, 15 Nov 2000 22:44:35 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: CR LF to <br> in REGEX
Message-Id: <slrn914tp3.6sn.mgjv@martien.heliotrope.home>

On Wed, 15 Nov 2000 10:12:49 -0000,
	John Plaxton <19wlr@globalnet.co.uk> wrote:
> Think I've found the answer for myself, but correct me if I'm wrong, ie to
> remove carriage returns and insert <br> instead.
> 
> $string =~ s/\n/<br>/g;


Well, yes, and no. "\n" is not a carriage return, nor is it a line feed,
nor is it any combination of the two. It is the internal representation
of the newline. On some platforms that's character 012 (0xa or 10) and
on others it's character 015 (0xd or 13), and on yet others it's a
combination of the two ("\015\012"). For most network protocols it's
(officially) also "\015\012", also known as a CRLF sequence.

Now, if you need to replace all literal CRLF sequences in a string with
'<br>', 

s/\015\012/<br>/g;

\begin{note}
If you need to read this from a file, and you have to do that in a
platform-independent way, then all you can do is open the file in binary
mode and read it that way. Look for sequences of those two characters,
and replace them. One way to do that is by reading the whole file into a
scalar, and using a regular expression substitution.
\end{note}

If your question was a bit confused, and what you really wanted was
replace all newline characters in a string with <br>, then your solution
works fine.

> @lines=split /\n/,$string

$newstr = '';

> for $line (@lines) {
> $newstr = ($newstr.$line."<br>");

$newstr .= "$line<br>";

> }

Ick. That's ugly :)

If you really think that you can get any benefit out of a solution that
uses split, then also use join:

$newstr = join '<br>', split /\n/, $string;

But the s///g is going to be much faster.

As an aside: You should consider using the -w flag and the strict
pragma. The code you presented didn't look like it was used under those
regimes.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Freudian slip: when you say one thing
Commercial Dynamics Pty. Ltd.   | but mean your mother.
NSW, Australia                  | 


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

Date: Wed, 15 Nov 2000 09:27:57 -0000
From: "Dave Cross" <dave@dave.org.uk>
Subject: Re: Date
Message-Id: <8utl0v$7gn$1@taliesin.netcom.net.uk>


<ameen @ dausha . net (Ameen Dausha)> wrote in message
news:3a11f48e.17053769@news...
> On 15 Nov 2000 00:53:46 GMT, jobbey83@aol.com (JOBBEY83) spat:
>
> >Hi, I am a total newbie and I am wondering how I can calculate the
current date
> >mm/dd/yy. If it involves installing a module could you please direct me
on how
> >to do so?
>
> The CPAN Module "Date::Manip" is plenty powerful.

Perhaps a little _too_ powerful for a task like this which can be
accomplished very easily with localtime.

Dave...





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

Date: Wed, 15 Nov 2000 12:04:08 GMT
From: ameen @ dausha . net (Ameen Dausha)
Subject: Re: Date
Message-Id: <3a127a51.51301822@news>

On Wed, 15 Nov 2000 09:27:57 -0000, "Dave Cross" <dave@dave.org.uk>
spat:

>
><ameen @ dausha . net (Ameen Dausha)> wrote in message
>news:3a11f48e.17053769@news...
>> On 15 Nov 2000 00:53:46 GMT, jobbey83@aol.com (JOBBEY83) spat:
>>
>> >Hi, I am a total newbie and I am wondering how I can calculate the
>current date
>> >mm/dd/yy. If it involves installing a module could you please direct me
>on how
>> >to do so?
>>
>> The CPAN Module "Date::Manip" is plenty powerful.
>
>Perhaps a little _too_ powerful for a task like this which can be
>accomplished very easily with localtime.

Yes, buy with localtime don't you need to incriment the month and day?
Don't you need to handle the fact that this is Perl Year 100? Granted,
that can be handled by adding a few lines of code, but:

use Date::Manip;

$today = &DateCalc("today", "%m/%d/%y");

>
>Dave...
>
>
>



Ben Wilson (a.k.a. Ameen, Last of the Dausha)
____________________________
-"Ever heard of Aristotle . . . Plato . . . Socrates?!"
-"Yes."
-"Morons!"


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

Date: Wed, 15 Nov 2000 08:11:00 -0500
From: Jeff Pinyan <jeffp@crusoe.net>
Subject: Re: Date
Message-Id: <Pine.GSO.4.21.0011150808480.265-100000@crusoe.crusoe.net>

[posted & mailed]

On Nov 15, ameen@dausha said:

>Yes, buy with localtime don't you need to incriment the month and day?
>Don't you need to handle the fact that this is Perl Year 100? Granted,
>that can be handled by adding a few lines of code, but:
>
>use Date::Manip;
>
>$today = &DateCalc("today", "%m/%d/%y");

Data::Manip is overkill, though.  It's everything, and then the kitchen
sink.  It'll slow your program down because it's a behemoth.

Why not use a simple localtime() solution -- which would require you to
KNOW about the return values it provides! -- or use something like the
POSIX::strftime() function?

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/





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

Date: Wed, 15 Nov 2000 11:44:11 +0100
From: "Alexander Farber (EED)" <eedalf@eed.ericsson.se>
Subject: debugger: { p "\n\nLINE: $_\n" if source code line == 336
Message-Id: <3A1268FB.4ADC2D4E@eed.ericsson.se>

Hi,

I am debugging a perl script which reads 
some data from a file in a while loop:

        while (<SWRFILE>){
#            print STDERR "$releasedseen";

            if ($releasedseen) {                # LINE 336

                if (/<(BR|br)>(\d\d\d\d-\d\d-\d\d)<\/(TD|td)>/) {
                    $temphash{$loadfile} = $2;
#                    print STDERR "$temphash{$loadfile}\n";
                } 
                $releasedseen = 0;
            }
 ...
        }

Is there a way to let the perl debugger
print the $_ only if it is at the source
code line number 336?

I am currently using { p "\n\nLINE: $_\n"
but it prints $_ all the time which is
disturbing (I just want to see it once
per loop - after the while-keyword).

TIA
Alex


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

Date: 15 Nov 2000 13:37:15 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: debugger: { p "\n\nLINE: $_\n" if source code line == 336
Message-Id: <8uu3ib$gvo$1@charm.magnus.acs.ohio-state.edu>

[A complimentary Cc of this posting was sent to Alexander Farber (EED)
<eedalf@eed.ericsson.se>],
who wrote in article <3A1268FB.4ADC2D4E@eed.ericsson.se>:
> I am currently using { p "\n\nLINE: $_\n"
> but it prints $_ all the time which is
> disturbing (I just want to see it once
> per loop - after the while-keyword).

Set an `a'ction.

Ilya


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

Date: Wed, 15 Nov 2000 12:09:45 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Delete empty directories
Message-Id: <bku41to45j6lnc9f6fcerbegdeqpj75cdb@4ax.com>

Here's a cute little problem. No it's not a homework problem, although
it's a good candidate. Description:

   Recursively scan through a directory tree (using File::Find), and
   delete all subdirectories that contain no files, but only empty
   subdirectories.

The problem is, simply put, that the callback order for the files
happens top down, and checking and deleting empty directories best
happens bottom up.

Yes I have a solution. I just won't post it yet.

-- 
	Bart.


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

Date: Wed, 15 Nov 2000 13:44:07 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Delete empty directories
Message-Id: <slrn9154p3.fjg.tjla@thislove.dyndns.org>

I was shocked! How could Bart Lateur <bart.lateur@skynet.be>
say such a terrible thing:
>Here's a cute little problem. No it's not a homework problem, although
>it's a good candidate. Description:

Look we're not here just to do your homework assignments you know <gdr>

>   Recursively scan through a directory tree (using File::Find), and
>   delete all subdirectories that contain no files, but only empty
>   subdirectories.
>
>The problem is, simply put, that the callback order for the files
>happens top down, and checking and deleting empty directories best
>happens bottom up.

Well you can set the 'bydepth' flag which should do what you want. It's
not a true depth first search though so I suspect that doing it this way
may actually be easier.

>Yes I have a solution. I just won't post it yet.

This gets rid of even the current directory if necessary. It will screw
up big time if you cannot delete a directory for some reason. Do I pass?

#!/usr/bin/perl -w
use strict;

use File::Find;

my @dirs_to_remove;

find(
    { 
    wanted => sub {
        my $name = $_;
        if (-d)
        {
            @dirs_to_remove = 
                grep { $name =~ /^$_/ ? 1 : !rmdir $_ }
                @dirs_to_remove;
            
            unshift @dirs_to_remove, $name;
        }
        elsif (-f)
        {
            @dirs_to_remove =
                grep { $name !~ /^$_/ }
                @dirs_to_remove;
        }
    },
    no_chdir => 1
    },
    '.'
);

rmdir $_ foreach @dirs_to_remove;

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Yes, we love peace, but we are not willing to take wounds for it, as we
are for war.
-John Andrew Holmes, "Wisdom in Small Doses"


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

Date: Wed, 15 Nov 2000 14:32:42 +0300
From: "Steve" <newsgroups@mail.ru>
Subject: Re: getting the real virtual host
Message-Id: <8uttfi$2iv4$1@gavrilo.mtu.ru>

I figured that might be the case. Thanks for the answer.


"David Steuber" <nospam@david-steuber.com> wrote in message
news:m33dgujgfh.fsf@solo.david-steuber.com...
> "Steve" <newsgroups@mail.ru> writes:
>
> ' Is there any way of getting the real host that the user requested in
order
> ' to end up at my page?
>
> If all your host names map to the same IP address then the answer is
> no.  You need the Host header to determine which site is asked for.
> In its absense, you can send back a default page, but that is about it.
>
> --
> David Steuber | Perl apprentice.  The axe did not stop the
> NRA Member    | mops and buckets from flooding my home.
> ICQ# 91465842
> ***         http://www.david-steuber.com/          ***




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

Date: Tue, 14 Nov 2000 18:45:14 -0800
From: sthoenna@efn.org (Yitzchak Scott-Thoennes)
Subject: Re: giving , another name, like "and" for &&
Message-Id: <6ifE6gzkgOpS092yn@efn.org>

In article <8tjmck$ejj$1@lublin.zrz.tu-berlin.de>,
anno4000@lublin.zrz.TU-Berlin.DE (Anno Siegel) wrote:
> The standard comma operator (well, the list-building comma operator)
> inserts both its (scalar) operands into the list being built.  "Then",
> however, must see its left operand as a list in which *not* to include
> the right operand(s).  But if the left operand is a list, the empty
> list is a possibility, so the case of an empty operand must be allowed.

Why?  I would expect a low-precedence replacement for ',' named 'then'
to *not* discard the left operand in list context.
E.g. @a = ('a' then 'b') would put two scalars in @a.

Now if you named it 'but', I can see your point.

handle_error() but exit unless $ok;
@a = (side_effects_only() but really_include_these());


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

Date: Wed, 15 Nov 2000 10:05:04 +0100
From: "Markus Elfring" <ELF@Messer.de>
Subject: How can a SMTP mail be deleted from a Unix mailbox by a script?
Message-Id: <8utj4k$cbi$1@news.messer.de>

Hi there,

I've written a script that processes a SMTP mail to import it into another
system after it was piped by the forward command (see "man forward"). The
script should delete the original message from the inbox or mailbox after a
successful import.

- How can the mail deleted with the use of the Unix commands "mail" or
"mailx" in the preferred programming languages "bash", "Perl", "PHP" or
"TCL"?
- What actions must be performed to remove the specific mail from the mbox
file?

Mit freundlichen Grüßen

Markus Elfring

MESSER GRIESHEIM GmbH
Geschäftsbereich Industriegase Deutschland
Informationssysteme
Fütingsweg 34
D-47805 Krefeld

Tel.: (0 21 51) 3 79-8 30
Fax: (0 21 51) 3 79-7 79
Internet: http://www.gase.net/

____________________________________________________________________________
______

Firmenname: Messer Griesheim GmbH
Sitz der Gesellschaft: Frankfurt/Main
Registergericht: Amtsgericht Frankfurt/Main, Reg.-Nr.: HRB 7812
Vorsitzender des Aufsichtsrates: Horst Waesche
Geschäftsführung: Klaus-Jürgen Schmieder (Vors.), Stefan Messer, Jürgen
Schöttler, Peter Stocks








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

Date: Wed, 15 Nov 2000 09:04:28 GMT
From: Alex Hart <news@#nospam#althepal.com>
Subject: how to use perlcc with boot_DynaLoader problem
Message-Id: <wksQ5.8069$46.518011@typhoon1.ba-dsg.net>

I posted a few weeks back asking how to use perlcc. No one answered me,
but I figured it out anway. I thought I would share the knowledge.

perlcc -e 'print "hello, World\n"; should produce an executable but it
was failing. The end of the failed compile looked like this:

Compiling C(perlc11979) for comp11979.p!
perl -I/usr/lib/perl5/5.6.0/i686-linux -I/usr/lib/perl5/5.6.0
-I/usr/lib/perl5/site_perl/5.6.0/i686-linux
-I/usr/lib/perl5/site_perl/5.6.0 -I/usr/lib/perl5/site_perl -I.
/tmp/comp11979.p.tst
cc -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/lib/perl5/5.6.0/i686-linux/CORE -o perlc11979 comp11979.p.c
-L/usr/lib -L/usr/lib/perl5/5.6.0/i686-linux/CORE -lperl -lnsl -lndbm
-ldb -ldl -lm -lc -lposix -lcrypt
/usr/lib/perl5/5.6.0/i686-linux/auto/IO/IO.so
/usr/lib/perl5/5.6.0/i686-linux/auto/Fcntl/Fcntl.so
/tmp/cce4TxOH.o: In function `xs_init':
/tmp/cce4TxOH.o(.text+0x324d): undefined reference to `boot_DynaLoader'
collect2: ld returned 1 exit status
ERROR: In compiling code for comp11979.p.c !

I made it work by cutting out the cc command, like this :

cc -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/lib/perl5/5.6.0/i686-linux/CORE -o perlc11979 comp11979.p.c
-L/usr/lib -L/usr/lib/perl5/5.6.0/i686-linux/CORE -lperl -lnsl -lndbm
-ldb -ldl -lm -lc -lposix -lcrypt
/usr/lib/perl5/5.6.0/i686-linux/auto/IO/IO.so
/usr/lib/perl5/5.6.0/i686-linux/auto/Fcntl/Fcntl.so

then add on the DynaLoader.a file to the compile, like this :


cc -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-I/usr/lib/perl5/5.6.0/i686-linux/CORE -o perlc11979 comp11979.p.c
-L/usr/lib -L/usr/lib/perl5/5.6.0/i686-linux/CORE -lperl -lnsl -lndbm
-ldb -ldl -lm -lc -lposix -lcrypt
/usr/lib/perl5/5.6.0/i686-linux/auto/IO/IO.so
/usr/lib/perl5/5.6.0/i686-linux/auto/Fcntl/Fcntl.so
/usr/lib/perl5/5.6.0/i686-linux/auto/DynaLoader/DynaLoader.a

Now the compile works.  Good luck out there.

- Alex Hart

$j="592888088758319859281631592858792919873179698955";
$p="push\@_,";$c="chop(\$_)";$_="$p$p($c.$c)+19;eval;
+".$j;eval;%_=map{chr}reverse@_;foreach(sort+keys%_){print$_{$_}}




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

Date: Wed, 15 Nov 2000 09:28:09 GMT
From: Alex Hart <news@#nospam#althepal.com>
Subject: I need a fork example, please
Message-Id: <JGsQ5.8070$46.518798@typhoon1.ba-dsg.net>

I've read what I can on forks, but everyone assumes I've used them
before with C, or something.  But I haven't.

I want to fork off a process, run a function, then die.  Basically, I
have a user interface that I want to keep going, but I want to talk to a
server in the background, without having to wait for the server's
response.

I imaging its something like this :

sub ServerTalk {
 blah ...
}

fork and ServerTalk() and die;
print " talking to the server right now".

Will this work. Is fork what I need to do this? I'd love a little insite
into this.

Thanks.
- Alex Hart

$j="592888088758319859281631592858792919873179698955";
$p="push\@_,";$c="chop(\$_)";$_="$p$p($c.$c)+19;eval;
+".$j;eval;%_=map{chr}reverse@_;foreach(sort+keys%_){print$_{$_}}




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

Date: Wed, 15 Nov 2000 09:06:54 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: IP geography
Message-Id: <slrn914khc.fjg.tjla@thislove.dyndns.org>

I was shocked! How could Jeff Zucker <jeff@vpservices.com>
say such a terrible thing:
>Bart Lateur wrote:
>> 
>> Martien Verbruggen wrote:
>> 
>> >> I guess when IPv6 rolls out, early in the 31st century (no, that isn't
>> >> a typo), each planet, station, moon, asteroid, etc, will get its own
>> >> set of subnets.
>> >
>> >There's enough room in that address space to individually address each
>> >organ in everyone's body :)
>> 
>> Ooh, that's not enough. I'll be satisfied only if there are enough IP
>> addresses for every cell in everybody's body.
>
>Bah, wimps!  I want one for every nucleotide in every strand of human
>DNA.  Yeah, that's the ticket.

More than enough to address every atom in the entire universe so I think
it should be okay :)

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Since this is an exercise divorced from reality, the usual vehicle
was LISP.
-Ken Thompson, Turing Award Lecture


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

Date: Wed, 15 Nov 2000 12:15:26 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: IP geography
Message-Id: <m3lmulig81.fsf@solo.david-steuber.com>

mgjv@tradingpost.com.au (Martien Verbruggen) writes:

' There's enough room in that address space to individually address each
' organ in everyone's body :)

Finally I will be able to tell my ass from my elbow!

-- 
David Steuber | Perl apprentice.  The axe did not stop the
NRA Member    | mops and buckets from flooding my home.
ICQ# 91465842
***         http://www.david-steuber.com/          ***


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

Date: Wed, 15 Nov 2000 09:55:01 +0100
From: "Markus Elfring" <ELF@Messer.de>
Subject: Is a function/class library for processing of SMTP-mails available?
Message-Id: <8utihp$c7q$1@news.messer.de>

Hi there,

I've found the following:
> man forward
" ...
     If the first character of the address is a vertical bar (|),
     sendmail(1M)  pipes the message to the standard input of the
     command the bar precedes.
 ... "

I want to read this piped message to import it in one of our systems after
the sender and the subject had been checked.
Do you know a function or class library for a programming language (e. g.
PHP, TCL or Perl) that helps me to process this mail?

Mit freundlichen Grüßen

Markus Elfring

MESSER GRIESHEIM GmbH
Geschäftsbereich Industriegase Deutschland
Informationssysteme
Fütingsweg 34
D-47805 Krefeld

Tel.: (0 21 51) 3 79-8 30
Fax: (0 21 51) 3 79-7 79
Internet: http://www.gase.net/

____________________________________________________________________________
______

Firmenname: Messer Griesheim GmbH
Sitz der Gesellschaft: Frankfurt/Main
Registergericht: Amtsgericht Frankfurt/Main, Reg.-Nr.: HRB 7812
Vorsitzender des Aufsichtsrates: Horst Waesche
Geschäftsführung: Klaus-Jürgen Schmieder (Vors.), Stefan Messer, Jürgen
Schöttler, Peter Stocks






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

Date: Wed, 15 Nov 2000 12:56:42 GMT
From: Joel Saunier <jsaunier@my-deja.com>
Subject: Re: Is a function/class library for processing of SMTP-mails available?
Message-Id: <8uu168$1ig$1@nnrp1.deja.com>

In article <8utihp$c7q$1@news.messer.de>,
  "Markus Elfring" <ELF@Messer.de> wrote:
> Hi there,
>
> I've found the following:
> > man forward
> " ...
>      If the first character of the address is a vertical bar (|),
>      sendmail(1M)  pipes the message to the standard input of the
>      command the bar precedes.
> ... "
>
> I want to read this piped message to import it in one of our systems
> after the sender and the subject had been checked.
> Do you know a function or class library for a programming language
> (e. g. PHP, TCL or Perl) that helps me to process this mail?

I think *every* **good** scripting language have that. For Tcl, it's
in the tcllib (currently 0.8). You have "::smtp" and "::mime" packages
to generate/parse e-mail.

No doubt that PHP, Perl, Python, ... have that too.

Sincerely,

Joël Saunier


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 15 Nov 2000 12:57:17 +0100
From: Alexander Nietzschmann <dj.peppone@gmx.net>
Subject: Is there something like "exe2perl"?
Message-Id: <3A127A1D.7C342153@gmx.net>

Hello everyone,

at http://www.perl2exe.com there's a program that compiles the perl
interpreter to a perl script and creates an executable. Does anyone know
if it's possible to extract the perl code from an exe that has been
created with perl2exe?

Greets, Alex


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

Date: Wed, 15 Nov 2000 12:53:52 GMT
From: David Steuber <nospam@david-steuber.com>
Subject: Re: Is there something like "exe2perl"?
Message-Id: <m33dgtieg0.fsf@solo.david-steuber.com>

Alexander Nietzschmann <dj.peppone@gmx.net> writes:

' at http://www.perl2exe.com there's a program that compiles the perl
' interpreter to a perl script and creates an executable. Does anyone know
' if it's possible to extract the perl code from an exe that has been
' created with perl2exe?

I don't think this is a reversable process.  Machine code runs at a
lower level than Perl code does.

If you do perl2exe on the following script:

#!/usr/bin/perl -w
use strict;

print "Hello, world!\n";

exit(0);

What will you get?  Would it be at all obvious how to get back the
original Perl from the binary image?  Also, the binary image would be
different for Intel, MIPS, Alpha, G4, etc.

It would take some fairly sophisticated code to turn the machine code
into C let alone Perl.  A debugger can convert the machine code into
assembly for you, but you won't necessarily be able to identify which
parts of the code are unique to the script and which parts are from
standard libraries that got linked in staticly.

-- 
David Steuber | Perl apprentice.  The axe did not stop the
NRA Member    | mops and buckets from flooding my home.
ICQ# 91465842
***         http://www.david-steuber.com/          ***


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

Date: 15 Nov 2000 06:19:52 -0700
From: tchrist@perl.com (Tom Christiansen)
Subject: Re: Perl syntax and beyond (was: Re: Perl style and module searches)
Message-Id: <3a128d78@cs.colorado.edu>

In article <8un21l$q1$1@news.panix.com>, David Combs <dkcombs@panix.com> wrote:
>Is also similar problem with "shift" (which is fast)
>opposite, push-onto-beginning, eg when trying to do a
>"queue" (eg for breadth-first-search).  Adding one
>to the first shifts whole rest of it to the right, ie
>must copy entire array.  Do that a bunch of times and
>it becomes O(n-squared).
>
>There is some hack with push that you can do, via 
>allocating more room when initializing it -- but that
>is for growing ONLY to the RIGHT.
>
>Only way to do queue that way is to build your own,
>I have been told, OO, where YOU manage the storage.

You are doing it wrong.  

    push @queue, $item;
    $item = shift @queue;

will be rather faster than 

    unshift @eueuq, $meti;
    $meti = pop @eueuq;

Go look at illguts for what is happening.  And yes, there are issues
here.  Sometimes they matter.  Often they don't.  One must become
skillful at discerning the difference.

Use Perl for its strengths, not its weaknesses.

In general, you are completely overkilling yourself  to write a
linked list in Perl code.  For anything less than *VERY HUGE*
datasets, a simple array will be faster.  Notice how difficult it
is to get splice to be slower than your own attempts.  That is
because your perl-based attempts run more op codes through the inner
interpreter loop, and splice does not.

For this kind of thing, therefore, you are over-engineering in all
but the very rarest of cases.  Thus, for the the average case, you
are doing far too much work for the nominal return--and, in point
of fact, are rather apt to end up with something that runs more
slowly, too.

    "Ambition is a poor excuse for not having sense enough to be lazy."
				--Charlie McCarthy

--tom


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V9 Issue 4892
**************************************


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