in reply to Re: Add character in middle
in thread Add character in middle

I used like this,
#!/usr/bin/perl $var='<date>'; $newvar=$var; $sec = substr($newvar,0,1); $sec = '</'; print $sec,"\n"; print "Old value is $var and new value is $sec";
It doesnot print like this Old value is <date> and new value is </date>

Replies are listed 'Best First'.
Re^3: Add character in middle
by JavaFan (Canon) on Aug 12, 2009 at 09:25 UTC
    Your last assignment to $sec is </. Why would you expect it to contain </date>?