![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Assign Values to variables from a text file | sarsani | Shell Programming and Scripting | 3 | 06-26-2009 08:05 PM |
| perl - print to a log file and screen | mjays | Shell Programming and Scripting | 6 | 08-21-2007 09:34 AM |
| how to print out line numbers of a text file? | forevercalz | Shell Programming and Scripting | 4 | 12-12-2005 05:04 AM |
| Print only certain lines from a text file | CamTu | Shell Programming and Scripting | 1 | 06-01-2005 12:47 PM |
| How to print a text file in landscape | yxiao | UNIX for Dummies Questions & Answers | 5 | 06-20-2002 07:21 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
PERL:print 32 variables into a text file
okay, down below is the script. i have 32 words put into 32 variables and i want perl to print all those 32 variables into one text document, each word under another in the text file. the text files called times.txt Sorry about the length of the script
print " VToshiba "; print "\n---------------------------------------------"; print "\nEnter name of the Rally:"; $rally = <STDIN>; chomp ($rally); print "\nEnter your name:"; $name = <STDIN>; chomp ($name); print "\nEnter Times Below and Hit Enter after each stage"; print "\nDAY 1"; #day1 - stage1 time print "\nStage 1:"; $d1st1 = <STDIN>; chomp ($d1st1); #day1 - stage2 time print "\nStage 2:"; $d1st2 = <STDIN>; chomp ($d1st2); #day1 - stage3 time print "\nStage 3:"; $d1st3 = <STDIN>; chomp ($d1st3); #day1 - stage1 time print "\nStage 4:"; $d1st4 = <STDIN>; chomp ($d1st4); #day1 - stage1 time print "\nStage 5:"; $d1st5 = <STDIN>; chomp ($d1st5); print "\nStage 6:"; $d1st6 = <STDIN>; chomp ($d1st6); #day1 - stage2 time print "\nStage 7:"; $d1st7 = <STDIN>; chomp ($d1st7); #day1 - stage3 time print "\nStage 8:"; $d1st8 = <STDIN>; chomp ($d1st8); #day1 - stage1 time print "\nStage 9:"; $d1st9 = <STDIN>; chomp ($d1st9); #day1 - stage1 time print "\nStage 10:"; $d1st10 = <STDIN>; chomp ($d1st10); #begin day 2 times. print "\n-------------------------------------------------"; print "\nDAY 2"; #day1 - stage1 time print "\nStage 1:"; $d2st1 = <STDIN>; chomp ($d2st1); #day1 - stage2 time print "\nStage 2:"; $d2st2 = <STDIN>; chomp ($d2st2); #day1 - stage3 time print "\nStage 3:"; $d2st3 = <STDIN>; chomp ($d2st3); #day1 - stage1 time print "\nStage 4:"; $d2st4 = <STDIN>; chomp ($d2st4); #day1 - stage1 time print "\nStage 5:"; $d2st5 = <STDIN>; chomp ($d2st5); print "\nStage 6:"; $d2st6 = <STDIN>; chomp ($d2st6); #day1 - stage2 time print "\nStage 7:"; $d2st7 = <STDIN>; chomp ($d2st7); #day1 - stage3 time print "\nStage 8:"; $d2st8 = <STDIN>; chomp ($d2st8); #day1 - stage1 time print "\nStage 9:"; $d2st9 = <STDIN>; chomp ($d2st9); #day1 - stage1 time print "\nStage 10:"; $d2st10 = <STDIN>; chomp ($d2st10); #begin day 3 print "\n------------------------------------------------"; print "\nDAY 3 (dont enter times if day 3 is not in the rally)"; #day1 - stage1 time print "\nStage 1:"; $d3st1 = <STDIN>; chomp ($d3st1); #day1 - stage2 time print "\nStage 2:"; $d3st2 = <STDIN>; chomp ($d3st2); #day1 - stage3 time print "\nStage 3:"; $d3st3 = <STDIN>; chomp ($d3st3); #day1 - stage1 time print "\nStage 4:"; $d3st4 = <STDIN>; chomp ($d2st4); #day1 - stage1 time print "\nStage 5:"; $d2st5 = <STDIN>; chomp ($d3st5); print "\nStage 6:"; $d3st6 = <STDIN>; chomp ($d3st6); #day1 - stage2 time print "\nStage 7:"; $d3st7 = <STDIN>; chomp ($d3st7); #day1 - stage3 time print "\nStage 8:"; $d3st8 = <STDIN>; chomp ($d3st8); #day1 - stage1 time print "\nStage 9:"; $d3st9 = <STDIN>; chomp ($d3st9); #day1 - stage1 time print "\nStage 10:"; $d3st10 = <STDIN>; chomp ($d3st10); print "\n----------------------------------------------"; print "\nPress Enter to create times file.This will be named results.txt"; print "\nand will be located where you installed this program."; $keyboard = <STDIN>; open (TIMES, ">times.txt"); $times = <TIMES>; #NEED HELP HERE !!!!!!!!!!!!!!!!!!!!!!! close (TIMES); Can someone please help me on this ! |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|