RE: Feeding ouput from Net::Telnet into sub

2010-04-10 Thread Joseph L. Casale
>so it could still likely use a review. especially if you are learning >perl. many doc examples aren't written to the best coding standards. I'll take you up on that once its "supposedly" done:) Many great tips, thanks for all the help! jlc -- To unsubscribe, e-mail: beginners-unsubscr...@perl.o

Re: Feeding ouput from Net::Telnet into sub

2010-04-10 Thread Uri Guttman
> "JLC" == Joseph L Casale writes: >> nothing HAS to be global. you can pass it to a sub, you can store the >> options in a hash (my way and easy with getopt::long), etc. some globals >> may be useful but always using them or not know other ways is bad. JLC> Ok, fair enough. that is

RE: Feeding ouput from Net::Telnet into sub

2010-04-10 Thread Joseph L. Casale
>nothing HAS to be global. you can pass it to a sub, you can store the >options in a hash (my way and easy with getopt::long), etc. some globals >may be useful but always using them or not know other ways is bad. Ok, fair enough. >no. it is a single string with 4 lines in it. why would you think

Re: Feeding ouput from Net::Telnet into sub

2010-04-10 Thread Uri Guttman
> "JLC" == Joseph L Casale writes: >> use a named variable with foreach loops. sure some docs and examples >> show using the default $_ but it can have problems with action at a >> distance. also a name makes the code read better. JLC> Ok, simple enough to do. >> and where does $m

RE: Feeding ouput from Net::Telnet into sub

2010-04-10 Thread Joseph L. Casale
>use a named variable with foreach loops. sure some docs and examples >show using the default $_ but it can have problems with action at a >distance. also a name makes the code read better. Ok, simple enough to do. >and where does $match get set? it must be from outside the sub so it is >a global

Re: Feeding ouput from Net::Telnet into sub

2010-04-10 Thread Uri Guttman
> "JLC" == Joseph L Casale writes: JLC> I get a page full of output from a command passed into a JLC> Net::Telnet session that as per the cpan example is stored in JLC> $output. I then want to call a sub passing $output into it, that JLC> matches a string against each line, and sets a

Feeding ouput from Net::Telnet into sub

2010-04-10 Thread Joseph L. Casale
I get a page full of output from a command passed into a Net::Telnet session that as per the cpan example is stored in $output. I then want to call a sub passing $output into it, that matches a string against each line, and sets a a var to "OK" if the match is successful. All is well, but I am unc