[13328] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 738 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 8 09:07:52 1999

Date: Wed, 8 Sep 1999 06:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 8 Sep 1999     Volume: 9 Number: 738

Today's topics:
        array of binary to hex <john.wilkinson@soton.sc.philips.com>
    Re: case for open lang on win32 - fill in the table (Jenda Krynicky)
    Re: Day of the week <agray@infoscience.otago.ac.nz>
    Re: Diffs between scalar and hash variables? (Sitaram Chamarty)
    Re: Find MAC address <latsharj@my-deja.com>
    Re: Help! Newbie can't see print error in code (Anno Siegel)
    Re: integer mistery (Anno Siegel)
    Re: Job opportunities <jpeterson@office.colt.net>
    Re: mod_perl? help! <jpeterson@office.colt.net>
        Old Script Doesn't Like My New Perl? Help! (Dan Poynor)
    Re: OLE.pm HELP NEEDED ! <gellyfish@gellyfish.com>
    Re: Pattern Matching Question (David Alan Black)
        perl Ad <One.Bored.Guru........@p0.f1.n30.z30.fidonet.org>
    Re: Perl/Tk Installation (Sitaram Chamarty)
        Problems using grep <robert.rawlinson@worldnet.att.net>
    Re: Programmer's Editor <garethr@cre.canon.co.uk>
    Re: Programmer's Editor <c.d.hulshof@*DELETE*student.utwente.nl>
        Setuid troubles <dave.anderson@freeuk.com>
    Re: suggestion to revise grep (another Q: reference com (Sitaram Chamarty)
    Re: Unix Trouble <agray@infoscience.otago.ac.nz>
    Re: XS and tie <dada@divinf.it>
    Re: Y2K bugs on the Internet (Malcolm Ray)
    Re: Y2K bugs on the Internet (Chris Nandor)
        Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)

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

Date: Wed, 8 Sep 1999 10:59:46 GMT
From: John Wilkinson <john.wilkinson@soton.sc.philips.com>
Subject: array of binary to hex
Message-Id: <37D641A2.845D29C0@soton.sc.philips.com>

Hi,
I have just started programming in Perl, and I have a little problem
that I need help with.
I have 3 arrays each of 8 cells. In each cell is a binary digit, and the
combination of the three arrays make up a 24 bit word. I now need to
gather all these arrays together and produce a printout in hex
representing this word.
How do I do this?


Thanks,
John.



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

Date: Wed, 08 Sep 1999 11:34:39 GMT
From: Jenda@Krynicky.cz (Jenda Krynicky)
Subject: Re: case for open lang on win32 - fill in the table
Message-Id: <1103_936790479@prague_main>

On Mon, 6 Sep 1999 19:22:10 -0500, "Jason Kohlhoff" <jwk6@earthlink.net> wrote:
> I have something to add...
> 
> You Perl guys are all full of "open" shit...

Oh, but you ARE a nice guy. Thanks.
 
> I doubt you could write a script for a Windows machine that could not be
> done(possibly even better) with WSH and VBS, or JS.

The question is not IF, but HOW EASY. And at what cost.

Please note that for anything a bit more advanced you need some OLE/COM/ActiveX (or whatever name they 
use this week) object that either you or someone else wrote in C or something.

And that you almost always have to PAY for them.

On the other hand almost all Perl modules are FREE (I am aware of exactly ONE that is not).

A little difference, huh?

And besides you have the SOURCE of both Perl and all the modules. 
Thus you may see the code while debuging your program.
And everybody is able to find&fix bugs in the modules.

I guess you are the one who should put up and especialy grow up.
He just wanted comments on his statement. If you do not agree on some point of the message, 
say so and give us examples. Your reply realy doesn't show too much selfconfidence 
(and confidence to VB).

Jenda
----------------------------------------------------------------------------------
 You can never get for money, what you get for free. ... me.
http://Jenda.Krynicky.cz



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

Date: 08 Sep 1999 21:40:39 +1200
From: Andrew Gray <agray@infoscience.otago.ac.nz>
Subject: Re: Day of the week
Message-Id: <uso4pivvs.fsf@infoscience.otago.ac.nz>

david_2exvia@my-deja.com writes:
> I have a date in string format (mm/dd/yyyy) and I'd like to find the day
> of the week (Mon, Tue...)

If you don't already have Steffen Beyer's Date::Calc module, you may
want to download it from CPAN.  The script below shows how you could
determe the day of the week (you will need to split your date format
given above first to get the individual components).

