[12396] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5996 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 14 23:07:22 1999

Date: Mon, 14 Jun 99 20:00:20 -0700
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, 14 Jun 1999     Volume: 8 Number: 5996

Today's topics:
    Re: a thread on threads <rra@stanford.edu>
        Compiling regexes for the duration of a subroutine <macintsh@cs.bu.edu>
    Re: Compiling regexes for the duration of a subroutine <tchrist@mox.perl.com>
    Re: Compiling regexes for the duration of a subroutine <rootbeer@redcat.com>
    Re: Compiling regexes for the duration of a subroutine <macintsh@cs.bu.edu>
        CPAN process still running???? <master@m.com>
        Digest::MD5 jonathan.loh@bankamerica.com
    Re: Digest::MD5 <rootbeer@redcat.com>
    Re: Extracting PIDs from a 'ps aux' <jbc@shell2.la.best.com>
    Re: file read (Larry Rosler)
    Re: Find and replace in a file within a while loop (Tad McClellan)
        GD.pm : Use accent for french page yamyot@my-deja.com
        Help with uploads <rideout@sound.net>
    Re: Help with uploads <rootbeer@redcat.com>
        How to integrate xloadimage with my Perl CGI <hkchan@coolhot.com>
        ipc::open3 example please (Steve .)
    Re: MacPerl and sending records to filemaker: apple eve (Rory C-L)
        MAKE, NMAKE, DMAKE <master@m.com>
    Re: my() in a loop <mjcarman@zeus.ia.net>
    Re: Need this code tightened (Marcel Grunauer)
        Perl & GD & "i,`,I ..." yamyot@my-deja.com
    Re: Perl class and constructor (Damian Conway)
        Perl Compiler cor75@my-deja.com
        Perl Mongers Book Review page is up <jbm@panix.com>
        Question...(advice requested) <portboy@home.com>
    Re: Script tolook at hotfolder and gunzip files on NT <rootbeer@redcat.com>
    Re: Search and replace <outlaw_torn@mailexcite.com>
    Re: waiting... <outlaw_torn@mailexcite.com>
        XS-Question (Konstantinos Agouros)
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: 14 Jun 1999 18:15:57 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: a thread on threads
Message-Id: <ylg13unu0i.fsf@windlord.stanford.edu>

Uri Guttman <uri@sysarch.com> writes:

> threads are never needed, only desired by those who think they are a
> winner. redmond has pushed more threads onto the world by making fork
> disappear and all the kiddies think that is the only way to do it
> now. having a separate data space is usually a win and it requires you
> you to make a better IPC than you would with threads.

The currently fastest transit news server package in existence runs on
Windows NT, not on Unix.  One of the primary reasons is threading.

The currently fastest Unix news server package is heavily threaded.  The
Unix news servers that use fork and shared memory, or use a monolithic
process and select loops, are noticeably slower.

Blind dismissal of threads is just as stupid as blind acceptance of them.
"Make a better IPC" often translates into "do a lot more pointless work
that you wouldn't have to do if you used a threading mdel."

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: 15 Jun 1999 00:30:07 GMT
From: John Siracusa <macintsh@cs.bu.edu>
Subject: Compiling regexes for the duration of a subroutine
Message-Id: <7k46qf$882$1@news1.bu.edu>

Consider this example:

    sub foo
    {
      my($re1, $re2) = @_;

      foreach my $thing (...lots of things...)
      {
        if($thing =~ /$re1/ && $thing =~ /$re2/)
        {
          # Whatever...
        }
      }
    }

I can't put /o on those matches because it'll only compile
the regexes the first time foo() is called.  I can't use the
dubious "last successful match" null regex technique because
I have more than one regex.  I could create an anonymous
subroutine to do the matches, but benchmarking reveals that
there's quite a speed hit for the repeated subroutine calls.

Is there another solution to this problem?

-----------------+----------------------------------------
  John Siracusa  | If you only have a hammer, you tend to
 macintsh@bu.edu | see every problem as a nail. -- Maslow


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

Date: 14 Jun 1999 18:33:53 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Compiling regexes for the duration of a subroutine
Message-Id: <37659f71@cs.colorado.edu>

     [courtesy cc of this posting mailed to cited author]

