Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

how to print dynamicaly ?

by virudinesh (Acolyte)
on May 30, 2013 at 08:09 UTC ( #1035994=perlquestion: print w/ replies, xml ) Need Help??
virudinesh has asked for the wisdom of the Perl Monks concerning the following question:

foreach($id_chap) { print "\t", $id_chap[0][0],"\n"; print "\t", $id_chap[0][1],"\n"; }

1.if only print this array only to print dynamicaly

am tried $id_chap++

but not working , here using array concept

Comment on how to print dynamicaly ?
Download Code
Replies are listed 'Best First'.
Re: how to print dynamicaly ?
by davido (Archbishop) on May 30, 2013 at 08:53 UTC

    $id_chap is a different variable from @id_chap.

    Do you want something like this?

    foreach my $row ( @id_chap ) { foreach my $col ( @{$row} ) { print "\t$id_chap[$row][$col]\n"; } }


Re: how to print dynamicaly ?
by marto (Bishop) on May 30, 2013 at 08:38 UTC
Re: how to print dynamicaly ?
by CountZero (Bishop) on May 30, 2013 at 11:47 UTC
    Perhaps you were thinking about something like this?
    foreach($id_chap) { print "\t", $_->[0],"\n"; print "\t", $_->[1],"\n"; }


    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics
Re: how to print dynamicaly ?
by Anonymous Monk on May 30, 2013 at 08:21 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1035994]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2015-11-29 21:28 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (753 votes), past polls