Hi Mattias! On Sun, 26 Mar 2000, Mattias Hermansson wrote:
Hi,
I am trying to read a file in Perl and put each line into 2 variables. Each line constats of something like 2:255/90 asb32331
How do I read each line and split it.
Ignore sorted :) Case of RTFM :)
Oh! That's so helpful, without telling where to read...
I'd do:
open(FILE, "program |");
while ($in = <FILE>) { ($first,$last) = split $in; }
The split line may or may not work. man perlre should do the trick.
Also man perl is a great piece of info...
You are correct. Saying RTFM is no answer :) I looked in man perl and man perlfunc and seen the split option. Which did the trick. Sean -- Linux User: #124682 ICQ: 679813 My Current Uptime is 1d, 0h and 3m on Linux 2.2.13 It said "Needs Windows 95 or better". So I installed Linux... ...Any system which depends on human reliability is unreliable. -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/