[17829] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5249 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jan 4 23:18:46 2001

Date: Thu, 4 Jan 2001 20:18:16 -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: <978668296-v9-i5249@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 4 Jan 2001     Volume: 9 Number: 5249

Today's topics:
        strange behavior with IE manon_bertolini@mantacorp.com
    Re: strange behavior with IE <joe+usenet@sunstarsys.com>
        Stupid question from a Newbie <agile3@bellsouth.net>
    Re: Stupid question from a Newbie (Rafael Garcia-Suarez)
        Survey : : Are you having computer dreams at night? (rr)
    Re: Syntax for "eq" and "||" <mischief@velma.motion.net>
    Re: Syntax for "eq" and "||" <uri@sysarch.com>
    Re: Syntax for "eq" and "||" <nospam@nospam.com>
    Re: Syntax for "eq" and "||" <nospam@nospam.com>
    Re: Syntax for "eq" and "||" <nospam@nospam.com>
    Re: Syntax for "eq" and "||" (Lloyd Zusman)
        Syntax question on hashes of hashes, Please (Stan Brown)
    Re: Syntax question on hashes of hashes, Please <nickco3@yahoo.co.uk>
        system versus backticks <a.v.a@home.nl>
    Re: system versus backticks <jhelman@wsb.com>
    Re: system versus backticks <joe+usenet@sunstarsys.com>
    Re: system versus backticks <a.v.a@home.nl>
    Re: system versus backticks <joe+usenet@sunstarsys.com>
    Re: system versus backticks (Abigail)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 02 Jan 2001 22:55:58 GMT
From: manon_bertolini@mantacorp.com
Subject: strange behavior with IE
Message-Id: <92tm9q$o7i$1@nnrp1.deja.com>

Has anyone every had a situation where you need to call a perl cgi and
print the output of the CGI in a pop-up but in EI the results open in
two windows?  One pop-up, and one full one?  EI is not reading running
the script in one, (the pop-up window), and is running the script on the
full size one.

My code:JS within Perl (works fine with NS)

function openWindow()


               {
               if (! window.focus)return true;

mywindow=window.open('http://localhost/cgi-bin/Instapoll.cgi','mywindow'
,'width=400,height=450');
               return true;

               }
<form name="oldpoll" action='http://localhost/cgi-bin/Instapoll.cgi'
TARGET="mywindow" method="post" OnSubmit="OpenWindow()">

Am I doing something wrong?  Is it Perl cgi's and IE?

Help!!


Sent via Deja.com
http://www.deja.com/


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

Date: 02 Jan 2001 18:51:20 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: strange behavior with IE
Message-Id: <m3hf3hy0lj.fsf@mumonkan.sunstarsys.com>

manon_bertolini@mantacorp.com writes:

> Has anyone every had a situation where you need to call a perl cgi and
> print the output of the CGI in a pop-up but in EI the results open in
> two windows?  One pop-up, and one full one?  EI is not reading running
> the script in one, (the pop-up window), and is running the script on the
> full size one.
> 
> My code:JS within Perl (works fine with NS)

Technically, this is OT since it's javascript you're asking about.
The problem is surely not perl-related.

> function openWindow()
> 
> 
>                {
>                if (! window.focus)return true;
> 
> mywindow=window.open('http://localhost/cgi-bin/Instapoll.cgi','mywindow'
> ,'width=400,height=450');
>                return true;
> 
>                }
> <form name="oldpoll" action='http://localhost/cgi-bin/Instapoll.cgi'
> TARGET="mywindow" method="post" OnSubmit="OpenWindow()">
   ^^^^^^^^^^^^
> Am I doing something wrong?  Is it Perl cgi's and IE?

