eval not work

N

ngoc

Hi
My eval do not work. I do not know why?
eval {
system "rename _new.xml .xml *.xml";
};
die 'Can not change new to current data' if $@;

when no xml file exists. It should come to exception situation and print
out 'Can not change new to current data' and exit program. But it
print out the message 'No such file and directory' and go ahead to next
step.

Thanks
ngoc
 
A

A. Sinan Unur

ngoc said:
My eval do not work. I do not know why?
eval {
system "rename _new.xml .xml *.xml";
};
die 'Can not change new to current data' if $@;

when no xml file exists. It should come to exception situation and print
out 'Can not change new to current data' and exit program. But it
print out the message 'No such file and directory' and go ahead to next
step.

You are jumping to conclusions. eval works perfectly.

You just failed to read the documentation for system

perldoc -f system

Sinan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,082
Members
48,773
Latest member
Kaybee

Latest Threads

Top