Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Question regarding using references with Net::SSH2 in module

by Preceptor (Deacon)
on Jun 14, 2013 at 20:58 UTC ( #1039036=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        #print $channel "$cmd\n";
        #while (<$channel>) {
        print {${$channel}} "$cmd\n";
        while (<${$channel}>) {
    
  2. or download this
    #!/usr/bin/perl
    
    ...
    open ( my $filehandle, ">", "testfile.txt" );
    &print_to_fh ( \$filehandle );
    close ( $filehandle ); 
    
  3. or download this
    sub print_to_fh
    {
    ...
    open ( my $filehandle, ">", "testfile.txt" );
    &print_to_fh ( \$filehandle );
    close ( $filehandle ); 
    
  4. or download this
      print {$$ref_to_fh} "Even more stuff\n";