How to get following output in perl


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to get following output in perl
# 1  
Old 08-08-2008
How to get following output in perl

Hi,

I am new to perl.

I am trying to write a perl program that will print out following output.
Code:
1:1
2:1,2
3:1,2,3
4:1,2,3,4
5:1,2,3,4,5
6:1,2,3,4,5,6

Script need to be written in for loop.

Please help
thanks
-Lalit
# 2  
Old 08-08-2008
Show some effort to solve the problem first.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl Script output

Hi All, I have an expect script that I would like a perl script to call in order to login to a node and run in a single command. The command being running is a log of events so has lots of data that will be output. I would like to output that data to a file. Would anyone be kind enought... (1 Reply)
Discussion started by: mutley2202
1 Replies

2. Shell Programming and Scripting

Perl help - how to assign output of perl to variable

Hi, guys, i have a script i inherited from a coworker but i'm not perl savy. The script works but i would like it to work better. I want to run this command ./ciscomgrtest.pl -r "show version" -h hosts.router and have the script goto each router in the hosts.router file and run the command... (2 Replies)
Discussion started by: whipuras
2 Replies

3. Shell Programming and Scripting

Perl : not getting the exact output

I have written a perl code to read alphabet from console and prints the status. But every time it is printing "Entered is vowel". print "Enter any alphabet: "; $a = <STDIN>; if ( $a == "a" || $a == "e" || $a == "i" || $a == "o" || $a == "u" ) { print "entered is vowel"; } else... (4 Replies)
Discussion started by: scriptscript
4 Replies

4. Shell Programming and Scripting

getting no output with my perl program

hi, i have posted the same kind of the question in some other forum of the same site. but realized that it is supposed to be here so i am reposting it .this is the perl script written to check for particular pattern. my file 1 would look like this hwk:678:9878:asd:09: abc cfgb 12 nmjk ......... (3 Replies)
Discussion started by: anurupa777
3 Replies

5. Shell Programming and Scripting

perl - output not being displayed

Hi All I have the following code sub pall_nvrm { my $cmd = `pall -w "/u/ab/scripts/dev/nvrmerros/nvrmpaller"`; print $cmd; } if i run pall -w "/u/ab/scripts/dev/nvrmerros/nvrmpaller" in a shell i get this sort of out put eagley: boxted: cadle: eabost: hales: (3 Replies)
Discussion started by: ab52
3 Replies

6. Shell Programming and Scripting

Output of a command in perl

Hi All If i run the following command nvidia-settings -V -q screens I get this output X Screen on sutton:0 sutton:0.0 (Quadro FX 4600) Is connected to the following display devices: DELL 2007FP (DFP-0: 0x00010000) Eizo CG243W (DFP-1:... (1 Reply)
Discussion started by: ab52
1 Replies

7. Shell Programming and Scripting

Formatting Perl Output

Hi, I am getting the output from a PERL program but the output is all on different lines. My code is printf hOUT "%s\t%s\t%s\t%s\t%s\t%s",$M1_CTR, $M2_CTR, $M3_CTR, $M4_CTR, $M5_CTR, $M6_CTR; Example: My report (which I send via email) should look like this Area 1 Area 2 ... (4 Replies)
Discussion started by: nurani
4 Replies

8. Shell Programming and Scripting

Perl...getting wrong output?

Good morning! Im trying to write and learn at the same time a simple script. fTHe script should tell me if a number is odd or even/ #!/usr/bin/perl $num = 10; $string1 = "This number is odd"; $string2 = "This number is even"; if ($num /= 2) { print "$string1\n"; }else{ ... (3 Replies)
Discussion started by: bigben1220
3 Replies

9. Shell Programming and Scripting

Perl - update output

I need help with the following code. It does what i want it to, but since I clear the screen and do not update it when i finally ^C my scroll back buffer is filled with garbage. Term::Cap might not be the best way to go, i am trying to keep this to Core Modules due to the difficulties of getting... (1 Reply)
Discussion started by: insania
1 Replies

10. Shell Programming and Scripting

getting colored output in perl

Hello, I am scripting in perl and I need to get my output of the "print" statement in color. Please tell me how to go ahead. Radha (2 Replies)
Discussion started by: s123.radha
2 Replies
Login or Register to Ask a Question