in reply to Re: extracting data from a line
in thread extracting data from a line

#! perl -w open(MYOUTFILE, ">/tmp/design_name_bot"); open (FILEH, "/tmp/strfile"); $_ = <FILEH>; print MYOUTFILE substr($_, rindex($_, '/') +1); close(FILEH); close(MYOUTFILE);
Substr is the most efficient method, and he specified a one line file.

Replies are listed 'Best First'.
Re^3: extracting data from a line
by Random_Walk (Prior) on Oct 23, 2004 at 10:36 UTC

    TedPride++ I had not thought of the substr($_, rindex($_, '/') +1) way to get the last 'element' off a line and this is something I find I am coding a lot here. Its always nice to learn a more efficient way to do things.

    Thanks,
    R.