Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

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 chanting in the Monastery: (6)
As of 2016-10-25 22:46 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (330 votes). Check out past polls.