perl and openvms · 2008-06-19 · perl and openvms bernd ulmann [email protected] ... a variable,...

23
Outline Introduction VMS specialities Examples Conclusion and contact Perl and OpenVMS Bernd Ulmann [email protected] IT-Symposium 2008 4th June – 5th June 2008 Frankfurt Bernd Ulmann [email protected] Perl and OpenVMS Outline Introduction VMS specialities Examples Conclusion and contact Outline 1 Introduction 2 VMS specialities 3 Examples 4 Conclusion and contact Bernd Ulmann [email protected] Perl and OpenVMS IT-Symposium 2008 05.06.2008 www.hp-user-society.de 1

Upload: others

Post on 18-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Per

lan

dO

pen

VM

S

Ber

nd

Ulm

ann

[email protected]

IT-S

ympos

ium

2008

4th

June

–5t

hJu

ne

2008

Fra

nkf

urt

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Out

line

1In

troduct

ion

2V

MS

spec

ialit

ies

3Exa

mple

s

4Con

clusion

and

conta

ct

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e1

Page 2: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Ove

rvie

w

Ove

rvie

w

On

the

follo

win

gslid

esItr

yto

give

anim

pres

sion

ofth

epow

erof

Per

lin

gener

alan

din

spec

ialin

anO

pen

VM

Sen

viro

nm

ent.

The

exam

ple

swer

ech

osen

from

my

own

dai

lywor

kon

ala

rge

Open

VM

Ssy

stem

and

range

from

sim

ple

code

snip

pet

s,pr

ogra

ms

for

one

tim

eusa

geto

larg

erPer

lpr

ogra

ms

runnin

gas

bat

chjo

bs

and

per

form

ing

cruci

alta

sks

like

fetc

hin

gm

ailfrom

aPO

P-s

erve

ran

dth

elik

e.

Per

lis

no

repla

cem

ent

for

DCL

but

itm

akes

life

much

mor

eea

sier

when

itco

mes

tofile

par

sing

and

modifyi

ng,

sock

etco

mm

unic

atio

n,dat

abas

eac

cess

eset

c.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Som

efa

cts

about

Per

l

Som

efa

cts

abou

tPer

l

The

follo

win

gslid

esco

nta

inso

me

(ver

y)bas

icfa

cts

abou

tPer

lw

hic

har

ein

no

way

com

ple

tebut

may

give

anim

pres

sion

ofth

epr

ogra

mm

ing

langu

age

for

thos

ew

ho

hav

enev

erse

enan

yac

tual

Per

lco

de.

For

Per

lpr

ogra

mm

ers

ther

eex

ists

one

mai

nre

sourc

eof

info

rmat

ion

and

enlig

hte

nm

ent

–th

eso

calle

dca

mel

book

,”P

rogr

amm

ing

Per

l”,publis

hed

byO

’Rei

lly.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e2

Page 3: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Som

efa

cts

about

Per

l

Wha

tis

Per

l?

Per

lwas

dev

elop

edby

Lar

ryW

all.

The

nam

eis

not

anac

rynom

but

are

tron

ym.

Per

lis

am

oder

nin

terp

rete

rla

ngu

age

(in

fact

the

inte

rpre

ter

does

ago

od

job

prec

ompili

ng

the

code

soPer

lpr

ogra

ms

tend

toru

nsu

rprisingl

yfa

st).

Per

lru

ns

onm

ore

arch

itec

ture

san

dop

erat

ing

syst

ems

than

mos

tot

her

langu

ages

(incl

udin

gJa

va).

Per

lco

de

look

sst

range

for

the

nov

ice.

Per

lis

incr

edib

lypow

erfu

lan

dco

nci

se.

Much

ofth

epow

erof

Per

llie

sin

its

module

s.

Per

l’s

philo

sophy

is”T

her

eis

mor

eth

anon

eway

todo

it.”

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Som

efa

cts

about

Per

l

Var

iabl

es Per

ldoes

not

care

abou

tth

ety

pe

ofa

variab

le,it

isty

pe

free

.

Inst

ead,Per

lca

res

abou

tth

est

ruct

ure

ofa

variab

le–

ines

sence

ther

ear

eth

ree

bas

icst

ruct

ure

s:

Sca

lars

:A

scal

arva

riab

leca

nhol

da

singl

eva

lue

ata

tim

ean

dth

eva

riab

lenam

eis

alway

spr

ecee

ded

bya$

like

inmy

$pi

=3.14159265;

Arr

ays:

An

arra

yis

anin

dex

edlis

tco

nsist

ing

ofsc

alar

sas

its

elem

ents

.T

he

nam

eof

