61 users online (1 members and 60 guests)  

Thread: explain


  Results 1 to 2 of 2

Related

  1. HI explain me about shift @_    Forum: CGI Perl Forum
    Replies: 1
  2. Can someone please explain how to add this.    Forum: CGI Perl Forum
    Replies: 3
  1. #1
    davidmook's Avatar
    New User

    Status
    Offline
    Join Date
    May 2006
    Posts
    10

    explain

    %credit=(
    'jar' =>{
    'apple'=>'12',
    },
    'no'=>{
    'oren'=>'13',
    },
    );

    foreach my $array(%credit){
    foreach my $app( % {$credit { $array }}){
    print $app;
    }
    }

    can explain to me foreach...

  2. #2
    pageBuzz.com's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2006
    Posts
    21

    Re: explain

    the term "foreach" is pretty litteral.

    You are telling the program to do something for eash of the lines, variable or hash elements.

    In your example you are asking the program to print the value for $app for each hash element $credit

    That probably does not make much sense to you, but you asked!



Tags for this Thread