Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: TMTOWTDI Puzzle: Generating a range of numbers

by danger (Priest)
on Dec 19, 2001 at 03:58 UTC ( #132976=note: print w/ replies, xml ) Need Help??

in reply to TMTOWTDI Puzzle: Generating a range of numbers

Here are a few variations:

$_ = 'aaaaaaaaaa'; my @list; push @list, pos() while /a/g; print "@list\n"; my @list = (length'a' .. length'aaaaaaaaaa'); print "@list\n"; my @b = ('a'..'j'); my @a = ('a'); my @list = @a..@b; print "@list\n"; $_ = 'xaaaaaaaaaa'; my @list = y/x// .. y/a//; print "@list\n"; $_="\n\n\n\n\n\n\n\n\n\n"; open(OUT,"+>out.lines")||die "can't $!"; print OUT; seek OUT,$|,$|; my @list; push @list, $. while <OUT>; print "@list\n"; unlink "out.lines";

UPDATE: chipmunk pointed out that I used 0 in the seek --- fixed.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://132976]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2016-07-24 04:01 GMT
Find Nodes?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?

    Results (221 votes). Check out past polls.