in reply to if ($?variable_name)

Or possibly you don't really ask the right question. Because something like "$?" does indeed look quite perlish. But "if ($?variable_name)" does not make much sense to me.

$? is a special variable that contains the return code or error status of that last child spawned or forked by your program, for example by a `...` backticks command or by a system command. Maybe you should explain better your question.

Replies are listed 'Best First'.
Re^2: if ($?variable_name)
by abhisek09 (Initiate) on Jul 24, 2013 at 22:22 UTC
    The script which i am looking at has both the perl and tcsh interpreter definded. I am wondering it may be a tcsh syntax then as it does not fit the context . I think it means if the variable variable_name exists get in the if condition ,looking at the context . But not sure .. Thanks
      Seems you have the answer. The tcsh documentation says:
         $?name
         ${?name}
                     Substitutes the string `1' if name is set, `0' if it is not.
      
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