anar

ray

ispr

ecee

ded

bya@

like

inmy

@entries;

Has

hes

:T

hes

ear

esim

ilar

toar

rays

but

use

strings

inst

ead

ofnum

eric

alin

dic

es.

Thei

rnam

esar

epr

ecee

ded

bya%

like

inmy

%data;

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e3

Page 4: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Som

efa

cts

about

Per

l

Var

iabl

es

Som

eex

ample

sof

Var

iable

s

my

$pi

=’threepointonefour’;

my

@array;

$array[0]

=’Something’;

$array[1]

=’Something

else’;

my

%data;

$data{’name’}=

’Bernd’;

$data{’occupation’}=

’VAX

enthusiast’;

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Som

efa

cts

about

Per

l

Con

trol

stru

ctur

es

Per

lsu

ppor

tsal

lof

the

com

mon

contr

olst

ruct

ure

slik

eif

...else,while,do

...while,for

etc.

Eve

rysu

chst

atem

ent

requires

ablo

cksu

rrou

nded

bybr

aces

–th

ese

can

not

be

left

out

like

inC

ifon

lya

singl

est

atem

ent

isto

be

contr

olle

d.

Inth

issp

ecia

lca

seso

calle

dst

atem

ent

modifi

ers

may

be

use

d:

Som

eex

ample

sof

contr

olst

ruct

ure

s

if

(condition)

#traditional

if

{...

} statement

if

condition

#statement

modifier;

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e4

Page 5: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Som

efa

cts

about

Per

l

Con

trol

stru

ctur

es

Som

eex

ample

sof

contr

olst

ruct

ure

s

for

(my

$i

=0;

$i

<10;

$i++)

{print

"$i\n";

} for

my

$value

(@array)

{print

"$value\n";

} print

"$\n"

for

(@array);

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Som

efa

cts

about

Per

l

Reg

ular

expr

ession

s

Much

ofPer

l’s

pow

erst

ems

from

its

built

inre

gula

rex

pres

sion

par

ser.

Reg

ula

rex

pres

sion

ste

nd

tolo

oka

bit

like

line

noi

seso

Iw

illnot

give

are

ason

able

exam

ple

her

e–

you

will

see

som

ein

the

exam

ple

sbel

ow.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e5

Page 6: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Som

efa

cts

about

Per

l

Modu

les

Anot

her

sourc

eof

Per

l’s

pow

eris

the

multitude

ofm

odule

sw

hic

har

eav

aila

ble

onCPA

N.

Reg

ardle

ssw

hat

your

initia

lpr

oble

mis,firs

thav

ea

look

for

am

odule

whic

hm

ight

be

hel

pfu

lfo

ryo

ur

task

.

Exa

mple

sfo

rth

epow

erof

module

sar

enum

erou

s–

inth

efo

llow

ing

slid

esa

prog

ram

tofe

tch

mai

lsfrom

aPO

P3-

serv

eris

des

crib

edw

hic

huse

sa

PO

P3-

module

for

exam

ple

.T

his

module

conta

ins

all

nec

essa

ryfu

nct

ional

ity

toco

nnec

tto

aPO

P3-

serv

eran

dge

tm

ails,

del

ete

mai

lset

c.W

ith

the

hel

pof

theNet::POP3-M

odule

thes

eta

sks

reduce

tosim

ple

calls

.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Som

efa

cts

about

Per

l

Do/

dono

t Do:

Be

open

for

the

Per

lway

toso

lve

prob

lem

s.Per

lpr

ogra

ms

tend

tobe

quite

shor

tan

dpow

erfu

l.Exp

ect

code

that

issign

ifica

ntly

shor

ter

than

equiv

alen

tco

de

inot

her

langu

ages

like

Cet

c.U

sest

atem

ents

likesplit,join,map,grep

inst

ead

ofunnec

essa

rylo

ops.

Use

regu

lar

expr

ession

sto

par

se,m

anip

ula

teor

split

strings

!B

est

rict

and

use

war

nin

gsal

lth

etim

e!G

etth

eCam

elB

ook

!

Do

not

:..

.pro

gram

inPer

llik

ein

Cet

c...

.use

arra

ysw

hen

you

can

use

has

hes

...

.loop

over

anar

ray

tofind

anel

emen

t!

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e6

Page 7: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Som

efa

cts

about

Per

l

Res

ourc

es

The

centr

alre

pos

itor

yfo

rPer

lan

dth

eth

ousa

nds

ofm

odule

sav

aila

ble

is

http://www.cpan.org

This

isth

eCom

preh

ensive

Per

lA

rchiv

eN

etwor

k.

When

ever

