Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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.


Comment on Re: TMTOWTDI Puzzle: Generating a range of numbers
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2014-07-23 07:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (135 votes), past polls