file handle strangeness

2004-07-18 Thread Glenn Linderman
use strict;
use warnings;
#
sub hexdump
{ return ( ': 33 33 33 33 33 33 33 33 ' . \n );
}
#
my $fh = *STDOUT;
print '' .  hexdump ();
print  hexdump ();
print $fh '' .  hexdump ();
print $fh  hexdump ();
__END__
Sample output:
test.pl
: 33 33 33 33 33 33 33 33 
: 33 33 33 33 33 33 33 33 
: 33 33 33 33 33 33 33 33 
 00?? ??

Why is the fourth line different, and where is it documented that it 
should be different?

--
Glenn -- http://nevcal.com/
===
The best part about procrastination is that you are never bored,
because you have all kinds of things that you should be doing.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: file handle strangeness

2004-07-18 Thread Randy W. Sims
On 7/18/2004 2:22 AM, Glenn Linderman wrote:
use strict;
use warnings;
#
sub hexdump
{ return ( ': 33 33 33 33 33 33 33 33 ' . \n );
}
#
my $fh = *STDOUT;
print '' .  hexdump ();
print  hexdump ();
print $fh '' .  hexdump ();
print $fh  hexdump ();
__END__
Sample output:
 test.pl
: 33 33 33 33 33 33 33 33 
: 33 33 33 33 33 33 33 33 
: 33 33 33 33 33 33 33 33 
 00?? ??
 
Why is the fourth line different, and where is it documented that it 
should be different?
'' can be interpreted as the bitwise and operator, and in your 4th line 
it is. The file handle $fh is being bitwise anded with the result of the 
function call to hexdump(). Either omit the  (you don't need it 
anyway), or put parenthesis around the function call to disambiguate:

print $fh ( hexdump ());
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: file handle strangeness

2004-07-18 Thread $Bill Luebkert
Glenn Linderman wrote:

 use strict;
 use warnings;
 #
 sub hexdump
 { return ( ': 33 33 33 33 33 33 33 33 ' . \n );
 }
 #
 my $fh = *STDOUT;
 
 print '' .  hexdump ();
 print  hexdump ();
 print $fh '' .  hexdump ();
 print $fh  hexdump ();

Either drop the  or add a + :

print FILEHANDLE LIST
print LIST
print   Prints a string or a list of strings. Returns true if successful.
FILEHANDLE may be a scalar variable name, in which case the variable
contains the name of or a reference to the filehandle, thus
introducing one level of indirection. (NOTE: If FILEHANDLE is a
variable and the next token is a term, it may be misinterpreted as
an operator unless you interpose a + or put parentheses around the
arguments.)

 __END__
 
 
 Sample output:
 
  test.pl
 : 33 33 33 33 33 33 33 33 
 : 33 33 33 33 33 33 33 33 
 : 33 33 33 33 33 33 33 33 
   00?? ??
  
 
 Why is the fourth line different, and where is it documented that it 
 should be different?
 


-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: file handle strangeness

2004-07-18 Thread Randy W. Sims
On 7/18/2004 2:22 AM, Glenn Linderman wrote:
use strict;
use warnings;
#
sub hexdump
{ return ( ': 33 33 33 33 33 33 33 33 ' . \n );
}
#
my $fh = *STDOUT;
print '' .  hexdump ();
print  hexdump ();
print $fh '' .  hexdump ();
print $fh  hexdump ();
__END__
Bonus round:
In addition to what I said in my previous post, a '+' can be used 
sometimes to disambiguate certain types of expressions. In this case, 
the results can vary depending on the placement of a single space:

print $fh + hexdump (); # ok
print $fh +  hexdump (); # error
print $fh +hexdump (); # ok
print $fh + hexdump (); # error
Why?
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


[Attn: Desai, Sheetal] Re: Out of Office AutoReply: file handle strangeness

2004-07-18 Thread Randy W. Sims
On 7/18/2004 2:36 AM, Desai, Sheetal A wrote:
I am on currently on maternity leave.
Please forward all QTS or Work Request System issues or questions to Jeff
Gordon (51669). If its an emergency during off business hours please call
the hot phone at (684-7124)
Please turn off your Out of Office AutoReply for the perl-win32-users 
mailing list.

Randy.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


[Attn: Strohmeier Ruediger] Re: Out of Office AutoReply: file handle strangeness

