J
julian
I am trying to grab parts perl from another script to print out. I
have a script called source and I want to grab all the actions when a
condition is met.
so using the following as a source script my main script looks for the
command "if ($State eq "start")" and I want to return the block of code
that would be run if that condition was meet in this case
{
foreach my $f (qw (jane))
{
print "hello";
}
}
How can I do this taking account that formatting might change and I
want to handel comented out {} and escaped {}
#source script
my $State = "none";
print $State;
if ($State eq "start")
{
foreach my $f (qw (jane))
{
print "hello";
}
}
if ($State eq "end"){
foreach my $f (qw (fred peter))
{
print "good bye";
}
}
have a script called source and I want to grab all the actions when a
condition is met.
so using the following as a source script my main script looks for the
command "if ($State eq "start")" and I want to return the block of code
that would be run if that condition was meet in this case
{
foreach my $f (qw (jane))
{
print "hello";
}
}
How can I do this taking account that formatting might change and I
want to handel comented out {} and escaped {}
#source script
my $State = "none";
print $State;
if ($State eq "start")
{
foreach my $f (qw (jane))
{
print "hello";
}
}
if ($State eq "end"){
foreach my $f (qw (fred peter))
{
print "good bye";
}
}