- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- Perl in Windows Environment Help
Operating System - Microsoft
1748047
Members
4662
Online
108757
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
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
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-01-2006 08:52 AM
08-01-2006 08:52 AM
Hi,
Being new to perl, I would like to get help with working in windows/dos environment on schedule basis (not execute manually from cmd):
1) do we need a batch file to execute the perl file?
2) does the perl need an extention as .pl?
3) what is the syntac on the first line of perl in windows:
#!C:\perl\bin\perl
or
#!/usr/bin/perl
(not in Unix environment!)
Any help is very appreciated!
Steven
Being new to perl, I would like to get help with working in windows/dos environment on schedule basis (not execute manually from cmd):
1) do we need a batch file to execute the perl file?
2) does the perl need an extention as .pl?
3) what is the syntac on the first line of perl in windows:
#!C:\perl\bin\perl
or
#!/usr/bin/perl
(not in Unix environment!)
Any help is very appreciated!
Steven
Steve
Solved! Go to Solution.
- Tags:
- Perl
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2006 09:13 AM
08-01-2006 09:13 AM
Solution
You should associate a .pl extension with perl.exe but that is not necessary. I assume that since you are asking this question under OB2/DP that this is an OB2/DP related question so there are a few things you have to do to make Perl work as a pre/post-exec script.
1) If you have installed Perl under Program Files, I suggest that you uninstall and install it under C:\Perl. This makes life simpler because your scripts and the data specifications don't have to be so careful about correctly quoting pathnames with embedded white space.
2) You actually have to copy 2 Perl files to your %OmniBack% bin directory (and once again, I suggest that you install OB2/DP in C:\OmniBack) so that you don't have to deal with white space. It's much easier to remove and reinstall DP that it is to deal with obscure scripting problems. In any event, you need to copy perl.exe and perl58.dll (or whatever version you are using) to the %OmniBack%\bin directory.
3) Your Perl script(s) also should be installed in the %OmniBack%\bin directory. (C:\OmniBack\bin on my Windows boxes).
4) Edit your data specification and add a line similar to this:
-pre_exec "perl.exe -I C:/Perl/lib -I C:/Perl/site/lib C:\OmniBack\bin\myscript.pl"
to the backup object.
This will execute myscript.pl as a pre-exec.
Make sure that your script explicitly exits with an appropriate return value (e.g. 0 if all is well).
1) If you have installed Perl under Program Files, I suggest that you uninstall and install it under C:\Perl. This makes life simpler because your scripts and the data specifications don't have to be so careful about correctly quoting pathnames with embedded white space.
2) You actually have to copy 2 Perl files to your %OmniBack% bin directory (and once again, I suggest that you install OB2/DP in C:\OmniBack) so that you don't have to deal with white space. It's much easier to remove and reinstall DP that it is to deal with obscure scripting problems. In any event, you need to copy perl.exe and perl58.dll (or whatever version you are using) to the %OmniBack%\bin directory.
3) Your Perl script(s) also should be installed in the %OmniBack%\bin directory. (C:\OmniBack\bin on my Windows boxes).
4) Edit your data specification and add a line similar to this:
-pre_exec "perl.exe -I C:/Perl/lib -I C:/Perl/site/lib C:\OmniBack\bin\myscript.pl"
to the backup object.
This will execute myscript.pl as a pre-exec.
Make sure that your script explicitly exits with an appropriate return value (e.g. 0 if all is well).
If it ain't broke, I can fix that.
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