in reply to Getting only the link in a line

You're potentially matching everything including spaces with the .* if there are numbers in the line after the URL , the first line doesn't have decimal digits \d at the end of the URL and you need to allow for the possibility of SSL (https) There are better (more precise) solutions, but try
($resolution_link) = $match =~ {(https?://\S+)};
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."

Replies are listed 'Best First'.
Re^2: Getting only the link in a line
by iphone (Beadle) on Nov 03, 2010 at 22:39 UTC

    there seems to be some syntax error with the code you provided.I used the below code it worked,but now the problem is there is "."(dot) at the end of somelinks .I need to remove that.How do I do that?

    ($resolution_link) = $match =~ /(https?:\/\/(\S+))/;
      That's why I said there were better solutions available ;), this was a quick hack to solve a specific case.

      One solution would be to remove punctuation at the end of the link in a second pass

      print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
      A reply falls below the community's threshold of quality. You may see it by logging in.