[13948] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1358 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 12 06:05:33 1999

Date: Fri, 12 Nov 1999 03:05:18 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <942404717-v9-i1358@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 12 Nov 1999     Volume: 9 Number: 1358

Today's topics:
    Re: Absolute path <david@inta.net.uk>
        calling a script <madhatter@cableinet.co.uk>
        CGI and GD.pm mciesiel@my-deja.com
    Re: error code = 2 - need help <gellyfish@gellyfish.com>
    Re: freeing memory <rhomberg@ife.ee.ethz.ch>
    Re: freeing memory (M.J.T. Guy)
    Re: funny behaviour of Perl <gellyfish@gellyfish.com>
    Re: funny behaviour of Perl (Stefaan A Eeckels)
    Re: GURU HELP NEEDED FOR NEWBIE <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
    Re: GURU HELP NEEDED FOR NEWBIE <rhomberg@ife.ee.ethz.ch>
    Re: HELP - Need DBI::Oracle Binaries (?) for Solaris (Abigail)
    Re: Help needed fast please <gellyfish@gellyfish.com>
    Re: How to not print Header in my page? (Martien Verbruggen)
    Re: How to use stat () ? (Abigail)
        Installing new modules <jjyooi@dcs.qmw.ac.uk>
    Re: Jobs Opportunities at CitySearch (Martien Verbruggen)
    Re: MD5 Encryption <jjyooi@yahoo.com>
    Re: modifying an series of RCS files <gellyfish@gellyfish.com>
    Re: Need help with arrays. (Sam Holden)
        Net::Ping michaelh@erols.com
    Re: OO question again (Martien Verbruggen)
    Re: Passing arrays + other arguments to a subroutine (Anno Siegel)
    Re: Perl and commonsense part 2 (Bart Lateur)
    Re: perl as first language? (David H. Adler)
    Re: Perl Extensions. Arrgh. <rhomberg@ife.ee.ethz.ch>
    Re: Perl Extensions. Arrgh. (Arved Sandstrom)
    Re: Perl man page translation (Abigail)
    Re: PHP problem <gellyfish@gellyfish.com>
    Re: PHP problem (Simon Cozens)
    Re: PHP problem <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
    Re: printing a number with 3 digits (Abigail)
        split <nigell.boulton@rade.net>
    Re: split <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
    Re: Style Sheets crash netscape (Martien Verbruggen)
    Re: unable to run perl scripts on pws <gellyfish@gellyfish.com>
        Unicode Script mehkriakram@my-deja.com
        Unicode Script mehkriakram@my-deja.com
    Re: Virus (Bart Lateur)
        Weekday in perl dpi27@my-deja.com
    Re: Win32::ODBC trouble (eats memory) (remove)net (Chris V.)
    Re: Win32::ODBC trouble (eats memory) (Sam Holden)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Fri, 12 Nov 1999 10:39:25 -0800
From: "David Ashe" <david@inta.net.uk>
Subject: Re: Absolute path
Message-Id: <80gqdb$2opn$1@news2.vas-net.net>

Andrei Rjeousski <andrv@yesic.com> wrote

> is it possible to find absolute path of the directory without asking the
> administrator?

print `pwd`;
__END__

or on a web server, use this cgi script

#!/usr/bin/perl
print "Content-type: text/html\n\n",`pwd`;

__END__

regs,
dave/ia




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

Date: Fri, 12 Nov 1999 09:38:59 -0000
From: "Kevin" <madhatter@cableinet.co.uk>
Subject: calling a script
Message-Id: <80gnno$6uq$1@news1.cableinet.co.uk>

how do you call an ssi command via Javascript

I have a cgi generating html and Im told you cannot called SSI through a cgi
generated html page

I am told that you can call the SSI commands if you call a cgi script
instead through Javascript and I was wondering if anyone has done this or
can give me another alternative to calling the other SSI commands?

KC




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

Date: Fri, 12 Nov 1999 09:34:14 GMT
From: mciesiel@my-deja.com
Subject: CGI and GD.pm
Message-Id: <80gmun$cir$1@nnrp1.deja.com>

Hi everybody

Is it possible to make a CGI output with an image made with GD.pm and
input field written in plain HTML on the same page?

I can make image as output, and some HTML output ofcourse, but
how to do it on the same page ?

Thanks


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


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

Date: 12 Nov 1999 09:18:58 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: error code = 2 - need help
Message-Id: <80gm22$l6m$1@gellyfish.btinternet.com>

On Thu, 11 Nov 1999 08:32:49 +0800 Justin Hardman wrote:
> I just installed Active Perl build 522 on my NT server, and now I am getting
> lots of error messages, that say "Win32 Error Code = 2," when I am running
> SSI scripts. When I just run a perl script it is bringing up a 404 error
> page.
> 