I think there is a potential race-condition going on here when
the submit button is pressed.  the TARGET="mywindow" will cause
the browser to open a new window (assuming mywindow doesn't yet exist),
and your javascript's openWindow() also causes a window with that 
name to open, along with the width-height attributes you've set 
for it.

If that's the issue, I'm sure you can recode this to behave better 
wrt IE, but you should ask in a javascript/cgi related newsgroup for 
a better answer.

HTH
-- 
Joe Schaefer



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

Date: Wed, 3 Jan 2001 22:28:43 -0500
From: "Tom Gregory" <agile3@bellsouth.net>
Subject: Stupid question from a Newbie
Message-Id: <5bS46.3890$of7.178380@news1.atl>

I am just learning Perl and have tons of questions.  The one in particular
has to do with the "project" that started me trying to learn it.

Being new, you folks let me know if I'm doing something wrong or whatever.

I have a website and am trying to modify Redicart (a free shopping cart) to
simply display an HTML page when the user finishes their selection, instead
of  going to a secure server.  But I keep getting a 405 error when I try to
do it the way I'm attempting.  Here's what's in the script that actually
executes
:
print "<FORM METHOD='POST'
ACTION='https://secure.paymentclearing.com/cgi-bin/mas/split.cgi'>";

Here's what I'm trying to get it to do:

print "<FORM METHOD='POST'
ACTION='http://www.agilityzone.com/confirm.htm'>";

I know the original is executing another cgi script and returning values,
but what am I missing here?

I simply want it to display a page of the user's selections with a text
statement for them to print the page, and then have it email me a copy of
the order.  Should be simple and in 'C' I could figure it out (maybe... been
a while).  But the answer has eluded me.

Any help is appreciated.  Please Email me directly, if you would.

Thanks

Tom
agile3@bellsouth.net





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

Date: Thu, 04 Jan 2001 08:41:21 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Stupid question from a Newbie
Message-Id: <slrn958dpl.bbm.rgarciasuarez@rafael.kazibao.net>

Tom Gregory wrote in comp.lang.perl.misc:
> print "<FORM METHOD='POST'
> ACTION='http://www.agilityzone.com/confirm.htm'>";

Usually web servers don't allow to access static documents with a POST
method. Use GET instead. BTW this question has nothing to do with Perl;
may I suggest you another newsgroup for the CGI-related questions :
comp.infosystems.www.authoring.cgi.

-- 
# Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: Sun, 31 Dec 2000 21:27:09 GMT
From: rr@dreamgate.com_remove_to_e (rr)
Subject: Survey : : Are you having computer dreams at night?
Message-Id: <3a4fa495.15123215@news.telocity.com>

Are you having computer dreams?

Includes dreams of computers, programming, peripherals, Internet
venues, and anything digital.

Questionnaire Online:
http://www.dreamgate.com/dream/computers/computerdreams.htm




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

Also, you can :
• e-mail them to me, Richard Wilkerson, at rcwilk@dreamgate.com

• drop them off anonymously at   http://www.dreamgate.com/dream/temple

• fill out the ascii plain text version
   http://www.dreamgate.com/dream/computers/computerdreams_survey.txt
 and e-mail or snail to
  Computer Survey
   %DreamGate
   4644 Geary Blvd   PMB 171
   San Francisco, CA 94118 

------------------------------------
DETAILS: 

Are you dreaming of problems with your hard disk, getting connected,
the wrong programs coming up, not being able to find the file you
want? Does your computer turn you on, and have you found yourself
mating with a digital partner or cyborg  sex? Has god spoken to you
through your computer in a dream? Has the computer in a dream assisted
you in becoming lucid? 

Just as during the last turn of the century, we shifted from horse and
carriage dreams to cars, trucks and jets, now too we are entering a
new cyber-symbolic era of networking and global interface. What dream
content will remain, what will change? 

This is a joint study by Electric Dreams and DreamGate:
 http://www.dreamgate.com/electric-dreams


Previous Articles:

COMPUTER DREAMS

 Wilkerson, Richard Catlett (1999 August). Research Request:
Computer's in Dreams : Pre and Post Internet Perceptions. Electric
Dreams & Part I Pre-Net Electric Dreams 6(8). Retrieved October 30,
2000 from Electric Dreams on the World Wide Web:
http://members.telocity.com/rcw666/ed-articles/richard_wilkerson_1999_aug_computers_in_dreams.htm

Wilkerson, Richard Catlett (2000 March). Digital Dreams: The changing
(inter)face of dreams in the twenty-first century. Electric Dreams
7(3). Retrieved October 30, 2000 from Electric Dreams on the World
Wide Web:
http://members.telocity.com/rcw666/ed-articles/richard_wilkerson_2000_mar_computer-dreams1.htm

Wilkerson, Richard Catlett (2000 July). Digital Dreaming Series:
Computer Dreams II : The changing (inter)face of dream texts. Electric
Dreams 7(7). Retrieved October 30, 2000 from Electric Dreams on the
World Wide Web:
http://members.telocity.com/rcw666/ed-articles/richard_wilkerson_2000_july_computer-dreams2.htm

Wilkerson, Richard Catlett (2000 November). Digital Dreaming Series:
Computer Dreams III :: The Digital Shift in Culture. Electric Dreams
7(11). Retrieved October 30, 2000 from Electric Dreams on the World
Wide Web:
http://members.telocity.com/rcw666/ed-articles/richard_wilkerson_2000_nov_computer-dreams3.htm


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

Note:  All dreams will  be published anonymously unless you would like
credit. Be 
*Very* clear about the personal information you would like included,
otherwise 
your personal info will be removed and a pen-name assigned to the
dream.

Feel free to send in articles and comments as well. Electric Dreams is
a public 
service network and can not offer you money for your articles or
dreams, but we 
can get your ideas and dreams out to the public. 


++++++++++++++++++++++++++++++++++++++++++++++++ 
Feel free to distribute this document on any channels or Net venues
you wish.
 and comments as well. Electric Dreams is a public 
service network and can not offer you money for your articles or
dreams, but we 
can get your ideas and dreams out to the public. 

Thanks for your cooperation, look for your dreams in the upcoming
issues of 
Electric Dreams. 

-Richard Wilkerson
editor, Electric Dreams
rcwilk@dreamgate.com

Electric Dreams has been publishing dreams online since 1994.  
http://www.dreamgate.com/electric-dreams

++++++++++++++++++++++++++++++++++++++++++++++++ 



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

Date: Fri, 29 Dec 2000 16:21:33 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Syntax for "eq" and "||"
Message-Id: <t4pegdeujapbb3@corp.supernews.com>

Martien Verbruggen <mgjv@tradingpost.com.au> wrote:
> On 29 Dec 2000 12:42:35 GMT,
> 	Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>> Martien Verbruggen <mgjv@tradingpost.com.au> wrote in comp.lang.perl.misc:
>>>On 29 Dec 2000 10:08:39 GMT,
>>>	Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>>>> The WebDragon  <nospam@nospam.com> wrote in comp.lang.perl.misc:
>>>>>In article <92g3m7$sl1$1@mamenchi.zrz.TU-Berlin.DE>, 
>>>>>anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
>>>>>
>>>>> | The WebDragon  <nospam@nospam.com> wrote in comp.lang.perl.misc:
>>>>> | >
>>>>> | >indeed.. looks *quite* nice, but I've run into a few things in 5.004 
>>>>> | >(MacPerl) that I've mailed him about and hope to see an update for 
>>>>> | >soonish. (failing some test cases, etc)
>>>>> | 
>>>>> | This public complaint about Damian's maintenance is in very bad style.
>>>>> | 
>>>>> | I find it hard to believe you posted that, but I don't see how your
>>>>> | paragraph can be read otherwise.

I read it as a friendly notice to the group that there might be problems
with a certain operation on a certain version of Perl. Kind of a heads-up
to the community. I know if I found a bug or behavior I found odd, I'd
try to warn everyone.

He did mail the author of the code, and didn't seem to me to be hostile
about the issue. If others were using the same code and same Perl
version, or planning to, it might be helpful to know that this was a
known issue and that the author has already been notified.

If I was the author, I'd certainly want people to know I was notified
of an issue instead of receiving multitudinous reports about it.

>>>>YOU read far too much into what I said.. did I press a little hot button 
>>>>>for you or something? 
>>>> 
>>>> What did I read that you didn't write?  You mailed Damian about some
>>>> problem you have on MacOS, got no reply, and took the fist chance
>>>> to go public about it.  Bad style.

This might not be the best for Damian's ego, but it could be helpful to
him. I doubt he would take it as a personal attack, though. If it's the
truth, it's the truth. Issues with code are a fact of life, and the
best an author can do is to minimize them in the areas preconceived and
deal with those that do appear later as they appear.

>>>I must say that I didn't read it the way you did. I read it as "I've
>>>found some problems with the module, and have notified the maintainer".
>>>And that is exactly what the maintainer probably wishes for: A speedy
>>>bug report.

I agree.

> [snip]

>> Hmm... looks like I must consider this.  Thanks for your unbiased
>> opinion, maybe I overreacted.

Based on how Anno understood the post, I don't think there was an
overreaction. I think maybe a misunderstanding of how the post was
intended to read, but if I understood the post as Anno did at first,
I'd wonder about its purpose, too. I can even see how the post could
be taken that way if someone was skimming it quickly.

[snip]

> Of course, I am now assuming a lot, maybe even too much :)

