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.

Empfohlene Antworten

Veröffentlicht

Hallo,

ich hätte mal ne Frage und zwar:

Gibt es ne möglichkeit nen hash auf eine bestimmtes schlüssel-wert paar in einem if befehl überprüfen? also :

if (exists %hash[$var1]="$var2" or %hash[$var2]="$var1")

{Befehl}

else

{befehl}

dabei sind $var1 und $var2 beides variablen die in einer foreach schlaufe für jeden durchlauf verändert werden, das pogramm kann aber, da die reihenfolge egal ist, doppelte ergebnisse erzeugen, welhe ich aber für die nächsten programmschritte ausschließen möchtet.

so wies da steht klappt es net, wenn wer ne antwort hat wäre echt toll

Ich weiss zwar nicht genau was du machen willst, aber deine Syntax stimmt hinten und vorne nicht.

Schau dir mal die Operatoren (bzw. die) und Hashes an.

exists kannst nicht brauchen, wenn dich der value interessiert.

Hier mal die richtige Syntax von deinem Beispiel als Einstieg ...

if (($hash{$var1} eq $var2) or ($hash{$var2} eq $var1))

Wobei ich mir nicht vorstellen kann, dass das inhaltlich irgendeinen Sinn macht.

Bearbeitet von bigvic

ahh, ich idiot, ja klar dass es dann net gehen kann.

ich schreib nen programm für ne biotechnologische anwendung, denke das werd ich dir net umbedingt erklären müssen, weils für jemanden der sich in dem bereich net auskennt sehr verwirrend klingt, aber es ist egal ob wert 1 vorne ist oder wert 2

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.