in reply to Re: howto parse (or determining end) of a line of perl
in thread howto parse (or determining end) of a line of perl

Yikes!

Yeah, I could do that... did you catch the part about not rewriting a parser? *sigh*...

Why do it? I want to be able to enter input and see the result as I can in bash (as an example).

Sure I can exec code, but then I could print the vars from vars that received an assignment in another statement (all of the user-input code in my calc is done in a separate namespace, so vars in that namespace can be preserved.

PPI might allow me to do what I want, but it certainly doesn't look like a simple upgrade, but more like a redesign or such...

thanks for the pointer though, might be usable...

BTW as far as why I would want to display results after entering a line: remember the prog is still a calculator, like:

> pcalc pcalc V0.1.8: Type 'constants' to see constants (1)> constants Constants: Phi,Φ,phi,ɸ,pi,π,e,c,g = 1 (2)> sub area($){ my $radius=shift; 4*$radius*pi } (3)> area 1 = 12.566370614359173

Replies are listed 'Best First'.
Re^3: howto parse (or determining end) of a line of perl
by Anonymous Monk on Aug 25, 2016 at 01:22 UTC

    Yikes!

    Exactly!