- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- Perl Help in Windows Environment
Operating System - Microsoft
1753481
Members
4539
Online
108794
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО08-02-2006 03:32 AM
тАО08-02-2006 03:32 AM
Being new for Perl, I would like to seek help about using it on Windows platform:
1) what should the 1st line be in *.pl file:
#!/usr/bin/perl
or
#!C:\perl\bin\perl
or
the combination?
2) how to execute perl on schedule, not from cmd manually. could that be:
a) xxx.bat
b) inside xxx.bat --> perl replicate_auto.pl?
Any help is greatly appreciated!
Steven
1) what should the 1st line be in *.pl file:
#!/usr/bin/perl
or
#!C:\perl\bin\perl
or
the combination?
2) how to execute perl on schedule, not from cmd manually. could that be:
a) xxx.bat
b) inside xxx.bat --> perl replicate_auto.pl?
Any help is greatly appreciated!
Steven
Steve
Solved! Go to Solution.
- Tags:
- Perl
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2006 03:44 AM
тАО08-02-2006 03:44 AM
Solution
You should note that the "shebang" syntax has no meaning in a windows environment (unless you are running SFU -- Microsoft Services for UNIX --- and are running under a UNIX-like shell). Because it begins with '#', it is treated as a comment by Perl. I just leave my scripts as:
#!/usr/bin/perl -w so that they work as intended in UNIX land. Windows handles the association of a file to an executable in an entirely different way. Windows uses filename extensions (e.g. .pl) to automatically associate .pl files with Perl.exe. In UNIX, filename extensions are absolutely meaningless except for conventions and except for any associations that might be built into an application.
In Windows:
My Computer -> Tools -> Folder Options ->File Types is where the .pl to Perl association is done although that is typically is done for you when Perl is installed.
If you need to execute Perl in a cron-like manner then you need to use a cron-like tool. Pick one and use it.
You also asked this question in the OmniBack/Data Protector forum and there are some special rules for using Perl as a pre/post-exec command. See my response there.
#!/usr/bin/perl -w so that they work as intended in UNIX land. Windows handles the association of a file to an executable in an entirely different way. Windows uses filename extensions (e.g. .pl) to automatically associate .pl files with Perl.exe. In UNIX, filename extensions are absolutely meaningless except for conventions and except for any associations that might be built into an application.
In Windows:
My Computer -> Tools -> Folder Options ->File Types is where the .pl to Perl association is done although that is typically is done for you when Perl is installed.
If you need to execute Perl in a cron-like manner then you need to use a cron-like tool. Pick one and use it.
You also asked this question in the OmniBack/Data Protector forum and there are some special rules for using Perl as a pre/post-exec command. See my response there.
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2006 03:55 AM
тАО08-02-2006 03:55 AM
Re: Perl Help in Windows Environment
windows uses file associations based on the filename extentions, i.e. if you have your file associations set up right all you need is the .pl at the end of the file name for windows to know it is a perl file
#! is just another comment on windows
a .bat file is not necessary, but it is nice to use because you can redirect the output to log file such that you can review any error messages that might have occured
#! is just another comment on windows
a .bat file is not necessary, but it is nice to use because you can redirect the output to log file such that you can review any error messages that might have occured
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-02-2006 04:15 AM
тАО08-02-2006 04:15 AM
Re: Perl Help in Windows Environment
Hi Steven,
To address your second question: I would create a batch file that executes your perl code (e.g. "perl.exe foo.pl"). If you associate '.pl' files with 'perl.exe', you won't need the batch file. Then create a Scheduled Task.
Start->Settings->Control Panel->Scheduled Tasks->Add Scheduled Task
PCS
To address your second question: I would create a batch file that executes your perl code (e.g. "perl.exe foo.pl"). If you associate '.pl' files with 'perl.exe', you won't need the batch file. Then create a Scheduled Task.
Start->Settings->Control Panel->Scheduled Tasks->Add Scheduled Task
PCS
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP