in reply to Trouble with a string
@VMSHUT = `cat /tmp/virshlist_shutdown`;
You will also need to remove the line terminator from each line of the array using chomp otherwise each file name will have a spurious line terminator at the end.
$ cat zzz Line 1 Line 2 Line 3 $ perl -e ' > @lines = `cat zzz`; > print qq{>$_<\n} for @lines;' >Line 1 < >Line 2 < >Line 3 < $ perl -e ' > @lines = `cat zzz`; > chomp @lines; > print qq{>$_<\n} for @lines;' >Line 1< >Line 2< >Line 3< $
I hope this is helpful.
Cheers,
JohnGG
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Trouble with a string
by Anonymous Monk on Dec 11, 2012 at 23:21 UTC |
In Section
Seekers of Perl Wisdom