In comp.lang.perl.misc, 
    John Siracusa <macintsh@cs.bu.edu> writes:
:I can't put /o on those matches because it'll only compile
:the regexes the first time foo() is called.  I can't use the
:dubious "last successful match" null regex technique because
:I have more than one regex.  

    #!/usr/bin/perl
    # popgrep5 - grep for abbreviations of places that say "pop"
    # version 5: qr// version
    @popstates = qw(CO ON MI WI MN);
    @poppats   = map { qr/\b$_\b/ } @popstates;
    while ($line = <>) {
	for $patobj (@poppats) {
	    print $line if $line =~ /$patobj/;
	}
    }

--tom
-- 
In general, if you think something isn't in Perl, try it out, because it
usually is.  :-)
        --Larry Wall in <1991Jul31.174523.9447@netlabs.com>


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

Date: Mon, 14 Jun 1999 17:57:44 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Compiling regexes for the duration of a subroutine
Message-Id: <Pine.GSO.4.02A.9906141756510.6999-100000@user2.teleport.com>

On 15 Jun 1999, John Siracusa wrote:

> I can't put /o on those matches because it'll only compile
> the regexes the first time foo() is called.  I can't use the
> dubious "last successful match" null regex technique because
> I have more than one regex.  I could create an anonymous
> subroutine to do the matches, but benchmarking reveals that
> there's quite a speed hit for the repeated subroutine calls.
> 
> Is there another solution to this problem?

See the qr// operator in the documentation for 5.005. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 15 Jun 1999 01:08:33 GMT
From: John Siracusa <macintsh@cs.bu.edu>
Subject: Re: Compiling regexes for the duration of a subroutine
Message-Id: <7k492h$fts$1@news1.bu.edu>

Tom Phoenix <rootbeer@redcat.com> wrote:
> See the qr// operator in the documentation for 5.005. Cheers!

Damn, these features sneak up on you!  Thanks :)

-----------------+----------------------------------------
  John Siracusa  | If you only have a hammer, you tend to
 macintsh@bu.edu | see every problem as a nail. -- Maslow


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

Date: Tue, 15 Jun 1999 01:29:00 +0100
From: "master" <master@m.com>
Subject: CPAN process still running????
Message-Id: <7k46mq$3as$1@nclient5-gui.server.virgin.net>

I have started experimenting with the CPAN shell the last couple of days.
After an unsuccessfull attempt at downloading and installing
"Bundle-libnet", (by running perl -MCPAN -e "install Bundle::libnet" or
something like that) I did CTRL-C to break out of the loop. My next attempt
to access the shell gave the following message:

        D:\users>perl -MCPAN -e shell

        There seems to be running another CPAN process (306). Contacting...
        kill process failed!

Now, even after rebooting my machine I still get the same error, and you can
understand how annoying that can be!!!!    @#**$#"~@!"

Can anyone tell me, is there a way of reseting the bloody thing? Is there a
place where the module is keeping info on past sessions? What's wrong???

Thank you in advance for your time..
A.Joannou






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

Date: Mon, 14 Jun 1999 22:33:13 GMT
From: jonathan.loh@bankamerica.com
Subject: Digest::MD5
Message-Id: <7k3vv9$5j8$1@nnrp1.deja.com>

Can someone please provide me a sample of how to encrypt and decrypt a
file using the Digest::MD5 package?  Or can I even do this using this
package?  If not what package do I need?

Please email me as well as post the answer to this newsgroup.
--
Jonathan Loh
System Administrator
Bank Of America


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 14 Jun 1999 17:56:06 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Digest::MD5
Message-Id: <Pine.GSO.4.02A.9906141752280.6999-100000@user2.teleport.com>

On Mon, 14 Jun 1999 jonathan.loh@bankamerica.com wrote:

> Can someone please provide me a sample of how to encrypt and decrypt a
> file using the Digest::MD5 package?  Or can I even do this using this
> package?  If not what package do I need?