#!usr/bin/perl -w
use strict;
use Date::Calc q(:all);

my $year=1999;
my $month=9;
my $day=8;

my $dayname=Day_of_Week($year,$month,$day);
print $dayname."\n";
$dayname=Day_of_Week_to_Text(Day_of_Week($year,$month,$day));
print $dayname."\n";
$dayname=Day_of_Week_Abbreviation(Day_of_Week($year,$month,$day));
print $dayname."\n";

produces

3
Wednesday
Wed

Cheers,
Andrew


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

Date: 8 Sep 1999 04:58:23 -0700
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Diffs between scalar and hash variables?
Message-Id: <slrn7tabm8.m3v.sitaram@diac.com>

On 5 Sep 1999 21:43:16 GMT, Jeffrey Epstein
<epsteinj@equity.wharton.upenn.edu> wrote:

>#  print $my_hash->{"filePointer"} "Printing from hash...\n";

Please read the last 2 paragraphs of the documentation on the
print function.  This is one way:

    perldoc -f print


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

Date: Wed, 08 Sep 1999 12:48:21 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: Find MAC address
Message-Id: <7r5luh$bn2$1@nnrp1.deja.com>

In article <37d5cb91.75760648@news.mindspring.com>,
  "rdw2 at mindspring dot com"@test.com (Richard Warkentin) wrote:
> Looks good, what is nbstat?

It's nbtstat. Try nbtstat /?.

--
Regards,
Dick


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


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

Date: 8 Sep 1999 10:51:30 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Help! Newbie can't see print error in code
Message-Id: <7r5f3i$7l4$1@lublin.zrz.tu-berlin.de>

Cathy Huang  <huang2@andrew.cmu.edu> wrote in comp.lang.perl.misc:
>I can't figure out why after I run this portion of code, the file
>paths.dat has been created, but is totally empty - 
>though volume3.dat is getting printed to fine. It's prob. something 
>obvious I can't see. 

[code snipped]

No, I don't see it either.  But then, you left a lot of stuff in
the code you presented that has apparently nothing to do with the
problem.  My suggestion:  Cut it down.  The problem seems to be, in
a nutshell: you're opening a file for writing, get no error, then
write to it, but the file remains empty.  Once you have trimmed your
code to show just that, you will very probably see for yourself what's
wrong.  If you don't, post it again.

Anno


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

Date: 8 Sep 1999 12:39:45 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: integer mistery
Message-Id: <7r5leh$7ra$1@lublin.zrz.tu-berlin.de>

[clp.modules trimmed from newsgroups]

Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:

>That subtracts two numbers that are relatively close in magnitude.  Kiss 
>precision goodbye.

I tend to mix up the two myself, but wouldn't that be accuracy you
lose?  The precision is still that of a float, but it's inaccurate.

If I'm wrong, I'm sure someone will soon teach me to apply common
sense to technical terminology.

Anno


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

Date: Wed, 08 Sep 1999 09:32:00 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: Job opportunities
Message-Id: <k2qB3.86$xa4.1217@news.colt.net>

Michelle Fowler <ciber@vnet.net> wrote:
> Hello everyone...


> Can I post Perl job openings here?

It is not an ideal forum. I would suggest that if you wish to advertise jobs
directly to the Perl community, that you find a Perl Mongers group for the
geographical area where your vacancies are, and then post the advertisement
there if they are willing to accept job postings (and in my experience they
tend to be, if it is bona fide and not random spam).



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

Date: Wed, 08 Sep 1999 09:47:51 GMT
From: Jon Peterson <jpeterson@office.colt.net>
Subject: Re: mod_perl? help!
Message-Id: <bhqB3.87$xa4.1217@news.colt.net>

clavikal <clavikal@voicenet.com> wrote:
> I (think) understand mod_perl somehow increases the speed, and lowers the
> cpu usage of perl programs because it doesn't spawn a separate process.

> The installation documentation at the mod_perl web site really sucks ( to me
> anyways ), so if anyone wouldn't mind, could someone please post easy

Sounds about right. Installing and maintaing a mod_perl/apache web server is
not a task for beginners. The fact that there are now n different and variously
incompatible ways to configure Apache doesn't help, either. My basic rules 
would be:

Never ever use the 'APACI' configuration for Apache, it's dreadfully confusing
for anything more than a default install. Use the 'src/Configuration' method
aka 'the old method'.

