[Vienna-pm] slices

Wolfgang Laun Wolfgang.Laun at alcatel.at
Thu Nov 17 03:41:50 PST 2005


my @s = eval( '@a[' . $slice . ']' );

Zwecks Fehlerbehandlung man perlfunc, "eval EXPR" konsultieren.

mfg

Johannes Fuernkranz wrote:

>Hallo,
>
>Ich haette mal eine schnelle Frage mit einer (hoffentlich) schnellen 
>Antwort.
>
>Ich moechte indirekt slices spezifizieren. Geht das? Wie?
>Also etwas wie
>
>my @a = qw(a b c d e f);
>my $slice = "1..2,4";
>
>my @s = @a[$slice];
># @s sollte nun (b,c,e) sein.
>
>Danke,
>
>Juffi
>_______________________________________________
>Vienna-pm mailing list
>Vienna-pm at pm.org
>http://mail.pm.org/mailman/listinfo/vienna-pm
>  
>



More information about the Vienna-pm mailing list