Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: BEGIN { } block

by busunsl (Vicar)
on Aug 11, 2009 at 14:22 UTC ( #787642=note: print w/replies, xml ) Need Help??


in reply to BEGIN { } block

Sometimes you have to make sure that some environment variables are set.

For example some settings for a connection to a database:

BEGIN { $ENV{NLS_LANG} = 'GERMAN'; $ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD'; $ENV{NLS_TIMESTAMP_FORMAT} = 'YYYY-MM-DD HH24:MI:SS'; } use DBI; my $dbh = DBI->connect('dbi:Oracle:db', 'user', 'pw');

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://787642]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2017-11-23 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (337 votes). Check out past polls.

    Notices?