yesterday has asked for the wisdom of the Perl Monks concerning the following question:
However I now need to process a list of commands (400) to a server, the list is a text file with no delimiters just a new line for each command .. so do I create my array from list?print $sock "$data\r\n"; my @output; $output = join('', @output);
ok now the tricky bit.. for me anyway :) do I need to create a long string from the list & split?$data_file = "/path/to/data.txt"; $delimiter = "\n"; open(FILE,"$data_file") || &error('open->data_file',$data_file); @FILE = <FILE>; close(FILE);
If I get to this position, how can I print the string to my socket? thanks Steve ...$commands = join('',@FILE); @commands = split(/$delimiter/,$commands);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: print list to socket
by kyle (Abbot) on Jun 05, 2007 at 11:26 UTC | |
by yesterday (Novice) on Jun 05, 2007 at 12:38 UTC | |
|
Re: print list to socket
by Util (Priest) on Jun 05, 2007 at 11:51 UTC | |
|
Re: print list to socket
by Moron (Curate) on Jun 05, 2007 at 12:26 UTC | |
by johngg (Canon) on Jun 05, 2007 at 13:14 UTC |