[7691] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1317 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 14 08:07:21 1997

Date: Fri, 14 Nov 97 05:00:43 -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           Fri, 14 Nov 1997     Volume: 8 Number: 1317

Today's topics:
     'end of file' unexpected <david.martin@biotek.uio.no>
     Re: 'end of file' unexpected <david.martin@biotek.uio.no>
     Re: [Newbie Q] A simple Remailer problem. (Found the pr (Grey Cloak)
     Re: [Q]: Arbitrary sort on field names (Toutatis)
     Re: Can't fetch from Altavista with "url_get" (by Jack  <Toby.Speight@digitivity.com>
     Re: Clever way to strip empties from an list? (Abigail)
     Re: CPAN confusion <hietanie@koah.research.nokia.com>
     Re: CPAN confusion <zenin@best.com>
     Debugger oddity (Brendan O'Dea)
     Re: Debugger (Ilya Zakharevich)
     FILE <jleurs@best.ms.philips.com>
     German letters <t.weber@bull.de>
     Re: how to learn perl <djb@16straight.com>
     How To Test if number is ODD or EVEN? (Jay Dixon)
     Re: How To Test if number is ODD or EVEN? (Bart Lateur)
     Re: How To Test if number is ODD or EVEN? <hietanie@koah.research.nokia.com>
     Re: How To Test if number is ODD or EVEN? (Toutatis)
     LVALUE BUG <msuarez@cybernet.com>
     Re: LVALUE BUG (Ilya Zakharevich)
     Re: multithreading (Jess O'Leary)
     Re: Passing a %hash via Shared mem. ?? <zenin@best.com>
     Perl Port to openVMS <rv33100@ggr.co.uk>
     Re: problem with Telnet module <jamesr@aethos.co.uk>
     Re: Reading in Environment variables - How to ? <jamesr@aethos.co.uk>
     Redirecting filehandle to multiple filehandles (Jamie O'Shaughnessy)
     SWIG needs Perl.lib for NT - where? <nospambruce_wheeler@hp.com.nospam>
     Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: Fri, 14 Nov 1997 12:22:12 +0100
From: David Martin <david.martin@biotek.uio.no>
Subject: 'end of file' unexpected
Message-Id: <346C3464.655C18EC@biotek.uio.no>

Trying to run a script either by invoking it as script.pl or using perl
script.pl I get an error like this

sh: Syntax error at line 1: 'end of file' unexpected
Broken pipe

The script has been checked with perl -c and is fine. Other scripts run
quite happily. It gives no errors with perl -w apart from the error
mentioned. 

Line 1 is the usual #!/usr/local/bin/perl -w and I have retyped it.
I've checked the file and can't find any spurious characters.

most of the code in the script is reused from other scripts in which it
works fine.
Does anyone have any idea what is happening here?
It appears to be a shell error but is related to my perl script
(otherwise why would I just get a problem for one script and not
others?)

I have checked perldiag and perlrun and a few of the other man pages but
cannot find any ideas as to why this error should appear.

Any suggestions would be gratefully received.

 ..d

-- 
* David Martin - Atherosclerosis and Thrombosis research group  *
* http://www.uio.no/~damartin/      david.martin@biotek.uio.no  *
* Lab +47 22 95 84 54 Fax +47 22 69 41 30  GSM +47 90 74 27 65  *


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

Date: Fri, 14 Nov 1997 13:38:11 +0100
From: David Martin <david.martin@biotek.uio.no>
Subject: Re: 'end of file' unexpected
Message-Id: <346C4633.987DA43C@biotek.uio.no>

David Martin wrote:
> 
> Trying to run a script either by invoking it as script.pl or using perl
> script.pl I get an error like this
> 
> sh: Syntax error at line 1: 'end of file' unexpected
> Broken pipe

Which came about from not stripping angle brackets from around an email
address whilst bringing it in from a file.

Apologies for wasting your time.

 ..d

-- 
* David Martin - Atherosclerosis and Thrombosis research group  *
* http://www.uio.no/~damartin/      david.martin@biotek.uio.no  *
* Lab +47 22 95 84 54 Fax +47 22 69 41 30  GSM +47 90 74 27 65  *


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

Date: 14 Nov 1997 09:51:50 GMT
From: spamtrap@greycloak.access.one.net (Grey Cloak)
Subject: Re: [Newbie Q] A simple Remailer problem. (Found the problem)
Message-Id: <slrn66o53d.9e4.spamtrap@greycloak.access.one.net>

On 14 Nov 1997 04:25:39 GMT,
Grey Cloak cause to appear:
>
>My correct Email is grycloak (at) grycloak.access.one.net
>
>I trying to create a simple Remailer to a fixed address. What I want it
>to do is change the subject line send the email and add a footer.  
>Would like to remove From: line also, but before I attemp that I want to 
>get it to remove the rest of the headers. 
>
>What it does instead is just forward the email unmodified.
>
The problem turnned out to be logic, Sleeping on it helpped. :) Here the 
working script:

#!/bin/perl -w
#
# -- Mail ban entery to list
#
# Created by GreyCloak for Temp ops List

$To="To: toaddress\@domain";

$From="From: FromAddress\@domain";

open (OUT, "|/usr/lib/sendmail -oi -t");


	while (<STDIN>) {
	              
	    if (s/^From: //) {
                $Who= $_;
		$_ = "$From\n"
                
            }

	    if (s/^Subject: //) {
                $_="Subject: FORWARD: $_";
                
            }

            if (s/^To: //) {
                $_ = "$To\n";
                
            }
 
	    print OUT $_; 

	}
        

print OUT "----- Remailer Note -------\n";
print OUT  "This email was filtered through Grey Cloak's Remailer. \n";
print OUT   "Any reply to the message will not reach the sender. \n";
print OUT  "Replies to this email will instead filter back to this list. \n";
print OUT  "The poster was $Who\n";

close OUT;

#Now log the results

	





-- 
Grey Cloak

         ---------------------------------------------
  .###########.   To email change spamtrap to grycloak for faster answer
 ##'___   ___`##  Mailbot Auto sends
 ##  * > < *  ##    wizardfaq: wizardfaq@greycloak.access.one.net     
 ### ) | | ( ###    Docslist:   Docslist@greycloak.access.one.net
 ###\_-===-_/###  The above two addresses is a mailbot and will
   #  ~!!!~  #    always send you a file. Don't use it to email me. 

http://www.geocities.com/Area51/7614
http://w3.one.net/~grycloak/dreams/dream.htm




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

Date: 14 Nov 1997 09:19:37 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: [Q]: Arbitrary sort on field names
Message-Id: <toutatis-ya023180001411971019360001@news.euro.net>

mgjv@comdyn.com.au (Martien Verbruggen) wrote:

> In article <346B12F5.A2470F6B@itis.com>,
>         Prince Mystery <mystery@itis.com> writes:
> > @fieldnames = ("name", "address1", "address2", "city", "state");
> > 
> > If I give the user the option to list a variable amount of field names,
> > and end up with an array similar (but smaller) to the one above, how do
> > I sort so that they will always appear in some semblance to the order
> > implied by the @fieldnames array?  (i.e. an array of ("city","name")
> > would be sorted to ("name", "city")).
> 
> Euhmm.. Why would you need to sort afterwards? If you walk through the
> array @fieldnames, adding the selected fields to an array, they should
> be sorted in the same way.
> 
> my @fieldnames = qw( name address1 address2 city state );
> my @selected = ();
> 
> foreach my $fn (@fieldnames)
> {
>         pop @selected $fn if (_is_selected($fn));
> }
> 
> # define _is_selected() here
> 
> This should give you an array @selected with the elements in the same
> order as they appear in @fieldnames, eliminating the need to sort.

Your code will not compile (missing comma after pop) and leaves you with an
empty @selected. Use push. Apart from that, I think in a situation where
you want every bit of speed (and that's what you want when building a
web-application) I can imagine many situations where looping through the
entire parent list is less efficient than a sort based on an index table.

-- 
Toutatis


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

Date: 14 Nov 1997 11:53:54 +0000
From: Toby Speight <Toby.Speight@digitivity.com>
Subject: Re: Can't fetch from Altavista with "url_get" (by Jack Lund)?
Message-Id: <s8lnyr7ktp.fsf@plato.ansa.co.uk>



KM> K. MIN <URL:mailto:s941046@ccs.sogang.ac.kr>

> In
> <URL:news:Pine.SGI.3.96.971114120550.9471A-100000@ccs.sogang.ac.kr>,
> KM wrote:

KM> I found a problem with running "url_get" to the search engines,
KM> i.e. Infoseek and Altavista.  In the program, "URL.pl", it seems
KM> that URL.pl can parse the query to the search engines, but when
KM> the queries are submitted, "url_get" couldn't work.

KM> For example, when I submit the query("Jack Lund") like below,

KM> url_pl http://www.infoseek.com/Titles?qt=Jack+Lund&col=WW&sv=IS&lk=noframes&nh=10

What shell are you using?  For most shells, you'll need to quote that
URL, since '?' and '&' are meaningful to it.

url_pl 'http://www.infoseek.com/Titles?qt=Jack+Lund&col=WW&sv=IS&lk=noframes&nh=10'




Version: 2.6.3i
Charset: noconv
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface

iQB1AwUBNGw7zedsuUurvcRtAQFlVgMAiVRfSzgJFvplG8XPXaP1wAbw37eq8IFG
swbqrwxqJYni3WMctZRMrc4SsJjYSTHppAjDaG6IRJZV43kZWUkTmEFmLykNLiKG
NPzIp6yV24JjmUzETGRG75UA5GG7rw1/
=fqxQ
-----END PGP SIGNATURE-----


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

Date: 14 Nov 1997 10:46:48 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Clever way to strip empties from an list?
Message-Id: <slrn66ob4c.kcu.abigail@betelgeuse.wayne.fnx.com>

Erik Y. Adams (erik@earthlink.net) wrote on 1536 September 1993 in
<URL: news:erik-1311972108460001@pool049-max5.pasadena-ca-us.dialup.earthlink.net>:
++ I've got a perl script that gets passed a list.  I join the list elements
++ together into a scalar and write it to a file.  The problem I have is some
++ of the list's elements are empty, and I'm winding up with some junk. 
++ Here's a snippet that demonstrates the problem:
++ 
++    @list = ("this", "that", "", "", "", "", "");
++    $string = join ':', @list;  # $string is now "this:that:::::";
++ 
++ What I want is is $string to equal "this:that".
++ 
++ I could add another line:
++ 
++    $string =~ s/:*$//g;
++ 
++ But I keep thinking that there's some function I could run against @list
++ that would automagically eliminate the null values.

$string = join ':', grep {length} @list;



Abigail
-- 
perl -wle 'print "Prime" if (1 x shift) !~ /^(11+?)\1+$/'


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

Date: 14 Nov 1997 10:55:07 +0200
From: Jarkko Hietaniemi <hietanie@koah.research.nokia.com>
Subject: Re: CPAN confusion
Message-Id: <dpbtzn7t3o.fsf@koah.research.nokia.com>


hermit@cats.ucsc.edu (William R. Ward) writes:
> True, but I still find the web interface to CPAN confusing (I was the

And I still repeat that there is none.  You must mean by "web interface"
that you open up http://www.perl.com/CPAN/.  Well, that is not a web
interface, that is just the standard ftp interface that just happens
to work also across the http and can be presented in your browser.

> Who maintains the scripts that generate the HTML module list files?
> Perhaps we can persuade this person to add this feature.

The email address is mentioned at the very first lines of the
CPAN/modules/00modlist.long.html.  But I will forward your wish
to them.

-- 
Jarkko Hietaniemi


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

Date: 14 Nov 1997 11:59:51 GMT
From: Zenin <zenin@best.com>
Subject: Re: CPAN confusion
Message-Id: <879508956.901540@thrush.omix.com>

William R. Ward <hermit@cats.ucsc.edu> wrote:
: What version of Perl is that?  I get "Can't locate CPAN.pm in @INC."
: when I try that.

	Upgrade.

-- 
-Zenin
 zenin@best.com


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

Date: 14 Nov 1997 08:36:35 GMT
From: bod@compusol.com.au (Brendan O'Dea)
Subject: Debugger oddity
Message-Id: <64h2ij$14o$1@diablo.compusol.com.au>

I came across some odd behaviour while debugging a script, which can
be demonstrated with a simple example:

    #!/usr/bin/perl

    if (open F, '/etc/group')
    {
        while (<F>)
        {
            print;
        }

        close F;
    }

When run through the perl5.004_04 debugger produces:

    Loading DB routines from perl5db.pl version 1.01
    Emacs support available.

    Enter h or `h h' for help.

    main::(/tmp/odd:3):     if (open F, '/etc/group')
    main::(/tmp/odd:4):     {
      DB<1> t
    Trace = on
      DB<1> c
==> main::(/tmp/odd:10):        close F;
    main::(/tmp/odd:7):             print;
    root::0:
    main::(/tmp/odd:5):         while (<F>)
    main::(/tmp/odd:6):         {
    main::(/tmp/odd:7):             print;
    other::1:
    [snip]
    main::(/tmp/odd:5):         while (<F>)
    main::(/tmp/odd:6):         {
    main::(/tmp/odd:10):        close F;
    DB::fake::(/usr/local/lib/perl5/perl5db.pl:2083):
    2083:     "Debugged program terminated.  Use `q' to quit or `R' to\
    restart.";
      DB<1> q

Where I would expect the marked line (==>) to be 5 rather than 10.

Note that if you replace

    while (<F>)

with

    for (; defined ($_ = <F>); )

the debugger output is correct.

Regards,
-- 
Brendan O'Dea                                        bod@compusol.com.au
Compusol Pty. Limited                  (NSW, Australia)  +61 2 9809 0133


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

Date: 14 Nov 1997 09:35:59 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Debugger
Message-Id: <64h61v$2ci$1@agate.berkeley.edu>

In article <EJJv80.C0A@world.std.com>,
Andrew M. Langmead <aml@world.std.com> wrote:
> The debugger is command line oriented, you type a command and follow
> it by the enter or return key on your keyboard.
> 
> The "n" command (stands for "next") goes to the next statement in your

*Very good*.  Please consider adding this info to
perdebug/DESCRIPTION.  Send a patch to p5p.  On your way, you may also
add 'r' to the "commands" section ;-).

Note that the _54 may contain new 'W'atch command.  Feel free to
document it too in DESCRIPTION section ;-).  The entry into 'commands'
looks like... Oh my, I did not add it... :-(.  

The 'h h' one is:  B<W> I<expr>      Add a watch expression
The 'h W' one is:  
	B<W> I<expr>		Add a global watch-expression.
	B<W>		Delete all watch-expressions.

I<After> the watch-expression is changed, program is stopped at the
next sequence point (sp?) (as if you set C<$DB::signal = 1> or
B<Control-C> was pressed).  Well, maybe C<$DB::signal = 1> is also
worth documenting, it is the same as one-time C<$DB::step = 1> (it
would reset to 0 when debugger stops your program).

Thanks,
Ilya


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

Date: Fri, 14 Nov 1997 11:55:19 +0100
From: Joep <jleurs@best.ms.philips.com>
Subject: FILE
Message-Id: <346C2E17.554F@best.ms.philips.com>

Hi, 

I need a script which places the result of multiple forms in one file on
the server.

I need a script to read the results placed in this file.

			Thankz,
				I'am desperate .-(   Joep



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

Date: Fri, 14 Nov 1997 09:54:08 +0100
From: Thomas Weber <t.weber@bull.de>
Subject: German letters
Message-Id: <346C11B0.2E6A@bull.de>

Hi, 
I'm a Perl Newbie and I'm very surprised about the power of Perl.
I intend to use the POD of Perl for global Softwaredocu, but my Problem
is:
How can I use the German Letters (like |dv_) in POD ??


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

Date: Thu, 13 Nov 1997 14:55:39 -0500
From: Dan Birchall <djb@16straight.com>
To: Mosl Roland <founder@pege.org>
Subject: Re: how to learn perl
Message-Id: <346B5B3B.3359@16straight.com>

Mosl Roland wrote:
> 
> I am with computers since 1976 and worked as
> a professional programmer 1980 to 1991.
> 
> Now I want to learn Perl.
> I need no beginers book,
> I need a book to convert my knowledge
> in Assembler, Basci, Pascal, C into Perl.
> 
> What books would You recommend me?

Honestly, I'd recommend just printing out the manual page
("man perl" on a UNIX system) and reading that.  It's concise
and covers all the syntax, structure, functions, et cetera.

That's how I learned it (after BASIC, some C, shells, FORTH).
Given your background it should be fairly easy.

-Dan

-- 
Dan Birchall - Internet Sysadmin - 16 Straight Communications
520 Fellowship Road, Suite A-112, Mount Laurel, NJ 08054-3400
Print design, web design and hosting... from a single source!
djb@16straight.com - http://www.16straight.com - 609.231.7887


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

Date: Fri, 14 Nov 1997 09:53:46 GMT
From: jay@dixonssurgical.co.uk (Jay Dixon)
Subject: How To Test if number is ODD or EVEN?
Message-Id: <346c1e03.4298330@news.dixonssurgical.co.uk>

I am slowly coming to grips with perl.  I can usually make a half
decent job of hacking existing scripts but I have got myself stumped.

I want to test if a variable is Odd (or Even) - i.e. I only want to
run a bit of code every other pass.  I have never come across this as
a bit of code.

if $counter == [????] print "stuff"; # as far as I can get!

Any suggestions will be much appreciated.

Thanks
Jay

---------
Jay Dixon - Dixons Surgical Ltd - Wickford - Essex - England
jay@dixonssurgical.co.uk  -  http://www.dixonssurgical.co.uk


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

Date: Fri, 14 Nov 1997 11:44:36 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: How To Test if number is ODD or EVEN?
Message-Id: <346c392b.702216@news.tornado.be>

jay@dixonssurgical.co.uk (Jay Dixon) wrote:

>I want to test if a variable is Odd (or Even) - i.e. I only want to
>run a bit of code every other pass.  I have never come across this as
>a bit of code.

Two ways. 

1) switch a value between 1 and 0.

	$go = 1 - $go;
	if ($go) { ... }

2) do a binary and with the lowest bit

	if ($counter++ & 1) { ... }

HTH,
Bart.


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

Date: 14 Nov 1997 13:19:17 +0200
From: Jarkko Hietaniemi <hietanie@koah.research.nokia.com>
Subject: Re: How To Test if number is ODD or EVEN?
Message-Id: <dp7mab7mfe.fsf@koah.research.nokia.com>


jay@dixonssurgical.co.uk (Jay Dixon) writes:

> I want to test if a variable is Odd (or Even) - i.e. I only want to
> run a bit of code every other pass.  I have never come across this as

Either modulus or bit-and will do.

> a bit of code.
> 
> if $counter == [????] print "stuff"; # as far as I can get!

if ($counter % 2 == 1) { ... }
if ($counter & 1 == 1) { ... }

and because non-zero numbers test as true:

if ($counter % 2)      { ... }
if ($counter & 1)      { ... }

-- 
Jarkko Hietaniemi


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

Date: 14 Nov 1997 12:04:28 GMT
From: toutatis@_SPAMTRAP_toutatis.net (Toutatis)
Subject: Re: How To Test if number is ODD or EVEN?
Message-Id: <toutatis-ya023180001411971304280001@news.euro.net>

bart.mediamind@tornado.be (Bart Lateur) wrote:

> jay@dixonssurgical.co.uk (Jay Dixon) wrote:
> 
> >I want to test if a variable is Odd (or Even) - i.e. I only want to
> >run a bit of code every other pass.  I have never come across this as
> >a bit of code.
> 
> Two ways. 
> 
> 1) switch a value between 1 and 0.
> 
>         $go = 1 - $go;
>         if ($go) { ... }

Don't see how how this is supposed to help?!
 
> 2) do a binary and with the lowest bit
> 
>         if ($counter++ & 1) { ... }

