in reply to one line perl code
Then $var will contain the value 'myvar'. You might also use an environment variable accessible via the %ENV hash, like this:cat file | perl -n0e 'BEGIN{$var = shift} #more code' myvar
I hope this is a useful answer to your question.VAR=myvar; export VAR; cat file | perl -n0e 'BEGIN{$var = $ENV{VAR}} # +more code'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: one line perl code
by perlisfun (Sexton) on May 08, 2002 at 21:04 UTC |