2004-07-18 Thread Randy W. Sims
On 7/18/2004 2:36 AM, Strohmeier Ruediger wrote:
Hello!
I am out of office July 15.
In really urgent cases, please contact Gunther Döhler on extension 26035.
Please turn off your Out of Office AutoReply for the perl-win32-users 
mailing list.

Randy.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


[Attn: SANTA Giovanni] Re: Out of Office AutoReply: file handle strangeness

2004-07-18 Thread Randy W. Sims
On 7/18/2004 2:36 AM, SANTA Giovanni wrote:
I am out of office until next  16th August
Please turn off your Out of Office AutoReply for the perl-win32-users 
mailing list.

Randy.

For any questions about:
SMTP
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
LAN-WAN Monitoring  Reporting
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
CC'd to all.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


[Attn: Anderson, Mark] Re: Out of Office AutoReply: file handle strangeness

2004-07-18 Thread Randy W. Sims
On 7/18/2004 2:36 AM, Anderson, Mark (Service Delivery) wrote:
I am currently out of the office until Monday 26th July
Should you require any immediate assistance please contact either Darren
O'Hara (0131 523 2504) or Sean Cooney (0131 523 4076) who will be happy to
help, otherwise I will respond to your email upon my return.
Please turn off your Out of Office AutoReply for the perl-win32-users 
mailing list.

Randy.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


[Attn: McCarty, Michael F] Re: Out of Office AutoReply: file handle strangeness

2004-07-18 Thread Randy W. Sims
On 7/18/2004 2:36 AM, McCarty, Michael F wrote:
I will be out of the office Thursday July 15 and Friday, July 16, returning
on Monday, July 19.
Please turn off your Out of Office AutoReply for the perl-win32-users 
mailing list.

Randy.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: file handle strangeness

2004-07-18 Thread $Bill Luebkert
Randy W. Sims wrote:

 Bonus round:
 
 In addition to what I said in my previous post, a '+' can be used 
 sometimes to disambiguate certain types of expressions. In this case, 
 the results can vary depending on the placement of a single space:
 
 print $fh + hexdump (); # ok
 print $fh +  hexdump (); # error
 print $fh +hexdump (); # ok
 print $fh + hexdump (); # error
 
 Why?

I think it's all about how it determines whether it's a numeric
expression or not.  Safer to use the parens in this case.

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--  o // //  Castle of Medieval Myth  Magic http://www.todbe.com/
-/-' /___/__/_/_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


GUI - Browse for directories.

2004-07-18 Thread Schichmanter, EithanX
Hi all,

A while back a discussion issued about browsing for files (multiple
selection).

I need a slight variation on the subject: I want to use the getOpenFile
method of Tk (or the GetOpenFileName of Win32::GUI) to open a DIRECTORY:
I want to enable the selection of a directory in my directory tree
structure and return that string to my script.

How can that be done?

I was able to find a cpp implementation of OpenDirDlg class that enables
that, but I'm looking for a Perl solution (to embed in my script).

Any help/ideas would be greatly appreciated.

All the best,

Schichmanter Eitan
SDM Team Developer,
Petah-Tikva, Israel
Intel(r) 
[EMAIL PROTECTED]
phone: +972-3-9207046
--
 
Schichmanter Eitan,
CM Consultant and Developer,
LMB-Consulting LTD.
[EMAIL PROTECTED]
www.lmb.co.il



___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: [Attn: McCarty, Michael F] Re: Out of Office AutoReply: file handle strangeness

2004-07-18 Thread Glenn Linderman
So what doesn't the list manager simply make Out of Office a forbidden 
sequence in a subject or body, and trash such emails?  That would cut 
the autoreplies at least by 2/3rds.

I could certainly live with that restriction and it seems you can't 
teach people how to do it right, just like you can't teach people not to 
install viruses on their computer, when the instructions are so clear 
and self-contained.

On approximately 7/17/2004 11:50 PM, came the following characters from
the keyboard of Randy W. Sims:
On 7/18/2004 2:36 AM, McCarty, Michael F wrote:
I will be out of the office Thursday July 15 and Friday, July 16, 
returning
on Monday, July 19.

Please turn off your Out of Office AutoReply for the perl-win32-users 
mailing list.