All of Perl's diagnostic messages are documented in the perldiag manpage
which you should have on your machine - this message does not number amongst
them.

I would suggest you ask comp.infosystems.www.servers.ms-windows as the
problem is with your server software not with Perl.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 12 Nov 1999 10:19:12 +0100
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: freeing memory
Message-Id: <382BDB90.61E78A0C@ife.ee.ethz.ch>

timfi@my-deja.com wrote:
> Is this also true for references to hashes of hashes?  For instance,
> say I have the following structure:
> 
>   $hashref = {
>        name => "Tom",
>        birthdate => \%birthdate };
> 
> Then would this work?  undef %{$hashref};

Yes. Or simply
$hashref = {};  #or
undef $hashref; #or
$hashref = 'something different';

When the reference count of an object becomes zero (meaning nothing
points to it a anymore), it is eventually removed

- Alex


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

Date: 12 Nov 1999 09:50:02 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: freeing memory
Message-Id: <80gnsa$qqj$1@pegasus.csx.cam.ac.uk>

Tad McClellan <tadmc@metronet.com> wrote:
>On Thu, 11 Nov 1999 19:10:24 GMT, timfi@my-deja.com <timfi@my-deja.com> wrote:
>
>>What is the best way to free memory for a complex data structure, i.e.
>>hash of hashes of hashes?
>
>   %hash = ();   # and let garbage collection do its job

With one small qualification:   Garbage collection won't retrieve
looped data structures, such as

      $hash{key} = \%hash;

But you're probably not doing that.


Mike Guy


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

Date: 12 Nov 1999 09:37:40 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: funny behaviour of Perl
Message-Id: <80gn54$l6q$1@gellyfish.btinternet.com>

On Thu, 11 Nov 1999 11:53:39 -0800 Larry Rosler wrote:
> In article <80f2id$6kp$1@nnrp1.deja.com> on Thu, 11 Nov 1999 18:40:20 
> GMT, emarkert@my-deja.com <emarkert@my-deja.com> says...
>> Well since you didn't state the OS you are using it makes it a bit
>> difficult to help...
>> 
>> However, if you are running this on UNIX it is most likely a permission
>> problem.  Make sure that you have this file set for at least r-x--x--x.
> 
> It needs to be r-x for any attempt to execute it.  So the --x fields are 
> useless.  rwxr-xr-x is typical.
> 

I was looking at some stuff on a machine at work and the files were all
rwx--x--x and they *did* work which came as somewhat of a suprise - I cant
remember what version of Unix it was though ... Pick one of SCO OpenServer
or Solaris.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 12 Nov 1999 10:05:23 GMT
From: Stefaan.Eeckels@ecc.lu (Stefaan A Eeckels)
Subject: Re: funny behaviour of Perl
Message-Id: <80gop3$2no$1@justus.ecc.lu>

In article <80gn54$l6q$1@gellyfish.btinternet.com>,
	Jonathan Stowe <gellyfish@gellyfish.com> writes:
> 
> I was looking at some stuff on a machine at work and the files were all
> rwx--x--x and they *did* work which came as somewhat of a suprise - I cant
> remember what version of Unix it was though ... Pick one of SCO OpenServer
> or Solaris.
Typically, shell scripts (and Perl programs) need to be
readable, compiled programs only need to be executable.

-- 
Stefaan
-- 

PGP key available from PGP key servers (http://www.pgp.net/pgpnet/)
___________________________________________________________________
  In a world where everyone uses an alias, one's real identity is
  the best disguise.


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

Date: Fri, 12 Nov 1999 01:16:40 -0800
From: Mark Bluemel <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
Subject: Re: GURU HELP NEEDED FOR NEWBIE
Message-Id: <000b8d9b.78936b0d@usw-ex0101-006.remarq.com>

In article <LvMW3.399$YI2.17761@typ11.nn.bcandid.com>, kragen@dnaco.net
(Kragen Sitaker) wrote:
> My PERL script doesn't work.  What's wrong?

use Irony :":-)";

Hmm.. My PSI::ESP module suggests that the script requires some fixes.

Have you put "#!/luser/yokel/Pearl" as your first line ? This is
especially important under Windoze.

If you have "-w" set or "use strict;", remove them at once as they can
hide problems.

If you need further assistance, please mail a binary dump of your
operating system to AOL who provide free online support.

HTDNH

--
Mark



* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: Fri, 12 Nov 1999 10:50:00 +0100
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: GURU HELP NEEDED FOR NEWBIE
Message-Id: <382BE2C8.2C329E86@ife.ee.ethz.ch>

Kragen Sitaker wrote:
> 
> My PERL script doesn't work.  What's wrong?

you probably made the mistake of using the -w or -T switches or the 
"use strict" command , all of which will either destroy your output with
useless messages or even worse, they cause perfectly good programs not
to work anymore.

- PERL Guru


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

Date: 12 Nov 1999 02:57:05 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: HELP - Need DBI::Oracle Binaries (?) for Solaris
Message-Id: <slrn82nlpl.lmh.abigail@alexandra.delanet.com>

David Cassell (cassell@mail.cor.epa.gov) wrote on MMCCLXIV September
MCMXCIII in <URL:news:382B6B91.25C0084B@mail.cor.epa.gov>:
__ 
__ [2]  I would expect that you would have better luck 
__ building this using gcc than with that *thing* that
__ Sun calls a C compiler.  gcc is free, you know.

Hmm, about the only thing that I could compile on gcc on Solaris instead
of Sun's compiler was the ``it compiles on any ANSI compiler'' GD library
from Tom Boutell. Although, it compiled fine after removing the //'s comments,
and de-Microsofting it (removal of ^Ms). It's unreasonable to expect from
a C compiler to understand C++ comments, or to deal with bogus characters.


gcc is free, but I've never been convinced it actually builds "better"
binaries (for whatever value of "better") than Sun's compiler. (sunpro).



Abigail
-- 
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
                       -> define ("foldoc", "perl")) [0] -> print'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 12 Nov 1999 08:54:36 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Help needed fast please
