Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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

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 !@monks...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2018-01-23 08:34 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (241 votes). Check out past polls.