Home: Perl Programming Help: Intermediate:
Converting shell to Perl found problem



digioleg54
User

Mar 22, 2017, 12:58 PM


Views: 3340
Converting shell to Perl found problem

I am converting shell to Perl scripts. In shell we have trap built in function. Perl has %SIG or sigtrap. I know it is using to catch signal. But I am not sure if I need it in my perl. Any advice?


FishMonger
Veteran / Moderator

Mar 22, 2017, 1:21 PM


Views: 3332
Re: [digioleg54] Converting shell to Perl found problem

It's impossible to answer that question without seeing any code or reasonable explanation of what your code needs to do.

It sounds like you're trying to do a literal 1to1 syntax conversion, which is never the proper thing to do.


digioleg54
User

Mar 22, 2017, 1:31 PM


Views: 3330
Re: [FishMonger] Converting shell to Perl found problem

shell script is just cleaning some directories.
I call another script, which is cleaning directory for example from files 60 dais old.


Laurent_R
Veteran / Moderator

Mar 23, 2017, 3:10 AM


Views: 3322
Re: [digioleg54] Converting shell to Perl found problem

We would still need more information about what you want to do, but my first feeling is that you most probably don't need to trap signals for your purpose.