Some Perl Special Variables Some Global Special Variables 5 of 28 : [PREV] [NEXT]

$_ ($ARG)

  • contains the default input and pattern-searching string
  • handy for temporary pattern matching and loop variables
  foreach (@list) {
      print "string '$_' contains 'hi' if(/hi/);
  }

© 2004 Barbie barbie@missbarbell.co.uk Home http://birmingham.pm.org/