I think you mean "module" instead of "package". MD5 isn't useful for that
sort of thing. But see the Module List on CPAN to find some modules which
will do the job.

    http://www.cpan.org/modules/00modlist.long.html#14)Authenticatio
    http://www.cpan.org/modules/
    http://www.cpan.org/

Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 15 Jun 1999 00:43:03 GMT
From: John Callender <jbc@shell2.la.best.com>
Subject: Re: Extracting PIDs from a 'ps aux'
Message-Id: <3765a197$0$211@nntp1.ba.best.com>

Gregory Snow <snow@biostat.washington.edu> wrote:

> try using map with split, i.e.

> @pids = map { (split)[1] } @grep;

Dang it; I *knew* there was a more concise approach I was overlooking.

I don't know why, but I have some kind of mental block that prevents me
from thinking of map as a solution to problems like this. The same
thing with the grep function; I just never seem to think of it until I
see someone else using it. You can imagine, then, how the Schwartzian
Transform made my eyes cross when I first saw it...

I guess it's because I devised workarounds involving foreach'ing over
the arrays before I knew that grep and map existed, and those have
served me well enough that I never internalized the more efficient
approach given above.

*sigh* 

One of these days I'll start thinking in Perl...

-- 
John Callender
jbc@west.net
http://www.west.net/~jbc/


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

Date: Mon, 14 Jun 1999 16:54:03 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: file read
Message-Id: <MPG.11cf35f942688be8989be1@nntp.hpl.hp.com>

[Posted and a courtesy copy mailed.]

In article <7k3g3q$v81$1@nnrp1.deja.com> on Mon, 14 Jun 1999 18:02:41 
GMT, olmert@netvision.net.il <olmert@netvision.net.il> says...
> Can any body help me with this: I want to create a perl script that
> opens a file for reading, prints it's content to the user's screen, and
> then timesout for 2 seconds. after two seconds it checks if the file was
> updated, and if so- prints the content from the place it stopped the
> previous time.
> any ideas?

perlfaq5:  "How do I do a tail -f in perl?"

> please reply to olmert@netvision.net.il

Sure.

-- 
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com


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

Date: Mon, 14 Jun 1999 13:20:44 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Find and replace in a file within a while loop
Message-Id: <cld3k7.5qc.ln@magna.metronet.com>

ramverma@my-deja.com wrote:

:    I have to loop through the first file(lookup.txt) read a line token
:    then loop through the relace file, search if token exists and
:    replace it with the value. Exit out of the inner loop and get the
:    second line of token and loop again through the replace file again.
:    This goes on till the entire loopup.txt file is looped through.


   Hopefully you have already had a look at the Perl FAQ, part 6:

      "How do I efficiently match many regular expressions at once?"


:    So far everything is fine. But the problem is, it doesn't replace
:    the tokens in the replace file(pattern matching), even though it
:    finds it.


   Hopefully you have some output statments somewhere in your
   unseen program?

   Hopefully you have already had a look at the Perl FAQ, part 5:

      "How do I change one line in a file/
       delete a line in a file/
       insert a line in the middle of a file/
       append to the beginning of a file?"


:    Can any one help.


   We are much more effective at troubleshooting code when
   given code to troubleshoot...

   Good luck.


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


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

Date: Tue, 15 Jun 1999 00:42:28 GMT
From: yamyot@my-deja.com
Subject: GD.pm : Use accent for french page
Message-Id: <7k47hj$828$1@nnrp1.deja.com>

I'm not able to display letter with accent in generated GIF image with
the GD module.  I need to generate a web page image with somme french
words in it, but all char with accent don't appear.

For exemple, I need to display "Icouter" and it display " couter".

Somebody know how can we display special char, is it possible to
specify charset or someting like that to be able to use special char.


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 14 Jun 1999 20:20:05 -0500
From: "R & K Rideout" <rideout@sound.net>
Subject: Help with uploads
Message-Id: <3765a82e.0@news.sound.net>

Does anyone have or know of a .pl to strip the ^M from the end of each line
once it is uploaded to UNIX.  Currently, I have to do it one line at a time.




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

Date: Mon, 14 Jun 1999 18:53:25 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Help with uploads
Message-Id: <Pine.GSO.4.02A.9906141847350.6999-100000@user2.teleport.com>

On Mon, 14 Jun 1999, R & K Rideout wrote:

> Does anyone have or know of a .pl 

