split

Honza Pazdziora adelton na informatics.muni.cz
Pondělí Leden 24 12:41:20 MET 2000


On Mon, Jan 24, 2000 at 12:39:27PM +0100, Pavel Kunc wrote:
> while (($autor, $nazev, $cena, $num_pol, $dilna, $provenience, $index_kat) =
> $st->fetchrow_array)
>  {
>   push @ROW, join '|', $index_kat, $autor, $nazev, $cena, $num_pol, $dilna,
> $provenience;
>  }
>  foreach $value (sort @ROW)
>  {
>   print "$value<br>\n";
>   ($index_kat, $autor, $nazev, $cena, $num_pol, $dilna, $provenience) =
> split /|/, $value;
>   print "$index_kat $autor $nazev $cena $num_pol $dilna $provenience<br>\n";
>  }

Tohle mnohem lepe napsat jako selectall_arrayref.

> Tohle se mi tiskne:
> 
> 0|BENEDÍK Karel (*1923)|Kosatce s růžemi|38000|5||    =>  $value pred split
> 0 | B E N E D    => split to takhle zpitvori

Na to byste mohl prijit sam.

------------------------------------------------------------------------
 Honza Pazdziora | adelton na fi.muni.cz | http://www.fi.muni.cz/~adelton/
   .project: Perl, DBI, Oracle, MySQL, auth. WWW servers, MTB, Spain.
------------------------------------------------------------------------


Další informace o konferenci Perl