Message-Id: <80gkkc$l50$1@gellyfish.btinternet.com>

On Thu, 11 Nov 1999 21:37:35 -0800 Larry Rosler wrote:
> In article <382b368b@news.amigo.net> on Thu, 11 Nov 1999 20:30:00 -0700, 
> Randy Smith <randys@NOSPAMamigo.net> says...
>> 
>> Chris <chris@chrismail.connectfree.co.uk> wrote in message
>> news:382a87d4.0@news2.cluster1.telinco.net...
>> : I have made some changes to the help I was last given like putting html in
>> : and it dosen't work plus the other file hasn't been helped with the files
>> : are below ( I have maked my changes) HELP ME PLEASE!!
>> :
>> : sign_up.pl ----
>> : #########################
>> :
>> : #!/usr/bin/perl -wT
>> :
>> : use strict;
>> : use CGI qw(:standard);
>> : use Fcntl qw(:flock);
>> :
>> : $ENV{qw(PATH IFS)} = '' x 2;
>> Did you forget a " in this line?
> 
> Probably supposed to be this:
> 
>     @ENV{qw(PATH IFS)} = ("") x 2;
> 

I must admit my culpability for that - yes it should be @ENV .. but it
does appear to work without the parens around the '' though ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 12 Nov 1999 10:11:27 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: How to not print Header in my page?
Message-Id: <slrn82nq40.eec.mgjv@wobbie.heliotrope.home>

[You computer seems to have a chronology problem. Your answer came
before the post you quoted. Please reset your clock]

[Fixed order]

On Thu, 11 Nov 1999 11:18:09 -0500,
	Qinqiang Sun <qsun@kitco.com> wrote:
> Alex Rhomberg wrote:
> 
> > Qinqiang Sun wrote:
> > >
> > > Hi,
> > > I use perl5 building 515 and IIS4.0 on our NT4.0 Server. Run perl script
> > > with perlIS.dll. I got the header part I don't want
> > > "HTTP/1.0 200 OK Date: Thu, 11 Nov 1999 15:45:47 GMT Server:
> > > Microsoft-IIS/4.0 Content-type: text/html ". Please help me to not print
> > > this on our page.
> >
> > Ask Microsoft Hotline how to configure your IIS correctly
> > - Alex
> 
> Hi,
> I configure two machnes and one is oK, the other does return header.
> I have no ideas.
>  Thank you.

And what makes you think that we have an idea? This group is here to
talk about Perl, not about how to configure the various Microsoft
products.

If you want my advice, switch to Apache. If you don't want to take that
advice, ask in a group that either has iss or microsoft in its name. Or
maybe there is a group in the comp.infosystems.www.* hierarchy that
talks about configuring web servers. Try there.

But _this_ is _not_ the rightplace to ask this question.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd.   | make up 3/4 of the population.
NSW, Australia                  | 


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

Date: 12 Nov 1999 04:44:03 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: How to use stat () ?
Message-Id: <slrn82ns24.lmh.abigail@alexandra.delanet.com>

Adrian Chin (Achin@inprise.com) wrote on MMCCLXIV September MCMXCIII in
<URL:news:382B769E.3469A9F9@inprise.com>:
@@ Subject:
@@              How to use stat function ?
@@         Date:
@@              Tue, 09 Nov 1999 11:59:14 +0800
@@        From:
@@              Adrian Chin <Achin@inprise.com>
@@  Organization:
@@              Inprise
@@  Newsgroups:
@@              comp.lang.perl.misc