Randy.
--
Glenn -- http://nevcal.com/
===
The best part about procrastination is that you are never bored,
because you have all kinds of things that you should be doing.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: file handle strangeness

2004-07-18 Thread Glenn Linderman
On approximately 7/18/2004 1:19 AM, came the following characters from
the keyboard of $Bill Luebkert:
Randy W. Sims wrote:

Bonus round:
In addition to what I said in my previous post, a '+' can be used 
sometimes to disambiguate certain types of expressions. In this case, 
the results can vary depending on the placement of a single space:

print $fh + hexdump (); # ok
print $fh +  hexdump (); # error
print $fh +hexdump (); # ok
print $fh + hexdump (); # error
Why?

I think it's all about how it determines whether it's a numeric
expression or not.  Safer to use the parens in this case.
Thanks for the responses.  I guess I was working too late last night to 
even see the ambiguity... I was like But I didn't put a comma there, 
and all I changed was adding the file handle, and the documentation 
made no sense last night, but it is perfectly clear this morning.  () 
added around the expression and all is well.

--
Glenn -- http://nevcal.com/
===
The best part about procrastination is that you are never bored,
because you have all kinds of things that you should be doing.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: [Attn: McCarty, Michael F] Re: Out of Office AutoReply: file handle strangeness

2004-07-18 Thread joe
Having the autoresponder Randy has set up to respond to OOO messages respond
directly back to the user instead of the user and the list may possibly
reduce it by another 1/3. :o)

  joe
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Glenn Linderman
Sent: Sunday, July 18, 2004 11:31 AM
To: [EMAIL PROTECTED]
Cc: McCarty, Michael F; [EMAIL PROTECTED]
Subject: Re: [Attn: McCarty, Michael F] Re: Out of Office AutoReply: file
handle strangeness

So what doesn't the list manager simply make Out of Office a forbidden
sequence in a subject or body, and trash such emails?  That would cut the
autoreplies at least by 2/3rds.

I could certainly live with that restriction and it seems you can't
teach people how to do it right, just like you can't teach people not to
install viruses on their computer, when the instructions are so clear and
self-contained.


On approximately 7/17/2004 11:50 PM, came the following characters from the
keyboard of Randy W. Sims:
 On 7/18/2004 2:36 AM, McCarty, Michael F wrote:
 
 I will be out of the office Thursday July 15 and Friday, July 16, 
 returning on Monday, July 19.
 
 
 Please turn off your Out of Office AutoReply for the perl-win32-users 
 mailing list.
 
 Randy.

-- 
Glenn -- http://nevcal.com/
===
The best part about procrastination is that you are never bored,
because you have all kinds of things that you should be doing.

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: [Attn: McCarty, Michael F] Re: Out of Office AutoReply: file handle strangeness

2004-07-18 Thread Glenn Linderman
On approximately 7/18/2004 9:09 AM, came the following characters from
the keyboard of joe:
Having the autoresponder Randy has set up to respond to OOO messages respond
directly back to the user instead of the user and the list may possibly
reduce it by another 1/3. :o)
It _may_, _eventually_, but the problem with an autoresponder, is that 
it is too late, until the turkey comes back from vacation.

And then they think oops... I'd better figure that out before the next 
vacation... and then they forget...

--
Glenn -- http://nevcal.com/
===
The best part about procrastination is that you are never bored,
because you have all kinds of things that you should be doing.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: [Attn: McCarty, Michael F] Re: Out of Office AutoReply: file handle strangeness

2004-07-18 Thread Glenn Linderman
On approximately 7/18/2004 10:26 AM, came the following characters from
the keyboard of Tobias Hoellrich:
In my case, every single OOO message via the win32-users list (actually any
non-work list) ends up in Spampal's (www.spampal.org) black-list, which
means I'm never, ever going to see a message from that user (that
email-address) again. This also locks out legit messages from those users,
but that's a problem I can live with (and there's still the question whether
I actually want to see a legit message from a user who is inconsiderate
enough to send his OOO message to a list). 
I hope that is your choice, not a requirement of using SpamPal.  The 
latter would seem quite onerous, and would not be appropriate for every 
situation.

--
Glenn -- http://nevcal.com/
===
The best part about procrastination is that you are never bored,
because you have all kinds of things that you should be doing.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs