Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/self/root/proc/thread-self/root/proc/self/root/lib64/perl5/vendor_perl/PDL/Demos/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/proc/thread-self/root/proc/self/root/lib64/perl5/vendor_perl/PDL/Demos/Screen.pm
# Perform pdl demos on terminals

package PDL::Demos::Routines;

# Copyright (C) 1998 Tuomas J. Lukka.
# All rights reserved, except redistribution
# with PDL under the PDL License permitted.

use Carp;
use PDL;

@ISA="Exporter";
@EXPORT = qw/comment act actnw output/;

$SIG{__DIE__} = sub {die Carp::longmess(@_);};

sub home() {
   if (-e '/usr/bin/tput') {
      system 'tput clear';
   } elsif ( $^O eq 'MSWin32' ) {
      system 'cls';
   }
}

sub comment($) {
   home();
   print "----\n";
   print $_[0];
   my $prompt = "---- (press enter)";
   defined($PERLDL::TERM) ? $PERLDL::TERM->readline($prompt) : ( print $prompt, <> );
}

sub act($) {
   home();
   my $script = $_[0];
   $script =~ s/^(\s*)output/$1print/mg;
   print "---- Code:";
   print $script;
   print "---- Output:\n";
   my $pack = (caller)[0];
#	eval "package $pack; use PDL; $_[0]";
   eval "package $pack; use PDL; $_[0]";
   print "----\nOOPS!!! Something went wrong, please make a bug report!: $@\n----\n" if $@;
   my $prompt = "---- (press enter)";
   defined($PERLDL::TERM) ? $PERLDL::TERM->readline($prompt) : ( print $prompt, <> );
}

sub actnw($) {
   home();
   my $script = $_[0];
   $script =~ s/^(\s*)output/$1print/mg;
   print "---- Code:";
   print $script;
   print "---- Output:\n";
   my $pack = (caller)[0];
#	eval "package $pack; use PDL; $_[0]";
   eval "package $pack; use PDL; $_[0]";
   print "----\n";
   print "----\nOOPS!!! Something went wrong, please make a bug report!: $@\n----\n" if $@;
}

sub output {print @_}

Hry