in reply to RE: Re: Need help with s///
in thread Need help with s///
You might also write it this way:#!/usr/local/bin/perl -w $a = "$$NETOBJ.parameter"; print ">>$a<<\n"; $a =~ s/\$\$NETOBJ\.//; print $a;
One other approach that may work for you is split:$a = "$$NETOBJ.parameter"; if ($a =~ s/\$\$NETOBJ\.//) { print $a; } else { print "Substitution failed.\n"; }
Of course, notice the single quotes in the declaration that time. That'll help even if you do use the regexp.$a = '$$NETOBJ.parameter'; (undef, $a) = split(/\./, $a, 2); print $a;
|
|---|