You know what they say about 'assume'? ;)
                              ---^--
Chris
-- 
Christopher E. Stith

Disclaimer: Actual product may not resemble picuture in ad in any way.



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

Date: Fri, 29 Dec 2000 17:29:46 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Syntax for "eq" and "||"
Message-Id: <x7u27n9lv8.fsf@home.sysarch.com>

>>>>> "CS" == Chris Stith <mischief@velma.motion.net> writes:

  CS> If I was the author, I'd certainly want people to know I was
  CS> notified of an issue instead of receiving multitudinous reports
  CS> about it.

knowing damian, he does appreciate any feedback on his work.

  >>>>> What did I read that you didn't write?  You mailed Damian about some
  >>>>> problem you have on MacOS, got no reply, and took the fist chance
  >>>>> to go public about it.  Bad style.

  CS> This might not be the best for Damian's ego, but it could be
  CS> helpful to him. I doubt he would take it as a personal attack,
  CS> though. If it's the truth, it's the truth. Issues with code are a
  CS> fact of life, and the best an author can do is to minimize them in
  CS> the areas preconceived and deal with those that do appear later as
  CS> they appear.

and he would not likely be insulted or hurt by a public mentioning of a
bug.

BTW you all may not know he is perl's doxy (his term) for the next
year. check out: http://www.yetanother.org/damian/