Nice, but better not mess with machine formats if you don't need to:
print "$i is odd\n" if $i % 2;

-- 
Toutatis


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

Date: Fri, 14 Nov 1997 00:57:38 -0500
From: "Michael A. Suarez" <msuarez@cybernet.com>
Subject: LVALUE BUG
Message-Id: <346BE852.3A80F30C@cybernet.com>

I believe that this is a bug in perl 5.00404 (tested in 5.00401 also). 
Should the following code behave this way or does is there
something that I don't understand. 

NOTE:  This Perl 5.001 and 5.003 do not have this problem. 

The following code:
	#!/usr/local/bin/perl
	
	sub doit
	{
	  my $todecode  = shift;
	  return $todecode;
	}

	$n=doit("N HI");
	print "N=",\$n,"\n";
	
	$z=doit($y[0]);
	print "Z=",\$z,"\n";
	
	$t=doit("T HI");
	print "t=",\$t,"\n";

Produces the following output:
	N=SCALAR(0x73ec4)
	Z=LVALUE(0x73f0c)
	t=LVALUE(0x73f6c)


Why does executing doit with $y[0] break doit so that it will always
return an LVALUE from that point on FOREVER...

The reason I even care is that I am using the p5-Storable module which
can't store LVALUE's. 


Thanks, 

