Stripping text off of the end of a string

The script below will strip /search?q=perl master off the end of $srcUrl.

#!/usr/bin/perl

my $srcUrl = 'http://www.google.com/search?q=perl master';
my $modUrl;

$srcUrl =~ /\/search/;
$modUrl = $`;

print $modUrl;

Page Comments (Click to edit)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.