in reply to Re: rel="nofollow" tag syntax?
in thread rel="nofollow" tag syntax?

Thanks Corion. Can you please tell me what -MCGI means? I tried putting your code in, but it just wiped out the link completely - obviously, I'm doing something wrong. Thanks again, -Bob

Replies are listed 'Best First'.
Re^3: rel="nofollow" tag syntax?
by Herkum (Parson) on Apr 17, 2007 at 12:39 UTC

    corion is using a one-liner that is run through the Perl interpreter. So the -MCGI means to load the CGI module for this one-line program.

    The code was not meant to be placed wholly into your code, it is just a quick way of showing how that one-line should work.

      Thanks Herkum for the clarification. So then, there's no way to hack the code like I was trying to do? In order to insert the nofollow tag into the link, I have to use a module? Thanks again -Bob

        You already are using the CGI module, or something whose API is strikingly similar to the API of CGI.pm. Maybe you could just try out the example given to you to see whether it works for you or not. The following self-contained program works for me. Maybe it works for you too?

        use strict; use CGI qw(a); my $url = 'http://perlmonks.net/'; print a({-href => $url, -rel => 'nofollow'}, $url);

        If that still doesn't work for you, maybe you can show us the exact differences. If you need character-exact layout instead of what CGI.pm (or the module you're using whose API is similar to that of CGI.pm) provides you, then maybe one of the templating systems will do for you?