Subject:
             Re: How to use stat function ?
Date:
             9 Nov 1999 06:29:56 -0000
From:
             abigail@delanet.com
Organization:
             Abigail's Kinderboerderijen
Posted-To:
             comp.lang.perl.misc
References:
             <38279C12.8FBB76DA@inprise.com>



Abigail
-- 
sub A::TIESCALAR{bless\my$x=>A};package B;@q=qw/Hacker Another
Perl Just/;use overload'""'=>sub{pop @q};sub A::FETCH{bless\my
$y=>B}; tie my $shoe => 'A';print "$shoe $shoe $shoe $shoe\n";


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 12 Nov 1999 10:52:39 +0000
From: Johnny 'Loopy' Ooi <jjyooi@dcs.qmw.ac.uk>
Subject: Installing new modules
Message-Id: <382BF177.1EEBA735@dcs.qmw.ac.uk>

I have a Windows Version of Perl and I've got a pile of CPAN modules.
How do I install them into Perl? I've got nmake15.exe from Microsoft's
site. PPM only seems to get the ones from activestate.com and it doesn't
have any modules that I want.

Any help out there?

-- 
Johnny Ooi. Aliases: Loopy, Tuxedo Mask, Quote Master.....
E-Mail		: jjyooi@dcs.qmw.ac.uk or jjyooi@yahoo.com
WWW		: http://www.dcs.qmw.ac.uk/~jjyooi/ or
http://members.xoom.com/Tuxedo_Loopy
ICQ No          : 6155774

"Stay sane guys!"

===============================================================


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

Date: 12 Nov 1999 09:43:22 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Jobs Opportunities at CitySearch
Message-Id: <slrn82nofg.eec.mgjv@wobbie.heliotrope.home>

On 11 Nov 1999 21:39:55 -0800,
	Randal L. Schwartz <merlyn@stonehenge.com> wrote:
> >>>>> "Tom" == Tom Briles <sariq@texas.net> writes:
> 
> Tom> But where do you see the word 'job' in comp.lang.perl.misc?
> 
> Here's what I send to every job posting in every group I frequent
> (except .smalltalk, because they seem to want to huddle there :):

I guess they're happy to get a job offer at all? :)

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | For heaven's sake, don't TRY to be
Commercial Dynamics Pty. Ltd.   | cynical. It's perfectly easy to be
NSW, Australia                  | cynical.


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

Date: Fri, 12 Nov 1999 09:58:03 GMT
From: Tuxedo Loopy <jjyooi@yahoo.com>
Subject: Re: MD5 Encryption
Message-Id: <80goba$dgv$1@nnrp1.deja.com>

In article <382981F9.CEBCD44@home.com>,
  dthusma@home-del.com wrote:
> Tuxedo Loopy wrote:
>
> check out the new mastering algo in perl by o'reilly.  They show
> everything* available
> for encryption, both isomorphic and encrypt/decrypt.  A very good
read,
> if I do say.

Thanks. I'll take a look some time.

--
Tuxedo Loopy
------------
jjyooi@yahoo.com
http://www.geocities.com/Tokyo/Bay/5879


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


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

Date: 12 Nov 1999 08:59:45 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: modifying an series of RCS files
Message-Id: <80gku1$l6h$1@gellyfish.btinternet.com>

On Wed, 10 Nov 1999 18:25:58 -0600 Navin Chander wrote:
> I have a series of files in RCS. I have to do the same modification to each file.
> 
> I am trying to do it using perl. but the problem is, when I check the file back in,
> 
> RCS requires an input. Can someone tell me how to do that in perl.
> 

Read the 'ci' manpage - you can supply the log message on the command line.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 12 Nov 1999 08:14:57 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Need help with arrays.
Message-Id: <slrn82nj4d.82f.sholden@pgrad.cs.usyd.edu.au>

On Thu, 11 Nov 1999 23:51:04 -0800,
	John Iyezack <snapperhead_420NOsnSPAM@hotmail.com.invalid> wrote:
>I have this array filled with numbers.  I need to be able to go through
>the array an take out all of the duplicate entrys and place them into
>another array.  Seems strange and simple, but, I can't figure it out!

Before you ask a question in a newsgroup you should read the FAQ.

Chances are your question isn't as strange and unusual as you suspect.

Also, if you post the code you have tried you are much more likely to
get an answer, then if you just ask 'how do I do ...'.

Have a look at :

Found in /local/usr/lib/perl5/5.00502/pod/perlfaq4.pod
How can I extract just the unique elements of an array?

The command : perldoc -q unique

Should give you the answer you are looking for. However, I encourage you
to read the documentation that comes with perl. Yes there is a lot. At 
least read all the FAQs and the table of contents, so you know where to
look for future answers.

-- 
Sam

