Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

kryptischer Perl Code !HELP!

Empfohlene Antworten

Veröffentlicht

Hallo Jungs und Mädls,

hab hier ne Zeile PERL Code die mir echt Kopfschmerzen bereitet:

# Memory Information

my $memoryinfo =

$hklm->{"HARDWARE\\RESOURCEMAP\\System Resources\\Physical Memory"};

$info->{"memory"} = ceil((unpack "L*", $memoryinfo->{".Translated"})[-1]

/ 1024 / 1024 + 16) . " MB";

Das ganze ist aus dem Modul Win32::MachineInfo (MachineInfo.pm ) und sollte eigentlich die Größe des RAM`s berechnen, bei den meisten unserer Rechner funktioniert das auch richtig, nur kommen bei einigen 17MB Arbeitsspeicher raus. Und das ist definitiv falsch.

- ich verstehe die funktion ceil() , rundet auf die nächste ganze zahl auf

- ich verstehe unpack (), zerlegt den string

- was mich allerdings sehr verwirrt ist der index [-1]

von der Klammerung glaub ich gehört der zur unpack funktion , ist das irgendein special oder so??

ciao

r##t

Hallo Jungs und Mädls,

hab hier ne Zeile PERL Code die mir echt Kopfschmerzen bereitet:

# Memory Information

my $memoryinfo =

$hklm->{"HARDWARE\\RESOURCEMAP\\System Resources\\Physical Memory"};

$info->{"memory"} = ceil((unpack "L*", $memoryinfo->{".Translated"})[-1]

/ 1024 / 1024 + 16) . " MB";

[schnippschnapp...]

- was mich allerdings sehr verwirrt ist der index [-1]

von der Klammerung glaub ich gehört der zur unpack funktion , ist das irgendein special oder so??

das [-1] bezeichnet das letzte Element des Arrays davor, sprich: des Arrays "(unpack "L*", $memoryinfo->{".Translated"})"

und die 17MB werden wohl davon kommen, dass bei den Divisionen mal 1 rauskommt und +16 gerechnet wird.

taschentoast

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.