Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Test if list is range

by LanX (Canon)
on Sep 29, 2012 at 11:33 UTC ( #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


Comment on Re: Test if list is range
Download Code
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
Node Status?
node history
Node Type: note [id://996364]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2014-09-18 23:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (126 votes), past polls