Every human culture has good and bad points. Every computer program has
Eveone more bug. Even Perl.
	--Larry Wall


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

Date: Fri, 12 Nov 1999 10:59:10 GMT
From: michaelh@erols.com
Subject: Net::Ping
Message-Id: <382bf249.635899@news.erols.com>

I am running the 5.004 CPAN dist on NT 4.0.  I am having trouble with
Net::Ping.  Using the examples in the HTML Doc's I was able to get it
to ping a Unix Host.  But when I ping a NT Host (that is running TCPIP
and happens to include a Exchange Server and IIS).  It times out.  It
doesn't matter if I use the full name or the IP Address.  I can use
the command line (NT Prog) Ping and it works fine for both Hosts.  Any
clues why Net::Ping may not work for NT Server?


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

Date: 12 Nov 1999 10:43:58 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: OO question again
Message-Id: <slrn82ns12.eec.mgjv@wobbie.heliotrope.home>

[Your newsreader seems to not know that the customary maximum length for
lines on Usenet is somewhere around 72 characters. Maybe you should
configure it]

On Thu, 11 Nov 1999 23:08:28 +0100,
	Thomas Schmickl <schmickl@magnet.at> wrote:

> I have learned in between that you can call a sub in different
> contexts, f. ex. the scalar and the array context.

That would be list context. There is no such thing as array context. The
name wantarray is a misnomer.

# perldoc perlsub 

for more information.

> In my case it would be the most easy thing to call a subroutine in an
> array-  or an reference-of-an-array context, which will work I think.

Euhmm.. not exactly literally true. You have scalar or list context.
That's as precise as it gets.

> But how could I do an scalar-context together with an
> reference-of-a-scalar context, which are basicsally both scalars. Is
> this possible.

You can't distinguish between the two. A scalar is a scalar, no matter
what it contains. When you return a reference to an array, the scalar
that receives the return value of your sub will contain that reference,
even if it contained a string or a integer before. Perl scalars have no
type.

A sub can return a list, or it can return a scalar. The list may be the
empty list, and the scalar may be undef. That more or less sums it up.

Now.. In your sub, you can find out whether it has been called in a void
context, list context or scalar context. And that sums it up.

more info in

# perldoc -f wantarray
and
# perldoc perlsub

> The second thing is, if Tk takes an reference to an hash-value to
> read/write from/to it, is there a way that it uses the reference of an
> Get/Set-subroutine the same way ? I think not, but maybe there is one?

I don't know Tk/Perl very well.. but I'm a bit confused by the
question.. A reference to a hash value? Did you mena a reference to a
hash? And is the rest of the question whether a method/sub can return a
reference to a hash?

The answer to that is yes, but there is no way you can _know_ in your
sub that that is what is expected. About half of the work of designing
an interface is by coming up with sensible return values and names. A
quarter is documenting it, and adjusting things while you are
documenting, and the rest is actual implementation (give or take a few
percents here or there). If something wants a reference to an hash,
then you will have to provide one:

sub return_hash_ref 
{
	my %ar = ( 'foo' => 'bar', 'baz' => 'banana' );
	return \%ar;
}

$hash_ref = return_hash_ref();

It is up to the user of your interface not to do things like:

$integer = return_hash_ref();
$array_ref = return_hash_ref();

And with a sub that wants a hash ref as one of its arguments:

my %fee = ( 'fie' => 'foe', 'fum' => 'fiddle' );

sub_needing_a_hash_ref(\%fee);

or, making a copy, instead of passing the main one:

sub_needing_a_hash_ref({%fee});

or, even like:

sub_needing_a_hash_ref(return_hash_ref());

Now, if return_hash_ref can return a list or a scalar,you just need to
put it in scalar context with 'scalar'

sub_needing_a_hash_ref(scalar return_hash_ref());

# perldoc -f scalar

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


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

Date: 12 Nov 1999 10:43:19 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Passing arrays + other arguments to a subroutine
Message-Id: <80gr07$pok$1@lublin.zrz.tu-berlin.de>

 <irf@netexecutive.com> wrote in comp.lang.perl.misc:
