Hmmm.. ref:CGI perl module

They have: 16 posts

Joined: Jan 2001

It seems that the 'standard' way to parse URL's in the later versions of the CGI perl module is to split name=value pairs by a semi colon rather than the good ol' ampersand.

I don't have a problem with this (in fact it looks pretty) - but it seems that PC users do.

Whilst the scripts are fine with it, if you cut n' paste it to use as a link, it always chops after the first semicolon (often bringing up an ISE).

Anyone come across this before? I really don't want to have to go back through all the scripts and swop back to the ampersand - ecpecially if it's being phased out.

What is Mr Stein thinking... Wink

my $friends = qq[=:Jilly , Andrew , Peter & Harry:=];
print &welcome($friends), "2"; my @home;
sub welcome{my $s=shift; $s=~s{^(=\Smiling(.+?)(\:=)$}
{$_=$2;@home=split/[&,]/;}esgx;$friends= join'me',@home;
$friends=~s{(\A|\S|\s+)([A-Z]).+?(\s|\Z)}{$2}sge;my$c=-1;
$friends=~s{(me|\Z)}{++$c;@_=(qw|ust nother erl acker|);qq!$_[$c] !;}eg; $friends}

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

semicolon?
where did you hear that?

I can't imagine that 'they' would phase out &.... especially after how many websites are coded with it!?!

They have: 16 posts

Joined: Jan 2001

Believe it or not, it's true. Take a peek inside the CGI.pm - from version 2.7(?) below the $USE_SEMICOLON_PARAM was always switched to '0' (off).

In recent distributions it's switched on by default. It's in the init_globals routine.

It's definately happening. The CGI module can still handle ampersands, but the semi colon is taking over. I've heard the buzz for a while.

my $friends = qq[=:Jilly , Andrew , Peter & Harry:=];
print &welcome($friends), "2"; my @home;
sub welcome{my $s=shift; $s=~s{^(=\Smiling(.+?)(\:=)$}
{$_=$2;@home=split/[&,]/;}esgx;$friends= join'me',@home;
$friends=~s{(\A|\S|\s+)([A-Z]).+?(\s|\Z)}{$2}sge;my$c=-1;
$friends=~s{(me|\Z)}{++$c;@_=(qw|ust nother erl acker|);qq!$_[$c] !;}eg; $friends}

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.