[thelist] $varaibles in perl

Adrian Fischer adrian at logo-logic.com
Sun Aug 20 02:35:47 CDT 2000

Hi Guys,

Just a quick one.  In perl when you read a file into <THEFILE> and then
"chomp" it can al the variables that make the file and then get chomped be a
variable themselves??

i.e. if for instance I read a file and it contains these variables
"($doThis, $doThat, $butnotThis, @stuff)" could I declare that as a variable
in the start of my script like this:
$NewVariable = "($doThis, $doThat, $butnotThis, @stuff)";
and then call it like this:
$NewVariable =  <THEFILE>;
close <THEFILE>;
chomp $NewVariable ;

I tried but it didn't do what I wanted.  It did print all the variable names
to a page when I tested to make sure I had declared the variable at the
start properly.  The reason I ask is because I'm forever adding things to my
script that makes me go back and amend all instances of the variable list.
If I could declare it in the head of the main script then I would only need
to change it there.  Would save lots of time in trying to work out what's
wrong with it only to find I haven't added the new variable in some sub

Am I making sense here.


Adrian Fischer
AussieBidder.Com (BN17329700)
58 Ballinger Crescent
Albany Creek
Queensland 4035

More information about the thelist mailing list