[16920] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4332 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 15 11:06:34 2000

Date: Fri, 15 Sep 2000 08:05:14 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <969030314-v9-i4332@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 15 Sep 2000     Volume: 9 Number: 4332

Today's topics:
    Re: 'Listen' option on sockets <lhswartw@ichips.intel.com>
    Re: 'Listen' option on sockets (Gwyn Judd)
        [ANNOUNCE] AxKit 0.99 <matt@sergeant.org>
        Alternativer to SDBM? <pleduc@your_finger.home.com>
        ANNOUNCE: Win32::ActAcc 0.1 <pbwolf@bellatlantic.net>
        Any interest in Perl support for EDA formats (like Spic <wim.nospam.verhaegen@esat.nospam.kuleuven.ac.be>
        binmode(): How is OS related with "\n"? <abuse@localhost.com>
        Can anyone help with weird error? lishy1950@my-deja.com
    Re: Can anyone help with weird error? (Gwyn Judd)
    Re: Can you do this with a Hash? <jwilson@ic.ac.uk>
    Re: Can't make DBI <anders@wall.alweb.dk>
    Re: Changing the filename for reporting compile errors <thomharp@flash.net>
        Filling Edits, Selecting and Klick ! <Martin.Lohmann@de.bosch.com>
    Re: Filling Edits, Selecting and Klick ! <anders@wall.alweb.dk>
        hashes: how to pass ref into subroutine? <michael@GeekTimes.com>
    Re: hashes: how to pass ref into subroutine? <anders@wall.alweb.dk>
    Re: MS-DOS window closes <dbohl@sgi.com>
    Re: MS-DOS window closes mexicanmeatballs@my-deja.com
        Newbe question <silvo.vidovic@tel.net.ba>
    Re: Newbie tempted to use perl - please advise <wyzelli@yahoo.com>
        obfuscator or compiler <agw@smolyak.cs.columbia.edu>
    Re: Perl 5.6.0 bug ? GEN33 opened only for output <joepepin@att.com>
    Re: Perl 5.6.0 bug ? GEN33 opened only for output <ren.maddox@tivoli.com>
        printer administration under NT <clandos@bigfoot.com>
    Re: Problem with hashes (MQSeries) (Andrew J. Perrin)
    Re: Qualifications for new Perl programmer????? <bcaligari@my-deja.com>
    Re: Qualifications for new Perl programmer????? hs121@my-deja.com
        Question about Overloading "=" alphazerozero@my-deja.com
    Re: Question about Overloading "=" <thomharp@flash.net>
    Re: Question about Overloading "=" alphazerozero@my-deja.com
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 15 Sep 2000 07:18:51 -0700
From: Larry Swartwood <lhswartw@ichips.intel.com>
To: Uri Guttman <uri@sysarch.com>
Subject: Re: 'Listen' option on sockets
Message-Id: <39C22FCB.6FA40FD5@ichips.intel.com>

Sorry for the misunderstanding, I suppose I was overly eager to help being new
to the newsgroup and all. for What's jeopardy style quoting?

Larry S.

Uri Guttman wrote:

> The following message is a courtesy copy of an article
> that has been posted to comp.lang.perl.misc as well.
>
> >>>>> "LS" == Larry Swartwood <lhswartw@ichips.intel.com> writes:
>
>   LS> What you need is a forking server, one that forks a new process to
>   LS> handle each new client. Here's some example code from the perl
>   LS> cookbook:
>
>   >> > I have a problem with a small server program. My server shall
>                                                                ^^^^^
>   >> only serve > one single client, so if a second one tries to connect
>   >> to the port he > has to get a 'connection denied'. After reading
>   >> the 'IO::Socket::INET' > manpage my impression was that the
>   >> 'Listen' option does what I need and > something like this should
>   >> work:
>
> the OP only wants 1 client connected at a time. note the word i marked
> above. there is no need to quote code from the cookbook as it is all
> available online at the o'reilly site.
>
> also don't quote in jeopardy style.
>
> uri
>
> --
> Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
> SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
> The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
> The Best Search Engine on the Net  ----------  http://www.northernlight.com



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

Date: Fri, 15 Sep 2000 14:39:27 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: 'Listen' option on sockets
Message-Id: <slrn8s4d4s.8q2.tjla@thislove.dyndns.org>

I was shocked! How could Larry Swartwood <lhswartw@ichips.intel.com>
say such a terrible thing:
>Sorry for the misunderstanding, I suppose I was overly eager to help being new
>to the newsgroup and all. for What's jeopardy style quoting?

What you just did. ie. putting your reply before the question.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Any sufficiently advanced technology is indistinguishable from magic.
		-- Arthur C. Clarke


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

Date: Fri, 15 Sep 2000 14:05:49 GMT
From: Matt Sergeant <matt@sergeant.org>
Subject: [ANNOUNCE] AxKit 0.99
Message-Id: <ss4b5tcjdc695@corp.supernews.com>

AxKit is an XML publishing framework for Apache written in
mod_perl. It provides the user with flexible methods for building
dynamic web sites using perl and XML and standard transformation
technologies like XSLT.

The 0.99 release fixes a large memory leak in AxKit (wasn't my fault -
I promise!) and improves consistency and overall reliability.

To read more about AxKit, please visit http://axkit.org/

You can download AxKit in full from either CPAN or the above link.

Matt.




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

Date: Fri, 15 Sep 2000 14:31:06 GMT
From: Paul Leduc <pleduc@your_finger.home.com>
Subject: Alternativer to SDBM?
Message-Id: <39C232AF.832825A@your_finger.home.com>

I have been using SDBM to hold template data to be used by a cgi script.
The problem is that there appears to be a limitation of 1K for each
value in the hash using SDBM.

Is there an alternate DBM I can use, with the same functionality as
SDBM, that does not have this limit?

-- 
Paul Leduc -  pleduc@home.com
(remove YOUR FINGER from my address when replying)


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

Date: Fri, 15 Sep 2000 13:03:44 GMT
From: "Phill Wolf" <pbwolf@bellatlantic.net>
Subject: ANNOUNCE: Win32::ActAcc 0.1
Message-Id: <ss4b655fdc6151@corp.supernews.com>

Win32::ActAcc brings Microsoft's "Active Accessibility" API (including
IAccessible and WinEvents) within reach of Perl scripts.