as for any non-reply, he is on a well deserved vacation. i am sure when
he gets back and bores through his email pile, he will reply to
webdragon. damian is as civilized as you would ever want.

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: 30 Dec 2000 03:05:50 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Syntax for "eq" and "||"
Message-Id: <92jjee$ft8$2@216.155.32.187>

In article <92hnr7$b6o$1@mamenchi.zrz.TU-Berlin.DE>, 
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:

 | 
 | What did I read that you didn't write?  You mailed Damian about some
 | problem you have on MacOS, got no reply, and took the fist chance
 | to go public about it.  Bad style.

you REALLY are reading far too much into what happened. 

I'm really tempted to just plonk you for calling me out on something 
that you imagine happened, because you seem to choose to wANT to read 
whatever you think happened into what I said, but sorry, that's just not 
so. 

 | >I ONLY JUST mailed him within the past few days. 
 | 
 | Ah.  That makes it acceptable.  I see.

Sarcasm is so unbecoming when you're completely off base. :) 

I explained it, you persist in reading it wrong, I'm explaining again, 
that you are incorrect, and should take your flag-waving somewhere else, 
and I hope you will realize that what you think I said is not what I 
meant.

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: 30 Dec 2000 03:14:32 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Syntax for "eq" and "||"
Message-Id: <92jjuo$ft8$3@216.155.32.187>

In article <slrn94p35e.2ud.mgjv@martien.heliotrope.home>, 
mgjv@tradingpost.com.au wrote:

[snip]

 | >>I must say that I didn't read it the way you did. I read it as "I've
 | >>found some problems with the module, and have notified the 
 | >>maintainer".
 | >>And that is exactly what the maintainer probably wishes for: A speedy
 | >>bug report.