A Perl Library file?

> to strip the ^M from the end of each line once it is uploaded to UNIX.  

If you are using FTP, your FTP utility should upload text files properly
(or you should get a new one). But you probably are asking for something
like this. Cheers!

    perl -pi.bak -e 'tr/\r//d' files*

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 15 Jun 1999 10:02:20 +0800
From: root <hkchan@coolhot.com>
Subject: How to integrate xloadimage with my Perl CGI
Message-Id: <3765B42C.A4813CB8@coolhot.com>

Hi,

I'm trying to reduce the image size or do format convertion from JPG to
GIF by using xloadimage in my CGI, but I just can't get rid of this
error message "Can't open display:"

Please advice and many thanks in advance.

Gerald






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

Date: Tue, 15 Jun 1999 00:52:30 GMT
From: syarbrou@nospam.enteract.com (Steve .)
Subject: ipc::open3 example please
Message-Id: <3765a304.38064810@news.enteract.com>

I've been told that IPC::open3 is the way to go for a program I'm
writing.  I am making a system call to a shell script, passing a path
variable with it(ex.  shell.sh /dir).

The script basically replicates a server to another one with rdist.  I
want the output of rdist to be outputted to the screen as it runs.  I
have written it to save the output and spit it out and the end, but do
not want the user to sit there for a half hour wondering what's
happening.

I've found a brief example of open2, but it doesn't seem to run when
put into the perl script.  Can someone send me an example of the
IPC::open3 function in relation to my application?  Thanks.

Steve

Newsgroup posts prefered.  If you respond thru email remove nospam
from address.


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

Date: Tue, 15 Jun 1999 01:45:18 +0100
From: 'x'campbell-lange@easynet.co.uk (Rory C-L)
Subject: Re: MacPerl and sending records to filemaker: apple events?
Message-Id: <'x'campbell-lange-1506990145190001@campbell-lange.easynet.co.uk>

In article <yog93.765$S2.48000@iad-read.news.verio.net>,
schinder@leprss.gsfc.nasa.gov wrote:


> 
> No, but you can send Apple Events directly from MacPerl.  In fact, you
> should be looking at Chris Nandor's beta of Mac::Glue, which may give
> you the control you want over Filemaker directly from MacPerl.  Check
> his web site, http://pudge.net/macperl/
> 

Paul.
Thanks
I've received some information from Chris on this, and will look into
using the Module. Thanks for your help
Rory

-- 
please remove the 'x' to reply


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

Date: Tue, 15 Jun 1999 01:34:18 +0100
From: "master" <master@m.com>
Subject: MAKE, NMAKE, DMAKE
Message-Id: <7k470o$3bt$1@nclient5-gui.server.virgin.net>

Trying to install MSQL on NT.

Downloaded
App :
            Msql Win32 server 2.09 (installed ok)

Modules :
            Msql-Mysql-module-1.2200.tar.gz
            DBI-1.09.tar.gz
            Data-ShowTable-3.3.tar.gz

----------------------------------------------------------------------------
-------------------------------
making these modules with nmake (ms c++) gives errors.
Starting with Data :: ShowTable, which is needed by Msql, "perl makefile.pl"

        perl makefile.pl [ENTER]
        Checking if your kit is complete...
        Looks good
        Writing Makefile for Data::ShowTable

nmake gives:

        nmake [ENTER]
        Microsoft (R) Program Maintenance Utility   Version 1.60.5270
        Copyright (c) Microsoft Corp 1988-1995. All rights reserved.


    D:\Perl\5.00502\bin\MSWin32-x86-object\perl -ID:\Perl\5.00502\lib\MSWin3
        2-x86-object -ID:\Perl\5.00502\lib -MExtUtils::Command -e cp
showtable blib\script\showtable
    D:\Perl\5.00502\bin\MSWin32-x86-object\perl -ID:\Perl\5.00502\lib\MSWin3
        2-x86-object -ID:\Perl\5.00502\lib  -e "system
qq[pl2bat.bat ].shift" blib\scrip
        t\showtable


nmake test  [ENTER]
Failed 17/17 test scripts, 0.00% okay. 12/12 subtests failed, 0.00% okay.
NMAKE : fatal error U1077: 'D:\Perl\5.00502\bin\MSWin32-x86-object\perl' :
retur
n code '0x2'
Stop.