>
>> >   foreach $element(@$_[0]){
>> >     print "myArray from sub: $key<BR>";
>>                                ^^^^
>>                                ^^^^
>> What is $key? Shouldn't it be $elements?
>
>> If you change $key to $element, the little snippet will do what you
>> want.
>
>yeah, sorry - i changed it from $key in my actual code to $element
>(for clarity!), and must have overseen that. but the snippet does
>not work even if everything is in concord, which is why i put the
>question up.

Well yes.  It's a precedence problem.  @$_[0] tries to access
the first element of the array a reference to which is stored
in the scalar variable $_.  No such luck, because $_ isn't set.
Indeed, if you had switched on warnings Perl would have told
you so.

What you want to do is to dereference the array ref in the
first element of @_, which you do with @{ $_[ 0]}.  Try that.

>Thank everyone, for the info, time to go find those perlref & perlsub
>docs!

Yes, please.

Anno


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

Date: Fri, 12 Nov 1999 08:21:43 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Perl and commonsense part 2
Message-Id: <382bcdec.490590@news.skynet.be>

Matthew Bafford wrote:

>[0] Yes, I know what '=>' does to its left hand side.  The point is,
>    Larry and Abigail (to name two prominent users of '=>') don't use it
>    when its side effects will cause problems.

If they did, their program would contain a bug in this place.

What's your point?  ;-)

-- 
	Bart.


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

Date: 12 Nov 1999 04:15:09 -0500
From: dha@panix.com (David H. Adler)
Subject: Re: perl as first language?
Message-Id: <slrn82nmkt.jqq.dha@panix.com>

On 10 Nov 1999 10:43:10 GMT, Damian Conway <damian@cs.monash.edu.au> wrote:
>abigail@delanet.com (Abigail) writes:
>
>>Now I'm stuck with the image of a student using a canoe to get from
>>Australia to Japan and back.
>
>Canoes? We don't coddle them with "looxuries" like canoes!

Will you also be slicing her in two with a bread knife when she gets home?

dave, who was under the impression that Yorkshire was in england,
rather than australia... ;-)

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
A picture is worth
several hundred thousand words...
in the right haiku			- Damian Conway


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

Date: Fri, 12 Nov 1999 10:33:33 +0100
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Subject: Re: Perl Extensions. Arrgh.
Message-Id: <382BDEED.3B9B468C@ife.ee.ethz.ch>

Ilya Zakharevich wrote:
> 
Oh, thats the guy from the xs and guts manpages.

> > The return's an SV. *All* returns from an XS module are ultimately SVs.
> 
> Then I understand your initial remark as advocating
> 
>   SV *
>   foo()
>     CODE:
>         RETVAL = 5;
>     OUTPUT:
>         RETVAL
> 
> as working?

So from now on, I will use the code he posted here. Never mind compiler
errors and segfaults, it *must* be correct...

- Alex


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

Date: Fri, 12 Nov 1999 07:05:46 -0400
From: Arved_37@chebucto.ns.ca (Arved Sandstrom)
Subject: Re: Perl Extensions. Arrgh.
Message-Id: <Arved_37-1211990705470001@dyip-59.chebucto.ns.ca>

In article <382BDEED.3B9B468C@ife.ee.ethz.ch>, Alex Rhomberg
<rhomberg@ife.ee.ethz.ch> wrote:

> Ilya Zakharevich wrote:
> > 
> Oh, thats the guy from the xs and guts manpages.
> 
> > > The return's an SV. *All* returns from an XS module are ultimately SVs.
> > 
> > Then I understand your initial remark as advocating
> > 
> >   SV *
> >   foo()
> >     CODE:
> >         RETVAL = 5;
> >     OUTPUT:
> >         RETVAL
> > 
> > as working?
> 
> So from now on, I will use the code he posted here. Never mind compiler
> errors and segfaults, it *must* be correct...
> 
Well, there is a bit of a philosophical discussion going on... :-)

Seriously, if you use

int
foo()
   CODE:
      RETVAL = 5;
   OUTPUT:
      RETVAL

you'll be OK.

Arved


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

Date: 12 Nov 1999 04:53:09 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: Perl man page translation
Message-Id: <slrn82nsj6.lmh.abigail@alexandra.delanet.com>

Jiun-Long Huang (jlhuang@csie.nctu.edu.tw) wrote on MMCCLXIV September
MCMXCIII in <URL:news:80g16s$ho1$1@netnews2.csie.nctu.edu.tw>:
?? 
?? 	I am planning to translate perl man pages into chinese. I wonder that
??     whom should I inform before translation. Thanks in advanced.

There's no need to inform anyone, but never the less, I suggest contacting
Tom Christiansen (tchrist@perl.com), to whom I'll cc this reply.



Abigail
-- 
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
 .qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
 .qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: 11 Nov 1999 16:23:20 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: PHP problem
Message-Id: <80eqho$jha$1@gellyfish.btinternet.com>

On Thu, 11 Nov 1999 22:03:45 +0800 BY Wu wrote:
> hi, I just installed php3 in my nt system with IIS3 server, now the problem
> is I can run the php srcipt when I put the script under document root , I
> can not run them form other dirctory. so I don't know wat is the problem ,
> any one got this kind of problem . pls help me. thank you.
> 

I am genuinely interested in the association you think exists between PHP
and Perl - please explain to us ...

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: 12 Nov 1999 10:30:28 GMT
From: simon@brecon.co.uk (Simon Cozens)
Subject: Re: PHP problem
Message-Id: <slrn82nr24.kd9.simon@othersideofthe.earth.li>

