File: perlvms.html

package info (click to toggle)
perl-doc-html 5.24.0-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 38,756 kB
  • ctags: 26,472
  • sloc: xml: 36; makefile: 2
file content (1551 lines) | stat: -rw-r--r-- 104,862 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>perlvms - perldoc.perl.org</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta http-equiv="Content-Language" content="en-gb">
  <link rel="search" type="application/opensearchdescription+xml" title="Search perldoc.perl.org" href="/static/search.xml"/>
  <link href="static/css-20100830.css" rel="stylesheet" rev="stylesheet" type="text/css" media="screen">
  <link href="static/exploreperl.css" rel="stylesheet" rev="stylesheet" type="text/css">
</head>

<body onLoad="perldoc.startup();" onPageShow="if (event.persisted) perldoc.startup();">
    <div id="page">
      
      <div id="header">
	<div id="homepage_link">
	  <a href="index.html"></a>
	</div>
	<div id="strapline">
	  Perl Programming Documentation
	</div>
	<div id="download_link" class="download">
	  <a href="http://www.perl.org/get.html">Download Perl</a>
	</div>
	<div id="explore_link" class="download">
	  <a id="explore_anchor" href="#">Explore</a>
	</div>
      </div>
      
      <div id="body">
        <div id="left_column">
          <div class="side_group">
            
	    <div class="side_panel doc_panel">
              <p>Manual</p>
              <ul>
                <li><a href="index-overview.html">Overview</a>
                <li><a href="index-tutorials.html">Tutorials</a>
                <li><a href="index-faq.html">FAQs</a>
                <li><a href="index-history.html">History / Changes</a>
                <li><a href="index-licence.html">License</a>
              </ul>
            </div>
            <div class="side_panel doc_panel">
              <p>Reference</p>
              <ul>
                <li><a href="index-language.html">Language</a>
                <li><a href="index-functions.html">Functions</a>
                <li><a href="perlop.html">Operators</a>
                <li><a href="perlvar.html">Special Variables</a>
                <li><a href="index-pragmas.html">Pragmas</a>
                <li><a href="index-utilities.html">Utilities</a>
                <li><a href="index-internals.html">Internals</a>
                <li><a href="index-platforms.html">Platform Specific</a>
              </ul>
            </div>
            <div class="side_panel doc_panel">
              <p>Modules</p>
              <ul>
		<li>
		
                
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		
                  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		
                  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		    
		  
		
                  
		
                  
		
                  
		    
		  
		
                  
		
                  
		
		
                    <a href="index-modules-A.html">A</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-B.html">B</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-C.html">C</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-D.html">D</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-E.html">E</a>
                    
                      
                        <li>
                      
                    
                
                    <a href="index-modules-F.html">F</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-G.html">G</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-H.html">H</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-I.html">I</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-L.html">L</a>
                    
                      
                        <li>
                      
                    
                
                    <a href="index-modules-M.html">M</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-N.html">N</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-O.html">O</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-P.html">P</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-S.html">S</a>
                    
                      
                        <li>
                      
                    
                
                    <a href="index-modules-T.html">T</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-U.html">U</a>
                    
                      
                        &bull;
                      
                    
                
                    <a href="index-modules-X.html">X</a>
                    
                
              </ul>
            </div>
            
	      <div class="side_panel doc_panel">
		<p>Tools</p>
		<ul>
		  <li><a href="preferences.html">Preferences</a>
		</ul>
	      </div>
            
          </div>
        </div>
        <div id="centre_column">
          <div id="content_header">
            <div id="title_bar">
              <div id="page_name">
                <h1>perlvms</h1>
              </div>
              <div id="perl_version">
                Perl 5 version 22.0 documentation
              </div>
              <div class="page_links" id="page_links_top">
                <a href="#" onClick="toolbar.goToTop();return false;">Go to top</a>
		
              </div>
	      <div class="page_links" id="page_links_bottom">
		
                  <a href="#" id="page_index_toggle">Show page index</a> &bull;
		
                <a href="#" id="recent_pages_toggle">Show recent pages</a>		
	      </div>
	      <div id="search_form">
		<form action="search.html" method="GET" id="search">
		  <input type="text" name="q" id="search_box" alt="Search">
		</form>
	      </div>
            </div>
            <div id="breadcrumbs">
                
    <a href="index.html">Home</a> &gt;
    
      
        <a href="index-platforms.html">Platform specific</a> &gt;
      
    
    perlvms
  

            </div>
          </div>
          <div id="content_body">
	    <!--[if lt IE 7]>
 <div class="noscript">
   <p>
     <strong>It looks like you're using Internet Explorer 6. This is a very old
     browser which does not offer full support for modern websites.</strong>
   </p>
   <p>
     Unfortunately this means that this website will not work on
     your computer.
   </p>
   <p>
     Don't miss out though! To view the site (and get a better experience from
     many other websites), simply upgrade to
     <a href="http://www.microsoft.com/windows/Internet-explorer/default.aspx">Internet
Explorer 8</a>
     or download an alternative browser such as
     <a href="http://www.mozilla.com/en-US/firefox/firefox.html">Firefox</a>,
     <a href="http://www.apple.com/safari/download/">Safari</a>, or
     <a href="http://www.google.co.uk/chrome">Google Chrome</a>.
   </p>
   <p>
     All of these browsers are free. If you're using a PC at work, you may
     need to contact your IT administrator.
   </p>
 </div>
<![endif]-->
	    <noscript>
	      <div class="noscript">
	      <p>
                <strong>Please note: Many features of this site require JavaScript. You appear to have JavaScript disabled,
	        or are running a non-JavaScript capable web browser.</strong>
	      </p>
	      <p>
		To get the best experience, please enable JavaScript or download a modern web browser such as <a href="http://www.microsoft.com/windows/Internet-explorer/default.aspx">Internet Explorer 8</a>, <a href="http://www.mozilla.com/en-US/firefox/firefox.html">Firefox</a>, <a href="http://www.apple.com/safari/download/">Safari</a>, or <a href="http://www.google.co.uk/chrome">Google Chrome</a>.
              </p>
	      </div>
	    </noscript>

	    <div id="recent_pages" class="hud_container">
	      <div id="recent_pages_header" class="hud_header">
		<div id="recent_pages_close" class="hud_close"><a href="#" onClick="recentPages.hide();return false;"></a></div>
		<div id="recent_pages_title" class="hud_title"><span class="hud_span_top">Recently read</span></div>
		<div id="recent_pages_topright" class="hud_topright"></div>
	      </div>
	      <div id="recent_pages_content" class="hud_content">
	      </div>
	      <div id="recent_pages_footer" class="hud_footer">
		<div id="recent_pages_bottomleft" class="hud_bottomleft"></div>
		<div id="recent_pages_bottom" class="hud_bottom"><span class="hud_span_bottom"></span></div>
		<div id="recent_pages_resize" class="hud_resize"></div>
	      </div>
	    </div>
  
	    <div id="from_search"></div>
            <h1>perlvms</h1>


  <!--    -->
<ul><li><a href="#NAME">NAME</a><li><a href="#DESCRIPTION">DESCRIPTION</a><li><a href="#Installation">Installation</a><li><a href="#Organization-of-Perl-Images">Organization of Perl Images</a><ul><li><a href="#Core-Images">Core Images</a><li><a href="#Perl-Extensions">Perl Extensions</a><li><a href="#Installing-static-extensions">Installing static extensions</a><li><a href="#Installing-dynamic-extensions">Installing dynamic extensions</a></ul><li><a href="#File-specifications">File specifications</a><ul><li><a href="#Syntax">Syntax</a><li><a href="#Filename-Case">Filename Case</a><li><a href="#Symbolic-Links">Symbolic Links</a><li><a href="#Wildcard-expansion">Wildcard expansion</a><li><a href="#Pipes">Pipes</a></ul><li><a href="#PERL5LIB-and-PERLLIB">PERL5LIB and PERLLIB</a><li><a href="#The-Perl-Forked-Debugger">The Perl Forked Debugger</a><li><a href="#PERL_VMS_EXCEPTION_DEBUG">PERL_VMS_EXCEPTION_DEBUG</a><li><a href="#Command-line">Command line</a><ul><li><a href="#I%2fO-redirection-and-backgrounding">I/O redirection and backgrounding</a><li><a href="#Command-line-switches">Command line switches</a></ul><li><a href="#Perl-functions">Perl functions</a><li><a href="#Perl-variables">Perl variables</a><li><a href="#Standard-modules-with-VMS-specific-differences">Standard modules with VMS-specific differences</a><ul><li><a href="#SDBM_File">SDBM_File</a></ul><li><a href="#Revision-date">Revision date</a><li><a href="#AUTHOR">AUTHOR</a></ul><a name="NAME"></a><h1>NAME</h1>
<p>perlvms - VMS-specific documentation for Perl</p>
<a name="DESCRIPTION"></a><h1>DESCRIPTION</h1>
<p>Gathered below are notes describing details of Perl 5's 
behavior on VMS.  They are a supplement to the regular Perl 5 
documentation, so we have focussed on the ways in which Perl 
5 functions differently under VMS than it does under Unix, 
and on the interactions between Perl and the rest of the 
operating system.  We haven't tried to duplicate complete 
descriptions of Perl features from the main Perl 
documentation, which can be found in the <i>[.pod]</i> 
subdirectory of the Perl distribution.</p>
<p>We hope these notes will save you from confusion and lost 
sleep when writing Perl scripts on VMS.  If you find we've 
missed something you think should appear here, please don't 
hesitate to drop a line to vmsperl@perl.org.</p>
<a name="Installation"></a><h1>Installation</h1>
<p>Directions for building and installing Perl 5 can be found in 
the file <i>README.vms</i> in the main source directory of the 
Perl distribution.</p>
<a name="Organization-of-Perl-Images"></a><h1>Organization of Perl Images</h1>
<a name="Core-Images"></a><h2>Core Images</h2>
<p>During the build process, three Perl images are produced.
<i>Miniperl.Exe</i> is an executable image which contains all of
the basic functionality of Perl, but cannot take advantage of
Perl XS extensions and has a hard-wired list of library locations
for loading pure-Perl modules.  It is used extensively to build and
test Perl and various extensions, but is not installed.</p>
<p>Most of the complete Perl resides in the shareable image <i>PerlShr.Exe</i>,
which provides a core to which the Perl executable image and all Perl
extensions are linked. It is generally located via the logical name
<i>PERLSHR</i>.  While it's possible to put the image in <i>SYS$SHARE</i> to
make it loadable, that's not recommended. And while you may wish to
INSTALL the image for performance reasons, you should not install it
with privileges; if you do, the result will not be what you expect as
image privileges are disabled during Perl start-up.</p>
<p>Finally, <i>Perl.Exe</i> is an executable image containing the main
entry point for Perl, as well as some initialization code.  It
should be placed in a public directory, and made world executable.
In order to run Perl with command line arguments, you should
define a foreign command to invoke this image.</p>
<a name="Perl-Extensions"></a><h2>Perl Extensions</h2>
<p>Perl extensions are packages which provide both XS and Perl code
to add new functionality to perl.  (XS is a meta-language which
simplifies writing C code which interacts with Perl, see
<a href="perlxs.html">perlxs</a> for more details.)  The Perl code for an
extension is treated like any other library module - it's
made available in your script through the appropriate
<code class="inline"><a class="l_k" href="functions/use.html">use</a></code> or <code class="inline"><a class="l_k" href="functions/require.html">require</a></code> statement, and usually defines a Perl
package containing the extension.</p>
<p>The portion of the extension provided by the XS code may be
connected to the rest of Perl in either of two ways.  In the
<b>static</b> configuration, the object code for the extension is
linked directly into <i>PerlShr.Exe</i>, and is initialized whenever
Perl is invoked.  In the <b>dynamic</b> configuration, the extension's
machine code is placed into a separate shareable image, which is
mapped by Perl's DynaLoader when the extension is <code class="inline"><a class="l_k" href="functions/use.html">use</a></code>d or
<code class="inline"><a class="l_k" href="functions/require.html">require</a></code>d in your script.  This allows you to maintain the
extension as a separate entity, at the cost of keeping track of the
additional shareable image.  Most extensions can be set up as either
static or dynamic.</p>
<p>The source code for an extension usually resides in its own
directory.  At least three files are generally provided:
<i>Extshortname</i><i>.xs</i> (where <i>Extshortname</i> is the portion of
the extension's name following the last <code class="inline"><span class="w">::</span></code>
), containing
the XS code, <i>Extshortname</i><i>.pm</i>, the Perl library module
for the extension, and <i>Makefile.PL</i>, a Perl script which uses
the <code class="inline"><span class="w">MakeMaker</span></code>
 library modules supplied with Perl to generate
