expect -> perl

Peter McEvoy Peter.McEvoy at barcouncil-ni.org.uk
Thu May 30 05:51:54 CDT 2002


Hi,
I'm currently using an expect script to pull an etrn feed, for no particular
reason i'd like to reimplement this in perl, the script is as follows:

#!/usr/bin/expect
set timeout 1000
spawn telnet foo.bar

expect {
        "220" {
                send "etrn bar.foo\n"
                puts "Send etrn request\n"

                expect {
                   "251" {
                        send "quit\n"
                        puts "no mail for you\n"
                   }

                   "253" {
                        send "quit\n"
                        puts "the mo fo mail is on its way\n"
                   }

                   "458" {
                        send "quit\n"
                        puts "already queued, so we quit\n"
                   }


                }
        }
        "connection refused" {
                send "quit\n"
                puts "connection was refused."
        }
}

I've had a duke on cpan and google, nothing jumped out at me, anyone care to
give me a nudge in the right direction? or should i just forget this whole
stupid malarky?
Ta
Pete
I love the house next door, its right up my street




More information about the Belfast-pm mailing list