Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Yaml !perl/range to perl range

by choroba (Canon)
on Dec 01, 2012 at 20:53 UTC ( #1006642=note: print w/ replies, xml ) Need Help??


in reply to Yaml !perl/range to perl range

Use split to get the margins:

use strict; use warnings; use feature 'say'; my $s = "2..5"; my ($start, $end) = split /\.\./, $s; say for $start .. $end;
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ


Comment on Re: Yaml !perl/range to perl range
Download Code
Replies are listed 'Best First'.
Re^2: Yaml !perl/range to perl range
by mpegjohn (Initiate) on Dec 01, 2012 at 21:07 UTC
    Yes, that looks good. Just thought I could have used the scalar and setup an array using that scalar. I like the split idea though.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2015-07-30 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls