in reply to extracting a substring?

You have 2 options that I can think of off the top of my head.

Do an 'index' inside a 'substr'
or a regex and capture the result to $1.

Resources:
  • index
  • substr
  • perlre

    Example of index/substr solution:
    #!/usr/bin/perl -w use strict; my $look_for = 'foobar'; my $string = 'this whole script is foobared'; my $result = substr($string,index($string,$look_for),length($look_for) +); print $result;

    Attempt at the regex:
    $str =~ /(Version\s+\d+\.\d+)/; $result = $1;


    grep
    grep> cd pub grep> more beer