This is where i get stuck with (ms) nmake.
----------------------------------------------------------------------------
-------------------------

with make (cygwin) i get errors from the first moment

make [ENTER]
Makefile:667: *** missing separator.  Stop.

if I place a tab in front of line 667
D:\Data-ShowTable-3.3>make
Makefile:668: *** missing separator.  Stop.

if I place a tab in front of line 668
D:\Data-ShowTable-3.3>make
The name specified is not recognized as an
internal or external command, operable program or batch file.
make: *** [config] Error 1

This is where i get stuck with (cygwin) make
----------------------------------------------------------------------------
-------

Is there any solution to the above??

Is there a 1off way of "make"ing modules??

Please remember, my platform is Windows NT.
I have easily installed DBI from activestates website, using ppm. That was
painless.
Is there a place where I could find these modules as packages (msql, and
data aren't on activestate's website)?

Is there a way of making modules install like packages?


Any suggestions appreciated. Thank you in advance.

PS. If any of the above questions seem naive please excuse me.
We are all, beginers somewhere at somepoint, however good we are in other
areas!!!!
I know I am in this area, and I know I am appealing to the more advanced
users of perl.






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

Date: Mon, 14 Jun 1999 19:50:36 -0500
From: Michael Carman <mjcarman@zeus.ia.net>
Subject: Re: my() in a loop
Message-Id: <3765A35C.8984A062@zeus.ia.net>

> So, where do you put your my()'s, and why?

I generally declare as many things as I can inside a loop/block/subroutine
in order to minimize the amount of clutter in the global namespace and
minimize the possibility of inadvertently clobbering values. I suppose it
might be slightly faster to my() things outside the loop, but then I suppose
it should also save a little memory to do it inside since the variable
ceases to exist once you've left the loop. It's not quite that simple --
just because you've left the scope of a variable and it's no longer defined
doesn't necessarily mean that the memory footprint of your program will
shrink, just that Perl isn't saving that space for anything else anymore.
Anyway, that's getting rather off-topic. If nothing else, keeping your
my()'s nearby means that you don't have a thousand declarations at the
beginning of your script and you don't need to go back to the beginning of
the file to declare something every time you need a new variable. (One of my
pet peeves about C.) It also helps to know when you don't need a particular
variable anymore.

-mjc



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

Date: Mon, 14 Jun 1999 22:51:26 GMT
From: marcel.grunauer@lovely.net (Marcel Grunauer)
Subject: Re: Need this code tightened
Message-Id: <37737b07.10541067@enews.newsguy.com>

On Mon, 14 Jun 1999 19:31:58 GMT, tbsmith@deltacom.net wrote:

>if ($miles <= 30) {
>    $30{$_} = $miles;

What does $_ contain?

Something like a place name where you build a list of places that are
within each range (30 to 120 miles)? So would call the whole code you
posted for each of the place names, and $miles would somehow have the
distance of that place to the current location, right?

>} elsif ($miles <= 60) {
>    $60{$_} = $miles;
>} elsif ($miles <= 90) {
>    $90{$_} = $miles;
>} elsif ($miles <= 120){
>    $120{$_} = $miles;
>}
>
>$miles is different distances. Here I just categorize them. Later I'll
>be printing out the lowest numbered hash with stuff in it. (The closest
>locations in a certain radius). I pass the lowest hash like this:
>
>        if (%30) {
>                print "The location(s) within a 30 mile radius
>                       around your zip code:<p>\n";
>                for (sort { $30{$a} <=> $30{$b} } keys %30) {
>                      $line = $_;
>                      $low_miles = $30{$_};
>                      &print_primary(30)
>                }

So if %30 (by the way, aren't these variable names a bit dodgy?)
contains something, you don't print the 60, 90 and 120 mile results?
Does print_primary use $line and $low_miles? Are they global
variables? I think it would be better to pass them to the subroutine
as arguments, something like:

print_primary($line, $low_miles, 30);

What's the "30" parameter for? What exactly does print_primary do?

>There's gotta be another way to do it, with much less code.
>
I've played around with mapping and grepping, but then realized that
for a large number of locations, there might be a better algorithm:

You only ever need to remember the "closest" set of results. That is,
once you've encountered something in the 30-60 range, you don't need
to look at the 60+ range anymore, and you can discard the results in
60+ range that you've already found.

This could make for quite a performance increase for a large number of
data, but some comparisons will make the code less neat as for a sort
of more straightforward solution.

It's late, I'll have to think about that some more. Will post again
when I've got something (unless someone else posts a neat solution).

HTH

Marcel



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

Date: Tue, 15 Jun 1999 00:34:49 GMT
From: yamyot@my-deja.com
Subject: Perl & GD & "i,`,I ..."
Message-Id: <7k4739$7tj$1@nnrp1.deja.com>

I use perl on NT to generate GIF image with
french text information.  All chars with accent
don`t appear.  Somebody know how can I display
char with accent.

After image creation, I use fonction like that

$im->string(gdSmallFont, 300, 100, "icouter",
$black);

And it display that:
" couter"


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 15 Jun 1999 01:20:47 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Perl class and constructor
Message-Id: <7k49pf$2ut$1@towncrier.cc.monash.edu.au>

Tom Christiansen <tchrist@mox.perl.com> writes:

>In comp.lang.perl.misc, damian@cs.monash.edu.au (Damian Conway) writes:
>:	print $obj->{__name};	// THROWS AN EXCEPTION

>So does that Perl statement, but at compile time. :-)


Arrrrggghhhhh.
I spent yesterday correcting undergraduate C++ assignments. 
It's astounding how quickly one can be reinfected :-(

Of course, I meant:

	print $obj->{__name};	# THROWS A *RUN-TIME* EXCEPTION


Damian


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

Date: Tue, 15 Jun 1999 01:15:35 GMT
From: cor75@my-deja.com
Subject: Perl Compiler
Message-Id: <7k49fh$8m0$1@nnrp1.deja.com>



Do I need to have root access in order to run make for the Perl
Compiler?

Thanks
Cory


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 14 Jun 1999 21:33:04 -0400
From: John Mignault <jbm@panix.com>
Subject: Perl Mongers Book Review page is up
Message-Id: <m3aeu2dz8v.fsf@jbm.dialup.access.net>

Well, the subject line explains most of it, but you can find the Perl
Monger Review of Books at

http://www.pm.org/book_reviews

Stop by and take a look. We hope to someday review a book not
published by O'Reilly. :)

j
-- 
#!/usr/bin/perl
$dot="\x2e";$lt="\x3c";$gt="\x3e";$at="\x40";
print "J Mignault ${lt}jbm${at}panix${dot}com${gt}\n";
$quote = qq(Uh-oh!!  I'm having TOO MUCH FUN!!);


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

Date: Tue, 15 Jun 1999 02:28:28 GMT
From: Mitch <portboy@home.com>
Subject: Question...(advice requested)
Message-Id: <37654A77.2FFD9A52@home.com>

My question is...I will have two serial ports to deal with.  The serial
ports will be either /dev/tty00 (user interaction) and /dev/tty01
(spewing messages).  I would like to be able to configure both of the
serial ports based on speed (9600 or 11520), data bits (7 or 8), stop
bits (1 or 2) and parity (none, even, odd).  Below is some code that
I've written to attempt to do this.  At the bottom of the serial
subroutine, you'll see a print statement, where I'm looking at what I
would be calling if I called "stty" command.

My question is, there's got to be a quicker and easier way of doing
this.  If so, any suggestions?  Also, should I use the stty command, or
screw around with the termios settings?  If using the stty command, how
can I call it to affect both serial ports?

Thanks,

 .mitch

sub serial
{
        my $view_port;
        my $speed;
        my $data_bits;
        my $stop_bits;
        my $parity;
        my $pflag;
        my $sflag;

        do {
                $view_port = &get_it("Set port to monitor input ?",
"/dev/tty00");
        } until ($view_port =~ /^\/dev\/tty0[0-1]/);
        do {
                $speed = &get_it("Set speed of serial ports:", "9600");
        } until ($speed =~ /^9600/ || $speed =~ /^11520/);

        do {
                $data_bits = &get_it("Set the data bits:", "8");
        } until ($data_bits =~ /^8/ || $data_bits =~ /^7/);

        do {
                $stop_bits = &get_it("Set the stop bits:", "1");
        } until ($stop_bits =~ /^1/ || $stop_bits =~ /^2/);

        do {
                $parity = &get_it("Set the parity:", "none");
        } until ($parity =~ /^none/i || $parity =~ /^even/i || $parity
=~ /^odd/i);

        if ($stop_bits == 1) {
                $sflag = "-cstopb";
        } else { $sflag = "cstopb"; }

        if ($parity =~ /^even/i) {
                $pflag = "-parodd";
        }
        elsif ($parity =~ /^odd/i) {
                $pflag = "parodd";
        }
        else {
                $pflag = "-parenb";
        }
        print "stty speed $speed $pflag cs$data_bits $sflag\n";
}


Here's my "get_it" subroutine:

sub get_it {
        my($wh,$def) = @_;
        &show( "$wh [$def] --->");
        my($an) = &get_line;
        $an = $def if ($an =~ /^\s*$/);
        $an;
}




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

Date: Mon, 14 Jun 1999 17:51:54 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Script tolook at hotfolder and gunzip files on NT
Message-Id: <Pine.GSO.4.02A.9906141750520.6999-100000@user2.teleport.com>

On Mon, 14 Jun 1999, Dutch McElvy wrote:

> Hi I am a newbie to perl but would like to write a script to look at a
> specific directory on an NT server and when gzipped files hit there
> for the gunzip application to run and unzip the files and then move
> those unzipped files into another specific directory.
> 
> Any suggestions would be appreciated.

You could probably use some of the functions documented in the perlfunc
manpage, especially readdir and friends, system, and rename. Cheers!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 15 Jun 1999 00:39:30 GMT
From: outlaw_torn <outlaw_torn@mailexcite.com>
Subject: Re: Search and replace
Message-Id: <7k47c1$808$1@nnrp1.deja.com>

In article <MPG.11ca511b922506f1989bbd@nntp.hpl.hp.com>,
  lr@hpl.hp.com (Larry Rosler) wrote:

> >
> > open (OUT, "outfile");
>
> I'd open an output file for output, not input.

DOH!...I always forget them greater than fellas...I should have it
tattoed to the inside of my eyelids "REMEMBER >".

Thanks


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Tue, 15 Jun 1999 00:52:56 GMT
From: outlaw_torn <outlaw_torn@mailexcite.com>
Subject: Re: waiting...
Message-Id: <7k4856$87h$1@nnrp1.deja.com>

Thank you very muchly...I've fiddled with example given in the perldoc
and I like the result very much.

In article <MPG.11c9007ccb1b2cc9989ba9@nntp.hpl.hp.com>,
  lr@hpl.hp.com (Larry Rosler) wrote:
>
> perldoc -f alarm
>
> --
> (Just Another Larry) Rosler
> Hewlett-Packard Company
> http://www.hpl.hp.com/personal/Larry_Rosler/
> lr@hpl.hp.com
>


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: Mon, 14 Jun 1999 19:48:15 GMT
From: elwood@news.agouros.de (Konstantinos Agouros)
Subject: XS-Question
Message-Id: <1999Jun14.194815.1257@news.agouros.de>

Hi,

I am currently writing a module where I build something
like $a->{hash}->[array]->{hashagain}
If I have a reference to SvRV(hv_fetch("hash"...) and array
is allready defined, and then create a new AV which I finally
store int $a->{hash} (in the C-part, using hv_store) will the
garbage-collection of perl clean up the old array?

Konstantin

P.S.: Is there an XS-Mode for emacs somewhere, or do I have to
use C-Mode?
-- 
Dipl-Inf. Konstantin Agouros aka Elwood Blues. Internet: elwood@agouros.de
Otkerstr. 28, 81547 Muenchen, Germany. Tel +49 89 69370185
----------------------------------------------------------------------------
"Captain, this ship will not sustain the forming of the cosmos." B'Elana Torres


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

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


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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

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

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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


------------------------------
End of Perl-Users Digest V8 Issue 5996
**************************************

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