Michael


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

Date: 14 Nov 1997 08:41:20 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: LVALUE BUG
Message-Id: <64h2rg$122$1@agate.berkeley.edu>

In article <346BE852.3A80F30C@cybernet.com>,
Michael A. Suarez <msuarez@cybernet.com> wrote:
> I believe that this is a bug in perl 5.00404 (tested in 5.00401 also). 
> Should the following code behave this way or does is there
> something that I don't understand. 
> 
> NOTE:  This Perl 5.001 and 5.003 do not have this problem. 
> 
> The following code:
> 	#!/usr/local/bin/perl
> 	
> 	sub doit
> 	{
> 	  my $todecode  = shift;
> 	  return $todecode;
> 	}
> 
> 	$n=doit("N HI");
> 	print "N=",\$n,"\n";
> 	
> 	$z=doit($y[0]);
> 	print "Z=",\$z,"\n";
> 	
> 	$t=doit("T HI");
> 	print "t=",\$t,"\n";
> 
> Produces the following output:
> 	N=SCALAR(0x73ec4)
> 	Z=LVALUE(0x73f0c)
> 	t=LVALUE(0x73f6c)
> 
> 
> Why does executing doit with $y[0] break doit so that it will always
> return an LVALUE from that point on FOREVER...

Please report it on perlbug or p5p.  I think it is a different
manifistation of the bug I commented about many times for the last
week.  Please also check whether removing "case SVt_PVLV" part of
sv_setsv() fixes this (and whether it breaks something else too :-().

Ilya


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

Date: Thu, 13 Nov 1997 22:26:17 -0800
From: jess@telecom-pros.com (Jess O'Leary)
Subject: Re: multithreading
Message-Id: <jess-1311972226170001@tc4-la9.linkline.com>

In article <01bced60$074f1d80$18b186cf@cyberus.cyberus.ca>, "Thane &
Leslie Eisener" <thaneles@removethis.cyberus.ca> wrote:

> I have a script that gathers data from the network for me three times.
> Currently these are performed in series.  How can I make these three
> function all at the same time?
> 
> Thanks in advance,
> Thane
> (thaneles@nospam.cyberus.ca => remove nospam)

Just use Marc's Parallel UserAgent found at ...

http://www.cs.washington.edu/homes/marclang/ParallelUA/


Sincerely,

Jess O'Leary


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

Date: 14 Nov 1997 12:13:29 GMT
From: Zenin <zenin@best.com>
Subject: Re: Passing a %hash via Shared mem. ??
Message-Id: <879509774.967394@thrush.omix.com>

Jason Gloudon <jgloudon@bbn.remove.com> wrote:
: If it's a simple hash containing text and not references, and you don't
: mind using a file you can do this using a tie'd array. man perltie for 
: specifics.

	Bzzz, wrong, but thanks for playing. :)

	The question was asking how to share the hash table between two
	processes, not how to map it to a file. -Besides, a DBM file would
	have been the correct answer in that case, and not a tied array.

	You would need to use a tied hash class though, that mapped it's
	calls to a mmaped space.  You might be able to get the Berkeley
	DB to help out with this (See DB_File).  It can store memory
	only DBs, so it might not be _too_ hard to make the memory it
	uses part of a mmaped space...Or not...I haven't tried.

	Anyway, once you've got it working, make sure you upload the
	new MMAPDB_File modules to CPAN. :-)