a <i>Descrip.MMS</i> file for the extension.</p>
<a name="Installing-static-extensions"></a><h2>Installing static extensions</h2>
<p>Since static extensions are incorporated directly into
<i>PerlShr.Exe</i>, you'll have to rebuild Perl to incorporate a
new extension.  You should edit the main <i>Descrip.MMS</i> or <i>Makefile</i>
you use to build Perl, adding the extension's name to the <code class="inline"><span class="w">ext</span></code>

macro, and the extension's object file to the <code class="inline"><span class="w">extobj</span></code>
 macro.
You'll also need to build the extension's object file, either
by adding dependencies to the main <i>Descrip.MMS</i>, or using a
separate <i>Descrip.MMS</i> for the extension.  Then, rebuild
<i>PerlShr.Exe</i> to incorporate the new code.</p>
<p>Finally, you'll need to copy the extension's Perl library
module to the <i>[.</i><i>Extname</i><i>]</i> subdirectory under one
of the directories in <code class="inline"><span class="i">@INC</span></code>
, where <i>Extname</i> is the name
of the extension, with all <code class="inline"><span class="w">::</span></code>
 replaced by <code class="inline">.</code> (e.g.
the library module for extension Foo::Bar would be copied
to a <i>[.Foo.Bar]</i> subdirectory).</p>
<a name="Installing-dynamic-extensions"></a><h2>Installing dynamic extensions</h2>
<p>In general, the distributed kit for a Perl extension includes
a file named Makefile.PL, which is a Perl program which is used
to create a <i>Descrip.MMS</i> file which can be used to build and
install the files required by the extension.  The kit should be
unpacked into a directory tree <b>not</b> under the main Perl source
directory, and the procedure for building the extension is simply</p>
<pre class="verbatim"><ol><li>    $ perl Makefile.PL  ! Create Descrip.MMS</li><li>    $ mmk               ! Build necessary files</li><li>    $ mmk test          ! Run test code, if supplied</li><li>    $ mmk install       ! Install into public Perl tree</li></ol></pre><p>VMS support for this process in the current release of Perl
is sufficient to handle most extensions.  (See the MakeMaker
documentation for more details on installation options for
extensions.)</p>
<ul>
<li>
<p>the <i>[.Lib.Auto.</i><i>Arch</i><i>$PVers</i><i>Extname</i><i>]</i> subdirectory
of one of the directories in <code class="inline"><span class="i">@INC</span></code>
 (where <i>PVers</i>
is the version of Perl you're using, as supplied in <code class="inline"><span class="i">$]</span></code>
,
with '.' converted to '_'), or</p>
</li>
<li>
<p>one of the directories in <code class="inline"><span class="i">@INC</span></code>
, or</p>
</li>
<li>
<p>a directory which the extensions Perl library module
passes to the DynaLoader when asking it to map
the shareable image, or</p>
</li>
<li>
<p><i>Sys$Share</i> or <i>Sys$Library</i>.</p>
</li>
</ul>
<p>If the shareable image isn't in any of these places, you'll need
to define a logical name <i>Extshortname</i>, where <i>Extshortname</i>
is the portion of the extension's name after the last <code class="inline"><span class="w">::</span></code>
, which
translates to the full file specification of the shareable image.</p>
<a name="File-specifications"></a><h1>File specifications</h1>
<a name="Syntax"></a><h2>Syntax</h2>
<p>We have tried to make Perl aware of both VMS-style and Unix-style file
specifications wherever possible.  You may use either style, or both,
on the command line and in scripts, but you may not combine the two
styles within a single file specification.  VMS Perl interprets Unix
pathnames in much the same way as the CRTL (<i>e.g.</i> the first component
of an absolute path is read as the device name for the VMS file
specification).  There are a set of functions provided in the
<code class="inline"><span class="w">VMS::Filespec</span></code>
 package for explicit interconversion between VMS and
Unix syntax; its documentation provides more details.</p>
<p>We've tried to minimize the dependence of Perl library
modules on Unix syntax, but you may find that some of these,
as well as some scripts written for Unix systems, will
require that you use Unix syntax, since they will assume that
'/' is the directory separator, <i>etc.</i>  If you find instances
of this in the Perl distribution itself, please let us know,
so we can try to work around them.</p>
<p>Also when working on Perl programs on VMS, if you need a syntax
in a specific operating system format, then you need either to
check the appropriate DECC$ feature logical, or call a conversion
routine to force it to that format.</p>
<p>The feature logical name DECC$FILENAME_UNIX_REPORT modifies traditional
Perl behavior in the conversion of file specifications from Unix to VMS
format in order to follow the extended character handling rules now
expected by the CRTL.  Specifically, when this feature is in effect, the
<code class="inline">./.../</code> in a Unix path is now translated to <code class="inline">[.^.^.^.]</code> instead of
the traditional VMS <code class="inline"><span class="s">[</span>...<span class="s">]</span></code>
.  To be compatible with what MakeMaker
expects, if a VMS path cannot be translated to a Unix path, it is
passed through unchanged, so <code class="inline"><span class="i">unixify</span><span class="s">(</span><span class="q">&quot;[...]&quot;</span><span class="s">)</span></code>
 will return <code class="inline"><span class="s">[</span>...<span class="s">]</span></code>
.</p>
<p>There are several ambiguous cases where a conversion routine cannot
determine whether an input filename is in Unix format or in VMS format,
since now both VMS and Unix file specifications may have characters in
them that could be mistaken for syntax delimiters of the other type. So
some pathnames simply cannot be used in a mode that allows either type
of pathname to be present.  Perl will tend to assume that an ambiguous
filename is in Unix format.</p>
<p>Allowing "." as a version delimiter is simply incompatible with
determining whether a pathname is in VMS format or in Unix format with
extended file syntax.  There is no way to know whether "perl-5.8.6" is a
Unix "perl-5.8.6" or a VMS "perl-5.8;6" when passing it to unixify() or
vmsify().</p>
<p>The DECC$FILENAME_UNIX_REPORT logical name controls how Perl interprets
filenames to the extent that Perl uses the CRTL internally for many
purposes, and attempts to follow CRTL conventions for reporting
filenames.  The DECC$FILENAME_UNIX_ONLY feature differs in that it
expects all filenames passed to the C run-time to be already in Unix
format.  This feature is not yet supported in Perl since Perl uses
traditional OpenVMS file specifications internally and in the test
harness, and it is not yet clear whether this mode will be useful or
useable.  The feature logical name DECC$POSIX_COMPLIANT_PATHNAMES is new
with the RMS Symbolic Link SDK and included with OpenVMS v8.3, but is
not yet supported in Perl.</p>
<a name="Filename-Case"></a><h2>Filename Case</h2>
<p>Perl enables DECC$EFS_CASE_PRESERVE and DECC$ARGV_PARSE_STYLE by
default.  Note that the latter only takes effect when extended parse
is set in the process in which Perl is running.  When these features
are explicitly disabled in the environment or the CRTL does not support
them, Perl follows the traditional CRTL behavior of downcasing command-line
arguments and returning file specifications in lower case only.</p>
<p><i>N. B.</i>  It is very easy to get tripped up using a mixture of other
programs, external utilities, and Perl scripts that are in varying
states of being able to handle case preservation.  For example, a file
created by an older version of an archive utility or a build utility
such as MMK or MMS may generate a filename in all upper case even on an
ODS-5 volume.  If this filename is later retrieved by a Perl script or
module in a case preserving environment, that upper case name may not
match the mixed-case or lower-case expectations of the Perl code.  Your
best bet is to follow an all-or-nothing approach to case preservation:
either don't use it at all, or make sure your entire toolchain and
application environment support and use it.</p>
<p>OpenVMS Alpha v7.3-1 and later and all version of OpenVMS I64 support
case sensitivity as a process setting (see <code class="inline"><span class="w">SET</span> <span class="w">PROCESS</span>
/<span class="w">CASE_LOOKUP</span>=<span class="w">SENSITIVE</span></code>
). Perl does not currently support case
sensitivity on VMS, but it may in the future, so Perl programs should
use the <code class="inline"><span class="w">File::Spec</span><span class="w">-&gt;case_tolerant</span></code>
 method to determine the state, and
not the <code class="inline"><span class="i">$^O</span></code>
 variable.</p>
