## Im getting this: "[19:08] Tcl error [Main]: can't read "a": no such variable"

bind pub - !find Main

proc Main {nick uhost handle chan args} {

set fg [open "/glftpd/ftp-data/logs/glftpd.log" "r"]
        set a [lindex $a 0]
        while {![eof $fg]} {
        set line [gets $fg]

        if {[string match $a $line]} {

        putserv "PRIVMSG #ace : I found $a on the site"
        break
        } else {

        putserv "PRIVMSG #ace : Sry couldnt find $a on the site"
}
}

close $fg