-- 
-Zenin
 zenin@best.com


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

Date: Fri, 14 Nov 1997 12:12:16 +0100
From: "Reinhard E. Voglmaier" <rv33100@ggr.co.uk>
Subject: Perl Port to openVMS
Message-Id: <346C3210.2D22@ggr.co.uk>

I am using Perl5 on HP-UX and Windows-NT. Now a developer has asked me
to install Perl on a alpha box using openVMS.
Somebody knows if there exists already somewhat ?

Thanx a lot
Reinhard


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

Date: 14 Nov 1997 12:18:00 GMT
From: "James Richardson" <jamesr@aethos.co.uk>
Subject: Re: problem with Telnet module
Message-Id: <01bcf0f7$6cfadee0$26c0a4c1@kitkat.aethos.co.uk>

Tim Gray <tim@hcirisc.cs.binghamton.edu> wrote in article
<t0iutxq6r6.fsf@hcirisc.cs.binghamton.edu>...
> Hi there,
> 	I am trying to use the Telnet.pm module on a system where I
> don't have root and therefore can't actually install the module
> properly.  So I put the module in the same directory as my script.  I
> have tried to 'use' it several ways but none work.
> 
> use Net::Telnet		#no shock there since it isn't in $PERL5LIB/Net
> use Telnet;
> use Telnet ();
> 
> No matter what it "can't locate object method new vie package Telnet".
> 
> The code snippet that instantiates the Telnet object looks like this
> 
> $popbox = new Telnet (Host => "mail.binghamton.edu",
>                    Port => 110);
> 
> Any suggestions?  Thanks.
> 


