Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

/usr/bin/perl -w?

by biochris (Beadle)
on Jun 20, 2005 at 19:53 UTC ( #468472=perlquestion: print w/replies, xml ) Need Help??
biochris has asked for the wisdom of the Perl Monks concerning the following question:

I try to run a logon perl script on RedHat Workstation 3. When I run a ps -ef I see my script as /usr/bin/perl -w? script_name Anyone knows why I get the question mark after the -w switch? Thank you

Replies are listed 'Best First'.
Re: /usr/bin/perl -w?
by ysth (Canon) on Jun 20, 2005 at 20:33 UTC
    Just at a guess, your script has a CR at the end of the shebang line?
      Thank you so much :)
Re: /usr/bin/perl -w?
by chas (Priest) on Jun 20, 2005 at 21:14 UTC
    And with regard to ysth's reply, I once noted that if my shebang line was #!/usr/bin/perl followed by a carriage return (due to editing the script on a Windows machine and then transferring to Linux), the script exited with an error that the command was not found. (Putting -w at the end of the line fixed the problem, because then the carriage return was ignored as an unknown option, I think.) You can check if the return is there by editing the script in binary mode with vi(m) or emacs, etc.
        Some people take the approach of creating a "/usr/bin/perl\r" link to /usr/bin/perl :)

        And Unix commands in general, too! Because of shell design and such, typing rm * in a directory which contains a file named -rf could delete everything (except the file -rf)! You should do rm -- * instead. I have actually been bitten by this once or twice, but luckily not by -rf but something more mundane.

      Looks like it worked. thanks so much
Re: /usr/bin/perl -w?
by aditya.singh (Acolyte) on Jun 22, 2005 at 09:36 UTC
    Check you shebang(#!) line. You probably have ^M or some other unprintable character there.
      Yep, that was the problem. Thanks

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://468472]
Approved by ikegami
Front-paged by ikegami
[marioroy]: At the Fransiscan monastery, got stuck up high in a tree from pruning and the chainsaw with large branch fell and broke the latter, but not me fortunately. Was stuck there for a while until a firetruck came by.
[Corion]: marioroy: So you live dangerously ...
[Lady_Aleena]: s/latter/ladder/; # ? marioroy
[karlgoethebier]: marioroy: Praise the Lord
[marioroy]: Well, that's why there must be angels around, invisible or not.
[marioroy]: Lady_Aleena yes, ladder.
[marioroy]: Corion, no not intentionally. not at all.
[Lady_Aleena]: /ne tries to decide whther or not to take a hammer to hubby's alarm clock.
[Lady_Aleena]: He never hears it.
[marioroy]: Back in HighSchool, I came late to Gym class. There was a fellow who was picked last, no team wanted him for racketball. So it was us two against everybody. I looked at him in the eye and said to let your body loose and let the powers to be help us win.

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2017-05-29 08:38 GMT
Find Nodes?
    Voting Booth?