Win32::ActAcc lets Perl scripts

  * "find" stuff on the screen (e.g., buttons)
  * query "accessible objects" (such as onscreen controls) as to their
condition
  * trap the WinEvents consequent to a click or keystroke

Used in conjunction with Win32::GuiTest (from Ernesto Guisado), which is
able to click and type, Win32::ActAcc can help automate tedious GUI tasks.

Win32::ActAcc 0.1 is on CPAN.

Phill Wolf
pbwolf@cpan.org





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

Date: Fri, 15 Sep 2000 15:26:06 +0200
From: Wim Verhaegen <wim.nospam.verhaegen@esat.nospam.kuleuven.ac.be>
Subject: Any interest in Perl support for EDA formats (like Spice)?
Message-Id: <39C2236E.5A07262B@esat.nospam.kuleuven.ac.be>

Hi,

I have in the past written many small and moderate size applications
in the Electronic Design Automation field, with a focus on analog
circuits. (Leave here if you do not know what I'm talking about :-)

In these applications I had to deal several times with spice or
spice-like netlists. For these text-based manipulations, it was
only natural to turn to Perl. Having written and re-written many
similar modules, I think it would be useful to have common modules
to do the major parts of these tasks. I have some quite specific ideas
about how to do this already, but before sharing them I would like
to know whether others are interested and/or have written similar
code which they like to share.

Any comments are welcome.

Regards,
Wim


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

Date: Fri, 15 Sep 2000 18:33:30 +0800
From: "multiplexor" <abuse@localhost.com>
Subject: binmode(): How is OS related with "\n"?
Message-Id: <8pstrq$915$1@horn.hk.diyixian.com>

I read from perlfunc that binmode is used in OS that distinguish between
binary and text files. Also, the systems which delimit lines with a single
character do not need binmode(). However, I am curious about how the two
points are related. For example, MS-DOS doesn't delimit lines with single
character "\n", as I know. Does it mean that MS-DOS distinguishes between
binary and text files? How about Unix?




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

Date: Fri, 15 Sep 2000 13:57:03 GMT
From: lishy1950@my-deja.com
Subject: Can anyone help with weird error?
Message-Id: <8pt9r3$om9$1@nnrp1.deja.com>

Hello
I'm getting the following error when running a script:

Can't modify concatenation in scalar assignment at isconfig.pl line 272,
near ");"

Here is the part of the code in question:

  271    %api.ssprefix=       ("int","sckt://url:port/blah/blah",
  272             "prod","sckt://url:port/blah/blah");
  273
  274    %api.webcomm.svr.addresses=    ("int","url:port",
  275             "prod","url:port");


I'm trying to set parameters in a hash here, not concatenate anything.
I have other hashes like this that don't get an error.  Numbers and
colons should be ok within the quotes, right?


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


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

Date: Fri, 15 Sep 2000 14:49:48 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: Can anyone help with weird error?
Message-Id: <slrn8s4do8.8q2.tjla@thislove.dyndns.org>

I was shocked! How could lishy1950@my-deja.com <lishy1950@my-deja.com>
say such a terrible thing:
>Hello
>I'm getting the following error when running a script:
>
>Can't modify concatenation in scalar assignment at isconfig.pl line 272,
>near ");"
>
>Here is the part of the code in question:
>
>  271    %api.ssprefix=       ("int","sckt://url:port/blah/blah",

This is the wrong syntax for a hash. It should be:

$api{ssprefix} = (yada);

The '.' operator in perl is the concatenation operator.

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
   38. Human communities are based on discourse -- on human speech
       about human concerns.
	From "The Cluetrain Manifesto" http://www.cluetrain.org


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

Date: Fri, 15 Sep 2000 11:37:54 +0100
From: "Jeff Wilson" <jwilson@ic.ac.uk>
Subject: Re: Can you do this with a Hash?
Message-Id: <8psu66$pmt$1@newstest.cc.ic.ac.uk>

Yes, but the simple way is to have two hashes. One for each field with the
same keys.
--
                Jeff Wilson

<rathmore@tierceron.com> wrote in message
news:8pqva5$45f$1@nnrp1.deja.com...
| Here is what I know:
|
| I've got a table that contains three fields for each row. Field_one is
| a unique identifier (sounds like it's time for a hash!), Field_two is a
| string, Field_three is a string. A couple of lines might look something
| like this:
|
| 2000   S/M   SM
| 2001   075   7-1/2
| 2002         NOSZ
|
| What I need to do with this data is read through a line of text and
| find any occurance of values found in Field_three. If a match is found,
| I need to replace the current value that matched Field_three with the
| value in Field_two.
|
| My question is, can a hash have more than one value per key? If that is
| possible, I'm thinking the code would be fairly straight-forward, but I
| can't find any reference to hashes with more than one value per key.
| Does that break the whole concept of a hash?
|
| Other ideas on what kind of data structure I might use?
|
| Thanks all!
|
|
| Sent via Deja.com http://www.deja.com/
| Before you buy.




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

Date: Fri, 15 Sep 2000 13:51:46 GMT
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Can't make DBI
Message-Id: <SPpw5.2023$Tn3.46358@news010.worldonline.dk>

Gabe wrote:

> I've got a fresh installation of Redhat 6.2 with Perl 5.00503 that the
> Redhat installer installed. When I try to make DBI I get a bunch of errors
> referring to files with an .h extension saying "No such file or
> directory". The readme says if you get errors related to perl's header
> files then you have a bad perl installation. I don't know how I could have
> a bad installation since perl was installed automatically. I tried
> reinstalling the perl RPM, but that didn't resolve the problem. I couldn't
> find help in the DBI list archives. Does anyone know what the problem is
> and how to fix it?
> 
> Thanks!
> Gabe
> 
> 

install what ever package contains the perl header files, maybe perl-devel 
(that's the one on Mandrake)

Or look for a perl-DBI package for oyur dist, try http://rpmfind.net

-anders
-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Fri, 15 Sep 2000 09:24:10 -0400
From: Thom Harp <thomharp@flash.net>
Subject: Re: Changing the filename for reporting compile errors
Message-Id: <39C222FA.5D8E256D@flash.net>

> Just a warning -- are you aware of the UNIX security implications of
> doing this?  (i.e., building a program off in /tmp and then running
> it..)

Good point. Is setting the umask so only the current user can access it good
enough?  Or is the problem bigger than that?




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

Date: Fri, 15 Sep 2000 14:11:59 +0200
From: Martin Lohmann <Martin.Lohmann@de.bosch.com>
Subject: Filling Edits, Selecting and Klick !
Message-Id: <8pt3mg$eqd$1@proxy.fe.internet.bosch.de>

Hellou.....

could any of you please programm me a script, which would do this on a
webpage :

- Fill a Edit Field with text from a file, variable
- Do a choose from a listbox (predefined value)
- Do a click on a graphic (banner, link)

Thanx !





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

Date: Fri, 15 Sep 2000 13:39:58 GMT
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: Filling Edits, Selecting and Klick !
Message-Id: <OEpw5.2016$Tn3.46173@news010.worldonline.dk>

Martin Lohmann wrote:

> Hellou.....
> 
> could any of you please programm me a script, which would do this on a
> webpage :
> 
> - Fill a Edit Field with text from a file, variable
> - Do a choose from a listbox (predefined value)
> - Do a click on a graphic (banner, link)
> 
> Thanx !
> 
> 
> 

You may want to look for a javascript ng...

-anders

-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Fri, 15 Sep 2000 03:34:15 -0700
From: mickey <michael@GeekTimes.com>
Subject: hashes: how to pass ref into subroutine?
Message-Id: <michael-549C0A.03341515092000@nntp3.tsoft.net>

#!/usr/local/bin/perl

# ---------------------------------------------------------------------
# I'm trying to understand how I can pass a reference to a hash so that
# (1) I don't copy the entire hash and (2) I can add elements to that
# hash from a subroutine.
#
# I've checked both the Perl FAQ and perlfaq.com without satisfaction.
#
# PLEASE email my personal account as well; this newsgroup is too busy!
# ---------------------------------------------------------------------

%hash = ( 'END' => 'END' ) ;

foreach $key ( keys( %hash ) ) { print qq($key -- $hash{$key}\n) ; }

&addItemToHash( %hash ) ;       # <-- how do I pass a ref to 'hash'?

foreach $key ( keys( %hash ) ) { print qq($key -- $hash{$key}\n) ; }

# ---------------------------------------------------------------------
# 
# ---------------------------------------------------------------------
sub addItemToHash {
    my( $h ) = @_ ;

    # Is this an appropriate test to ensure I've gotten a hash?
    unless (@_ == 1 && ref($h) eq 'ARRAY')
        { die "usage: addItemToHash ARRAYREF1"; }

    foreach $key ( keys( %h ) ) { print qq($key -- $h{$key}\n) ; }

    $h{'added'} = 'value' ;     # <-- how do I add an element?
}

Michael

--
Michael "Mickey" Sattler, Geek Times   <mailto:michael@GeekTimes-NOSPAM.com>
San Francisco, California, USA    <http://www.GeekTimes.com/michael/>


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

Date: Fri, 15 Sep 2000 13:39:09 GMT
From: Anders Lund <anders@wall.alweb.dk>
Subject: Re: hashes: how to pass ref into subroutine?
Message-Id: <1Epw5.2014$Tn3.46173@news010.worldonline.dk>

mickey wrote:

> #!/usr/local/bin/perl
> 
> # ---------------------------------------------------------------------
> # I'm trying to understand how I can pass a reference to a hash so that
> # (1) I don't copy the entire hash and (2) I can add elements to that
> # hash from a subroutine.
> #
> # I've checked both the Perl FAQ and perlfaq.com without satisfaction.
> #
> # PLEASE email my personal account as well; this newsgroup is too busy!
> # ---------------------------------------------------------------------
> 
> %hash = ( 'END' => 'END' ) ;
> 
> foreach $key ( keys( %hash ) ) { print qq($key -- $hash{$key}\n) ; }
> 
> &addItemToHash( %hash ) ;       # <-- how do I pass a ref to 'hash'?

addItemToHash (\%hash); #pass hash ref
> 
> foreach $key ( keys( %hash ) ) { print qq($key -- $hash{$key}\n) ; }
> 
> # ---------------------------------------------------------------------
> # 
> # ---------------------------------------------------------------------
> sub addItemToHash {
>     my( $h ) = @_ ;
> 
>     # Is this an appropriate test to ensure I've gotten a hash?
>     unless (@_ == 1 && ref($h) eq 'ARRAY')
>         { die "usage: addItemToHash ARRAYREF1"; }
> 
>     foreach $key ( keys( %h ) ) { print qq($key -- $h{$key}\n) ; }
> 
>     $h{'added'} = 'value' ;     # <-- how do I add an element?
> }

sub addItemToHash {

my $hashref = shift; #take first arg
print qq($_ -- $hashref->{$_}\n) for (keys %$hashref); # dump hashref
$hashref->{'added'} = 'avalue';

}


Read docs!!

$perldoc perlref

- the place to start...

-anders
-- 
[ the word wall - and the trailing dot - in my email address
is my _fire_wall - protecting me from the criminals abusing usenet]


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

Date: Fri, 15 Sep 2000 08:06:12 -0500
From: Dale Bohl <dbohl@sgi.com>
Subject: Re: MS-DOS window closes
Message-Id: <39C21EC4.E10DEA10@sgi.com>

Tim Hammerquist wrote:
> 
> Razib <raldanash@my-deja.com> wrote:
> > i'm using ACTIVEPERL, and every time i try to open a .pl script i've
> > set up in the MS-DOS window, it closes before i can see what's going on.
> >
> > is there some way i can figure out what's going on?  i downloaded
> > ACTIVEPERL several times, so i know it's not that
> 
> My best advice is: run it from the command line. Go to the Start menu,
> find the MS-DOS shortcut, click on it.  If your PATH is set up, there
> should be a problem typing "perl script.pl".  True, you lose Windows'
> file association "feature", but I always get a little tingle when I take
> some of Windows' power in my own hands.  I don't run Windows without a
> DOS window (or equivalent text-based shell window).
> 
> --
> -Tim Hammerquist <timmy@cpan.org>
> Nearly all men can stand adversity, but if you
> want to test a man's character, give him power.
>         -- Abraham Lincoln

Here's another way.

It actually opens up a dos window, executes the program then closes the
window again, really fast :o)

what you can do is just add this final line to your program:

<STDIN>

or just

<>

so this is what your hello world would look like:

print "Hello World!\n";

<>

now all you have to do is press a key (could be the Enter key)
and the windows closes...


-- 

Thanks,
Dale

Dale Bohl
SGI Information Services
dbohl@sgi.com
(715)-726-8406
http://wwwcf.americas.sgi.com/~dbohl/
JAPH


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

Date: Fri, 15 Sep 2000 13:39:10 GMT
From: mexicanmeatballs@my-deja.com
Subject: Re: MS-DOS window closes
Message-Id: <8pt8pq$nf8$1@nnrp1.deja.com>

In article <39C21EC4.E10DEA10@sgi.com>,
  Dale Bohl <dbohl@sgi.com> wrote:
> Tim Hammerquist wrote:
> >
> > Razib <raldanash@my-deja.com> wrote:
> > > i'm using ACTIVEPERL, and every time i try to open a .pl script
i've
> > > set up in the MS-DOS window, it closes before i can see what's
going on.
> > >
> > > is there some way i can figure out what's going on?  i downloaded
> > > ACTIVEPERL several times, so i know it's not that
> >
> > My best advice is: run it from the command line. Go to the Start
menu,
> > find the MS-DOS shortcut, click on it.  If your PATH is set up,
there
> > should be a problem typing "perl script.pl".  True, you lose
Windows'
> > file association "feature", but I always get a little tingle when I
take
> > some of Windows' power in my own hands.  I don't run Windows without
a
> > DOS window (or equivalent text-based shell window).
> >
> > --
> > -Tim Hammerquist <timmy@cpan.org>
> > Nearly all men can stand adversity, but if you
> > want to test a man's character, give him power.
> >         -- Abraham Lincoln
>
> Here's another way.
>
> It actually opens up a dos window, executes the program then closes
the
> window again, really fast :o)
>
> what you can do is just add this final line to your program:
>
> <STDIN>
>
> or just
>
> <>
>
> so this is what your hello world would look like:
>
> print "Hello World!\n";
>
> <>
>
> now all you have to do is press a key (could be the Enter key)
> and the windows closes...
>
> --
>

DOS windows have a property that determines whether or not they close
when the program running in them ends. There's a check box called
'Close on exit' under the 'Program' tab in the DOS window properties.
Uncheck that.
I may be well off beam here, I don't use perl on windows, so maybe
you're not running a DOS box at all, but it sounds like it.

--
Jon
perl -e 'print map {chr(ord($_)-3)} split //, "MrqEdunhuClqdph1frp";'


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


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

Date: Fri, 15 Sep 2000 14:43:54 +0200
From: "Silvo" <silvo.vidovic@tel.net.ba>
Subject: Newbe question
Message-Id: <8pt5p1$bmip$1@as121.tel.hr>

How can I extract the Header and Record size of a DBF file opend in Perl
with
the open statement ?
Or, this will do it too, how to get the ASCII value of a character?

Please help.





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

Date: Fri, 15 Sep 2000 21:03:44 +0930
From: "Wyzelli" <wyzelli@yahoo.com>
Subject: Re: Newbie tempted to use perl - please advise
Message-Id: <qOnw5.3$YM1.851@vic.nntp.telstra.net>

"John G.Burns" <john@seaway.demon.co.uk> wrote in message
news:39C1E6F5.5750@seaway.demon.co.uk...
> What I need to do is build a list of files changed in the last 24 hours
> and copy them to a directory. I then need to bring up a modem link and
> copy the files to a remote host. The program should invoke itself at a
> regular time every night.
>
> If Perl isn't the best way to do this under NT then what is?
>
> Where can I download the most suitable version of Perl for NT?
>

Perl is certainly good for this task.

http://www.activestate.com/

Wyzelli




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

Date: 15 Sep 2000 11:01:33 -0400
From: Art Werschulz <agw@smolyak.cs.columbia.edu>
Subject: obfuscator or compiler
Message-Id: <yla4s3hn1gy.fsf@smolyak.cs.columbia.edu>

Hi.

Does an obfuscator or a compiler exist for perl?

-- 
Art Werschulz (8-{)}   "Metaphors be with you."  -- bumper sticker
GCS/M (GAT): d? -p+ c++ l u+(-) e--- m* s n+ h f g+ w+ t++ r- y? 
Internet: agw@cs.columbia.edu<a href="http://www.cs.columbia.edu/~agw/">WWW</a>
ATTnet:   Columbia U. (212) 939-7061, Fordham U. (212) 636-6325


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

Date: Fri, 15 Sep 2000 09:42:30 -0400
From: "Joe Pepin" <joepepin@att.com>
Subject: Re: Perl 5.6.0 bug ? GEN33 opened only for output
Message-Id: <8pt8ia$gs12@kcweb01.netnews.att.com>

Here's a test case.  I open /dev/null for reading and try to read a line. I
should get nothing, silently.  Poking around in the sources it appears that
warnings are hard-wired for file descriptors 0, 1 and 2 even if they have
been opened on other files.

$cat input_only.pl

#!/usr/bin/perl -w

use strict;
use FileHandle;

close(STDIN);
my $fh0 = new FileHandle('/dev/null', 'r');
print STDERR "fileno fh0 = ", fileno($fh0), "\n";

close(STDOUT);
my $fh1 = new FileHandle('/dev/null', 'r');
print STDERR "fileno fh1 = ", fileno($fh1), "\n";

$fh1->getline;


And here's the output:

$ input_only.pl
fileno fh0 = 0
fileno fh1 = 1
Filehandle Symbol::GEN1 opened only for output at
/usr/local/lib/perl5/5.6.0/sun4-solaris/IO/Handle.pm line 391.

$ perl -v

This is perl, v5.6.0 built for sun4-solaris







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

Date: 15 Sep 2000 09:09:58 -0500
From: Ren Maddox <ren.maddox@tivoli.com>
Subject: Re: Perl 5.6.0 bug ? GEN33 opened only for output
Message-Id: <m3k8cdzqyx.fsf@dhcp11-177.support.tivoli.com>

"Joe Pepin" <joepepin@att.com> writes:

> Here's a test case.  I open /dev/null for reading and try to read a line. I
> should get nothing, silently.  Poking around in the sources it appears that
> warnings are hard-wired for file descriptors 0, 1 and 2 even if they have
> been opened on other files.
> 
> $cat input_only.pl
> 
> #!/usr/bin/perl -w
> 
> use strict;
> use FileHandle;
> 
> close(STDIN);
> my $fh0 = new FileHandle('/dev/null', 'r');
> print STDERR "fileno fh0 = ", fileno($fh0), "\n";
> 
> close(STDOUT);
> my $fh1 = new FileHandle('/dev/null', 'r');
> print STDERR "fileno fh1 = ", fileno($fh1), "\n";
> 
> $fh1->getline;
> 
> 
> And here's the output:
> 
> $ input_only.pl
> fileno fh0 = 0
> fileno fh1 = 1
> Filehandle Symbol::GEN1 opened only for output at
> /usr/local/lib/perl5/5.6.0/sun4-solaris/IO/Handle.pm line 391.
> 
> $ perl -v
> 
> This is perl, v5.6.0 built for sun4-solaris

I do not get that behavior:

% input_only.pl
fileno fh0 = 0                     
fileno fh1 = 1
% perl -v

This is perl, v5.6.0 built for i686-linux-thread-multi

-- 
Ren Maddox
ren@tivoli.com


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

Date: Fri, 15 Sep 2000 14:25:46 +0200
From: "uunet" <clandos@bigfoot.com>
Subject: printer administration under NT
Message-Id: <39c2154d$0$17241@personalnews.de.uu.net>

is there a library that supports printer administration, such as grant
rights, under perl

i use active perl 5.6 at the moment and there seems to be no solution to
grant access permissions to nt- lpr-printers

thanks
carsten





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

Date: 15 Sep 2000 09:18:27 -0400
From: aperrin@demog.berkeley.edu (Andrew J. Perrin)
Subject: Re: Problem with hashes (MQSeries)
Message-Id: <u8zstiyjg.fsf@demog.berkeley.edu>

Paul Brady <psbrady@my-deja.com> writes:

> I've written a server module for an app using MQSeries, but having some
> trouble unpacking values in the message header fields.
> 
> The client process I've written in perl to emulate the real client sets
> the MsgDesc field as follows :
> 
> $MsgDesc = {
>     MsgSeqNumber => $msg_id
>     };
> 
> where $msg_id is a number (2 in my current test)
> 
> The server picks up the message, and check the $MsgDesc field.  The
> following is the output from my debug session :
> 
> p $MsgDesc
> HASH(0x6d6984)
> 
> so I treat it as a hash and try to unpack it
> 
> p $$MsgDesc{"MsgSeqNumber"}
> 1
> 
> p $MsgDesc->{MsgSeqNumber}
> 1

Look elsewhere for your problem - you're doing fine with the
assignment and reading (although the double quotes are useless above): 

aperrin@SLOVO ~ % perl -de1
Default die handler restored.

Loading DB routines from perl5db.pl version 1.07
Editor support available.

Enter h or `h h' for help, or `perldoc perldebug' for more help.

main::(-e:1):   1
  DB<1> $msg_id = 2

  DB<2> $MsgDesc = {MsgSeqNumber => $msg_id}

  DB<3> p $MsgDesc->{MsgSeqNumber}
2
  DB<4> p $$MsgDesc{MsgSeqNumber}
2
  DB<6> p $$MsgDesc{"MsgSeqNumber"}
2

> 
> I'd like to use this as a unique ID to track the transaction right
> through the system, but it's no good unless I can get it to evaluate to
> 2 at the server end.
> 
> Any ideas ?
> 

Sure - make sure $msg_id is set correctly and appropriately scoped in
the assignment phase.

-- 
----------------------------------------------------------------------
Andrew Perrin - Solaris-Linux-NT-Samba-Perl-Access-Postgres Consulting
       aperrin@igc.apc.org - http://demog.berkeley.edu/~aperrin
----------------------------------------------------------------------


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

Date: Fri, 15 Sep 2000 13:36:26 GMT
From: Brendon Caligari <bcaligari@my-deja.com>
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <8pt8kn$n5t$1@nnrp1.deja.com>

In article <Eccw5.17275$a5.244729@news1.rdc1.mb.home.com>,
  andrew-johnson@home.com wrote:
[ snip snip ]

> practices with Perl, or that sound practices cannot be taught using
> Perl?
>
it's true that with hashes and references just about any structure can
be implemented, whilst with modules and class hashes.  Perl
takes 'away' the closeness between programmer and implementation.  No
strict types and checking, no real pointers, the richness of the
language all risk the beginner become lazier and not appreciate the
underlying foundations.

if you start teaching a beginner in perl.....would would he,
say....know of sorting routines, lists, trees, graphs...

teach a beginning pascal, c, lisp, sql.....and when he's been
thoroughly brain washed give him perl to get work done.

[ snip snip ]

>
> regards,
> andrew
>
> --
> Andrew L. Johnson   http://members.home.net/andrew-johnson/
>       Perl can certainly be used as a first computer language, but
>       it was really designed to be a *last* computer language.
>           -- Larry Wall

so so so true

cheers

Brendon


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


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

Date: Fri, 15 Sep 2000 14:45:38 GMT
From: hs121@my-deja.com
Subject: Re: Qualifications for new Perl programmer?????
Message-Id: <8ptcma$scp$1@nnrp1.deja.com>

what about mastering perl5? i think it's a good one too

In article <39C126A5.9D0D15D4@rac.ray.com>,
  Russ Jones <russ_jones@rac.ray.com> wrote:
> Brendon Caligari wrote:
> >
> > introductory perl programming books are fine....bought "learning
> > perl" and although I didn't like it, i think it's a good book.
> > "programming perl" i liked, and "advanced perl programming" i
adhored.
> >
>
> Do you mean "adored" or "abhorred?" Big diff!
>
> --
> Russ Jones - HP OpenView IT/Operatons support
> Raytheon Aircraft Company, Wichita KS
> russ_jones@rac.ray.com 316-676-0747
>
> Quae narravi, nullo modo negabo. - Catullus
>


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


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

Date: Fri, 15 Sep 2000 13:03:37 GMT
From: alphazerozero@my-deja.com
Subject: Question about Overloading "="
Message-Id: <8pt6mu$kpp$1@nnrp1.deja.com>

I was wondering if anyone knew of any Modules on CPAN that overload
the "=" operator.
Ive been reading the documentation for overload but every time I do I
get more confused not less.

Any help on this subject would be very apreciated.

thanx

alphazerozero


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


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

Date: Fri, 15 Sep 2000 09:22:30 -0400
From: Thom Harp <thomharp@flash.net>
Subject: Re: Question about Overloading "="
Message-Id: <39C22296.E19DC6D4@flash.net>

> I was wondering if anyone knew of any Modules on CPAN that overload
> the "=" operator.

To my knowledge you can't do that, but you might want to look into the
"tie" function.  It allows you to associate a variable with a class, and
you can create methods which handle the usual actions of that variable,
such as fetching and storing...





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

Date: Fri, 15 Sep 2000 14:04:55 GMT
From: alphazerozero@my-deja.com
Subject: Re: Question about Overloading "="
Message-Id: <8pta9n$pad$1@nnrp1.deja.com>

In article <39C22296.E19DC6D4@flash.net>,
  Thom Harp <thomharp@flash.net> wrote:
> To my knowledge you can't do that, but you might want to look into the
> "tie" function.  It allows you to associate a variable with a class,
and
> you can create methods which handle the usual actions of that
variable,
> such as fetching and storing...

Yeah I do know about that, but actually I meant about a copy
constructor (which use overload considers to be the "=" operator.) and
its use with other overloaded operators.

If you look at the doc that goes with overload its very confusing..
So i might be confused as well... :-)

yves




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


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

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


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