bingo. tacnuke, nail, head. :) (i.e. guaranteed direct hit) heh

 | [snip]
 | 
 | > Hmm... looks like I must consider this.  Thanks for your unbiased
 | > opinion, maybe I overreacted.
 | > 
 | > I still don't see why this had to be brought up at all.  If it isn't
 | > a complaint, why mention it?  The thread was about Damian's "quantum
 | > superposition operator" at the point.  Outside the author's name
 | > I don't see a connection to the MacPerl problem.  Or is there?
 | 
 | I don't think it was brought up for any reason besides too much 
 | verbosity :), but I'll leave it to WebDragon to confirm or deny 

heh. see above. you got it right, first swing. explained it better than 
I did too, LOL! :)

 | that. I have found that MacPerl users often find 'problems' in code 
 | and/or test programs, because they work with an older version of 
 | Perl, unfortunately. I suspect that some of the problems were 

'tis 5.004 essentially. I also work on unix perl 5.004_04 at the current 
shell I have to test things for cross-platform compatibility. 

 | related to newer syntax not compiling correctly, or something like 
 | that. This really should be an incentive to someone who knows Macs 
 | and loves Perl (and has the knowledge of Perl internally) to get the 
 | Macperl versions up to the latest (altough I am not certain ow hard 
 | that would be). 

Yes in fact Matthias Neeracher just passed the MacPerl torch to Chris 
Nandor for the next release (presumably 5.6.0) so he could work on the 
OS X issues with perl, and other things. 

I've requested to be in the bugtest list for the new port to MacOS (not 
OS X which is native unix and doesn't need a 'port' essentially) as I 
use a 'slightly' antiquated OS 8.6, and frankly am having a LOT of fun 
hacking around in perl, learning it. 

 | I think the information intended was no more than: "Yes, I know 
 | about that module, it looks nice, but it also looks like I won't be 
 | able to just use it as-is, because there seem to be some problems 
 | still with MacPerl (or perl 5.004). I have notified Damian, and hope 
 | that he'll be able to fix it soon, so I can start using it with the 
 | full confidence that Damian's code deserves". Since the problems 

essentially :) 

 | seem to occur only in the tests, maybe he's already using it, 
 | ignoring the failed tests.

no, actually I'm just waiting for the next update so I can start playing 
with it.. I'd be happy to help Damian test compatiblity issues. 
 
 | Of course, I am now assuming a lot, maybe even too much :)

heheheh no worries. 
Happy New year !

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: 30 Dec 2000 03:17:31 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: Syntax for "eq" and "||"
Message-Id: <92jk4b$ft8$4@216.155.32.187>

In article <x7u27n9lv8.fsf@home.sysarch.com>, Uri Guttman 
<uri@sysarch.com> wrote:

 | as for any non-reply, he is on a well deserved vacation. i am sure when
 | he gets back and bores through his email pile, he will reply to
 | webdragon. damian is as civilized as you would ever want.

indeed, I've mailed him in the past once or twice. 

I continue to be amazed at the overall responsiveness of the various 
Module Authors in the Perl community. 

Particularly since i use "that bastard OS" *snicker* :)

-- 
send mail to mactech (at) webdragon (dot) net instead of the above address. 
this is to prevent spamming. e-mail reply-to's have been altered 
to prevent scan software from extracting my address for the purpose 
of spamming me, which I hate with a passion bordering on obsession.  


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

Date: Sun, 31 Dec 2000 11:51:46 GMT
From: ljz@asfast.com (Lloyd Zusman)
Subject: Re: Syntax for "eq" and "||"
Message-Id: <root3a4f1dbf5d0a@news.asfast.net>

On 29 Dec 2000 12:42:35 GMT,
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
> Martien Verbruggen <mgjv@tradingpost.com.au> wrote in comp.lang.perl.misc:
> >
> > [ ... ]
> >
> >Maybe you did indeed read more into the statement than it actually
> >contained?
> 
> Hmm... looks like I must consider this.  Thanks for your unbiased
> opinion, maybe I overreacted.
> 
> I still don't see why this had to be brought up at all.  If it isn't
> a complaint, why mention it?  The thread was about Damian's "quantum
> superposition operator" at the point.  Outside the author's name
> I don't see a connection to the MacPerl problem.  Or is there?

