I believe you are missing quotes. The argument of eval is a string to
be compiled and executed, as in  
      eval ('$y=slice ($x,"0,8,,")')
Regards,
Luis


On Wed, Aug 21, 2013 at 02:14:14PM +0000, Chris Marshall wrote:
> I don't have a working PDL but I mean using
> eval for exception trapping.  Try looking at
> the eval docs in perldoc -f eval or someone with
> a working example....
> 
> On Wed, Aug 21, 2013 at 1:51 PM, Ingo Schmid <[email protected]> wrote:
> > Chris,
> >
> > sorry, I get this. It never returns, just dies, apparently.
> >
> > pdl> help $x
> > This variable is Double D [2,6,1,4]            P            0.38KB
> > pdl> eval (slice ($x,'0,8,,'))
> >
> >
> > Runtime error: Stringizing problem: Slice cannot start or end above
> > limit.    eval {...} called at Basic/Core/Core.pm.PL (i.e. PDL::Core.pm)
> > line 2969
> >     PDL::string('PDL=SCALAR(0x4e242b0)', undef, '') called at (eval 581)
> > line 5
> >
> >
> >
> > On 08/21/2013 03:36 PM, Chris Marshall wrote:
> >> eval ?
> >>
> >> On Wed, Aug 21, 2013 at 9:20 AM, Ingo Schmid <[email protected]> wrote:
> >>> Hi,
> >>>
> >>> I want a user to enter a string defining a slice of a piddle to extract.
> >>>
> >>> Now when I call
> >>>
> >>>
> >>> $y=$x->slice($string) || barf "Not a valid slice\n";
> >>>
> >>> that does not catch it. How do I catch it?
> >>>
> >>> Ingo
> >>>
> >>> _______________________________________________
> >>> Perldl mailing list
> >>> [email protected]
> >>> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
> >>>
> >
> 
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

-- 

                                                                  o
W. Luis Mochán,                      | tel:(52)(777)329-1734     /<(*)
Instituto de Ciencias Físicas, UNAM  | fax:(52)(777)317-5388     `>/   /\
Apdo. Postal 48-3, 62251             |                           (*)/\/  \
Cuernavaca, Morelos, México          | [email protected]   /\_/\__/
GPG: DD344B85,  2ADC B65A 5499 C2D3 4A3B  93F3 AE20 0F5E DD34 4B85



_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to