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

Re: Getting a subroutine reference from an object instance

2010-04-10 Thread Peter Scott
On Fri, 09 Apr 2010 16:34:27 +0200, Eric Veith1 wrote: > Peter, >> I suspect you would have an easier time if you wrote what sounds like a >> largish project using Moose and composed in a forkable role. If you > must >> use method attributes there is MooseX::MethodAttributes but (and I am >> gett

Re: Modules download from CPAN

2010-04-10 Thread Shawn H Corey
Alan Haggai Alavi wrote: Hi, CPAN::Mini can be used to create/update local mirrors. minicpan script (http://search.cpan.org/perldoc?minicpan) which uses CPAN::Mini will be helpful in maintaining a local CPAN mirror. If you're going to working on CPAN, you should sign up for the CPAN mailing

Re: Modules download from CPAN

2010-04-10 Thread Alan Haggai Alavi
Hi, CPAN::Mini can be used to create/update local mirrors. minicpan script (http://search.cpan.org/perldoc?minicpan) which uses CPAN::Mini will be helpful in maintaining a local CPAN mirror. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginn

Re: Perl; socket

2010-04-10 Thread Uri Guttman
> "Nz" == Niko zuna writes: Nz> #!/usr/bin/perl Nz> # Needed pkg no need for comments like that. Nz> use Getopt::Std; use Getopt::Long instead. you can still have short names but also long names. Nz> use strict "vars"; why 'vars'? just plain strict is better. Nz> # Global var

Perl; socket

2010-04-10 Thread Niko zuna
Hi, I have made a TCP socket, both a server and a client, and it works just fine, except from the fact that I cant receive more than one input line from the server when I execute a Unix command trough the socket. And when I am trying to send a ps command from the client to the server to count how m