Hi all

Think I have a better unstanding of the use of () for my regex search, but this morning I have a new set of problems, whereby I need to perform a search and replace and then pass on to the new variable.

My current code is as so, and works:

$_ =~ s/(^\w+\.dat\|)//;                                                        
my $lineExtract = $_;

But I would like to have it a one liner.

I tried:

my ($lineExtract) = ($_ =~ s/(^\w+\.dat\|)//);
and
$lineExtract = ($_ =~ s/(^\w+\.dat\|)//);

If I do a print on the $lineExtract I dont get the output I require.

Any tips and advise would greatfully be appreciated.

I tried googling and the perldoc, but I havent found a decent answer.

Kind Regards
Brent Clark

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to