Well, whether there is or not, I respectfully ask you to consider
this: your responses to WebDragon were of a tone and attitude that
were virtually guaranteed to generate contentious replies ... at
least 11 at my last count.  Since you are concerned about keeping
the bandwidth down in this group, you might in the future want to
use a slightly different communication style here, so as not to
"push people's buttons" and thereby defeat your own purpose.  If you
said nothing to WebDragon or if you had approached him in private
email to discuss this, none of these 11 non-Perl-related replies
would have appeared here in c.l.p.misc.


> Anno


-- 
 Lloyd Zusman
 ljz@asfast.com


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

Date: 3 Jan 2001 08:49:13 -0500
From: stanb@panix.com (Stan Brown)
Subject: Syntax question on hashes of hashes, Please
Message-Id: <92vakp$sd6$1@panix6.panix.com>


I'm working on a perl script that has a master data structure, which is a
set of hashes of hashes of hashes.

Hre's what a snippet of the data looks like, from Data::Dumper:


$VAR1 = 'B600';
$VAR2 = {
          'STH' => bless( {}, 'DBI::st' ),
          'B600_C_C' => {
                          'COLUMN' => 'C_CURRENT',
                          'TAG' => 'B600_C_C'
                        },
          'LAST_DATE' => 'UNKOWN',
          'LAST_UPDATE_TIME' => 978459775,
          'B600_PF' => {
                         'COLUMN' => 'PF',
                         'TAG' => 'B600_PF'
                       },
          'LAST_UPDATE_TIME_ALARMED' => 0,
          'B600_C_A' => {
                          'COLUMN' => 'A_CURRENT',
                          'TAG' => 'B600_C_A'
                        },
          'B600_C_B' => {
                          'COLUMN' => 'B_CURRENT',
                          'TAG' => 'B600_C_B'
                        }
        };
