in reply to Re^2: Text filer and assign
in thread Text filer and assign
Most likely, you want to use "capturing" (see perlre) to keep the stuff that interests you:
... if( $line =~ /(\[\d+\.\d+\sGB\s\/\s\d+\.\d+\sGB\])/i ) { my $pvname = $1; print $pvname; };
Note that your regular expression does not match the result you want, because your result has the string free in it, while your regular expression will not match that. You should add the string at the appropriate place.
While it makes debugging easier, you don't need a temp file:
for my $line (`pvscan`) { ... };
|
|---|