Never use the Apache dynamic modules, it's more trouble than it's worth - make
all modules, including perl, compiled in statically. This ought to always be
the default.

Start with a fresh distro of everything - freshly unpacked Apache, freshly 
unpacked mod_perl.

Consider simpler alternatives such as fastCGI, Velocigen, or what have you.

Oh, and Doug if you are listening I'm volunteering to re-do the perl.apache.org
website anytime you like :-0




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

Date: Wed, 08 Sep 1999 03:27:05 -0700
From: designer@ricochet.net (Dan Poynor)
Subject: Old Script Doesn't Like My New Perl? Help!
Message-Id: <designer-ya02408000R0809990327050001@news.ricochet.net>

I'm getting the following error when running an old script with newly
installed perl

[root@server hq]# perl -w /home/httpd/cgi-bin/rotate.pl
Use of uninitialized value at /home/httpd/cgi-bin/rotate.pl line 7.

---------here's the script rotate.pl-------------
#! /usr/bin/perl

$oldlink = readlink("/home/httpd/foobar.com/current");
@dirs = sort grep {!-l $_ && -d _} </home/httpd/foobar.com.com/slideshows/*>;
push(@dirs, $dirs[0]);
for (1..@dirs) { $newlink = $dirs[$_] and last if $dirs[$_-1] eq $oldlink }
symlink($newlink, "tmp.$$");
rename("tmp.$$", "/home/httpd/foobar.com.com/current");

exit (0);
--------------------------------------------------

My httpd error_log say "Premature end of script headers" if I attempt to
run this through http.

I've been through the FAQs and checked everything a dozen times it seems.
Below are details of my perl (RH6) install. Any help greatly appreciated!!!

Thanks,
DAN

[root@server hq]# perl -V
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
    osname=linux, osvers=2.2.1-ac1, archname=i386-linux
    uname='linux porky.devel.redhat.com 2.2.1-ac1 #1 smp mon feb 1 17:44:44
est 1999 i686 unknown '
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
    cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release)
    cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
    stdchar='char', d_stdstdio=undef, usevfork=false
    intsize=4, longsize=4, ptrsize=4, doublesize=8
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lposix -lcrypt
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Built under linux
  Compiled at Apr  6 1999 23:34:07
  @INC:
    /usr/lib/perl5/5.00503/i386-linux
    /usr/lib/perl5/5.00503
    /usr/lib/perl5/site_perl/5.005/i386-linux
    /usr/lib/perl5/site_perl/5.005


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

Date: 8 Sep 1999 10:28:42 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: OLE.pm HELP NEEDED !
Message-Id: <37d62c4a_2@newsread3.dircon.co.uk>

Frederic Descamps <frederic.descamps@origin-it.com> wrote:
> Hi,
> 
> How can I get back the value of a field in MS access USING OLE.pm.
> 

I dont understand why you want to use OLE to do this when you would
be far better off doing it with ODBC.

/J\
-- 
"The only man in the cabinet who supported them was that fucking lunatic
Redwood" - John Major


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

Date: 8 Sep 1999 07:21:09 -0400
From: dblack@pilot.njin.net (David Alan Black)
Subject: Re: Pattern Matching Question
Message-Id: <7r5gr5$hi7$1@pilot.njin.net>

Hello -

elephant@squirrelgroup.com (elephant) writes:

>stuart.mcintosh@db.com writes ..
>>I'm trying to come up with something that will match all of the
>>following when they come up in the middle of a line of text (I use 'POS'
>>to set the search start position to the correct starting place first)
>>
>>123.45678  P
>>  3.4567890P
>> 23.456789
>>
>>I tried m/\S+\s*\S/g - according to the "programming perl" book the \s*
>>should match zero or more occurances of a whitespace character but I
>>found it was failing on the second example above...

>it fails because on the second one the first \S+ matches everything .. 
>then the \s* successfully matches a zero length string .. but then the 
>regex wants a second \S .. but it can't find it because the whole string 
>was matched by the \S+


Except.... it actually succeeds, thanks to backtracking:

print "1: $1, 2: $2, 3: $3\n" if "  3.4567890P" =~ /(\S+)(\s*)(\S)/

1: 3.4567890, 2: , 3: P


so the problem must be elsewhere.
-- 
David Alan Black                 blackdav@shu.edu or dblack@pilot.njin.net
Associate Professor              Seton Hall University
Department of Communication      South Orange, NJ 07079
http://pirate.shu.edu/~blackdav  includes Syllabus Markup Language (SyML)


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

Date: Wed, 08 Sep 1999 00:01:52
From: "One Bored Guru        " <One.Bored.Guru........@p0.f1.n30.z30.fidonet.org>
Subject: perl Ad
Message-Id: <00002c4e@madnet.net>

Attention Perl-5/Linux Programmers.

The Sync3 Developement Team is looking for Perl-5/Linux programmers
to help on an open source project writing a new type of bbs designed
for Linux and The Internet.  If you think you have the skill and are
interested, please send email to devteam[at]sync3.com indicating your
interest and providing us with the relevant details pertaining to
your skill level and previous experience.  Thank you for your time
and interest.

     Steve Byers,
     Project Administrator,
     The Sync3 Project.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        + The Talamasca Internet Newsgroup Gateway +
               telnet://talamasca-bbs.com


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

Date: 8 Sep 1999 04:58:24 -0700
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Perl/Tk Installation
Message-Id: <slrn7tac2t.m3v.sitaram@diac.com>

On 07 Sep 1999 10:15:53 GMT, KJPhilbr13 <kjphilbr13@aol.com>
wrote:

>After unpacking Tk800.015.tar, I have done the following in the distribution
>directory:
>    Makefile.PL
>    make
>    make test
>And that went fine.  Now what do I do?  There must be more to do because when I

How about "make install"?

It's all in the README file, you know!

And I would like to tell you about an even greater way to install
things like this.  Try this:

    perl -MCPAN -e shell
    install Tk

And you can go and get lunch (or coffee - depending on how fast
you machine and/or your net connection are) while all the hard
work - yes, including the 3 steps you did yourself - gets done for
you.


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

Date: Wed, 08 Sep 1999 08:56:02 -0400
From: Robert Rawlinson <robert.rawlinson@worldnet.att.net>
Subject: Problems using grep
Message-Id: <37D65CE2.5FDEE57B@worldnet.att.net>

I am trying to use grep to find records in a list of files. I
want grep to search in the files in the list looking for records
with the search info. I used:
    @List = grep {"5551212"} "/work/D\?0606.dat"
I had hoped it would look through the /work files for records
containing 5551212 and place the records found in the @List. All
I get is the name of one of the files in @List. Could someone
help find why this does not work?
Thanks for any help you can offer.
Bob

--
Robert A. Rawlinson
Felicity Ohio 45120




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

Date: Wed, 8 Sep 1999 10:20:53 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: Programmer's Editor
Message-Id: <sig10pln5m.fsf@cre.canon.co.uk>

Randal L. Schwartz <merlyn@stonehenge.com> wrote:
> Does it get both of these right:
> 
>   time /3 ;#/; print "hello";
>   sin /3 ;#/; print "goodbye";
> 
> As in, does it highlight the "print" in print "hello" as a comment,
> and the "print" in print "goodbye" as a keyword and string?

I've just tried this with Ilya's cperl-mode for Emacs.  It doesn't
understand prototypes, so it gets the second line wrong.  But re-writing
the second line as

    sin m/3 ;#/; print "goodbye";

gives cperl-mode enough information to get it right.

-- 
Gareth Rees


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

Date: Wed, 8 Sep 1999 12:11:13 +0200
From: "casper" <c.d.hulshof@*DELETE*student.utwente.nl>
Subject: Re: Programmer's Editor
Message-Id: <7r5crk$ogb$1@dinkel.civ.utwente.nl>

elephant <elephant@squirrelgroup.com> wrote in message
news:MPG.12405b3989eaf327989cb6@news-server...
> Randal L. Schwartz writes ..
> >Syntax highlighting for Perl.  I'll believe it when I see it.
>
> thing is that with syntax highlighting (as with a lot of things)
> "useful" is a subset of "complete"

I agree. I use Ultraedit myself, and find the syntax highlighting quite
useful. My typing sucks most of the time, and the NOT highlighting of
wrongly spelled commands automatically triggers my memory :-) Hasn't someone
written a Perlscript-to-colored-script converter in Perl yet? Seems like a
task for Randal :-)

Casper H.




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

Date: Wed, 08 Sep 1999 10:25:24 GMT
From: "David Anderson" <dave.anderson@freeuk.com>
Subject: Setuid troubles
Message-Id: <oQqB3.13437$Ze2.404272@nnrp3.clara.net>

Hi,

I've written a set of modules that I would like to use in a CGI script. I
would also want to keep the files I write to secure, so I tried running with
setuid enabled but I get an error "-I not allowed with setuid". But I need
to include the directory with my modules in it. Can anyone supply any
tips/work arounds?

Thanks,

Dave








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

Date: 8 Sep 1999 04:58:27 -0700
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: suggestion to revise grep (another Q: reference comparison)
Message-Id: <slrn7tad96.m3v.sitaram@diac.com>

On Tue, 7 Sep 1999 15:19:36 +0800, John Lin <johnlin@chttl.com.tw>
wrote:

>if(grep($person,@friends)) { print "$person is my friend" }
>
>Hey, I got strange friends on those input values
>
>$person='John';  $person='Tom';  and even  $person='son';
>
>Finally I know I should write
>
>grep(/^$person$/,@friends);
>or
>grep { $person eq $_ } @friends;
>
>But I think it is worthy to revise the grep function

Why?  The documentation for the grep functions clearly states what
the purpose of the "EXPR" is - it is merely evaluated, with $_
being set to each element of the list in turn (localised, of
course).

Your first version of the code was an expression consisting of
$person.  Not even a regular expression involving $person.

>(Here I got another question:
>How can we compare references?

What do you mean by compare?  If you want to know if two
references are pointing at the exact same referant, then "eq"
should do fine.  It would string-ise the reference, and then
compare.  Exactly what you saw.

If you mean what is also called a "deep compare" (comparing the
referants for equality, recursively if they happen to be or
contain references), then it may be a little more difficult.  I'm
sure there's a module for this somewhere though :-)

>Anyway, just like we have 2 kinds of split:
>split on regular expression and split on string,
>my suggestion is to revise grep
>so that we have 3 kinds of grep:
>
>grep on regular expression: grep /expression/,@array
>grep on computation:  grep { block } @array
>grep to find an element: grep $scalar,@array

So you are proposing that the following piece of perldoc -f grep:

    returns the list value consisting of those elements for which
    the expression evaluated to TRUE.

be no longer true.  And for what?  Because you don't want to type
a few extra characters!

>It would be more clear and
>produce less invisible bugs (like I did).

What would be most clear is if people read the docs!  The very
first line of "perldoc -f grep" says this:

    This is similar in spirit to, but not the same as, grep(1)...

And yet you carried your notion of the command line grep into the
perl grep.

Unfortunately it is impossible to learn Perl without reading the
documentation.  I'm sure that it is true for any non-trivial
language, O/S, application, etc.

>What do you think about it?

I'm sure you'll hear lots of people tell you what they think about
it :-)

>Thank you for your advices.

You're most welcome.


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

Date: 08 Sep 1999 21:06:21 +1200
From: Andrew Gray <agray@infoscience.otago.ac.nz>
Subject: Re: Unix Trouble
Message-Id: <uvh9lixgy.fsf@infoscience.otago.ac.nz>

ljl_ljl@my-deja.com writes:
> must i be using Unix as my os to be able to use perl??

No.  Perl is one of the more platform neutral languages.  You can run
your scripts on any system with perl installed.  Some features do not
work on all platforms (e.g. flock on Windows 95 I believe), but this
is because of limitations of the operating system, not perl itself.

> if no, how come i saw so many tutorials teaching people Perl using
> Unix?

Perl has UNIX roots, especially from sed, awk, and shell programming.
It also makes extensive use of regular expressions.  As such it is
slightly easier for people with a UNIX background to learn.  Also, the
philosophy of Perl is very compatible with the philosophy of UNIX:
using many small tools (some of which may have been written by others)
to solve a problem, as opposed to the MS Windows approach of using a
small number of omni-powerful applications with overlapping
functionality.

But there is no reason to not use perl on MS Windows.  It's just
taking Windows people longer to realise the power and beauty of Perl.

> if yes, i am using Windows98 and how am i going to debug my script?

You can write, test, and execute your script on any of a large number
of OSes that include MS Windows.  See
http://www.perl.com/pub/language/info/software.html for source and
binary distributions.

> what does it means to be a Unix server, how do i know whether mine is
> one??

A server is a computer that provides services to other computers,
terminals, etc.  You did say that you are running Win98 above, so
presumably you are not running a UNIX server unless you have more than
one OS installed.

> what other things do i need before i could learn to write perl scripts??

* The command perldoc is your friend.  Read as much as you can.
* CPAN is the second place to look when you have a problem.
* DejaNews is the third to check for other people having had the same
  problem.
* People in USENET groups are more likely to help if you try and solve
  the problem yourself first, and you send your attempt as part of the
  message along with an explaination of what didn't work as you
  wanted.

Cheers,
Andrew







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

Date: Wed, 8 Sep 1999 11:56:24 +0200
From: "Aldo Calpini" <dada@divinf.it>
Subject: Re: XS and tie
Message-Id: <7r5bqq$ntn$1@fe1.cs.interbusiness.it>

Aldo Calpini wrote:
> I have an interesting problem that can be concisely
> expressed as a question:
>
> does the perlguts API for hashes (in particular,
> hv_store) support tied hashes and their magic?

in reply to my own question, I just realized that
I overlooked the paragraph 'Understanding the
Magic of Tied Hashes and Arrays' in perlguts ;-)
now I've changed my hv_store code in XS to:

    storing = newSViv((long) someValue);
    stored = hv_store(self, "-type", 5, storing, 0);
    if(stored != NULL) {
        mg_set(storing);
    } else {
        SvREFCNT_dec(storing);
    }

 ...but still no luck.
hv_store() does return NULL! and what perlguts says about this
is:

    "It may also return NULL, indicating that the value did
     not actually need to be stored in the array."

so the question become, can someone elaborate some more on
this point? how does hv_store() decide if the value needs to
be stored or not?

BTW, I've checked the magic types (after the hv_store), and
it is 'P' for self and 'p' for storing, as expected. so I
see no particular reason why the value shouldn't need to
be stored.

also, I'm using 5.005_02, and the whole fact about HVs and
MAGIC is marked as [MAYCHANGE]. does anyone knows if it
effectively changed or not?

thank you all!
cheers...

__END__
# Aldo Calpini
print sort {$_{$a} cmp $_{$b}} values %{{split undef,
"xritajbugne fahokem csuctawer jhdtlrnpqloevkshpr"}};





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

Date: 8 Sep 1999 10:20:37 GMT
From: M.Ray@ulcc.ac.uk (Malcolm Ray)
Subject: Re: Y2K bugs on the Internet
Message-Id: <slrn7tce3l.mea.M.Ray@carlova.ulcc.ac.uk>

On Tue, 07 Sep 1999 12:40:22 GMT, finsol@ts.co.nz <finsol@ts.co.nz> wrote:
>Is it any surprise that there is such a lot of Y2K bugged code about
>when many prominent programmers do very little in informing their
>programming community on this subject and in some cases deny there is
>indeed any problem?

You're so right!  There's been *no* publicity about Y2K.  I've seen no
TV or newspaper coverage of the issue, and it's never raised in the trade
press.  It never gets a mention in programming-related newsgroups, and
I've seen no websites devoted to it.  I've yet to meet a programmer who's
aware that it's an issue, and certainly nobody realises that they should
*test* their code.  In fact, you're probably the only person writing
about it.  Boy, won't everyone be surprised on 1/1/2000!
-- 
Malcolm Ray                           University of London Computer Centre


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

Date: Wed, 08 Sep 1999 12:15:13 GMT
From: pudge@pobox.com (Chris Nandor)
Subject: Re: Y2K bugs on the Internet
Message-Id: <pudge-0809990815180001@192.168.0.77>

In article <slrn7tce3l.mea.M.Ray@carlova.ulcc.ac.uk>, M.Ray@ulcc.ac.uk
(Malcolm Ray) wrote:

# On Tue, 07 Sep 1999 12:40:22 GMT, finsol@ts.co.nz <finsol@ts.co.nz> wrote:
# >Is it any surprise that there is such a lot of Y2K bugged code about
# >when many prominent programmers do very little in informing their
# >programming community on this subject and in some cases deny there is
# >indeed any problem?
# 
# You're so right!  There's been *no* publicity about Y2K.  I've seen no
# TV or newspaper coverage of the issue, and it's never raised in the trade
# press.  It never gets a mention in programming-related newsgroups, and
# I've seen no websites devoted to it.  I've yet to meet a programmer who's
# aware that it's an issue, and certainly nobody realises that they should
# *test* their code.  In fact, you're probably the only person writing
# about it.  Boy, won't everyone be surprised on 1/1/2000!

Careful ... you don't want to tip her off to the global conspiracy, where
programmers around the world will lull the world into a false sense of
security after surviving 2000-01-01, and then we bring down the world's
economic systems on 2000-02-02.  Groundhog Day 2000 will not soon be
forgotten, let me tell you!

-- 
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])


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

Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 1 Jul 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.  

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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu. 

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


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