you

nee

da

Per

lin

terp

rete

r,a

module

ordocu

men

tation

,hav

ea

look

atth

eCPA

Nweb

site

orse

arch

direc

tly

via

http://search.cpan.org

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Som

efa

cts

about

Per

l

Inst

allin

gPer

l

Bas

ical

lyth

ere

are

two

way

sto

get

aPer

lin

terp

rete

rup

and

runnin

gon

asy

stem

:

1You

can

use

apr

ecom

pile

dpac

kage

–fo

rO

pen

VM

Sth

ere

isa

HP

supplie

ddistr

ibution

kit,

for

other

pla

tfor

ms

ther

ear

enum

erou

ssu

chki

tsav

aila

ble

.

2G

etth

eso

urc

esan

dco

mpile

and

inst

allth

esy

stem

yours

elf.

Per

sonal

ly,Iwou

ldal

way

spr

efer

the

seco

nd

met

hod

since

Ilik

eto

know

what

isre

ally

runnin

gon

my

syst

eman

dso

met

imes

Iwan

tto

do

som

eth

ings

diff

eren

tly

com

par

edw

ith

apr

ecom

pile

din

stal

lation

kit.

(Com

pili

ng

aPer

lsy

stem

onan

Alp

ha

isfa

st,but

ona

VA

Xth

isca

nta

kese

vera

lhou

rs,be

prep

ared

!)

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e7

Page 8: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

VM

Sm

odule

s

VM

Sm

odu

les

As

allof

you

know

,O

pen

VM

Sis

diff

eren

tfrom

(and

super

ior

to:-)

other

oper

atin

gsy

stem

sw

hic

hhas

tobe

take

nin

toac

count

when

por

ting

orw

riting

softwar

e.

Ther

ear

ea

lot

ofm

odule

sen

capsu

ling

Open

VM

Ssp

ecifi

cta

sks

like

inte

rfac

ing

the

mai

lsy

stem

and

the

like

aswel

las

ther

ear

em

odule

sw

hic

hta

kein

toac

count

that

ther

eis

ava

riet

yof

diff

eren

tway

sto

han

dle

file

and

direc

tory

nam

eset

c.

Inth

efo

llow

ing

ase

lect

ion

ofm

odule

sw

hic

hIfo

und

tobe

espec

ially

use

fulin

anO

pen

VM

Sen

viro

nm

ent

islis

ted:

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

VM

Sm

odule

s

Som

eus

eful

modu

les

for

Open

VM

Ssy

stem

s

VMS::Device

Inte

rfac

he

to$GETDVI

and

the

like.

VMS::Filespec

Con

vert

sbet

wee

nO

pen

VM

San

dU

NIX

file

spec

s.VMS::FlatFile

Use

has

hes

towor

kw

ith

index

file

s.VMS::ICC

Intr

acl

ust

erco

mm

unic

atio

nse

rvic

es.

VMS::Mail

Inte

rfac

eto

the

Open

VM

Sm

ailsy

stem

.VMS::Process

Man

age

Open

VM

Spr

oce

sses

.VMS::Queue

Wor

kw

ith

queu

esan

dth

eir

entr

ies.

VMS::Stdio

File

oper

atio

ns

like

bin

mode,

flush

,vm

sopen

etc.

VMS::System

Ret

riev

esy

stem

info

rmat

ion.

File::Basename

Sys

tem

indep

enden

top

erat

ions

onfile

nam

eset

c.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e8

Page 9: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Exa

mple

s

Exa

mpl

es

The

follo

win

gslid

essh

owso

me

prac

tica

lex

ample

sof

using

Per

lin

apr

oduct

ive

Open

VM

Sen

viro

nm

ent.

Som

eex

ample

s,es

pec

ially

the

sim

ple

ron

es,ar

eac

com

pan

ied

with

thei

rso

urc

eco

de

whic

hm

ight

be

inte

rest

ing,

alth

ough

mor

eco

mple

xex

ample

sar

eon

lydes

crib

ed.

Ifyo

uar

ein

tere

sted

inth

eso

urc

eco

de

ofon

eof

thes

em

ore

com

ple

xex

ample

s,ple

ase

let

me

know

,Iw

illm

ake

itav

aila

ble

toyo

uby

mai

lupon

reques

t.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Pro

gram

sfo

ron

etim

eus

age

Man

yev

eryd

ayta

sks

require

that

syst

emad

min

istr

ator

sas

wel

las

prog

ram

mer

sper

form

som

eunex

pec

ted

task

slik

ecl

ever

pat

tern

mat

chin

g,par

sing

log

file

san

dth

elik

ew

hic

har

enot