Jonathan Stowe (comp.lang.perl.misc):
>I am genuinely interested in the association you think exists between PHP
>and Perl - please explain to us ...

I really do not believe you want to know the answer to that question.

Simon
(Rntreyl rkcrpgvat gur nafjre `Gurl'er obgu PTV.')

-- 
A Linux machine! because a 486 is a terrible thing to waste!
(By jjs@wintermute.ucr.edu, Joe Sloan)


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

Date: Fri, 12 Nov 1999 02:40:08 -0800
From: Mark Bluemel <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
Subject: Re: PHP problem
Message-Id: <000b8d9b.8e586c5e@usw-ex0101-006.remarq.com>

In article <slrn82nr24.kd9.simon@othersideofthe.earth.li>,
simon@brecon.co.uk (Simon Cozens) wrote:
> Jonathan Stowe (comp.lang.perl.misc):
> >I am genuinely interested in the association you think exists
> between PHP
> >and Perl - please explain to us ...
> I really do not believe you want to know the answer to that
> question.
> Simon
> (Rntreyl rkcrpgvat gur nafjre `Gurl'er obgu PTV.')
(N fher org) :-)

Can we also have a definitive statement on why a raven is like a
writing desk?  and more to the point, why my car won't run on diesel or
coal - they're fuels like petrol aren't they?

--



* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: 12 Nov 1999 04:54:10 -0600
From: abigail@delanet.com (Abigail)
Subject: Re: printing a number with 3 digits
Message-Id: <slrn82nsl7.lmh.abigail@alexandra.delanet.com>

G.Ananth Somayaji (gs_ananth@ti.com) wrote on MMCCLXIV September MCMXCIII
in <URL:news:rf5yac41g09.fsf@ti.com>:
()
() 	I am trying to print a number so that it should always 
() have only 3 digits. For example 7 should be printed as 007. Looks
() sort of a simple task but the solution has evaded me for a couple 
() of days now. 


Hmmm, it would take less than 3 days to read perlfunc and stumble upon
the right function....



Abigail
-- 
               split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_)  {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};


  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.newsfeeds.com       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----


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

Date: Fri, 12 Nov 1999 09:25:17 -0000
From: "Nigell Boulton" <nigell.boulton@rade.net>
Subject: split
Message-Id: <382bd1c4.0@news.netdirect.net.uk>

How do I open a text file that has data such as

fred:30
bill:25
john:30

open the file and then change and display it on screen in the format

Fred is 30 years old
Bill is 25 years old
John is 30 years old

thanks for your help

reply by email to nigell@nigell.com




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

Date: Fri, 12 Nov 1999 01:59:02 -0800
From: Mark Bluemel <mark.bluemelNOmaSPAM@siemens.co.uk.invalid>
Subject: Re: split
Message-Id: <0a0133f8.83a0d227@usw-ex0101-006.remarq.com>

In article <382bd1c4.0@news.netdirect.net.uk>, "Nigell Boulton"
<nigell.boulton@rade.net> wrote:
> How do I open a text file that has data such as
> fred:30
> bill:25
> john:30
> open the file and then change and display it on screen in the
> format
> Fred is 30 years old
> Bill is 25 years old
> John is 30 years old
> thanks for your help
> reply by email to nigell@nigell.com

If I do your homework, do I get your pocket money?

This is so simply fundamental that I won't even ask if you've read the
manual or the FAQ - you're either ignorant or lazy. The former can be
cured - do some research - the latter is probably incurable.

And no, I won't reply by email - you post here, you get the reponses
here - wanting to post a question and then get direct responses is
antisocial in the context of usenet.

--

Mark


* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!



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

Date: 12 Nov 1999 09:53:33 GMT
From: mgjv@wobbie.heliotrope.home (Martien Verbruggen)
Subject: Re: Style Sheets crash netscape
Message-Id: <slrn82np2j.eec.mgjv@wobbie.heliotrope.home>

On Fri, 12 Nov 1999 15:02:14 +0900,
	Mike Ryan <mryan@kc4.so-net.ne.jp> wrote:
> OK please IGNORE this, I am idiot :)

Nonono.. I think it is about high bloody time that _they_ got this perl
thing worked out so ti doesn't crash Netscape anymore aith Style Sheets.
No matter what your HTML said; Perl should just be able to deal with it
and not crash Netscape. Especially not with Style Sheets.

What, in any of these two posts, exactly, has anything at all to do with
perl? Please, next time you post here, make sure it has something to do
with Perl, and if it is about style sheets, HTML HTPP, web browsers, CGI
or JavaScript, post to one of the comp.infosystems.www.* groups, and let
us sleep.

Thank you for your future cooperation.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | In a world without fences, who needs
Commercial Dynamics Pty. Ltd.   | Gates?
NSW, Australia                  | 


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

