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] SEEK in "strict subs" ???

Empfohlene Antworten

Veröffentlicht

Hi, ich hab ein Script welches Dateien nach einer bestimmten Artieklnummer durchsucht, die steht nun in einer Zeile, jetzt möchte ich in die Zeile die danach kommt.

Wie mach ich das?

Ich habe es mit "SEEK( FILE, 50 , SEEK_CUR)" versucht aber es dann kommt folgender Fehler:

Bareword "SEEK_CUR" not allowed while "strict subs" in use at E:\bin\Segment-Catch.pl line 163.

Execution of E:\bin\Segment-Catch.pl aborted due to compilation errors.

Was hab ich noch für möglichkeiten in die nächste zeile zu gelangen???

hallo,

ich selber hatte diesen fehler noch nicht, aber mein perl buch meint zu diesem fehler folgendes:

Ist "strict subs" aktiv, ist ein Bareword nur als Subroutinen-Identifier, in geschweiften Klammern stehend oder links von => stehend erlaubt. Vielleicht haben Sie vergessen, eine Subroutine vorzudeklarieren?

Hoff mal, das hilft dir dabei ?!

Hallo,

$flag=0;

open(LESEN,"demo.dat") or die "Fehler beim Öffnen von 'demo.dat': $!\n";

while(defined($i = <LESEN>))

{

if ($flag==1)

{

do something;

$flag=0

}

if ($i == 12345)

{$flag=1}

}

Hiermal ne Quickhacklösung. Es wird ein Flag gesetzt wenn deine Art-Nummer erreicht ist und geht dann mit der nächsten Zeile in die if-Anweisung.

cya

alligator

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.