read

ilyso

lved

with

stan

dar

dD

CL

tool

s.

Man

yof

thes

epr

oble

ms

can

be

solv

edon

the

fly

using

aco

uple

oflin

esof

Per

lco

de.

The

follo

win

gse

ctio

ns

show

som

ety

pic

alex

ample

sfrom

my

own

ever

yday

wor

kusing

Open

VM

S.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e9

Page 10: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Per

las

aco

mm

and

line

tool

Per

lca

nbe

use

das

aco

mm

and

line

tool

like,

for

exam

ple

,awk

onU

NIX

syst

ems.

This

can

be

very

use

fulw

hen

you

hav

ea

puzz

ling

prob

lem

whic

hdoes

not

des

erve

are

alpr

ogra

mbut

nee

ds

acl

ever

dat

aco

nve

rsio

non

the

fly

orso

met

hin

glik

eth

at.

Sin

ceth

ere

are

ava

riet

yof

com

man

dlin

eop

tion

sfo

rPer

lw

hic

har

euse

fulin

this

conte

xt,on

lya

sim

ple

exam

ple

isgi

ven

inth

efo

llow

ing.

Mor

ein

form

atio

nab

out

this

topic

may

be

found

else

wher

elik

eth

eCam

elbook

etc.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Cha

ngin

ga

confi

gura

tion

file

Once

Iin

her

ited

aco

nfigu

ration

fileTRANSFER.INI

whic

hlo

oked

inpar

tslik

eth

is:

[logging]

log

=log/transfer.log

ticket

=log/ticket.log

[templates]

ticket

=templates/ticket.tpl

mail

=templates/mail.tpl

Ofco

urs

eth

ese

pat

hnam

esar

enot

very

Open

VM

Slik

ean

dit

wou

ldhav

ebee

nquite

cum

ber

som

eto

edit

allof

them

(ther

ewas

alo

tof

thos

epat

hnam

es)

byhan

d.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e10

Page 11: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Cha

ngin

ga

confi

gura

tion

file

One

could

write

asm

allPer

lpr

ogra

mre

adin

gth

efile

,per

form

ing

the

nec

essa

rych

ange

susing

regu

lar

expr

ession

san

dw

riting

the

resu

ltbac

kto

disk.

Sin

ceta

sks

like

thes

ear

eco

mm

onpla

ce,Per

lca

nbe

use

das

am

ighty

com

man

dlin

eto

olfo

rper

form

ing

inpla

ceed

itop

erat

ions

like

tran

sfor

min

gth

ese

pat

hnam

esin

toO

pen

VM

Sfile

nam

es:

Inpla

ceed

itin

g:

perl

-i

-pe

-"s/^(.*\s*)=(\s*)(.+)\/(.+)/$1=$2\[

\.$3\]$4/"

i-

transfer.ini

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Cha

ngin

ga

confi

gura

tion

file

Apply

ing

this

singl

elin

est

atem

ent

toth

eco

nfigu

ration

file

show

nab

ove,

the

resu

ltin

gfile

look

slik

eth

is:

[logging]

log

=[.log]transfer.log

ticket

=[.log]ticket.log

[templates]

ticket

=[.templates]ticket.tpl

mail

=[.templates]mail.tpl

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e11

Page 12: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Fin

ding

unre

solv

edbi

blio

grap

hyitem

s

When

writing

LATEX

-docu

men

tsin

cludin

ga

bib

liogr

aphy

withou

tusing

Bib

TeX

,th

ere

isso

me

risk

ofhav

ing

unci

ted

bib

liogr

aphy

entr

ies

inth

eso

urc

eco

de.

Abib

liogr

aphy

entr

yhas

the

form

\bibitem{zachary}%book

G.

Pascal

Zachary,

\emph{Endless

Frontier

--

Vannevar

Bush,

Engineer

of

the

American

Century},

The

MIT

Press,

1999

While

aci

tation

look

slik

e

cf.

\cite{zachary}[p.

142].

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Fin

ding

unre

solv

edbi

blio

grap

hyitem

s

Hav

ing

adocu

men

tof

mor

eth

an12

0000

lines

resu

ltin

gin

abou

t60

0pag

esof

text

with

mor

eth

an60

0bib

ligra

phy

entr

ies,

Inee

ded

away

tobe

sure

that

ever

yen

try

was

infa

ctci

ted

inth

ete

xt.

To

acco

mplis

hth

isIw

rote

the

follo

win

gsh

ort

Per

lpr

ogra

mw

hic

hre

ads

inth

eco

mple

teso

urc

eco

de

with

asingl

est

atem

ent

and

par

ses

this

for

