Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

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 error

Featured Replies

Posted

Perl error
having gen-kernel.pl file
and this declaration:

my $code = "";
...
my $output = shift;
open STDOUT,">$output" or die "can't open $output: $!";

$code .= <<EOF;
    ; finalize the computation of A,B,C,D
    iadd r0, r0, r23
    iadd r1, r1, r24
    iadd r2, r2, r25
    iadd r3, r3, r26
    ; compute x,y (x = A; y = C - D)
    mov r21, r0
    iadd r22, r2, r3_neg(xyzw)
    ; decrement loop counter
    iadd r4.x, r4.x, l100.y
  endloop

  umul r5.x, vaTid.x, l100.w
  mov g[r5.x+2], r21
  mov g[r5.x+3], r22
  ; increment the 4 iteration counters
  iadd r5.y, l100.x, r4_neg(x).x
  iadd g[r5.x+4], g[r5.x+4], r5.yyyy
end
\x00
EOF
print $code;

The error is this: Use of uninitialized value value in concatenation (.) or string at gen-kernel.pl line 219.
How to fix the error, sorry but I am null at Perl programming!

 

It works for me. Does line 219 refer to the one with $code .= <<EOF;? Maybe the problem stems from the part where you denoted as ...

  • Author

my $output = shift;
open STDOUT,">$output" or die "can't open $output: $!";
$code .= <<EOF;

Use of uninitialized value value $output in concatenation (.) or string at gen-kernel.pl line 219.
line 219 is "open STDOUT,">$output" or die "can't open $output: $!";"
My guess now is that the error is at the line: my $output = shift;

I've read a tutorial:
https://perlmaven.com/shift
https://www.perlmonks.org/?node_id=88222

and yeah shift is empty!
But also shift contains program parameters,
so
perl.exe gen-kernel.pl kernel.il
will do the trick!
 

Create an account or sign in to comment

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.