rammohan has asked for the wisdom of the Perl Monks concerning the following question:
I have a above Perl script that Prints the results of the script on the terminal screen. Instead of having the information printed on the screen, I need it to save it to a text file.#!/usr/bin/perl -w use strict; use warnings; use diagnostics; use feature 'say'; my@array = qw(a b c d e f g h i j k l m n o p q r s t u v w x y z); my@array_a = @array[0..5]; my@array_b = @array[6..8]; my@array_c = @array[8..15]; my@array_d = @array[16..16]; my@array_e = @array[17..20]; my@array_f = @array[21..24]; my@array_g = @array[25..16]; print "first five string:",@array_a,"\n"; print @array_b,"\n"; print @array_c,"\n"; print @array_d,"\n"; print @array_e,"\n"; print @array_f,"\n"; print @array_g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to save the output result in file
by hdb (Monsignor) on Jan 17, 2014 at 06:33 UTC | |
by rammohan (Acolyte) on Jan 17, 2014 at 06:41 UTC | |
by hdb (Monsignor) on Jan 17, 2014 at 06:52 UTC | |
|
Re: How to save the output result in file
by AnomalousMonk (Archbishop) on Jan 17, 2014 at 09:04 UTC | |
|
Re: How to save the output result in file
by nithins (Sexton) on Jan 17, 2014 at 06:43 UTC | |
|
Re: How to save the output result in file
by Anonymous Monk on Jan 17, 2014 at 08:30 UTC | |
|
Re: How to save the output result in file
by rammohan (Acolyte) on Jan 17, 2014 at 07:08 UTC | |
by Corion (Patriarch) on Jan 17, 2014 at 07:50 UTC |