-Robert#!/usr/bin/perl -w use strict; my $file = 'c:\\path\\file.name'; open FILE, "$file" or die "Couldnt open file:$!\n"; my @info = <FILE>; close FILE; my ($server,$client); for(@info){ chomp; if(/Job server:+[\W]+(.*)/){ $server = $1; } if(/Job name:+[\W]+(.*)/){ $client = $1; $client =~ s/-.*//; print "$client is on $server\n"; } }
In reply to Re: File to @array then parse like a file
by blaze
in thread File to @array then parse like a file
by dbrock
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |