- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: perl in unix editor
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-02-2011 06:47 AM
тАО05-02-2011 06:47 AM
perl in unix editor
WITHOUT THIS LINE OS DIDNOT RECOGONIZE the perl commands like "print". So please help me to run the perl program.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-02-2011 06:53 AM
тАО05-02-2011 06:53 AM
Re: perl in unix editor
Can you say which editor you are using?
# key is certainly permitted entry in vi for example.
Knowing what kind of system you are using, PC or X terminal or whatnot would also be extremely helpful.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-02-2011 07:14 AM
тАО05-02-2011 07:14 AM
Re: perl in unix editor
Can you say which _anything_ you are using?
> [...] unix os [...]
Not a very detailed description of anything.
uname -a
> [It does not allow me to enter '#' key]
What, exactly, is "It"? What, exactly, are
you doing? What, exactly, happens when you
do it?
Have you tried anything like, say:
perl your_file
?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-02-2011 10:55 AM
тАО05-02-2011 10:55 AM
Re: perl in unix editor
What is your stty setting for erase? "@" and "#" cause problems if you don't set these to non-default.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-02-2011 11:43 AM
тАО05-02-2011 11:43 AM
Re: perl in unix editor
You probably have not run a standard profile during your login. Standard profiles reset the stty settings for backspace and cancel from # and @ to backspace and CTRL-U. If you are using Xwindows, the default action in HP-UX is to silently ignore profiles (a very bad setting) so enable all profiles by running this command when you are logged in:
echo "*loginShell: true" >> $HOME/.Xdefaults
Then logout and login again. Now, your # key should work normally.
If you're not using Xwindows or the above doesn't fix the problem, your .profile files do not have the correct stty commands. Here is what you need:
stty erase "^H" kill "^U" intr "^C" eof "^D" -parity ixoff
stty susp \^Z dsusp \^Y
These are found in the standard .profiles:
/usr/newconfig/etc/skel/.profile
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-02-2011 11:49 AM
тАО05-02-2011 11:49 AM
Re: perl in unix editor
> How to run perl in unix through unix os. I am not able to write the line as #!/usr/local/bin/perl. [It does not allow me to enter '#' key]
You have a bigger problem than anything related to Perl.
Without the ability to specify a "she-bang" (otherwise known as an interpreter line) --- the '#!' your shell will think that it is the interpreter for anything you attempt to run. Of course, as Steven suggested, you can always specify the interpreter externally.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2011 02:27 AM
тАО05-03-2011 02:27 AM
Re: perl in unix editor
First look if it compiles.
$ /usr/local/bin/perl -cw /path/to/your/perlscript.pl
Then if no errors appear you can excute it by ommitiing the "-c" (compile only) option.
Strange, no one mentioned this.
But if you want to do any serious Perl hacking you simply can't do without the hashmark char. Just think about Perl single line comments, the array last element index sigil e.g. $#ary, or simply regex delimiter e.g. m#...#, s#...#...# etc