Putting code in a variable and running interactively?
From: Jimmy Phillips (sendto_at_spammers.com)
Date: 08/25/04
- Next message: Jürgen Exner: "Re: Putting code in a variable and running interactively?"
- Previous message: Jürgen Exner: "Re: Perl Question"
- Next in thread: Jürgen Exner: "Re: Putting code in a variable and running interactively?"
- Reply: Jürgen Exner: "Re: Putting code in a variable and running interactively?"
- Reply: nobull_at_mail.com: "Re: Putting code in a variable and running interactively?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 24 Aug 2004 20:44:55 -0500
I am fairly new to Perl so I wasn't real sure how to title this.
I want to build a regex interactively in a program and then run it. So
far I do it by writing it to a file along with the Perl envelope around it
then calling it from my program. Works ok but seems clunky. Then I found
a tutorial about executing perl code in a regular expression but so far it
hasn't quite worked the way I want.
So... Is it possible to put a legimate line of Perl code in a variable,
then (somehow) execute that variable. Sort of like so...
$z = "Print amount";
(execute) $z;
Or put another way. Build program B within program A then run program B
within the original program A?
If this was a standard programming environment like Builder or Kylix I
wouldn't even ask such a rediculous question, but in my so far brief
experience with Perl I haven't found much it won't to.
JP
- Next message: Jürgen Exner: "Re: Putting code in a variable and running interactively?"
- Previous message: Jürgen Exner: "Re: Perl Question"
- Next in thread: Jürgen Exner: "Re: Putting code in a variable and running interactively?"
- Reply: Jürgen Exner: "Re: Putting code in a variable and running interactively?"
- Reply: nobull_at_mail.com: "Re: Putting code in a variable and running interactively?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|