Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://132976]
help
Chatterbox?
[karlgoethebier]: no typo
[marioroy]: At the Fransiscan monastery, got stuck up high in a tree from pruning and the chainsaw with large branch fell and broke the latter, but not me fortunately. Was stuck there for a while until a firetruck came by.
[Corion]: marioroy: So you live dangerously ...
[Lady_Aleena]: s/latter/ladder/; # ? marioroy
[karlgoethebier]: marioroy: Praise the Lord
[marioroy]: Well, that's why there must be angels around, invisible or not.
[marioroy]: Lady_Aleena yes, ladder.
[marioroy]: Corion, no not intentionally. not at all.
[Lady_Aleena]: /ne tries to decide whther or not to take a hammer to hubby's alarm clock.
[Lady_Aleena]: He never hears it.

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2017-05-29 08:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?