line number from exceptions

Moritz Lenz moritz at faui2k3.org
Sun Mar 29 20:30:48 UTC 2009


Allison Randal wrote:
> Robin Edwards wrote:
>> Hi,
>> 
>> I am trying to throw an error on a type mismatch through an assignment operator.
>> 
>>     ex = new 'Exception'
>>     ex['severity'] = .EXCEPT_ERROR
>>     ex['message'] = "Type mismatch in assignment!"
>> 
>> I can't find a away of leaving the user with a code line number is
>> this possible?
>> 
>> I have tried trying to grab '$/' to with no success any ideas?
> 
> Hi Robin,
> 
> Hmmm... Your code sample above is PIR, but $/ is Perl 6 syntax (for 
> output record separator, last I checked).

Actually it holds the Match object (which includes things like $0, $1
etc from the regex captures, as well as named captures)

Cheers,
Moritz


More information about the parrot-dev mailing list