Thread Hash als Option missbrauchen (118 answers)
Opened by bloonix at 2005-12-19 02:24

bloonix
 2005-12-21 00:53
#61007 #61007
User since
2005-12-17
1615 Artikel
HausmeisterIn
[Homepage]
user image
Oh Hilfe,

ich habe gerade folgendes versucht:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl -w

use strict;

my %param = ( SysInfo => 1 );
my $stats = {};

for (qw/SysInfo/) { # nur zum Testen
no strict 'refs';
$stats->{$_} = &$_() if $param{$_};
}

sub SysInfo {
  open(FM,"</proc/meminfo") or die "LinuxStatistics: can't open /proc/meminfo\n";

  while (<FM>) {        # line 16
     # do something
  }

  close FM;
}


und bin auf einen Fehler gestoßen...

"Modification of a read-only value attempted at ./TestHash line 16."
What is a good module? That's hard to say.
What is good code? That's also hard to say.
One man's Thing of Beauty is another's man's Evil Hack.

View full thread Hash als Option missbrauchen