On 02/17/2017 06:43 PM, ToddAndMargo wrote:
Hi All,

<code>
$ cat die.pl6
#!/usr/bin/perl6

use strict;
# use warnings;
# use lib;  # fill name of lib in

die "Curses on you!";
</code>

$ die.pl6
Curses on you!
  in block <unit> at ./die.pl6 line 7


What is the best way to exit, like "die", without
the commentary "in block ...." from the "die" command?
I just want my stuff to show and nothing else.


Many thanks,
-T




Figured it out.  Just use "exit":


<code>
#!/usr/bin/perl6

use strict;
# use warnings;
# use lib;  # fill name of lib in

print "Curses on you!\n";
exit 2;

print "This should not print\n";
</code>

$ exit.pl6; echo $?
Curses on you!
2

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Serious error.
All shortcuts have disappeared.
Screen. Mind. Both are blank.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to