allci

tation

sin

afirs

tru

nw

hic

hbuild

sa

has

hco

nta

inin

gal

lci

tation

s,fo

llowed

bya

seco

nd

run

look

ing

for

all

bib

liogr

aphy

entr

ies.

Entr

ies

withou

tco

rres

pon

din

gci

tation

will

be

prin

ted

tost

dou

t(it

turn

edou

tth

atm

ore

than

20en

trie

sin

the

text

wer

eunuse

d).

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e12

Page 13: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Fin

din

gunci

ted

entr

ies

inLATEX

-sou

rce

usestrict;

usewarnings;

die"Usagebib.pl<filename.tex>\n"unless@ARGV+0;

my$data;

openmy$fh,’<’,$ARGV[0]or

die"Couldnotopen$ARGV[0]:

$!\n";

{local$/;

$data=<$fh>;

} close$fh;

my%cite;

$cite{$

}++for$data=∼

m/\\

cite\{

(.+?)\}

/g;

$cite{$

}orprint"$\n"for$data=∼

m/\\

bibitem\{

(.+?)\}

/g;

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Par

sing

alo

gfile

Som

ewee

ksag

oIhad

topar

sea

log

file

with

entr

ies

like

show

nin

the

follo

win

gfo

rso

me

tim

esta

mps

toca

lcula

tean

aver

age

tim

eva

lue.

[LOG|SYSTEM|2008

May13,14:15:26(886)|ENGINE.batch]

Loaded16eventsin497

milliSecs

[END]

[LOG|SYSTEM|2008

May13,14:15:55(281)|Risk|BatchJob]

TimetoexecuteScenario24902ms

[END]

[LOG|SYSTEM|2008

May13,14:15:55(283)|RiskAnalysis|BatchJob]

ScenarioAnalysis

Executed

[SUCCESS]

[END]

[LOG|SYSTEM|2008

May13,14:16:12(870)|Risk|BatchJobThread]

TimetoexecuteScenario13662ms

[END]

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e13

Page 14: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Par

sing

alo

gfile

Sin

ceth

ese

logfi

les

grow

quite

fast

and

since

itis

impos

sible

tore

star

tlo

ggin

gin

toa

new

file

when

anew

round

ofte

sts

isper

form

ed,th

eca

lcula

tion

ofav

erag

etim

esm

ust

be

pos

sible

from

any

poi

nt

inth

efile

onst

arting

with

agi

ven

dat

ean

dtim

esta

mp.

Using

asim

pleSEARCH

isnot

too

easy

since

log

entr

ies

are

atle

ast

thre

elin

esin

lengt

han

dsince

Iam

only

inte

rest

edin

entr

ies

ofth

efo

rmTime

to

execute

Scenario...

afte

ra

give

ntim

esta

mp.

All

ofth

isca

lled

for

ash

ort

Per

lpr

ogra

mto

par

seth

efile

and

com

pute

the

des

ired

aver

age

exec

ution

tim

eva

lue.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Par

sing

alo

gfile

usestrict;usewarnings;

die"Usage:

stat3

\"yyyymmmdd\"

\"hh:mm:ss\"

\n"if@ARGV!=

3;

my($file,$date,$mintime)=@ARGV;

my@values;

openmy$fh,’<’,$file

ordie"Couldnotopen$file:

$!\n";

{local$/=’[END]’;

while(my$entry=<$fh>)

{my($time,$duration)=$entry=∼

m/^.+\|.

+\|$

date,\s(\d

\d:\d

\d:\d

\d\s).*executeScenario\s(\d+)\sms/s;

push(@values,$duration)

if$timeand$timege$mintime;

}} close$fh;

print’Average:

’,int(eval(join(’+’,@values))/@values)/1e3,

’s(’,

@values

+0,")\n"if@values+

0;

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e14

Page 15: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Are

ther

ean

yfile

sw

ith

W:W

Don

my

disk

?

One

day

Iwas

aske

d”H

owca

nyo

ube

sure

ther

ear

eno

file

son

your

syst

emdisk

whic

har

ew

rita

ble

byW

ORLD

?”

Good

ques

tion

–th

isca

llsfo

ra

shor

tPer

lpr

ogra

m.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Sea

rch

for

file

sw

ith

W:W

D

use

strict;

use

warnings;

my

($fc,

$mc)

=(0,

0);

for

my

$line

(‘dir/prot/width=(file=60)

[...]‘)

{my

($file,

$w)

=$line

=m/(.+)\s+.+,(.*)\)/;

next

unless

$file;

$fc++;

print

"$file\n"

and

$mc++

if

($w

=m/[WD]/);

} print

