#!/usr/bin/perl -w use strict; $_ = 'test1=1&&test3=3'; for ( split '&' ) { my($param,$value) = split '='; print "param='$param'\n"; print "value='$value'\n"; # and using $param even though it is undefined the 2nd time }