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.

[Perl]Foreach Probleme

Empfohlene Antworten

Veröffentlicht

Hallo Zusammen,

ich programmiere seit 2 Jahren mit C# aber muss zurzeit mit perl etwas entwickeln. Ich habe eine foreachschleife womit ich eine Tabelle bzw. Liste auslese. Ich habe einiges ausprobiert aber hat nicht so ganze geklappt.

Als erstes seht ihr C# Code und als zweites ein Screenshot was ich so mit perl gemacht habe.Ich danke euch



string s;


foreach(string mac in arrList)

{

     s+= mac ;      

}

Console.Writeline(s);

post-89280-14430449586094_thumb.png

Und was ist nun genau das Problem?

An dem Screenshot ist für mich erst einmal nur ersichtlich, dass Du scheinbar eine Hash-Referenz bekommst ("$R_tbl"). Die sollte man übrigens lieber prüfen und nicht blind dereferenzieren. Innerhalb der "foreach"-Schleife versuchst Du jedoch, diese Hash-Referenz als Skalar zu dereferenzieren, aber trotzdem auf einen Hash zuzugreifen. Warum kein direkt Zugriff auf die Hash-Referenz?

if (ref $hash_ref eq 'HASH')

{

	foreach my $key (keys %$hash_ref)

	{

		my $foo = $hash_ref->{$key};

	}

}

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.