in reply to Perl output on console as well as on text file

This is exactly what the module IO::Tee is for.
Bill
  • Comment on Re: Perl output on console as well as on text file

Replies are listed 'Best First'.
Re^2: Perl output on console as well as on text file
by shyamasoni (Initiate) on Jan 06, 2015 at 05:00 UTC

    Thanku karl but following error is occuring 'tee-object' is not recognized as an internal or external command, operable program or batch file.

      "... 'tee-object' is not recognized..."

      You mean the tee-object cmdlet doesn't work? This works for me:

      PS C:\Dokumente und Einstellungen\karl\Desktop\monks> perl -e 'print q +q(Hello world\n)' | tee-object -filepath shyamasoni-out.txt Hello world PS C:\Dokumente und Einstellungen\karl\Desktop\monks> cat shyamasoni-o +ut.txt Hello world

      Could you copy & paste the exact error you get from PS (activate Quick-Edit mode, mark region in PS with mouse, press ENTER and then CRTL-V...)?

      Update: See also Set-ExecutionPolicy Cmdlet.

      Regards, Karl

      «The Crux of the Biscuit is the Apostrophe»