"$fc

files

processed,

$mc

are

world

writable/deletable!\n";

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e15

Page 16: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Mig

rating

aM

ySQ

Lda

taba

seto

RD

B

On

one

occ

asio

nIhad

tom

igra

tequite

alo

tof

dat

afrom

aM

ySQ

Ldat

abas

eru

nnin

gon

aLIN

UX

syst

emto

anRD

Bdat

abas

eru

nnin

gon

anO

pen

VM

Ssy

stem

.

The

firs

tid

eawas

tow

rite

adat

abas

edum

pfrom

the

MyS

QL

syst

em,re

form

atth

isusing

Per

lin

toso

met

hin

gw

hic

hco

uld

be

under

stood

byRD

Ban

dfe

edth

ere

sultin

gdat

ain

toth

eRD

Bsy

stem

.

This

turn

edou

tto

be

too

cum

ber

som

e,so

anot

her

appr

oach

was

take

n:

Write

ash

ort

Per

lpr

ogra

mco

nnec

ting

tobot

hdat

abas

esan

dco

pyin

gdat

aon

the

fly

from

one

syst

emto

the

other

.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Mig

rating

aM

ySQ

Ldat

abas

eto

RD

B(initia

lizat

ion)

usestrict;

usewarnings;

nowarningsqw/uninitialized/;

useNet::MySQL;

useDBI;

useDBD::RDB;

my$rdb=

DBI

->connect(

’dbi:RDB:ATTACHALIASRECIPESFILENAME

DISK$RDBDATA:[000000]RECIPES’,undef,undef,

RaiseError=>1,PrintError=>1,AutoCommit=>0,

ChopBlanks=>

1);

my@tables=qw/arteigenschafteneinheitenglutenfreikategorien

personenregionrezeptkategorienrezeptzutatenrecipeszustand

zutaten/;

my$mysql=Net::MySQL->new

(hostname=>

’klapauzius.pi-research.de’,

database=>’recipes’,user=>’rikka’,

password=>’:-)’);

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e16

Page 17: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Pro

gra

ms

for

one

tim

eusa

ge

Mig

rating

aM

ySQ

Ldat

abas

eto

RD

B(c

opyi

ng

dat

a)

formy$table(@tables)

{$rdb->do("deletefromrecipes.$table");

$mysql->query("select*from$table");

my$recordset=$mysql->

createrecorditerator;

my@fields=$recordset->getfieldnames;

my$statement="insertintorecipes.$table(".

join(’,’,@fields).

’)

values(’.

join(’,’,map

{’?’}

0..$#fields).

’)’;

my$rdbsth=$rdb->

prepare($statement);

my$counter=0;

while(my$record=$recordset->each)

{$rdbsth->execute(@$record);

$rdb->commitunless$counter%50;

} $rdb->commitif$counter%

50;

print"\nInserted$counterlinesintorecipes.$table\n";

} $rdb->disconnect;

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Lar

ger

pro

gra

ms

Lar

ger

prog

ram

s

Man

ypr

oble

ms

whic

hocc

ur

ona

regu

lar

bas

isca

nbe

solv

edusing

Per

l,to

o.Exa

mple

sfo

rsu

chpr

oble

ms

are:

Gen

erat

ing

sim

ple

web

serv

erst

atistics

ona

dai

lybas

is.

Fet

chin

gm

ailfrom

aPO

Pse

rver

inre

gula

rtim

ein

terv

als

and

distr

ibuting

thes

em

ails

toth

eO

pen

VM

Sm

ailsy

stem

.

Sen

din

gou

tgoi

ng

mai

lsto

anSM

TP

serv

erre

quirin

gau

then

tica

tion

whic

his

not

curr

ently

suppor

ted

byO

pen

VM

S.

Cac

hin

gre

sults

from

dat

abas

equer

ies

tosp

eed

up

exec

ution

tim

eof

prog

ram

sre

ques

ting

dat

afrom

the

dat

abas

e.

Thes

eex

ample

sw

illbe

brie

fly

des

crib

edin

the

follo

win

g.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e17

Page 18: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Lar

ger

pro

gra

ms

Sim

ple

web

serv

erst

atistics

Aft

erob

serv

ing

that

the

web

serv

erru

nnin

gon

my

Open

VM

Ssy

stem

isra

ther

busy

serv

ing

reques

tsIwan

ted

tohav

ea

sim

ple

web

serv

erst

atistics

tokn

oww

hic

hfile

sar

ere

ques

ted

how

ofte

nfrom

rem

ote

use

rs.

All

inal

lIwan

ted

toge

ner

ate

alo

gfile

like

this

ever