$VAR3 = 'B350';
$VAR4 = {
          'STH' => bless( {}, 'DBI::st' ),
          'B350_C_B' => {
                          'COLUMN' => 'B_CURRENT',
 ....
	And so on.

	I fill it by iterating throgh it like this:


while (my ( $tbl_key, $ref1) = each %record)
{
  	# print "tbl_key: $tbl_key\n";
   $begin = 0;
   while( my ($key2, $ref2) = each %{ $ref1 } )
   {
      # print "\tkey2: $key2\n";
	  if(($key2 ne 'LAST_DATE') && ( $key2 ne 'LAST_UPDATE_TIME') && ($key2 ne 'LAST_UPDATE_TIME_ALARMED'))
	  {
      	while ( my ( $col_key, $value3) = each %{ $ref2 } )
      	{
         	# print "\t\tcol_key: $col_key\n";
         	# print "\t\tvalue3: $value3\n";
			if($col_key eq 'COLUMN')
			{
				if($begin == 0)
				{
					$string = "SELECT DSTAMP ";
					$begin = 1;
				}
				$string = join ' ' , $string, ', ' , $value3;
				# print("Add column $value3 to select for $tbl_key\n");
			}
      	} # KEY3
	  }
   } # KEY2

   That all works fine.

   Now as for using that data, I have a fairly large chunck of code inside
   a loop that used to iterate like this:


	foreach $key (sort keys(%record))
	{

    Obviously this was a simple hash, I was iterating through at the time.

	Now since what I need to do most of the worki is still at teh outermost
	part of the nested hashe's, I would like to avoid completly reworking
	this loop.

	However in one place within this loop, I need to walk the lower level
	loops.

   Now inside that loop, I need to iterate through just one (at a time) of
   the subhahses.

   Something like:

	foreach $key2 (sort keys($record{$key}))
	{

	Which obviosly does not work.

	Now I could do teh full nested loop thing here, but I'm striving for
	eficency, and I would rather just iterate through what I need to.

	Can someon show me how to do this?

	I alos tried something like this:


   while( my ($key2, $ref2) = each %{ $ref{$key} } )
   {

	Which I think is close, but doesn work eaither.





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

Date: Wed, 03 Jan 2001 16:57:58 +0000
From: Nick Condon <nickco3@yahoo.co.uk>
Subject: Re: Syntax question on hashes of hashes, Please
Message-Id: <3A535A16.EA265B4A@yahoo.co.uk>

Stan Brown wrote:

>    Now inside that loop, I need to iterate through just one (at a time) of
>    the subhahses.
>
>    Something like:
>
>         foreach $key2 (sort keys($record{$key}))
>         {

I'm not sure I understand you correctly, but does this do what you want?

  foreach $key2 (sort keys %{$record{$key}})

>         Which I think is close, but doesn work eaither.

It's so annoying when that happens, isn't it.



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

Date: Mon, 01 Jan 2001 13:40:44 GMT
From: AvA <a.v.a@home.nl>
Subject: system versus backticks
Message-Id: <3A508A4E.B4A182D6@home.nl>

hi all,

i was wondering why the two following codes have different output:
---------------------
1. @ary = glob("*");
    foreach (@ary){
        print;
    }

    print system("date");
---------------------
2. @ary = glob("*");
    foreach (@ary){
        print:
    }

    print `date`;

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

in the first example the date gets printed before the loop,
and in the second example the date gets printed after the loop (as
intended).

what causes that?




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

Date: Mon, 01 Jan 2001 15:14:12 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: system versus backticks
Message-Id: <ea715tsb2e8f0r47hpkcj1j05pmi8tsanr@4ax.com>

On Mon, 01 Jan 2001 13:40:44 GMT, AvA <a.v.a@home.nl> wrote:

>i was wondering why the two following codes have different output:
>---------------------
>1. @ary = glob("*");
>    foreach (@ary){
>        print;
>    }
>
>    print system("date");
>---------------------
>2. @ary = glob("*");
>    foreach (@ary){
>        print:
>    }
>
>    print `date`;
>
>--------------------
>
>in the first example the date gets printed before the loop,
>and in the second example the date gets printed after the loop (as
>intended).
>
>what causes that?

I would guess that your output buffer is to blame.  In your first code
snippet, the date that is printed is actually beyond the control of
the interpreter (since it's printed by the date program).  Thus, if it
executes before the interpreter decides to dump to STDOUT, then that
date will appear first.  Flushing your output should solve the problem
(add the following line to the top of your script):

$| = 1;

Also, in your first snippet, you don't really need the print since
invoking the date command via system will put the date to STDOUT.  By
using print you are telling the interpreter to print the return value
of the system call (which should be 0).  Eliminate the print (and just
use system("date)) and you'll get rid of that bizarre zero following
your output.

Hope this helps,
JH


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

Date: 01 Jan 2001 10:52:01 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: system versus backticks
Message-Id: <m3bstr5kym.fsf@mumonkan.sunstarsys.com>

AvA <a.v.a@home.nl> writes:

> hi all,
> 
> i was wondering why the two following codes have different output:

Buffered IO.

> ---------------------
> 1. @ary = glob("*");
>     foreach (@ary){
>         print;
>     }

perl is buffering the write to STDOUT until it gets an "\n" char.
Try adding a 

print "\n"; 

line here to see what happens.
 
>     print system("date");
      ^^^^^
(confusing and probably unnecessary)

Here you are exec(3)'ing "date", and the OS is responsible for

0) forking a shell
1) opening STDOUT for "date"
2) writing "date" output to STDOUT
3) closing STDOUT for "date" (flushes any buffered IO to STDOUT)

Do a stack trace (strace -f) on this to see what's happening:

% cat /tmp/try.pl
#!/usr/bin/perl -w
use strict;

my @ary = glob("*");
    foreach (@ary){
        print;
    }

system("date");

__END__

% strace -f /tmp/try.pl
(usenet formatting and copious snippage)

fork()                                  = 12008
[pid 12005] wait4(12008,  <unfinished ...>

[pid 12008] execve("/bin/date", ["date"], [/* 38 vars */]) = 0
[pid 12008] ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
[pid 12008] write(1, "Mon Jan  1 10:09:58 EST 2001\n", 29Mon Jan  1 [...]
[pid 12008] close(1)                    = 0
[pid 12008] munmap(0x40017000, 4096)    = 0
[pid 12008] _exit(0)                    = ?
<... wait4 resumed> [WIFEXITED(s) && WEXITSTATUS(s) == 0], 0, NULL) = 12008
--- SIGCHLD (Child exited) ---
write(1, "5.00503CPANTexti386-linuxmansite" [...]

> ---------------------
> 2. @ary = glob("*");
>     foreach (@ary){
>         print:
>     }
> 
>     print `date`;
> 

Here the output of date is captured by perl, and so it's printed to
STDOUT by the perl parent (hence in the correct sequence), not the 
forked child (strace -f might help here, too, but I'll leave that to you :)

> in the first example the date gets printed before the loop,
> and in the second example the date gets printed after the loop (as
> intended).

Both readers and writers usually have buffers when
doing buffered IO (the terminal's buffer is the "reader" here).
Remembering this often helps me, anyway.

HTH.
-- 
Joe Schaefer


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

Date: Mon, 01 Jan 2001 16:12:12 GMT
From: AvA <a.v.a@home.nl>
Subject: Re: system versus backticks
Message-Id: <3A50ADCE.8FEFFDE5@home.nl>

Joe Schaefer wrote:

> AvA <a.v.a@home.nl> writes:
>
> > hi all,
> >
> > i was wondering why the two following codes have different output:
>
> Buffered IO.
>
> > ---------------------
> > 1. @ary = glob("*");
> >     foreach (@ary){
> >         print;
> >     }
>
> perl is buffering the write to STDOUT until it gets an "\n" char.
> Try adding a
>
> print "\n";
>
> line here to see what happens.
>
> >     print system("date");
>       ^^^^^

yes that helped, thanks



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

Date: 01 Jan 2001 12:56:07 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: system versus backticks
Message-Id: <m37l4f5f7s.fsf@mumonkan.sunstarsys.com>

AvA <a.v.a@home.nl> writes:

> Joe Schaefer wrote:
> 
> > AvA <a.v.a@home.nl> writes:
> >
> > > hi all,
> > >
> > > i was wondering why the two following codes have different output:
> >
> > Buffered IO.
> >
> > > ---------------------
> > > 1. @ary = glob("*");
> > >     foreach (@ary){
> > >         print;
> > >     }
> >
> > perl is buffering the write to STDOUT until it gets an "\n" char.
> > Try adding a
> >
> > print "\n";
> >
> > line here to see what happens.
> >
> > >     print system("date");
> >       ^^^^^
> 
> yes that helped, thanks

Be sure you take a look at the documentation for perl's autoflush
variable "$|" then.  It's in

% perldoc perlvar

-- 
Joe Schaefer


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

Date: 3 Jan 2001 16:07:22 GMT
From: abigail@foad.org (Abigail)
Subject: Re: system versus backticks
Message-Id: <slrn956jhq.nmu.abigail@tsathoggua.rlyeh.net>

AvA (a.v.a@home.nl) wrote on MMDCLXXX September MCMXCIII in
<URL:news:3A508A4E.B4A182D6@home.nl>:
@@ hi all,
@@ 
@@ i was wondering why the two following codes have different output:
@@ ---------------------
@@ 1. @ary = glob("*");
@@     foreach (@ary){
@@         print;
@@     }
@@ 
@@     print system("date");
@@ ---------------------
@@ 2. @ary = glob("*");
@@     foreach (@ary){
@@         print:
@@     }
@@ 
@@     print `date`;
@@ 
@@ --------------------
@@ 
@@ in the first example the date gets printed before the loop,
@@ and in the second example the date gets printed after the loop (as
@@ intended).
@@ 
@@ what causes that?


Buffering.



Abigail
-- 
perl -wleprint -eqq-@{[ -eqw+ -eJust -eanother -ePerl -eHacker -e+]}-


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

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


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