How about making a directory $HOME/lib/perl5, then install the module in
there.. (i.e. as $HOME/lib/perl5/Net/Telnet.pm )

Then in your script...

#!/usr/local/bin/perl5

BEGIN {
	push (@INC, "/home/yourlogin/lib/perl5")
}

use Net::Telnet;

That should work...

James



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

Date: 14 Nov 1997 12:25:58 GMT
From: "James Richardson" <jamesr@aethos.co.uk>
Subject: Re: Reading in Environment variables - How to ?
Message-Id: <01bcf0f8$8a31b3c0$26c0a4c1@kitkat.aethos.co.uk>

sekhar@wv.mentorg.com wrote in article <879464129.22117@dejanews.com>...
> I need some help with trying to read in a ENVIRONMENT variable into
> my Perl script.
> 
> I have an environment variable called DESIGN_PATH that is currently
> set to $HOME/designs.  I would like my Perl script to 'cd'  to this
> directory and list all the files in the directory. I have attempted
> to use the 'opendir' and 'chdir' commands without success.
> 
> The syntax that I tried was :
> 
> opendir(DIR, "$ENV{'$DESIGN_PATH'}");
> chdir($ENV{'$DESIGN_PATH'});
> 

Hmm.. you say the env. var is called DESIGN_PATH , but then try and look up
a completely different one! ($DESIGN_PATH)...

