Setting environment for using XAMPP for Windows. rmicro@RMICRO-PC C:\Program Files\xampp # perl -le '$str = "the cat sat on the mat";print substr( $str, 4, -4 )' Can't find string terminator "'" anywhere before EOF at -e line 1.
rmicro@RMICRO-PC C:\Program Files\xampp # It failed to work for me. Why? rmicro@RMICRO-PC C:\Program Files\xampp # perl -v This is perl, v5.10.1 (*) built for MSWin32-x86-multi-thread Copyright 1987-2009, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet, point your browser at http://www.perl.org/, the Perl Home Page. On Thu, Jan 13, 2011 at 3:16 PM, Shawn H Corey <shawnhco...@gmail.com>wrote: > On 11-01-12 11:27 PM, Sunita Rani Pradhan wrote: > >> I have a string as; $str = "the cat sat on the mat" . >> >> >> >> How the following command works substr($str , 4, -4) on the string ? >> What should be the output? >> > > TITS (Try It To See) > > perl -le '$str = "the cat sat on the mat";print substr( $str, 4, -4 )' > > > -- > Just my 0.00000002 million dollars worth, > Shawn > > Confusion is the first step of understanding. > > Programming is as much about organization and communication > as it is about coding. > > The secret to great software: Fail early & often. > > Eliminate software piracy: use only FLOSS. > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http://learn.perl.org/ > > > -- *Satajanus Nig. Ltd *