After further research I found this problem is affecting more users than I
realized. Most of them have file associations set that run UltraEdit for
the files we're commonly downloading. So this obscured the problem, since
when it occurs it results in Windows falling back to the default
appli
Hugh Loebner wrote:
> foreach my $fhkey ( keys %fh){
> open ( $fh{$fhkey}, ">$fhkey" ) ;
> }
Nobody mentioned this yet: Since you want your filehandles to be unique, why
not use the key of the hash instead of the value? In other words, change the
above to:
foreach my $fhkey ( keys %fh){
Because the first parameter passed to open
is the file handle. In the first case, there are 3 file handles: 1,2,3. In
the second case, the same file handle is used for each file, always ‘1’.
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hugh Loebner
Sent: Fri
Hugh Loebner wrote:
> Hello perl gurus,
>
> I spent almost a whole day solving this problem. However, I wonder why
> it's a problem.
> #
> # The following program (which is what I started out with) will NOT work
> properly: Each eleme
At 09:20 AM 7/1/05 -0400, [EMAIL PROTECTED] wrote:
># this works fine, produces three files, aa , bb, cc with contents 'xxx aa
>xxx' etc
>
>my %fh = ( aa => 1, bb =>2, cc => 3) ; # note that each instance of
>$fh{$fhkey} has a different value
>
>foreach my $fhkey ( keys %fh){
>open ( $fh{$fhkey},
Title: Message
See
answers:
my %fh = ( aa => 1, bb =>2, cc => 3) ;
# note that each instance of $fh{$fhkey} has a different valueforeach my
$fhkey ( keys %fh){ open ( $fh{$fhkey}, ">$fhkey"
) ;## >so, you open 3 file handles,
one named "1", one named "2", and one named "3"
Hello perl gurus,
I spent almost a whole day solving this problem. However, I wonder why it's a problem.
#
use strict;
no strict "refs" ;
# this works fine, produces three files, aa , bb, cc with contents 'xxx aa xxx' etc
my %fh = ( aa =>
L. Neil Johnson wrote:
> Thanks for the coding critique. You're right. Any idea if either form
> evaluates faster? $#array or scalar @array?
Find out for yourself:
use Benchmark;
...
--
,-/- __ _ _ $Bill LuebkertMailto:[EMAIL PROTECTED]
(_/ / )//
On Thursday, June 30, 2005 09:33:23 +0200, Johan Lindstrom
[SMTP:[EMAIL PROTECTED] wrote:
> This is what I meant when I said a hash is a good solution to this problem.
> You're not really interested in the order, you want to access each element
> by a convenient name.
>
> It sounds like a bit of
On Thursday, June 30, 2005 1:25 AM, $Bill Luebkert [SMTP:[EMAIL PROTECTED]
wrote:
>
> You could start that package off with a 'package main;' stmt which will
> put you in the same namespace as the calling module.
Good idea. This obviates the need to import identifiers. Rob suggested a
similar a
10 matches
Mail list logo