topical media & game development

talk show tell print

basic-regex-26-ReplaceDefaultVariable.pl / pl



  #!/usr/bin/perl -w
  use strict;
  _ = "I went to a training course from Star Training Company.";
  print "The default string, $_, contains '_'.\n\n";
  if (s/Star/Moon/)
  {
   print "A replacement has taken place using the default variable.\n";
   print "The replaced string in $_ is now '_'.";
  }


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.