Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

2.how to print dynamicaly

am tried $id_chap++

but not working , here using array concept

Comment on how to print dynamicaly ?
Download Code
Re: how to print dynamicaly ?
by Anonymous Monk on May 30, 2013 at 08:21 UTC
Re: how to print dynamicaly ?
by marto (Bishop) on May 30, 2013 at 08:38 UTC
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"; } }

    Dave

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"; }

    CountZero

    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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2014-12-23 02:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (133 votes), past polls