when i run this code i lost $a and $b value#!/usr/bin/perl #===================================================================== +========== # # FILE: test.pl # # USAGE: ./test.pl # # DESCRIPTION: # # OPTIONS: --- # REQUIREMENTS: --- # BUGS: --- # NOTES: --- # AUTHOR: YOUR NAME (), # COMPANY: # VERSION: 1.0 # CREATED: 2012/3/9 下午 03:23:45 # REVISION: --- #===================================================================== +========== use strict; use warnings; system("ls > z & ls > zz"); my $a = "z"; my $b = "zz"; foreach($a,$b) { print $_; my $fh; open $fh,"<$_"; while(<$fh>){ print $_; } close $fh; } print $a,$b;
In reply to the variable is lost by cruise
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |