For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > July 2006 > Re: Ubung aus dem Kamelbuch









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Ubung aus dem Kamelbuch
Xbiton

2006-07-27, 3:57 am


javier@callwayonline.de schrieb:

> Hallo,
>
> ich versuche folgedes aus dem Programmieren mit perl:
>
> while ( <> ) {
>
> next unless s/^(.*?):\s*//;
> $HoL{$1} =3D [ split ];
>
> }
>
> die Hash Datei sieht folgenden aus
>
> 1: 1 2 3 4 5 6
> 2: 34 5 7 8 9
> usw.
>
> wenn ich der Skript auf eine Win Xp Pro mit perl activestate 5.8
>
> perl -w HoL.pl Hash.txt
>
> aufrufe
>
> Bekomme ich folgende Fehlermeldung:
>
> Name "main::HoL" used only once: possible typo at HoL.pl line 12
>
> genau das gleiche wenn das skript so umgeschrieben wird:
>
> while ($line =3D <> ){
> ($who, $rest) =3D split /:\s*/, $line, 2;
> @field =3D split ' ', $rest;
> $HoL{$who} =3D [ @field ];
>=20
> }
>=20
> was mache ich falsch?
>=20
> Gr=FC=DFe.
>=20
> Xaver


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com