Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Test if list is range

by LanX (Saint)
on Sep 29, 2012 at 11:33 UTC ( [id://996364]=note: print w/replies, xml ) Need Help??


in reply to Test if list is range

please use <code> tags!

No, there is (unfortunately) no range datatype, the range operator does only create a list in list context.

If you need ranges as types , consider creating an object or tie handling the behavior you want.

You could also try one of the cpan modules for ranges.

Cheers Rolf

Replies are listed 'Best First'.
Re^2: Test if list is range
by Anonymous Monk on Sep 30, 2012 at 01:07 UTC

    There might be a way

    $ perl -MO=Deparse -e " use Data::Dump; dd [ 1,2,3 ] " use Data::Dump; dd([1, 2, 3]); -e syntax OK $ perl -MO=Deparse -e " use Data::Dump; dd [ 1..3 ] " use Data::Dump; dd([1..3]); -e syntax OK
      for this you need to know where in the source an array variable was set ....

      Its like trying to determine if ones grandparents where married by screening his bloodsample.

      Cheers Rolf

        for this you need to know where an array variable was defined .... Its like trying to determine if ones grandparents where married by screening his bloodsample.

        And how is that important?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-29 05:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found