in reply to @array1 vs @array2
OK, here's some example-arrays as well.
@array1 = ( "1,Larry Wall" , "2,Douglas Adams"); @array2 = ( "1,Programing Perl,1", "2,The Hitchhikers Guide to the Galaxy,2", "2,Mostly Harmless,2"); foreach (@array1) { ($id,$name) = split( /,/, $_); print "The author is $name"; $no = grep { m/,$id$/ } @array2; print "We have $no books by this Author\n"; }
-- Brigitte 'I never met a chocolate I didnt like' Jellinek http://www.horus.com/~bjelli/ http://perlwelt.horus.at
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: @array1 vs @array2
by Anonymous Monk on Mar 19, 2001 at 22:23 UTC | |
by mikfire (Deacon) on Mar 19, 2001 at 22:47 UTC |