ynig

ht

ina

smal

lbat

chjo

b:

2734:

mymachines/dornier/do80/

288:

mymachines/bbc/tischanalogrechner/

117:

publications/anhyb.pdf

97:

publications/handson.pdf

88:

mymachines/eai/understanding/understanaloghybridcomp.m4a

83:

analogcomputing/vehiclesimulation/weakdamping.avi

72:

mymachines/dornier/do80/do80bedienungshandbuch.pdf

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Lar

ger

pro

gra

ms

Sim

ple

web

serv

erst

atistics

usestrict;

usewarnings;

die"Filenameandaccountname

expected!\n"unless@ARGV==2;

my($logfile,$account)=@ARGV;

openmy$fh,’<’,$logfileor

die"Unabletoopenlogfile

$logfile,$!\n";

my%matches;

while(my$line=<$fh>)

{my($ip,$key)=$line

=∼

m/^(\d+\.

\d+).*$account\/(.+?)\s/;

nextif!$ipor

$ip

eq’192.168’;

$key=∼

s/"//g;

$matches$key++

if$key;

} close$fh;

printf"%5d:

%s\n",$matches{$

},$

for(sort$matches$b<=>$matches$akeys(%matches));

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e18

Page 19: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Lar

ger

pro

gra

ms

Fet

chin

gm

ailfrom

aPO

P-s

erve

r

Som

etim

esit

isdes

irab

leto

fetc

hm

ails

from

aty

pic

alPO

P3-

serv

eran

dm

ake

thes

eav

aila

ble

inth

eO

pen

VM

Sm

ailsy

stem

soth

esy

stem

use

rsca

nac

cess

thei

rm

ails

usingMAIL

ora

suitab

leweb

inte

rfac

elik

eyahmail

orsoymail

etc.

To

mak

eth

ispos

sible

,a

Per

lw

ritt

enbat

chjo

bis

required

whic

hpol

lsin

regu

lar

inte

rval

sa

variet

yof

PO

P3-

serv

ers

and

mai

lbox

es,

fetc

hes

mai

lsan

ddistr

ibute

sth

ese

mai

lsto

the

variou

suse

rsof

the

Open

VM

Ssy

stem

.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Lar

ger

pro

gra

ms

Fet

chin

gm

ailfrom

aPO

P-s

erve

r

Using

the

follo

win

gm

odule

s,th

eov

eral

lPer

lco

de

for

imple

men

ting

this

bat

chjo

bco

nsist

sof

only

140

lines

:

Net

::PO

P3;

Clie

nt

inte

rfac

eto

the

PO

P3-

prot

oco

l.IO

::File

;File

crea

tion

and

acce

ssm

ethods.

PO

SIX

qw

(tm

pnam

);U

sed

for

crea

ting

tem

por

ary

file

nam

es.

VM

S::M

ail;

Inte

rfac

eto

the

Open

VM

Sm

ailsy

stem

.

When

itis

pos

sible

tore

ceiv

em

ails,it

wou

ldbe

nic

eto

be

able

tose

nd

mai

ls,to

o,as

the

follo

win

gslid

essh

ow.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e19

Page 20: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Lar

ger

pro

gra

ms

SM

TP-p

roxy

Alm

ost

ever

ycu

rren

tm

ailpr

ovid

erre

quires

its

clie

nts

toau

then

tica

tepr

ior

tose

ndin

gm

ailvi

ath

eir

SM

TP

serv

er(s

).

Unfo

rtunat

ely

auth

entica

tion

isnot

suppor

ted

byth

eT

CPIP

pac

kage

for

Open

VM

S.Sin

ceIhad

the

requirem

ent

tose

nd

outg

oing

mai

ldirec

tly,

i.e.

withou

tan

inte

rmed

iate

syst

em,it

was

dec

ided

toim

ple

men

ta

smal

lSM

TP-p

roxy

runnin

gon

the

Open

VM

Ssy

stem

.

This

prox

yco

nnec

tson

the

loca

lm

achin

eto

por

t25

and

liste

ns

for

outg

oing

mai

l.A

not

her

connec

tion

ism

ade

topor

t25

ofth

epr

ovid

er.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Lar

ger

pro

gra

ms

SM

TP-p

roxy

Eve

ryou

tgoi

ng

mai

lis

par

sed

and

enrich

edw

ith

the

nec

essa

ryau

then

tica

tion

info

rmat

ion

bef

ore

bei

ng

sent

toth

epr

ovid

erw

hic

hso

lved

the

prob

lem

quite

easily.

The

SM

TP

prox

ym

akes

use

ofth

efo

llow

ing

module

sw

hic