Why not try.. $ENV{"DESIGN_PATH"}

> I would greatly appreciate any help ..

I take it you tried a couple of things before posting your question.....

James



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

Date: Fri, 14 Nov 1997 09:08:55 GMT
From: joshaugh@uk.oracle.com (Jamie O'Shaughnessy)
Subject: Redirecting filehandle to multiple filehandles
Message-Id: <346c13bc.1990196351@newshost.us.oracle.com>


I'm writing a script to control software testing, as part of the script we
output everything to the screen and also to a log file. The script calls a
number of external commands. The problem I have is when I call an external
command and pipe it's output back into the script (so I can write to both the
screen and log file), I can't capture the STDERR of the command, e.g.

open(CMD, "$cmd |") || die "blah";
while(<CMD>) {
   print STDOUT $_;
   print LOG $_;
}

The FAQ says to redirect STDERR, e.g.

open(STDERR, ">&LOG");
open(CMD, "$cmd |") || die "blah";
while(<CMD>) {
   print STDOUT $_;
   print LOG $_;
}

which does redirect the STDERR output of $cmd to the log file, but not to the
screen.

Is there any way I can capture the STDERR from the $cmd so I can output it to
two filehandles, or even act on what I read from STDERR?

Thanks,
Jamie

___________________________________________________________________________ 
Jamie O'Shaughnessy                        Work: joshaugh @ uk.oracle.com 
Oracle C++ Object Layer Generator Team
______________________________________________________  __  __ _  __ .   __ 
Opinions expressed here are my own and not those of... (__)|-</-\(__ |__ -_ 


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

Date: Thu, 13 Nov 1997 17:52:58 -0800
From: Bruce Wheeler <nospambruce_wheeler@hp.com.nospam>
Subject: SWIG needs Perl.lib for NT - where?
Message-Id: <346BAEFA.5ADE@hp.com.nospam>

I'm using Visual C++ 5.0 to compile a swig wrappped application.
I'm getting BaseParser_wrap.obj : error LNK2001: unresolved external
symbol _Perl_sv_setref_pv plus about 19 similar errors

I've downloaded perl from www.activestate.com build 313 using both
Pw32i313.exe (1,494 KB) (Perl for Win32 Intel/x86 binary) and
Pw32s313.zip (1,882 KB) (Perl for Win32 Source Files)

but don't have anything that looks like a perl.lib


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

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

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