in reply to Re: text parser TkGUI ActiveState
in thread text parser TkGUI ActiveState

Thank you for your post, and suggestions on my code. I am able to understand most of the code; however, what does the following do?

my( $device, $stime, $etime, $value ) = 1 .. 10;

Replies are listed 'Best First'.
Re^3: text parser TkGUI ActiveState
by roboticus (Chancellor) on Aug 12, 2015 at 13:40 UTC

    jasonwolf:

    You can normally answer a question like this yourself, simply by trying it:

    $ cat x.pl use strict; use warnings; my ($m,$n,$o,$p) = 1 .. 10; print "m=$m, n=$n, o=$o, p=$p\n"; $ perl x.pl m=1, n=2, o=3, p=4

    So, it assigns 1 to the first variable, 2 to the second, ... up through the fourth. Then it throws the rest of the list items away.

    By playing with the program (changing the number of variables, and the size of the list), you could then deduce the general behavior.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.