<a name="Symbolic-Links"></a><h2>Symbolic Links</h2>
<p>When built on an ODS-5 volume with symbolic links enabled, Perl by
default supports symbolic links when the requisite support is available
in the filesystem and CRTL (generally 64-bit OpenVMS v8.3 and later). 
There are a number of limitations and caveats to be aware of when
working with symbolic links on VMS.  Most notably, the target of a valid
symbolic link must be expressed as a Unix-style path and it must exist
on a volume visible from your POSIX root (see the <code class="inline"><span class="w">SHOW</span> <span class="w">ROOT</span></code>
 command
in DCL help).  For further details on symbolic link capabilities and
requirements, see chapter 12 of the CRTL manual that ships with OpenVMS
v8.3 or later.</p>
<a name="Wildcard-expansion"></a><h2>Wildcard expansion</h2>
<p>File specifications containing wildcards are allowed both on 
the command line and within Perl globs (e.g. <code class="inline"><span class="q">&lt;*.c&gt;</span></code>
).  If
the wildcard filespec uses VMS syntax, the resultant 
filespecs will follow VMS syntax; if a Unix-style filespec is 
passed in, Unix-style filespecs will be returned.
Similar to the behavior of wildcard globbing for a Unix shell,
one can escape command line wildcards with double quotation
marks <code class="inline">"</code> around a perl program command line argument.  However,
owing to the stripping of <code class="inline">"</code> characters carried out by the C
handling of argv you will need to escape a construct such as
this one (in a directory containing the files <i>PERL.C</i>, <i>PERL.EXE</i>,
<i>PERL.H</i>, and <i>PERL.OBJ</i>):</p>
<pre class="verbatim"><ol><li>    $ perl -e "print join(' ',@ARGV)" perl.*</li><li>    perl.c perl.exe perl.h perl.obj</li></ol></pre><p>in the following triple quoted manner:</p>
<pre class="verbatim"><ol><li>    $ perl -e "print join(' ',@ARGV)" """perl.*"""</li><li>    perl.*</li></ol></pre><p>In both the case of unquoted command line arguments or in calls
to <code class="inline"><a class="l_k" href="functions/glob.html">glob()</a></code> VMS wildcard expansion is performed. (csh-style
wildcard expansion is available if you use <code class="inline"><span class="w">File::Glob::glob</span></code>
.)
If the wildcard filespec contains a device or directory 
specification, then the resultant filespecs will also contain 
a device and directory; otherwise, device and directory 
information are removed.  VMS-style resultant filespecs will 
contain a full device and directory, while Unix-style 
resultant filespecs will contain only as much of a directory 
path as was present in the input filespec.  For example, if 
your default directory is Perl_Root:[000000], the expansion 
of <code class="inline">[.t]*.*</code> will yield filespecs  like 
"perl_root:[t]base.dir", while the expansion of <code class="inline"><span class="w">t</span><span class="q">/*/</span>*</code>
 will 
yield filespecs like "t/base.dir".  (This is done to match 
the behavior of glob expansion performed by Unix shells.)</p>
<p>Similarly, the resultant filespec will contain the file version
only if one was present in the input filespec.</p>
<a name="Pipes"></a><h2>Pipes</h2>
<p>Input and output pipes to Perl filehandles are supported; the 
"file name" is passed to lib$spawn() for asynchronous 
execution.  You should be careful to close any pipes you have 
opened in a Perl script, lest you leave any "orphaned" 
subprocesses around when Perl exits.</p>
<p>You may also use backticks to invoke a DCL subprocess, whose 
output is used as the return value of the expression.  The 
string between the backticks is handled as if it were the
argument to the <code class="inline"><a class="l_k" href="functions/system.html">system</a></code> operator (see below).  In this case,
Perl will wait for the subprocess to complete before continuing.</p>
<p>The mailbox (MBX) that perl can create to communicate with a pipe
defaults to a buffer size of 8192 on 64-bit systems, 512 on VAX.  The
default buffer size is adjustable via the logical name PERL_MBX_SIZE
provided that the value falls between 128 and the SYSGEN parameter
MAXBUF inclusive.  For example, to set the mailbox size to 32767 use
<code class="inline"><span class="i">$ENV</span>{<span class="q">&#39;PERL_MBX_SIZE&#39;</span>} = <span class="n">32767</span><span class="sc">;</span></code>
 and then open and use pipe constructs. 
An alternative would be to issue the command:</p>
<pre class="verbatim"><ol><li>    $ Define PERL_MBX_SIZE 32767</li></ol></pre><p>before running your wide record pipe program.  A larger value may
improve performance at the expense of the BYTLM UAF quota.</p>
<a name="PERL5LIB-and-PERLLIB"></a><h1>PERL5LIB and PERLLIB</h1>
<p>The PERL5LIB and PERLLIB logical names work as documented in <a href="perl.html">perl</a>,
except that the element separator is '|' instead of ':'.  The
directory specifications may use either VMS or Unix syntax.</p>
<a name="The-Perl-Forked-Debugger"></a><h1>The Perl Forked Debugger</h1>
<p>The Perl forked debugger places the debugger commands and output in a
separate X-11 terminal window so that commands and output from multiple
processes are not mixed together.</p>
<p>Perl on VMS supports an emulation of the forked debugger when Perl is
run on a VMS system that has X11 support installed.</p>
<p>To use the forked debugger, you need to have the default display set to an
X-11 Server and some environment variables set that Unix expects.</p>
<p>The forked debugger requires the environment variable <code class="inline"><span class="w">TERM</span></code>
 to be <code class="inline"><span class="w">xterm</span></code>
,
and the environment variable <code class="inline"><span class="w">DISPLAY</span></code>
 to exist.  <code class="inline"><span class="w">xterm</span></code>
 must be in
lower case.</p>
<pre class="verbatim"><ol><li>  $define TERM "xterm"</li><li></li><li>  $define DISPLAY "hostname:0.0"</li></ol></pre><p>Currently the value of <code class="inline"><span class="w">DISPLAY</span></code>
 is ignored.  It is recommended that it be set
to be the hostname of the display, the server and screen in Unix notation.  In
the future the value of DISPLAY may be honored by Perl instead of using the
default display.</p>
<p>It may be helpful to always use the forked debugger so that script I/O is
separated from debugger I/O.  You can force the debugger to be forked by
assigning a value to the logical name &lt;PERLDB_PIDS&gt; that is not a process
identification number.</p>
<pre class="verbatim"><ol><li>  $define PERLDB_PIDS XXXX</li></ol></pre><a name="PERL_VMS_EXCEPTION_DEBUG"></a><h1>PERL_VMS_EXCEPTION_DEBUG</h1>
<p>The PERL_VMS_EXCEPTION_DEBUG being defined as "ENABLE" will cause the VMS
debugger to be invoked if a fatal exception that is not otherwise
handled is raised.  The purpose of this is to allow debugging of
internal Perl problems that would cause such a condition.</p>
<p>This allows the programmer to look at the execution stack and variables to
find out the cause of the exception.  As the debugger is being invoked as
the Perl interpreter is about to do a fatal exit, continuing the execution
in debug mode is usually not practical.</p>
<p>Starting Perl in the VMS debugger may change the program execution
profile in a way that such problems are not reproduced.</p>
<p>The <code class="inline"><a class="l_k" href="functions/kill.html">kill</a></code> function can be used to test this functionality from within
a program.</p>
<p>In typical VMS style, only the first letter of the value of this logical
name is actually checked in a case insensitive mode, and it is considered
enabled if it is the value "T","1" or "E".</p>
<p>This logical name must be defined before Perl is started.</p>
<a name="Command-line"></a><h1>Command line</h1>
<a name="I%2fO-redirection-and-backgrounding"></a><h2>I/O redirection and backgrounding</h2>
<p>Perl for VMS supports redirection of input and output on the 
command line, using a subset of Bourne shell syntax:</p>
<ul>
<li>
<p><code class="inline">&lt;<span class="w">file</span></code>
 reads stdin from <code class="inline"><span class="w">file</span></code>
,</p>
</li>
<li>
<p><code class="inline">&gt;file</code> writes stdout to <code class="inline"><span class="w">file</span></code>
,</p>
</li>
<li>
<p><code class="inline">&gt;&gt;<span class="w">file</span></code>
 appends stdout to <code class="inline"><span class="w">file</span></code>
,</p>
</li>
<li>
<p><code class="inline"><span class="n">2</span>&gt;<span class="w">file</span></code>
 writes stderr to <code class="inline"><span class="w">file</span></code>
,</p>
</li>
<li>
<p><code class="inline"><span class="n">2</span>&gt;&gt;<span class="w">file</span></code>
 appends stderr to <code class="inline"><span class="w">file</span></code>
, and</p>
</li>
<li>
<p><code class="inline"><span class="n">2</span>&gt;<span class="i">&amp;1</span></code>
 redirects stderr to stdout.</p>
</li>
</ul>
<p>In addition, output may be piped to a subprocess, using the  
character '|'.  Anything after this character on the command 
line is passed to a subprocess for execution; the subprocess 
takes the output of Perl as its input.</p>
<p>Finally, if the command line ends with '&amp;', the entire 
command is run in the background as an asynchronous 
subprocess.</p>
<a name="Command-line-switches"></a><h2>Command line switches</h2>
<p>The following command line switches behave differently under
VMS than described in <a href="perlrun.html">perlrun</a>.  Note also that in order
to pass uppercase switches to Perl, you need to enclose
them in double-quotes on the command line, since the CRTL
downcases all unquoted strings.</p>
<p>On newer 64 bit versions of OpenVMS, a process setting now
controls if the quoting is needed to preserve the case of
command line arguments.</p>
<ul>
<li><a name="-i"></a><b>-i</b>
<p>If the <code class="inline">-<span class="w">i</span></code>
 switch is present but no extension for a backup
copy is given, then inplace editing creates a new version of
a file; the existing copy is not deleted.  (Note that if
an extension is given, an existing file is renamed to the backup
file, as is the case under other operating systems, so it does
not remain as a previous version under the original filename.)</p>
</li>
<li><a name="-S"></a><b>-S</b>
<p>If the <code class="inline"><span class="q">&quot;-S&quot;</span></code>
 or <code class="inline">-<span class="q">&quot;S&quot;</span></code>
 switch is present <i>and</i> the script
name does not contain a directory, then Perl translates the
logical name DCL$PATH as a searchlist, using each translation
as a directory in which to look for the script.  In addition,
if no file type is specified, Perl looks in each directory
for a file matching the name specified, with a blank type,
a type of <i>.pl</i>, and a type of <i>.com</i>, in that order.</p>
</li>
<li><a name="-u"></a><b>-u</b>
<p>The <code class="inline">-u</code>
 switch causes the VMS debugger to be invoked
after the Perl program is compiled, but before it has
run.  It does not create a core dump file.</p>
</li>
</ul>
<a name="Perl-functions"></a><h1>Perl functions</h1>
<p>As of the time this document was last revised, the following 
Perl functions were implemented in the VMS port of Perl 
(functions marked with * are discussed in more detail below):</p>
<pre class="verbatim"><ol><li>    <span class="w">file</span> <span class="w">tests</span>*<span class="cm">,</span> <a class="l_k" href="functions/abs.html">abs</a><span class="cm">,</span> <a class="l_k" href="functions/alarm.html">alarm</a><span class="cm">,</span> <span class="w">atan</span><span class="cm">,</span> <span class="w">backticks</span>*<span class="cm">,</span> <a class="l_k" href="functions/binmode.html">binmode</a><span class="i">*,</span> <a class="l_k" href="functions/bless.html">bless</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/caller.html">caller</a><span class="cm">,</span> <a class="l_k" href="functions/chdir.html">chdir</a><span class="cm">,</span> <a class="l_k" href="functions/chmod.html">chmod</a><span class="cm">,</span> <a class="l_k" href="functions/chown.html">chown</a><span class="cm">,</span> <a class="l_k" href="functions/chomp.html">chomp</a><span class="cm">,</span> <a class="l_k" href="functions/chop.html">chop</a><span class="cm">,</span> <a class="l_k" href="functions/chr.html">chr</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/close.html">close</a><span class="cm">,</span> <a class="l_k" href="functions/closedir.html">closedir</a><span class="cm">,</span> <a class="l_k" href="functions/cos.html">cos</a><span class="cm">,</span> <a class="l_k" href="functions/crypt.html">crypt</a><span class="i">*,</span> <a class="l_k" href="functions/defined.html">defined</a><span class="cm">,</span> <a class="l_k" href="functions/delete.html">delete</a><span class="cm">,</span> <a class="l_k" href="functions/die.html">die</a><span class="cm">,</span> <a class="l_k" href="functions/do.html">do</a><span class="cm">,</span> <a class="l_k" href="functions/dump.html">dump</a><span class="i">*,</span> </li><li>    <a class="l_k" href="functions/each.html">each</a><span class="cm">,</span> <a class="l_k" href="functions/endgrent.html">endgrent</a><span class="cm">,</span> <a class="l_k" href="functions/endpwent.html">endpwent</a><span class="cm">,</span> <a class="l_k" href="functions/eof.html">eof</a><span class="cm">,</span> <a class="l_k" href="functions/eval.html">eval</a><span class="cm">,</span> <a class="l_k" href="functions/exec.html">exec</a><span class="i">*,</span> <a class="l_k" href="functions/exists.html">exists</a><span class="cm">,</span> <a class="l_k" href="functions/exit.html">exit</a><span class="cm">,</span> <a class="l_k" href="functions/exp.html">exp</a><span class="cm">,</span> </li><li>    <a class="l_k" href="functions/fileno.html">fileno</a><span class="cm">,</span> <a class="l_k" href="functions/flock.html">flock</a>  <a class="l_k" href="functions/getc.html">getc</a><span class="cm">,</span> <a class="l_k" href="functions/getgrent.html">getgrent</a>*<span class="cm">,</span> <a class="l_k" href="functions/getgrgid.html">getgrgid</a><span class="i">*,</span> <a class="l_k" href="functions/getgrnam.html">getgrnam</a><span class="cm">,</span> <a class="l_k" href="functions/getlogin.html">getlogin</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/getppid.html">getppid</a><span class="cm">,</span> <a class="l_k" href="functions/getpwent.html">getpwent</a>*<span class="cm">,</span> <a class="l_k" href="functions/getpwnam.html">getpwnam</a><span class="i">*,</span> <a class="l_k" href="functions/getpwuid.html">getpwuid</a><span class="i">*,</span> <a class="l_k" href="functions/glob.html">glob</a><span class="cm">,</span> <a class="l_k" href="functions/gmtime.html">gmtime</a><span class="i">*,</span> <a class="l_k" href="functions/goto.html">goto</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/grep.html">grep</a><span class="cm">,</span> <a class="l_k" href="functions/hex.html">hex</a><span class="cm">,</span> <a class="l_k" href="functions/ioctl.html">ioctl</a><span class="cm">,</span> <span class="w">import</span><span class="cm">,</span> <a class="l_k" href="functions/index.html">index</a><span class="cm">,</span> <a class="l_k" href="functions/int.html">int</a><span class="cm">,</span> <a class="l_k" href="functions/join.html">join</a><span class="cm">,</span> <a class="l_k" href="functions/keys.html">keys</a><span class="cm">,</span> <a class="l_k" href="functions/kill.html">kill</a><span class="i">*,</span></li><li>    <a class="l_k" href="functions/last.html">last</a><span class="cm">,</span> <a class="l_k" href="functions/lc.html">lc</a><span class="cm">,</span> <a class="l_k" href="functions/lcfirst.html">lcfirst</a><span class="cm">,</span> <span class="w">lchown</span>*<span class="cm">,</span> <a class="l_k" href="functions/length.html">length</a><span class="cm">,</span> <a class="l_k" href="functions/link.html">link</a><span class="i">*,</span> <a class="l_k" href="functions/local.html">local</a><span class="cm">,</span> <a class="l_k" href="functions/localtime.html">localtime</a><span class="cm">,</span> <a class="l_k" href="functions/log.html">log</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/lstat.html">lstat</a><span class="cm">,</span> <span class="q">m//</span><span class="cm">,</span> <a class="l_k" href="functions/map.html">map</a><span class="cm">,</span> <a class="l_k" href="functions/mkdir.html">mkdir</a><span class="cm">,</span> <a class="l_k" href="functions/my.html">my</a><span class="cm">,</span> <a class="l_k" href="functions/next.html">next</a><span class="cm">,</span> <a class="l_k" href="functions/no.html">no</a><span class="cm">,</span> <a class="l_k" href="functions/oct.html">oct</a><span class="cm">,</span> <a class="l_k" href="functions/open.html">open</a><span class="cm">,</span> <a class="l_k" href="functions/opendir.html">opendir</a><span class="cm">,</span> <a class="l_k" href="functions/ord.html">ord</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/pack.html">pack</a><span class="cm">,</span> <a class="l_k" href="functions/pipe.html">pipe</a><span class="cm">,</span> <a class="l_k" href="functions/pop.html">pop</a><span class="cm">,</span> <a class="l_k" href="functions/pos.html">pos</a><span class="cm">,</span> <a class="l_k" href="functions/print.html">print</a><span class="cm">,</span> <a class="l_k" href="functions/printf.html">printf</a><span class="cm">,</span> <a class="l_k" href="functions/push.html">push</a><span class="cm">,</span> <span class="q">q//</span><span class="cm">,</span> <span class="q">qq//</span><span class="cm">,</span> <span class="q">qw//</span><span class="cm">,</span></li><li>    <span class="q">qx//</span>*<span class="cm">,</span> <a class="l_k" href="functions/quotemeta.html">quotemeta</a><span class="cm">,</span> <a class="l_k" href="functions/rand.html">rand</a><span class="cm">,</span> <a class="l_k" href="functions/read.html">read</a><span class="cm">,</span> <a class="l_k" href="functions/readdir.html">readdir</a><span class="cm">,</span> <a class="l_k" href="functions/readlink.html">readlink</a><span class="i">*,</span> <a class="l_k" href="functions/redo.html">redo</a><span class="cm">,</span> <a class="l_k" href="functions/ref.html">ref</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/rename.html">rename</a><span class="cm">,</span> <a class="l_k" href="functions/require.html">require</a><span class="cm">,</span> <a class="l_k" href="functions/reset.html">reset</a><span class="cm">,</span> <a class="l_k" href="functions/return.html">return</a><span class="cm">,</span> <a class="l_k" href="functions/reverse.html">reverse</a><span class="cm">,</span> <a class="l_k" href="functions/rewinddir.html">rewinddir</a><span class="cm">,</span> <a class="l_k" href="functions/rindex.html">rindex</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/rmdir.html">rmdir</a><span class="cm">,</span> <span class="q">s///</span><span class="cm">,</span> <a class="l_k" href="functions/scalar.html">scalar</a><span class="cm">,</span> <a class="l_k" href="functions/seek.html">seek</a><span class="cm">,</span> <a class="l_k" href="functions/seekdir.html">seekdir</a><span class="cm">,</span> <a class="l_k" href="functions/select.html">select</a><span class="s">(</span><span class="w">internal</span><span class="s">)</span><span class="cm">,</span></li><li>    <a class="l_k" href="functions/select.html">select</a> <span class="s">(</span><a class="l_k" href="functions/system.html">system</a> <span class="i">call</span><span class="s">)</span>*<span class="cm">,</span> <a class="l_k" href="functions/setgrent.html">setgrent</a><span class="cm">,</span> <a class="l_k" href="functions/setpwent.html">setpwent</a><span class="cm">,</span> <a class="l_k" href="functions/shift.html">shift</a><span class="cm">,</span> <a class="l_k" href="functions/sin.html">sin</a><span class="cm">,</span> <a class="l_k" href="functions/sleep.html">sleep</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/socketpair.html">socketpair</a><span class="cm">,</span> <a class="l_k" href="functions/sort.html">sort</a><span class="cm">,</span> <a class="l_k" href="functions/splice.html">splice</a><span class="cm">,</span> <a class="l_k" href="functions/split.html">split</a><span class="cm">,</span> <a class="l_k" href="functions/sprintf.html">sprintf</a><span class="cm">,</span> <a class="l_k" href="functions/sqrt.html">sqrt</a><span class="cm">,</span> <a class="l_k" href="functions/srand.html">srand</a><span class="cm">,</span> <a class="l_k" href="functions/stat.html">stat</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/study.html">study</a><span class="cm">,</span> <a class="l_k" href="functions/substr.html">substr</a><span class="cm">,</span> <a class="l_k" href="functions/symlink.html">symlink</a><span class="i">*,</span> <a class="l_k" href="functions/sysread.html">sysread</a><span class="cm">,</span> <a class="l_k" href="functions/system.html">system</a><span class="i">*,</span> <a class="l_k" href="functions/syswrite.html">syswrite</a><span class="cm">,</span> <a class="l_k" href="functions/tell.html">tell</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/telldir.html">telldir</a><span class="cm">,</span> <a class="l_k" href="functions/tie.html">tie</a><span class="cm">,</span> <a class="l_k" href="functions/time.html">time</a><span class="cm">,</span> <a class="l_k" href="functions/times.html">times</a>*<span class="cm">,</span> <span class="q">tr///</span><span class="cm">,</span> <a class="l_k" href="functions/uc.html">uc</a><span class="cm">,</span> <a class="l_k" href="functions/ucfirst.html">ucfirst</a><span class="cm">,</span> <a class="l_k" href="functions/umask.html">umask</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/undef.html">undef</a><span class="cm">,</span> <a class="l_k" href="functions/unlink.html">unlink</a><span class="i">*,</span> <a class="l_k" href="functions/unpack.html">unpack</a><span class="cm">,</span> <a class="l_k" href="functions/untie.html">untie</a><span class="cm">,</span> <a class="l_k" href="functions/unshift.html">unshift</a><span class="cm">,</span> <a class="l_k" href="functions/use.html">use</a><span class="cm">,</span> <a class="l_k" href="functions/utime.html">utime</a><span class="i">*,</span></li><li>    <a class="l_k" href="functions/values.html">values</a><span class="cm">,</span> <a class="l_k" href="functions/vec.html">vec</a><span class="cm">,</span> <a class="l_k" href="functions/wait.html">wait</a><span class="cm">,</span> <a class="l_k" href="functions/waitpid.html">waitpid</a><span class="i">*,</span> <a class="l_k" href="functions/wantarray.html">wantarray</a><span class="cm">,</span> <a class="l_k" href="functions/warn.html">warn</a><span class="cm">,</span> <a class="l_k" href="functions/write.html">write</a><span class="cm">,</span> <span class="q">y///</span></li></ol></pre><p>The following functions were not implemented in the VMS port, 
and calling them produces a fatal error (usually) or 
undefined behavior (rarely, we hope):</p>
<pre class="verbatim"><ol><li>    <a class="l_k" href="functions/chroot.html">chroot</a><span class="cm">,</span> <a class="l_k" href="functions/dbmclose.html">dbmclose</a><span class="cm">,</span> <a class="l_k" href="functions/dbmopen.html">dbmopen</a><span class="cm">,</span> <a class="l_k" href="functions/fork.html">fork</a>*<span class="cm">,</span> <a class="l_k" href="functions/getpgrp.html">getpgrp</a><span class="cm">,</span> <a class="l_k" href="functions/getpriority.html">getpriority</a><span class="cm">,</span>  </li><li>    <a class="l_k" href="functions/msgctl.html">msgctl</a><span class="cm">,</span> <a class="l_k" href="functions/msgget.html">msgget</a><span class="cm">,</span> <span class="w">msgsend</span><span class="cm">,</span> <a class="l_k" href="functions/msgrcv.html">msgrcv</a><span class="cm">,</span> <a class="l_k" href="functions/semctl.html">semctl</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/semget.html">semget</a><span class="cm">,</span> <a class="l_k" href="functions/semop.html">semop</a><span class="cm">,</span> <a class="l_k" href="functions/setpgrp.html">setpgrp</a><span class="cm">,</span> <a class="l_k" href="functions/setpriority.html">setpriority</a><span class="cm">,</span> <a class="l_k" href="functions/shmctl.html">shmctl</a><span class="cm">,</span> <a class="l_k" href="functions/shmget.html">shmget</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/shmread.html">shmread</a><span class="cm">,</span> <a class="l_k" href="functions/shmwrite.html">shmwrite</a><span class="cm">,</span> <a class="l_k" href="functions/syscall.html">syscall</a></li></ol></pre><p>The following functions are available on Perls compiled with Dec C
5.2 or greater and running VMS 7.0 or greater:</p>
<pre class="verbatim"><ol><li>    <a class="l_k" href="functions/truncate.html">truncate</a></li></ol></pre><p>The following functions are available on Perls built on VMS 7.2 or
greater:</p>
<pre class="verbatim"><ol><li>    <a class="l_k" href="functions/fcntl.html">fcntl</a> <span class="s">(</span><span class="w">without</span> <span class="w">locking</span><span class="s">)</span></li></ol></pre><p>The following functions may or may not be implemented, 
depending on what type of socket support you've built into 
your copy of Perl:</p>
<pre class="verbatim"><ol><li>    <a class="l_k" href="functions/accept.html">accept</a><span class="cm">,</span> <a class="l_k" href="functions/bind.html">bind</a><span class="cm">,</span> <a class="l_k" href="functions/connect.html">connect</a><span class="cm">,</span> <a class="l_k" href="functions/getpeername.html">getpeername</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/gethostbyname.html">gethostbyname</a><span class="cm">,</span> <a class="l_k" href="functions/getnetbyname.html">getnetbyname</a><span class="cm">,</span> <a class="l_k" href="functions/getprotobyname.html">getprotobyname</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/getservbyname.html">getservbyname</a><span class="cm">,</span> <a class="l_k" href="functions/gethostbyaddr.html">gethostbyaddr</a><span class="cm">,</span> <a class="l_k" href="functions/getnetbyaddr.html">getnetbyaddr</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/getprotobynumber.html">getprotobynumber</a><span class="cm">,</span> <a class="l_k" href="functions/getservbyport.html">getservbyport</a><span class="cm">,</span> <a class="l_k" href="functions/gethostent.html">gethostent</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/getnetent.html">getnetent</a><span class="cm">,</span> <a class="l_k" href="functions/getprotoent.html">getprotoent</a><span class="cm">,</span> <a class="l_k" href="functions/getservent.html">getservent</a><span class="cm">,</span> <a class="l_k" href="functions/sethostent.html">sethostent</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/setnetent.html">setnetent</a><span class="cm">,</span> <a class="l_k" href="functions/setprotoent.html">setprotoent</a><span class="cm">,</span> <a class="l_k" href="functions/setservent.html">setservent</a><span class="cm">,</span> <a class="l_k" href="functions/endhostent.html">endhostent</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/endnetent.html">endnetent</a><span class="cm">,</span> <a class="l_k" href="functions/endprotoent.html">endprotoent</a><span class="cm">,</span> <a class="l_k" href="functions/endservent.html">endservent</a><span class="cm">,</span> <a class="l_k" href="functions/getsockname.html">getsockname</a><span class="cm">,</span></li><li>    <a class="l_k" href="functions/getsockopt.html">getsockopt</a><span class="cm">,</span> <a class="l_k" href="functions/listen.html">listen</a><span class="cm">,</span> <a class="l_k" href="functions/recv.html">recv</a><span class="cm">,</span> <a class="l_k" href="functions/select.html">select</a><span class="s">(</span><a class="l_k" href="functions/system.html">system</a> <span class="i">call</span><span class="s">)</span>*<span class="cm">,</span></li><li>    <a class="l_k" href="functions/send.html">send</a><span class="cm">,</span> <a class="l_k" href="functions/setsockopt.html">setsockopt</a><span class="cm">,</span> <a class="l_k" href="functions/shutdown.html">shutdown</a><span class="cm">,</span> <a class="l_k" href="functions/socket.html">socket</a></li></ol></pre><p>The following function is available on Perls built on 64 bit OpenVMS v8.2
with hard links enabled on an ODS-5 formatted build disk.  CRTL support
is in principle available as of OpenVMS v7.3-1, and better configuration
support could detect this.</p>
<pre class="verbatim"><ol><li>    <a class="l_k" href="functions/link.html">link</a></li></ol></pre><p>The following functions are available on Perls built on 64 bit OpenVMS
v8.2 and later.  CRTL support is in principle available as of OpenVMS
v7.3-2, and better configuration support could detect this.</p>
<pre class="verbatim"><ol><li>   <a class="l_k" href="functions/getgrgid.html">getgrgid</a><span class="cm">,</span> <a class="l_k" href="functions/getgrnam.html">getgrnam</a><span class="cm">,</span> <a class="l_k" href="functions/getpwnam.html">getpwnam</a><span class="cm">,</span> <a class="l_k" href="functions/getpwuid.html">getpwuid</a><span class="cm">,</span></li><li>   <a class="l_k" href="functions/setgrent.html">setgrent</a><span class="cm">,</span> <span class="w">ttyname</span></li></ol></pre><p>The following functions are available on Perls built on 64 bit OpenVMS v8.2
and later.</p>
<pre class="verbatim"><ol><li>   <span class="w">statvfs</span><span class="cm">,</span> <a class="l_k" href="functions/socketpair.html">socketpair</a></li></ol></pre><ul>
<li><a name="File-tests"></a><b>File tests</b>
<p>The tests <code class="inline">-b</code>
, <code class="inline">-B</code>
, <code class="inline">-c</code>
, <code class="inline">-C</code>
, <code class="inline">-d</code>
, <code class="inline">-e</code>
, <code class="inline">-f</code>
,
<code class="inline">-o</code>
, <code class="inline">-M</code>
, <code class="inline">-s</code>
, <code class="inline">-S</code>
, <code class="inline">-t</code>
, <code class="inline">-T</code>
, and <code class="inline">-z</code>
 work as
advertised.  The return values for <code class="inline">-r</code>
, <code class="inline">-w</code>
, and <code class="inline">-x</code>

tell you whether you can actually access the file; this may
not reflect the UIC-based file protections.  Since real and
effective UIC don't differ under VMS, <code class="inline">-O</code>
, <code class="inline">-R</code>
, <code class="inline">-W</code>
,
and <code class="inline"><a class="l_k" href="functions/-X.html">-X</a></code> are equivalent to <code class="inline">-o</code>
, <code class="inline">-r</code>
, <code class="inline">-w</code>
, and <code class="inline">-x</code>
.
Similarly, several other tests, including <code class="inline">-A</code>
, <code class="inline">-g</code>
, <code class="inline">-k</code>
,
<code class="inline">-l</code>
, <code class="inline">-p</code>
, and <code class="inline">-u</code>
, aren't particularly meaningful under
VMS, and the values returned by these tests reflect whatever
your CRTL <code class="inline"><a class="l_k" href="functions/stat.html">stat()</a></code> routine does to the equivalent bits in the
st_mode field.  Finally, <code class="inline">-d</code>
 returns true if passed a device
specification without an explicit directory (e.g. <code class="inline"><span class="j">DUA1:</span></code>
), as
well as if passed a directory.</p>
<p>There are DECC feature logical names AND ODS-5 volume attributes that
also control what values are returned for the date fields.</p>
<p>Note: Some sites have reported problems when using the file-access
tests (<code class="inline">-r</code>
, <code class="inline">-w</code>
, and <code class="inline">-x</code>
) on files accessed via DEC's DFS.
Specifically, since DFS does not currently provide access to the
extended file header of files on remote volumes, attempts to
examine the ACL fail, and the file tests will return false,
with <code class="inline"><span class="i">$!</span></code>
 indicating that the file does not exist.  You can
use <code class="inline"><a class="l_k" href="functions/stat.html">stat</a></code> on these files, since that checks UIC-based protection
only, and then manually check the appropriate bits, as defined by
your C compiler's <i>stat.h</i>, in the mode value it returns, if you
need an approximation of the file's protections.</p>
</li>
<li><a name="backticks"></a><b>backticks</b>
<p>Backticks create a subprocess, and pass the enclosed string
to it for execution as a DCL command.  Since the subprocess is
created directly via <code class="inline"><span class="w">lib</span><span class="i">$spawn</span><span class="s">(</span><span class="s">)</span></code>
, any valid DCL command string
may be specified.</p>
</li>
<li><a name="binmode-FILEHANDLE"></a><b>binmode FILEHANDLE</b>
<p>The <code class="inline"><a class="l_k" href="functions/binmode.html">binmode</a></code> operator will attempt to insure that no translation
of carriage control occurs on input from or output to this filehandle.
Since this involves reopening the file and then restoring its
file position indicator, if this function returns FALSE, the
underlying filehandle may no longer point to an open file, or may
point to a different position in the file than before <code class="inline"><a class="l_k" href="functions/binmode.html">binmode</a></code>
was called.</p>
<p>Note that <code class="inline"><a class="l_k" href="functions/binmode.html">binmode</a></code> is generally not necessary when using normal
filehandles; it is provided so that you can control I/O to existing
record-structured files when necessary.  You can also use the
<code class="inline"><span class="w">vmsfopen</span></code>
 function in the VMS::Stdio extension to gain finer
control of I/O to files and devices with different record structures.</p>
</li>
<li><a name="crypt-PLAINTEXT%2c-USER"></a><b>crypt PLAINTEXT, USER</b>
<p>The <code class="inline"><a class="l_k" href="functions/crypt.html">crypt</a></code> operator uses the <code class="inline"><span class="w">sys</span><span class="i">$hash_password</span></code>
 system
service to generate the hashed representation of PLAINTEXT.
If USER is a valid username, the algorithm and salt values
are taken from that user's UAF record.  If it is not, then
the preferred algorithm and a salt of 0 are used.  The
quadword encrypted value is returned as an 8-character string.</p>
<p>The value returned by <code class="inline"><a class="l_k" href="functions/crypt.html">crypt</a></code> may be compared against
the encrypted password from the UAF returned by the <code class="inline"><span class="w">getpw</span>*</code>

functions, in order to authenticate users.  If you're
going to do this, remember that the encrypted password in
the UAF was generated using uppercase username and
password strings; you'll have to upcase the arguments to
<code class="inline"><a class="l_k" href="functions/crypt.html">crypt</a></code> to insure that you'll get the proper value:</p>
<pre class="verbatim"><ol><li><a name="validate_passwd"></a>    sub <span class="m">validate_passwd</span> <span class="s">{</span></li><li>        <a class="l_k" href="functions/my.html">my</a><span class="s">(</span><span class="i">$user</span><span class="cm">,</span><span class="i">$passwd</span><span class="s">)</span> = <span class="i">@_</span><span class="sc">;</span></li><li>        <a class="l_k" href="functions/my.html">my</a><span class="s">(</span><span class="i">$pwdhash</span><span class="s">)</span><span class="sc">;</span></li><li>        if <span class="s">(</span> !<span class="s">(</span><span class="i">$pwdhash</span> = <span class="s">(</span><a class="l_k" href="functions/getpwnam.html">getpwnam</a><span class="s">(</span><span class="i">$user</span><span class="s">)</span><span class="s">)</span>[<span class="n">1</span>]<span class="s">)</span> ||</li><li>               <span class="i">$pwdhash</span> ne <a class="l_k" href="functions/crypt.html">crypt</a><span class="s">(</span><span class="q">&quot;\U$passwd&quot;</span><span class="cm">,</span><span class="q">&quot;\U$name&quot;</span><span class="s">)</span> <span class="s">)</span> <span class="s">{</span></li><li>            <span class="i">intruder_alert</span><span class="s">(</span><span class="i">$name</span><span class="s">)</span><span class="sc">;</span></li><li>        <span class="s">}</span></li><li>        <a class="l_k" href="functions/return.html">return</a> <span class="n">1</span><span class="sc">;</span></li><li>    <span class="s">}</span></li></ol></pre></li>
<li><a name="die"></a><b>die</b>
<p><code class="inline"><a class="l_k" href="functions/die.html">die</a></code> will force the native VMS exit status to be an SS$_ABORT code
if neither of the $! or $? status values are ones that would cause
the native status to be interpreted as being what VMS classifies as
SEVERE_ERROR severity for DCL error handling.</p>
<p>When <code class="inline"><span class="w">PERL_VMS_POSIX_EXIT</span></code>
 is active (see <a href="#%24%3f">$?</a> below), the native VMS exit
status value will have either one of the <code class="inline"><span class="i">$!</span></code>
 or <code class="inline"><span class="i">$?</span></code>
 or <code class="inline"><span class="i">$^E</span></code>
 or
the Unix value 255 encoded into it in a way that the effective original
value can be decoded by other programs written in C, including Perl
and the GNV package.  As per the normal non-VMS behavior of <code class="inline"><a class="l_k" href="functions/die.html">die</a></code> if
either <code class="inline"><span class="i">$!</span></code>
 or <code class="inline"><span class="i">$?</span></code>
 are non-zero, one of those values will be
encoded into a native VMS status value.  If both of the Unix status
values are 0, and the <code class="inline"><span class="i">$^E</span></code>
 value is set one of ERROR or SEVERE_ERROR
severity, then the <code class="inline"><span class="i">$^E</span></code>
 value will be used as the exit code as is.
If none of the above apply, the Unix value of 255 will be encoded into
a native VMS exit status value.</p>
<p>Please note a significant difference in the behavior of <code class="inline"><a class="l_k" href="functions/die.html">die</a></code> in
the <code class="inline"><span class="w">PERL_VMS_POSIX_EXIT</span></code>
 mode is that it does not force a VMS
SEVERE_ERROR status on exit.  The Unix exit values of 2 through
255 will be encoded in VMS status values with severity levels of
SUCCESS.  The Unix exit value of 1 will be encoded in a VMS status
value with a severity level of ERROR.  This is to be compatible with
how the VMS C library encodes these values.</p>
<p>The minimum severity level set by <code class="inline"><a class="l_k" href="functions/die.html">die</a></code> in <code class="inline"><span class="w">PERL_VMS_POSIX_EXIT</span></code>
 mode
may be changed to be ERROR or higher in the future depending on the 
results of testing and further review.</p>
<p>See <a href="#%24%3f">$?</a> for a description of the encoding of the Unix value to
produce a native VMS status containing it.</p>
</li>
<li><a name="dump"></a><b>dump</b>
<p>Rather than causing Perl to abort and dump core, the <code class="inline"><a class="l_k" href="functions/dump.html">dump</a></code>
operator invokes the VMS debugger.  If you continue to
execute the Perl program under the debugger, control will
be transferred to the label specified as the argument to
<code class="inline"><a class="l_k" href="functions/dump.html">dump</a></code>, or, if no label was specified, back to the
beginning of the program.  All other state of the program
(<i>e.g.</i> values of variables, open file handles) are not
affected by calling <code class="inline"><a class="l_k" href="functions/dump.html">dump</a></code>.</p>
</li>
<li><a name="exec-LIST"></a><b>exec LIST</b>
<p>A call to <code class="inline"><a class="l_k" href="functions/exec.html">exec</a></code> will cause Perl to exit, and to invoke the command
given as an argument to <code class="inline"><a class="l_k" href="functions/exec.html">exec</a></code> via <code class="inline"><span class="w">lib</span><span class="i">$do_command</span></code>
.  If the
argument begins with '@' or '$' (other than as part of a filespec),
then it is executed as a DCL command.  Otherwise, the first token on
the command line is treated as the filespec of an image to run, and
an attempt is made to invoke it (using <i>.Exe</i> and the process
defaults to expand the filespec) and pass the rest of <code class="inline"><a class="l_k" href="functions/exec.html">exec</a></code>'s
argument to it as parameters.  If the token has no file type, and
matches a file with null type, then an attempt is made to determine
whether the file is an executable image which should be invoked
using <code class="inline"><span class="w">MCR</span></code>
 or a text file which should be passed to DCL as a
command procedure.</p>
</li>
<li><a name="fork"></a><b>fork</b>
<p>While in principle the <code class="inline"><a class="l_k" href="functions/fork.html">fork</a></code> operator could be implemented via
(and with the same rather severe limitations as) the CRTL <code class="inline"><span class="i">vfork</span><span class="s">(</span><span class="s">)</span></code>

routine, and while some internal support to do just that is in
place, the implementation has never been completed, making <code class="inline"><a class="l_k" href="functions/fork.html">fork</a></code>
currently unavailable.  A true kernel <code class="inline"><a class="l_k" href="functions/fork.html">fork()</a></code> is expected in a
future version of VMS, and the pseudo-fork based on interpreter
threads may be available in a future version of Perl on VMS (see
<a href="perlfork.html">perlfork</a>).  In the meantime, use <code class="inline"><a class="l_k" href="functions/system.html">system</a></code>, backticks, or piped
filehandles to create subprocesses.</p>
</li>
<li><a name="getpwent"></a><b>getpwent</b>
</li>
<li><a name="getpwnam"></a><b>getpwnam</b>
</li>
<li><a name="getpwuid"></a><b>getpwuid</b>
<p>These operators obtain the information described in <a href="perlfunc.html">perlfunc</a>,
if you have the privileges necessary to retrieve the named user's
UAF information via <code class="inline"><span class="w">sys</span><span class="i">$getuai</span></code>
.  If not, then only the <code class="inline"><span class="i">$name</span></code>
,
<code class="inline"><span class="i">$uid</span></code>
, and <code class="inline"><span class="i">$gid</span></code>
 items are returned.  The <code class="inline"><span class="i">$dir</span></code>
 item contains
the login directory in VMS syntax, while the <code class="inline"><span class="i">$comment</span></code>
 item
contains the login directory in Unix syntax. The <code class="inline"><span class="i">$gcos</span></code>
 item
contains the owner field from the UAF record.  The <code class="inline"><span class="i">$quota</span></code>

item is not used.</p>
</li>
<li><a name="gmtime"></a><b>gmtime</b>
<p>The <code class="inline"><a class="l_k" href="functions/gmtime.html">gmtime</a></code> operator will function properly if you have a
working CRTL <code class="inline"><a class="l_k" href="functions/gmtime.html">gmtime()</a></code> routine, or if the logical name
SYS$TIMEZONE_DIFFERENTIAL is defined as the number of seconds
which must be added to UTC to yield local time.  (This logical
name is defined automatically if you are running a version of
VMS with built-in UTC support.)  If neither of these cases is
true, a warning message is printed, and <code class="inline"><a class="l_k" href="functions/undef.html">undef</a></code> is returned.</p>
</li>
<li><a name="kill"></a><b>kill</b>
<p>In most cases, <code class="inline"><a class="l_k" href="functions/kill.html">kill</a></code> is implemented via the undocumented system
service <code class="inline"><span class="i">$SIGPRC</span></code>
, which has the same calling sequence as <code class="inline"><span class="i">$FORCEX</span></code>
, but
throws an exception in the target process rather than forcing it to call
<code class="inline"><span class="i">$EXIT</span></code>
.  Generally speaking, <code class="inline"><a class="l_k" href="functions/kill.html">kill</a></code> follows the behavior of the
CRTL's <code class="inline"><a class="l_k" href="functions/kill.html">kill()</a></code> function, but unlike that function can be called from
within a signal handler.  Also, unlike the <code class="inline"><a class="l_k" href="functions/kill.html">kill</a></code> in some versions of
the CRTL, Perl's <code class="inline"><a class="l_k" href="functions/kill.html">kill</a></code> checks the validity of the signal passed in and
returns an error rather than attempting to send an unrecognized signal.</p>
<p>Also, negative signal values don't do anything special under
VMS; they're just converted to the corresponding positive value.</p>
</li>
<li><a name="qx%2f%2f"></a><b>qx//</b>
<p>See the entry on <code class="inline"><span class="w">backticks</span></code>
 above.</p>
</li>
<li><a name="select-(system-call)"></a><b>select (system call)</b>
<p>If Perl was not built with socket support, the system call
version of <code class="inline"><a class="l_k" href="functions/select.html">select</a></code> is not available at all.  If socket
support is present, then the system call version of
<code class="inline"><a class="l_k" href="functions/select.html">select</a></code> functions only for file descriptors attached
to sockets.  It will not provide information about regular
files or pipes, since the CRTL <code class="inline"><a class="l_k" href="functions/select.html">select()</a></code> routine does not
provide this functionality.</p>
</li>
<li><a name="stat-EXPR"></a><b>stat EXPR</b>
<p>Since VMS keeps track of files according to a different scheme
than Unix, it's not really possible to represent the file's ID
in the <code class="inline"><span class="w">st_dev</span></code>
 and <code class="inline"><span class="w">st_ino</span></code>
 fields of a <code class="inline"><span class="w">struct</span> <a class="l_k" href="functions/stat.html">stat</a></code>
.  Perl
tries its best, though, and the values it uses are pretty unlikely
to be the same for two different files.  We can't guarantee this,
though, so caveat scriptor.</p>
</li>
<li><a name="system-LIST"></a><b>system LIST</b>
<p>The <code class="inline"><a class="l_k" href="functions/system.html">system</a></code> operator creates a subprocess, and passes its 
arguments to the subprocess for execution as a DCL command.  
Since the subprocess is created directly via <code class="inline"><span class="w">lib</span><span class="i">$spawn</span><span class="s">(</span><span class="s">)</span></code>
, any 
valid DCL command string may be specified.  If the string begins with
'@', it is treated as a DCL command unconditionally.  Otherwise, if
the first token contains a character used as a delimiter in file
specification (e.g. <code class="inline"><span class="j">:</span></code>
 or <code class="inline">]</code>), an attempt is made to expand it
using  a default type of <i>.Exe</i> and the process defaults, and if
successful, the resulting file is invoked via <code class="inline"><span class="w">MCR</span></code>
. This allows you
to invoke an image directly simply by passing the file specification
to <code class="inline"><a class="l_k" href="functions/system.html">system</a></code>, a common Unixish idiom.  If the token has no file type,
and matches a file with null type, then an attempt is made to
determine whether the file is an executable image which should be
invoked using <code class="inline"><span class="w">MCR</span></code>
 or a text file which should be passed to DCL
as a command procedure.</p>
<p>If LIST consists of the empty string, <code class="inline"><a class="l_k" href="functions/system.html">system</a></code> spawns an
interactive DCL subprocess, in the same fashion as typing
<b>SPAWN</b> at the DCL prompt.</p>
<p>Perl waits for the subprocess to complete before continuing
execution in the current process.  As described in <a href="perlfunc.html">perlfunc</a>,
the return value of <code class="inline"><a class="l_k" href="functions/system.html">system</a></code> is a fake "status" which follows
POSIX semantics unless the pragma <code class="inline"><a class="l_k" href="functions/use.html">use</a> <span class="w">vmsish</span> <span class="q">&#39;status&#39;</span></code>
 is in
effect; see the description of <code class="inline"><span class="i">$?</span></code>
 in this document for more 
detail.</p>
</li>
<li><a name="time"></a><b>time</b>
<p>The value returned by <code class="inline"><a class="l_k" href="functions/time.html">time</a></code> is the offset in seconds from
01-JAN-1970 00:00:00 (just like the CRTL's times() routine), in order
to make life easier for code coming in from the POSIX/Unix world.</p>
</li>
<li><a name="times"></a><b>times</b>
<p>The array returned by the <code class="inline"><a class="l_k" href="functions/times.html">times</a></code> operator is divided up 
according to the same rules the CRTL <code class="inline"><a class="l_k" href="functions/times.html">times()</a></code> routine.  
Therefore, the "system time" elements will always be 0, since 
there is no difference between "user time" and "system" time 
under VMS, and the time accumulated by a subprocess may or may 
not appear separately in the "child time" field, depending on 
whether <code class="inline"><a class="l_k" href="functions/times.html">times()</a></code> keeps track of subprocesses separately.  Note
especially that the VAXCRTL (at least) keeps track only of
subprocesses spawned using <code class="inline"><a class="l_k" href="functions/fork.html">fork()</a></code> and <code class="inline"><a class="l_k" href="functions/exec.html">exec()</a></code>; it will not
accumulate the times of subprocesses spawned via pipes, <code class="inline"><a class="l_k" href="functions/system.html">system()</a></code>,
or backticks.</p>
</li>
<li><a name="unlink-LIST"></a><b>unlink LIST</b>
<p><code class="inline"><a class="l_k" href="functions/unlink.html">unlink</a></code> will delete the highest version of a file only; in
order to delete all versions, you need to say</p>
<pre class="verbatim"><ol><li>    <span class="n">1</span> while <a class="l_k" href="functions/unlink.html">unlink</a> <span class="w">LIST</span><span class="sc">;</span></li></ol></pre><p>You may need to make this change to scripts written for a
Unix system which expect that after a call to <code class="inline"><a class="l_k" href="functions/unlink.html">unlink</a></code>,
no files with the names passed to <code class="inline"><a class="l_k" href="functions/unlink.html">unlink</a></code> will exist.
(Note: This can be changed at compile time; if you
<code class="inline"><a class="l_k" href="functions/use.html">use</a> <span class="w">Config</span></code>
 and <code class="inline"><span class="i">$Config</span>{<span class="q">&#39;d_unlink_all_versions&#39;</span>}</code>
 is
<code class="inline"><span class="w">define</span></code>
, then <code class="inline"><a class="l_k" href="functions/unlink.html">unlink</a></code> will delete all versions of a
file on the first call.)</p>
<p><code class="inline"><a class="l_k" href="functions/unlink.html">unlink</a></code> will delete a file if at all possible, even if it
requires changing file protection (though it won't try to
change the protection of the parent directory).  You can tell
whether you've got explicit delete access to a file by using the
<code class="inline"><span class="w">VMS::Filespec::candelete</span></code>
 operator.  For instance, in order
to delete only files to which you have delete access, you could
say something like</p>
<pre class="verbatim"><ol><li><a name="safe_unlink"></a>    sub <span class="m">safe_unlink</span> <span class="s">{</span></li><li>        <a class="l_k" href="functions/my.html">my</a><span class="s">(</span><span class="i">$file</span><span class="cm">,</span><span class="i">$num</span><span class="s">)</span><span class="sc">;</span></li><li>        foreach <span class="i">$file</span> <span class="s">(</span><span class="i">@_</span><span class="s">)</span> <span class="s">{</span></li><li>            <a class="l_k" href="functions/next.html">next</a> unless <span class="i">VMS::Filespec::candelete</span><span class="s">(</span><span class="i">$file</span><span class="s">)</span><span class="sc">;</span></li><li>            <span class="i">$num</span> += <a class="l_k" href="functions/unlink.html">unlink</a> <span class="i">$file</span><span class="sc">;</span></li><li>        <span class="s">}</span></li><li>        <span class="i">$num</span><span class="sc">;</span></li><li>    <span class="s">}</span></li></ol></pre><p>(or you could just use <code class="inline"><span class="w">VMS::Stdio::remove</span></code>
, if you've installed
the VMS::Stdio extension distributed with Perl). If <code class="inline"><a class="l_k" href="functions/unlink.html">unlink</a></code> has to
change the file protection to delete the file, and you interrupt it
in midstream, the file may be left intact, but with a changed ACL
allowing you delete access.</p>
<p>This behavior of <code class="inline"><a class="l_k" href="functions/unlink.html">unlink</a></code> is to be compatible with POSIX behavior
and not traditional VMS behavior.</p>
</li>
<li><a name="utime-LIST"></a><b>utime LIST</b>
<p>This operator changes only the modification time of the file (VMS 
revision date) on ODS-2 volumes and ODS-5 volumes without access 
dates enabled. On ODS-5 volumes with access dates enabled, the 
true access time is modified.</p>
</li>
<li><a name="waitpid-PID%2cFLAGS"></a><b>waitpid PID,FLAGS</b>
<p>If PID is a subprocess started by a piped <code class="inline"><a class="l_k" href="functions/open.html">open()</a></code> (see <a href="open.html">open</a>), 
<code class="inline"><a class="l_k" href="functions/waitpid.html">waitpid</a></code> will wait for that subprocess, and return its final status
value in <code class="inline"><span class="i">$?</span></code>
.  If PID is a subprocess created in some other way (e.g.
SPAWNed before Perl was invoked), <code class="inline"><a class="l_k" href="functions/waitpid.html">waitpid</a></code> will simply check once per
second whether the process has completed, and return when it has.  (If
PID specifies a process that isn't a subprocess of the current process,
and you invoked Perl with the <code class="inline">-w</code>
 switch, a warning will be issued.)</p>
<p>Returns PID on success, -1 on error.  The FLAGS argument is ignored
in all cases.</p>
</li>
</ul>
<a name="Perl-variables"></a><h1>Perl variables</h1>
<p>The following VMS-specific information applies to the indicated
"special" Perl variables, in addition to the general information
in <a href="perlvar.html">perlvar</a>.  Where there is a conflict, this information
takes precedence.</p>
<ul>
<li><a name="%25ENV"></a><b>%ENV</b>
<p>The operation of the <code class="inline"><span class="i">%ENV</span></code>
 array depends on the translation
of the logical name <i>PERL_ENV_TABLES</i>.  If defined, it should
be a search list, each element of which specifies a location
for <code class="inline"><span class="i">%ENV</span></code>
 elements.  If you tell Perl to read or set the
element <code class="inline">$ENV{</code><i>name</i><code class="inline">}</code>, then Perl uses the translations of
<i>PERL_ENV_TABLES</i> as follows:</p>
<ul>
<li><a name="CRTL_ENV"></a><b>CRTL_ENV</b>
<p>This string tells Perl to consult the CRTL's internal <code class="inline"><span class="w">environ</span></code>
 array
of key-value pairs, using <i>name</i> as the key.  In most cases, this
contains only a few keys, but if Perl was invoked via the C
<code class="inline"><a class="l_k" href="functions/exec.html">exec[lv]e()</a></code> function, as is the case for some embedded Perl
applications or when running under a shell such as GNV bash, the
<code class="inline"><span class="w">environ</span></code>
 array may have been populated by the calling program.</p>
</li>
<li><a name="CLISYM_%5bLOCAL%5d"></a><b>CLISYM_[LOCAL]</b>
<p>A string beginning with <code class="inline"><span class="w">CLISYM_</span></code>
tells Perl to consult the CLI's
symbol tables, using <i>name</i> as the name of the symbol.  When reading
an element of <code class="inline"><span class="i">%ENV</span></code>
, the local symbol table is scanned first, followed
by the global symbol table..  The characters following <code class="inline"><span class="w">CLISYM_</span></code>
 are
significant when an element of <code class="inline"><span class="i">%ENV</span></code>
 is set or deleted: if the
complete string is <code class="inline"><span class="w">CLISYM_LOCAL</span></code>
, the change is made in the local
symbol table; otherwise the global symbol table is changed.</p>
</li>
<li><a name="Any-other-string"></a><b>Any other string</b>
<p>If an element of <i>PERL_ENV_TABLES</i> translates to any other string,
that string is used as the name of a logical name table, which is
consulted using <i>name</i> as the logical name.  The normal search
order of access modes is used.</p>
</li>
</ul>
<p><i>PERL_ENV_TABLES</i> is translated once when Perl starts up; any changes
you make while Perl is running do not affect the behavior of <code class="inline"><span class="i">%ENV</span></code>
.
If <i>PERL_ENV_TABLES</i> is not defined, then Perl defaults to consulting
first the logical name tables specified by <i>LNM$FILE_DEV</i>, and then
the CRTL <code class="inline"><span class="w">environ</span></code>
 array.  This default order is reversed when the
logical name <i>GNV$UNIX_SHELL</i> is defined, such as when running under
GNV bash.</p>
<p>In all operations on %ENV, the key string is treated as if it 
were entirely uppercase, regardless of the case actually 
specified in the Perl expression.</p>
<p>When an element of <code class="inline"><span class="i">%ENV</span></code>
 is read, the locations to which
<i>PERL_ENV_TABLES</i> points are checked in order, and the value
obtained from the first successful lookup is returned.  If the
name of the <code class="inline"><span class="i">%ENV</span></code>
 element contains a semi-colon, it and
any characters after it are removed.  These are ignored when
the CRTL <code class="inline"><span class="w">environ</span></code>
 array or a CLI symbol table is consulted.
However, the name is looked up in a logical name table, the
suffix after the semi-colon is treated as the translation index
to be used for the lookup.   This lets you look up successive values
for search list logical names.  For instance, if you say</p>
<pre class="verbatim"><ol><li>   $  Define STORY  once,upon,a,time,there,was</li><li>   $  perl -e "for ($i = 0; $i &lt;= 6; $i++) " -</li><li>   _$ -e "{ print $ENV{'story;'.$i},' '}"</li></ol></pre><p>Perl will print <code class="inline"><span class="w">ONCE</span> <span class="w">UPON</span> <span class="w">A</span> <span class="w">TIME</span> <span class="w">THERE</span> <span class="w">WAS</span></code>
, assuming, of course,
that <i>PERL_ENV_TABLES</i> is set up so that the logical name <code class="inline"><span class="w">story</span></code>

is found, rather than a CLI symbol or CRTL <code class="inline"><span class="w">environ</span></code>
 element with
the same name.</p>
<p>When an element of <code class="inline"><span class="i">%ENV</span></code>
 is set to a defined string, the
corresponding definition is made in the location to which the
first translation of <i>PERL_ENV_TABLES</i> points.  If this causes a
logical name to be created, it is defined in supervisor mode.
(The same is done if an existing logical name was defined in
executive or kernel mode; an existing user or supervisor mode
logical name is reset to the new value.)  If the value is an empty
string, the logical name's translation is defined as a single <code class="inline"><span class="w">NUL</span></code>

(ASCII <code class="inline">\<span class="n">0</span></code>
) character, since a logical name cannot translate to a
zero-length string.  (This restriction does not apply to CLI symbols
or CRTL <code class="inline"><span class="w">environ</span></code>
 values; they are set to the empty string.)</p>
<p>When an element of <code class="inline"><span class="i">%ENV</span></code>
 is set to <code class="inline"><a class="l_k" href="functions/undef.html">undef</a></code>, the element is looked
up as if it were being read, and if it is found, it is deleted.  (An
item "deleted" from the CRTL <code class="inline"><span class="w">environ</span></code>
 array is set to the empty
string.)  Using <code class="inline"><a class="l_k" href="functions/delete.html">delete</a></code> to remove an element from <code class="inline"><span class="i">%ENV</span></code>
 has a
similar effect, but after the element is deleted, another attempt is
made to look up the element, so an inner-mode logical name or a name
in another location will replace the logical name just deleted. In
either case, only the first value found searching PERL_ENV_TABLES is
altered.  It is not possible at present to define a search list
logical name via %ENV.</p>
<p>The element <code class="inline"><span class="i">$ENV</span>{<span class="w">DEFAULT</span>}</code>
 is special: when read, it returns
Perl's current default device and directory, and when set, it
resets them, regardless of the definition of <i>PERL_ENV_TABLES</i>.
It cannot be cleared or deleted; attempts to do so are silently
ignored.</p>
<p>Note that if you want to pass on any elements of the
C-local environ array to a subprocess which isn't
started by fork/exec, or isn't running a C program, you
can "promote" them to logical names in the current
process, which will then be inherited by all subprocesses,
by saying</p>
<pre class="verbatim"><ol><li>    foreach <a class="l_k" href="functions/my.html">my</a> <span class="i">$key</span> <span class="s">(</span><span class="q">qw[C-local keys you want promoted]</span><span class="s">)</span> <span class="s">{</span></li><li>        <a class="l_k" href="functions/my.html">my</a> <span class="i">$temp</span> = <span class="i">$ENV</span>{<span class="i">$key</span>}<span class="sc">;</span> <span class="c"># read from C-local array</span></li><li>        <span class="i">$ENV</span>{<span class="i">$key</span>} = <span class="i">$temp</span><span class="sc">;</span>    <span class="c"># and define as logical name</span></li><li>    <span class="s">}</span></li></ol></pre><p>(You can't just say <code class="inline"><span class="i">$ENV</span>{<span class="i">$key</span>} = <span class="i">$ENV</span>{<span class="i">$key</span>}</code>
, since the
Perl optimizer is smart enough to elide the expression.)</p>
<p>Don't try to clear <code class="inline"><span class="i">%ENV</span></code>
 by saying <code class="inline"><span class="i">%ENV</span> = <span class="s">(</span><span class="s">)</span><span class="sc">;</span></code>
, it will throw
a fatal error.  This is equivalent to doing the following from DCL:</p>
<pre class="verbatim"><ol><li>    <span class="w">DELETE</span>/<span class="w">LOGICAL</span> *</li></ol></pre><p>You can imagine how bad things would be if, for example, the SYS$MANAGER
or SYS$SYSTEM logical names were deleted.</p>
<p>At present, the first time you iterate over %ENV using
<code class="inline"><a class="l_k" href="functions/keys.html">keys</a></code>, or <code class="inline"><a class="l_k" href="functions/values.html">values</a></code>,  you will incur a time penalty as all
logical names are read, in order to fully populate %ENV.
Subsequent iterations will not reread logical names, so they
won't be as slow, but they also won't reflect any changes
to logical name tables caused by other programs.</p>
<p>You do need to be careful with the logical names representing
process-permanent files, such as <code class="inline"><span class="w">SYS</span><span class="i">$INPUT</span></code>
 and <code class="inline"><span class="w">SYS</span><span class="i">$OUTPUT</span></code>
.
The translations for these logical names are prepended with a
two-byte binary value (0x1B 0x00) that needs to be stripped off
if you want to use it. (In previous versions of Perl it wasn't
possible to get the values of these logical names, as the null
byte acted as an end-of-string marker)</p>
</li>
<li><a name="%24!"></a><b>$!</b>
<p>The string value of <code class="inline"><span class="i">$!</span></code>
 is that returned by the CRTL's
strerror() function, so it will include the VMS message for
VMS-specific errors.  The numeric value of <code class="inline"><span class="i">$!</span></code>
 is the
value of <code class="inline"><span class="w">errno</span></code>
, except if errno is EVMSERR, in which
case <code class="inline"><span class="i">$!</span></code>
 contains the value of vaxc$errno.  Setting <code class="inline"><span class="i">$!</span></code>

always sets errno to the value specified.  If this value is
EVMSERR, it also sets vaxc$errno to 4 (NONAME-F-NOMSG), so
that the string value of <code class="inline"><span class="i">$!</span></code>
 won't reflect the VMS error
message from before <code class="inline"><span class="i">$!</span></code>
 was set.</p>
</li>
<li><a name="%24%5eE"></a><b>$^E</b>
<p>This variable provides direct access to VMS status values
in vaxc$errno, which are often more specific than the
generic Unix-style error messages in <code class="inline"><span class="i">$!</span></code>
.  Its numeric value
is the value of vaxc$errno, and its string value is the
corresponding VMS message string, as retrieved by sys$getmsg().
Setting <code class="inline"><span class="i">$^E</span></code>
 sets vaxc$errno to the value specified.</p>
<p>While Perl attempts to keep the vaxc$errno value to be current, if
errno is not EVMSERR, it may not be from the current operation.</p>
</li>
<li><a name="%24%3f"></a><b>$?</b>
<p>The "status value" returned in <code class="inline"><span class="i">$?</span></code>
 is synthesized from the
actual exit status of the subprocess in a way that approximates
POSIX wait(5) semantics, in order to allow Perl programs to
portably test for successful completion of subprocesses.  The
low order 8 bits of <code class="inline"><span class="i">$?</span></code>
 are always 0 under VMS, since the
termination status of a process may or may not have been
generated by an exception.</p>
<p>The next 8 bits contain the termination status of the program.</p>
<p>If the child process follows the convention of C programs
compiled with the _POSIX_EXIT macro set, the status value will
contain the actual value of 0 to 255 returned by that program
on a normal exit.</p>
<p>With the _POSIX_EXIT macro set, the Unix exit value of zero is
represented as a VMS native status of 1, and the Unix values
from 2 to 255 are encoded by the equation:</p>
<pre class="verbatim"><ol><li>   <span class="w">VMS_status</span> = <span class="n">0x35a000</span> + <span class="s">(</span><span class="w">unix_value</span> * <span class="n">8</span><span class="s">)</span> + <span class="n">1.</span></li></ol></pre><p>And in the special case of Unix value 1 the encoding is:</p>
<pre class="verbatim"><ol><li>   <span class="w">VMS_status</span> = <span class="n">0x35a000</span> + <span class="n">8</span> + <span class="n">2</span> + <span class="n">0x10000000</span>.</li></ol></pre><p>For other termination statuses, the severity portion of the
subprocess's exit status is used: if the severity was success or
informational, these bits are all 0; if the severity was
warning, they contain a value of 1; if the severity was
error or fatal error, they contain the actual severity bits,
which turns out to be a value of 2 for error and 4 for severe_error.
Fatal is another term for the severe_error status.</p>
<p>As a result, <code class="inline"><span class="i">$?</span></code>
 will always be zero if the subprocess's exit
status indicated successful completion, and non-zero if a
warning or error occurred or a program compliant with encoding
_POSIX_EXIT values was run and set a status.</p>
<p>How can you tell the difference between a non-zero status that is
the result of a VMS native error status or an encoded Unix status?
You can not unless you look at the ${^CHILD_ERROR_NATIVE} value.
The ${^CHILD_ERROR_NATIVE} value returns the actual VMS status value
and check the severity bits. If the severity bits are equal to 1,
then if the numeric value for <code class="inline"><span class="i">$?</span></code>
 is between 2 and 255 or 0, then
<code class="inline"><span class="i">$?</span></code>
 accurately reflects a value passed back from a Unix application.
If <code class="inline"><span class="i">$?</span></code>
 is 1, and the severity bits indicate a VMS error (2), then
<code class="inline"><span class="i">$?</span></code>
 is from a Unix application exit value.</p>
<p>In practice, Perl scripts that call programs that return _POSIX_EXIT
type status values will be expecting those values, and programs that
call traditional VMS programs will either be expecting the previous
behavior or just checking for a non-zero status.</p>
<p>And success is always the value 0 in all behaviors.</p>
<p>When the actual VMS termination status of the child is an error,
internally the <code class="inline"><span class="i">$!</span></code>
 value will be set to the closest Unix errno
value to that error so that Perl scripts that test for error
messages will see the expected Unix style error message instead
of a VMS message.</p>
<p>Conversely, when setting <code class="inline"><span class="i">$?</span></code>
 in an END block, an attempt is made
to convert the POSIX value into a native status intelligible to
the operating system upon exiting Perl.  What this boils down to
is that setting <code class="inline"><span class="i">$?</span></code>
 to zero results in the generic success value
SS$_NORMAL, and setting <code class="inline"><span class="i">$?</span></code>
 to a non-zero value results in the
generic failure status SS$_ABORT.  See also <a href="perlport.html#exit">exit in perlport</a>.</p>
<p>With the <code class="inline"><span class="w">PERL_VMS_POSIX_EXIT</span></code>
 logical name defined as "ENABLE",
setting <code class="inline"><span class="i">$?</span></code>
 will cause the new value to be encoded into <code class="inline"><span class="i">$^E</span></code>

so that either the original parent or child exit status values 
 0 to 255 can be automatically recovered by C programs expecting
_POSIX_EXIT behavior.  If both a parent and a child exit value are
non-zero, then it will be assumed that this is actually a VMS native
status value to be passed through.  The special value of 0xFFFF is
almost a NOOP as it will cause the current native VMS status in the
C library to become the current native Perl VMS status, and is handled
this way as it is known to not be a valid native VMS status value.
It is recommend that only values in the range of normal Unix parent or
child status numbers, 0 to 255 are used.</p>
<p>The pragma <code class="inline"><a class="l_k" href="functions/use.html">use</a> <span class="w">vmsish</span> <span class="q">&#39;status&#39;</span></code>
 makes <code class="inline"><span class="i">$?</span></code>
 reflect the actual 
VMS exit status instead of the default emulation of POSIX status 
described above.  This pragma also disables the conversion of
non-zero values to SS$_ABORT when setting <code class="inline"><span class="i">$?</span></code>
 in an END
block (but zero will still be converted to SS$_NORMAL).</p>
<p>Do not use the pragma <code class="inline"><a class="l_k" href="functions/use.html">use</a> <span class="w">vmsish</span> <span class="q">&#39;status&#39;</span></code>
 with <code class="inline"><span class="w">PERL_VMS_POSIX_EXIT</span></code>

enabled, as they are at times requesting conflicting actions and the
consequence of ignoring this advice will be undefined to allow future
improvements in the POSIX exit handling.</p>
<p>In general, with <code class="inline"><span class="w">PERL_VMS_POSIX_EXIT</span></code>
 enabled, more detailed information
will be available in the exit status for DCL scripts or other native VMS tools,
and will give the expected information for Posix programs.  It has not been
made the default in order to preserve backward compatibility.</p>
<p>N.B. Setting <code class="inline"><span class="w">DECC</span><span class="i">$FILENAME_UNIX_REPORT</span></code>
 implicitly enables 
<code class="inline"><span class="w">PERL_VMS_POSIX_EXIT</span></code>
.</p>
</li>
<li><a name="%24%7c"></a><b>$|</b>
<p>Setting <code class="inline"><span class="i">$|</span></code>
 for an I/O stream causes data to be flushed
all the way to disk on each write (<i>i.e.</i> not just to
the underlying RMS buffers for a file).  In other words,
it's equivalent to calling fflush() and fsync() from C.</p>
</li>
</ul>
<a name="Standard-modules-with-VMS-specific-differences"></a><h1>Standard modules with VMS-specific differences</h1>
<a name="SDBM_File"></a><h2>SDBM_File</h2>
<p>SDBM_File works properly on VMS. It has, however, one minor
difference. The database directory file created has a <i>.sdbm_dir</i>
extension rather than a <i>.dir</i> extension. <i>.dir</i> files are VMS filesystem
directory files, and using them for other purposes could cause unacceptable
problems.</p>
<a name="Revision-date"></a><h1>Revision date</h1>
<p>Please see the git repository for revision history.</p>
<a name="AUTHOR"></a><h1>AUTHOR</h1>
<p>Charles Bailey  bailey@cor.newman.upenn.edu
Craig Berry  craigberry@mac.com
Dan Sugalski  dan@sidhe.org
John Malmberg wb8tyw@qsl.net</p>




  <div id="page_index" class="hud_container">
    <div id="page_index_header" class="hud_header">
      <div id="page_index_close" class="hud_close"><a href="#" onClick="pageIndex.hide();return false;"></a></div>
      <div id="page_index_title" class="hud_title"><span class="hud_span_top">Page index</span></div>
      <div id="page_index_topright" class="hud_topright"></div>
    </div>
    <div id="page_index_content" class="hud_content">
      <ul><li><a href="#NAME">NAME</a><li><a href="#DESCRIPTION">DESCRIPTION</a><li><a href="#Installation">Installation</a><li><a href="#Organization-of-Perl-Images">Organization of Perl Images</a><ul><li><a href="#Core-Images">Core Images</a><li><a href="#Perl-Extensions">Perl Extensions</a><li><a href="#Installing-static-extensions">Installing static extensions</a><li><a href="#Installing-dynamic-extensions">Installing dynamic extensions</a></ul><li><a href="#File-specifications">File specifications</a><ul><li><a href="#Syntax">Syntax</a><li><a href="#Filename-Case">Filename Case</a><li><a href="#Symbolic-Links">Symbolic Links</a><li><a href="#Wildcard-expansion">Wildcard expansion</a><li><a href="#Pipes">Pipes</a></ul><li><a href="#PERL5LIB-and-PERLLIB">PERL5LIB and PERLLIB</a><li><a href="#The-Perl-Forked-Debugger">The Perl Forked Debugger</a><li><a href="#PERL_VMS_EXCEPTION_DEBUG">PERL_VMS_EXCEPTION_DEBUG</a><li><a href="#Command-line">Command line</a><ul><li><a href="#I%2fO-redirection-and-backgrounding">I/O redirection and backgrounding</a><li><a href="#Command-line-switches">Command line switches</a></ul><li><a href="#Perl-functions">Perl functions</a><li><a href="#Perl-variables">Perl variables</a><li><a href="#Standard-modules-with-VMS-specific-differences">Standard modules with VMS-specific differences</a><ul><li><a href="#SDBM_File">SDBM_File</a></ul><li><a href="#Revision-date">Revision date</a><li><a href="#AUTHOR">AUTHOR</a></ul>
    </div>
    <div id="page_index_footer" class="hud_footer">
      <div id="page_index_bottomleft" class="hud_bottomleft"></div>
      <div id="page_index_bottom" class="hud_bottom"><span class="hud_span_bottom"></span></div>
      <div id="page_index_resize" class="hud_resize"></div>
    </div>
  </div>


	    &nbsp;
          </div>
          <div id="content_footer">
          </div>
        </div>
        <div class="clear"></div>
      </div>
      
    <div id="footer">
      <div id="footer_content">
        <div id="footer_strapline">
          perldoc.perl.org - Official documentation for the Perl programming language
        </div>
        <div id="footer_links">
          <div id="address">
            <p class="name">Contact details</p>
            <p class="address">
	      Site maintained by <a href="mailto:jj@jonallen.info">Jon Allen (JJ)</a><br>
	    </p>
            <p class="contact">
              Documentation maintained by the <a href="http://lists.cpan.org/showlist.cgi?name=perl5-porters">Perl 5 Porters</a>
            </p>
          </div>
          <ul class="f1">
            <li>Manual
              <ul class="f2">
                <li><a href="index-overview.html">Overview</a>
                <li><a href="index-tutorials.html">Tutorials</a>
                <li><a href="index-faq.html">FAQs</a>
                <li><a href="index-history.html">Changes</a>
              </ul>
            <li>Reference
              <ul class="f2">
                <li><a href="index-language.html">Language</a>
                <li><a href="index-functions.html">Functions</a>
                <li><a href="perlop.html">Operators</a>
                <li><a href="perlvar.html">Variables</a>
              </ul>
            <li>Modules
              <ul class="f2">
                <li><a href="index-modules-A.html">Modules</a>
                <li><a href="index-pragmas.html">Pragmas</a>
                <li><a href="index-utilities.html">Utilities</a>
              </ul>
            <li>Misc
              <ul class="f2">
                <li><a href="index-licence.html">License</a>
                <li><a href="index-internals.html">Internals</a>
                <li><a href="index-platforms.html">Platforms</a>
              </ul>          </ul>
          <div class="clear"></div>
        </div>
      </div>
      <div id="footer_end">
      </div>
    </div>
      
    </div>
      <script language="JavaScript" type="text/javascript" src="static/exploreperl.js"></script>
      <script language="JavaScript" src="static/combined-20100403.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">
  perldoc.setPath(0);
  perldoc.pageName    = 'perlvms';
  perldoc.pageAddress = 'perlvms.html';
  perldoc.contentPage = 1;
  explorePerl.render();
  explorePerl.addEvents('explore_anchor');
</script>
    
  </body>
</html>