I am working on TCL scripts right now.  When I run tclsh script.tcl the script works perfectly but when I run source script.tcl the commands are no longer found.
#!/usr/bin/env tclsh
proc test {} {
  set a 43
  set b 27
  set c [expr $a + $b]
  set d [expr [expr $a - $b]* $c]
  for {set k 0} {$k < 10} {incr k} {
    if {$k < 5} {
      puts "k<5, pow=[expr pow($d,$k)]"
    } else {
      puts "k>=5, mod=[expr $d % $k]"
    }
  }
}
...which, when run, causes the error:
$ source myfirst.tcl
Command 'proc, not found, did you mean:
  command 'croc' from snap croc (6.4.10)
  command 'prof' from deb profphd
  command 'nproc' from deb coreutils
  command 'proj' from deb proj-bin
See 'snap info <snapname>' for additional versions.
bash: myfirst.tcl: line 7: syntax error near undexpected token `k'