hre

sults

inan

over

allco

de

size

ofon

ly68

lines

ofPer

l:

Net::ProxyMod;

This

module

allo

ws

easy

pac

ket

modifi

cation

.MIME::Base64;

MIM

E-e

nco

din

gan

d-d

ecodin

gTie::RefHash;

Allo

ws

using

refe

rence

sas

has

hke

ys.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e20

Page 21: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Lar

ger

pro

gra

ms

Ada

taba

sepr

oxy

Som

etim

esit

isdes

irab

leto

per

form

dat

abas

eac

cess

esnot

direc

tly

but

via

apr

oxy

whic

hm

ight

eith

erco

nta

inso

me

busines

slo

gic

and/o

rca

che

asm

uch

dat

aas

pos

sible

tore

duce

dat

abas

elo

adat

the

cost

ofso

me

additio

nal

mem

ory

consu

mption

.

In20

05th

epr

oble

mar

ose

that

acce

sses

toan

RD

Bdat

abas

eru

nnin

gon

aVA

Xwer

eto

oslow

and

did

not

mat

chex

pec

tation

s.

Sin

ceal

lof

thes

eac

cess

eswer

ere

ads

conta

inin

gse

vera

ljo

ins

and

the

like,

the

idea

ofim

ple

men

ting

apr

oxy

serv

erin

Per

lto

cach

eth

ere

sults

yiel

ded

bysu

chac

cess

esan

ddel

iver

the

cach

edre

sults

foral

lfo

llow

ing

acce

sses

inst

ead

ofquer

ying

the

dat

abas

eca

me

up.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Lar

ger

pro

gra

ms

Ada

taba

sepr

oxy

(seri

alizin

gand

cachin

g)

��

��

��

��

Clie

nt1

Clie

nt2

Clie

ntn

Dat

abas

e

Pro

xy

� �� �

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e21

Page 22: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Lar

ger

pro

gra

ms

Ada

taba

sepr

oxy

The

spee

dup

effec

tw

hic

hca

nbe

obta

ined

using

this

Per

lw

ritt

endat

abas

epr

oxy

isdra

mat

ic:

Aty

pic

alre

ques

tw

hic

hta

kes

3.2

seco

nds

when

issu

eddirec

tly

toth

edat

abas

eis

satisfi

edin

3.52

seco

nds

using

the

prox

yw

ith

empty

cach

e(i.e

.direc

tly

afte

rst

artu

p).

The

very

sam

ere

ques

tissu

edto

the

prox

yw

hic

hal

read

yhas

the

required

dat

ain

its

cach

eta

kes

only

0.34

seco

nds

and

isth

us

rough

lyte

ntim

esfa

ster

than

the

direc

tdat

abas

eac

cess

.

Ofco

urs

etu

nin

gth

epr

oxy

with

resp

ect

toits

cach

esize

and

cach

elif

etim

edep

ends

onth

ety

pe

ofwor

kloa

d.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Concl

usion

Con

clus

ion

Per

ltu

rns

out

tobe

anin

valu

able

tool

for

ever

yday

usa

geas

wel

las

for

larg

ean

dco

mple

xpr

oduct

ion

prog

ram

s.

Esp

ecia

llyin

anO

pen

VM

Sen

viro

nm

ent

whic

hof

ten

has

spec

ialnee

ds

when

itco

mes

tosy

stem

connec

tivi

tyan

dth

elik

e,Per

lca

nbe

emplo

yed

with

much

ben

efit.

Per

ldoes

not

consu

me

too

man

yre

sourc

esan

dis

real

lyfa

stfo

ran

inte

rpre

tive

langu

age,

soit

can

be

even

use

don

smal

ler

VA

Xsy

stem

s.

Itis

impor

tant

tore

aliz

eth

atPer

lis

not

asc

ripting

langu

age

but

rath

era

very

mig

hty

prog

ram

min

gla

ngu

age.

Thus

Per

lsh

ould

be

take

nse

riou

sly.

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e22

Page 23: Perl and OpenVMS · 2008-06-19 · Perl and OpenVMS Bernd Ulmann ulmann@vaxman.de ... a variable, it is type free. Instead, Perl cares about the structure of a variable – in essence

Outlin

eIn

troduct

ion

VM

Ssp

ecia

litie

sExa

mple

sConcl

usion

and

conta

ct

Conta

ct

Con

tact

The

auth

orca

nbe

reac

hed

at

[email protected]

Ber

nd

Ulm

[email protected]

Per

land

Open

VM

S

IT-S

ympo

sium

200

805

.06.

2008

ww

w.h

p-us

er-s

ocie

ty.d

e23