#! perl -slw use strict; use Inline C => Config => BUILD_NOISY => 1; use Inline C => <<'END_C', NAME => 'XSenv', CLEAN_AFTER_BUILD => 0; char *test( char *name ) { HV *env = get_hv( "ENV", 0 ); SV **pval = hv_fetch( env, name, strlen( name ), 0 ); if( pval ) { SV *val = *pval; return( SvPVX( val ) ); } return( "" ); } END_C print test( 'path' ); print test( 'fred' ); $ENV{fred} = 12345; print test( 'fred' );