Date: 12 Nov 1999 08:56:44 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: unable to run perl scripts on pws
Message-Id: <80gkoc$l53$1@gellyfish.btinternet.com>

In comp.lang.perl.misc David Cassell <cassell@mail.cor.epa.gov> wrote:
> ltawfall@my-deja.com wrote:
>> 
>> I've been trying to run a >basic< perl script on my personal
>> web server that I installed when I installed win98se.
>> 
>> The web server itself works fine with regular html pages.
> 
> So the problem is most likely getting your web server config
> correct.  That sounds like a post for one of the server
> newsgroups.  There is at least one specifically for PWS.
> 
>> I checked the MS knowledge base for help and the activestate perl help
>> docs and nothing works yet.
> 
> Your script is straight from the MS KnowledgeBase?  Yuck.
> I would think that MS would have heard of here-docs by now.

You would also thought that they would have updated it since CGI programs
no longer have to be NPH for IIS.

/J\
-- 
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>


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

Date: Fri, 12 Nov 1999 10:06:40 GMT
From: mehkriakram@my-deja.com
Subject: Unicode Script
Message-Id: <80gorf$dsj$1@nnrp1.deja.com>

Can any body who has worked on unicode pass me a copy of the entire
script. I have starting problems out here. What exactly i am looking is
at how to understand incoming data  string and parse it.
It would be really greatful of anybody who helps.
Note: I am stuck with CJKV problem.
Thank You in advance


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


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

Date: Fri, 12 Nov 1999 10:06:04 GMT
From: mehkriakram@my-deja.com
Subject: Unicode Script
Message-Id: <80goqb$dsg$1@nnrp1.deja.com>

Can any body who has worked on unicode pass me a copy of the entire
script. I have starting problems out here. What exactly i am looking is
at how to understand incoming data  string and parse it.
It would be really greatful of anybody who helps.
Note: I am stuck with CJKV problem.
Thank You in advance


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


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

Date: Fri, 12 Nov 1999 09:27:31 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Virus
Message-Id: <382cd03f.1085977@news.skynet.be>

Abigail wrote:

>Here's a little virus that attaches itself to any file ending in ".pl"
>in the current directory. 

It will change the behaviour of the current script because it clears $/.
The user might notice that the script starts failing to work correctly.

Using 

	local $/;

instead of

	undef $/;

cures that.

Funny that you expiciltely close localized file handles, which will be
closed automaticlly anyway, but you don't localize this global variable.

-- 
	Bart.


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

Date: Fri, 12 Nov 1999 10:11:09 GMT
From: dpi27@my-deja.com
Subject: Weekday in perl
Message-Id: <80gp3s$dv7$1@nnrp1.deja.com>

Hi,

Is there any function that could give me the weekday of a
specified date ?
If not, how could I get it with the following informations :
month day, month, year.

Thanks,


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


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

Date: Fri, 12 Nov 1999 10:02:14 GMT
From: zoot@brilliant.(remove)net (Chris V.)
Subject: Re: Win32::ODBC trouble (eats memory)
Message-Id: <382be3ea.655963@news.alt.net>

On Thu, 11 Nov 1999 19:31:38 -0800, Larry Rosler <lr@hpl.hp.com>
wrote:

>> Is this a bug or am I missing something?

<OFFTOPIC>
>
>You are missing how to use your newsreader to cross-post, instead of 
>posting the same article twice in two newsgroups.

I'm just sticking to the agreements: since I started out on the net
way back in '93, crossposting was considered a definite no-no, in
whatever hierarchy you did it.  I hope you're not one of those who
wants to change this.
</OFFTOPIC>

Chris V.


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

Date: 12 Nov 1999 10:28:16 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: Win32::ODBC trouble (eats memory)
Message-Id: <slrn82nqub.95k.sholden@pgrad.cs.usyd.edu.au>

On Fri, 12 Nov 1999 10:02:14 GMT, remove <zoot@brilliant.net> wrote:
>On Thu, 11 Nov 1999 19:31:38 -0800, Larry Rosler <lr@hpl.hp.com>
>wrote:
>
>>> Is this a bug or am I missing something?
>
><OFFTOPIC>
>>
>>You are missing how to use your newsreader to cross-post, instead of 
>>posting the same article twice in two newsgroups.
>
>I'm just sticking to the agreements: since I started out on the net
>way back in '93, crossposting was considered a definite no-no, in
>whatever hierarchy you did it.  I hope you're not one of those who
>wants to change this.
></OFFTOPIC>

But cross-posting is better than posting the same messages to multiple
groups at a time. At least if you cross-post poeple will only see
your post once, instead of once in each group.

-- 
Sam

People get annoyed when you try to debug them.
	--Larry Wall


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

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


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