# $command can be any system command, that would produce an acceptable output my $string = "my email is"; my $dir = "/home/erik/*"; my $command = "grep -ri '".$string."' ".$dir; open(IN, $command." |"); my @IN = <IN>; close(IN);
Better, Stephen? =) I agree, that opening dirs isn't the best purpose for this method.
Erik
In reply to Re: Using UNIX commands inside Perl scripts, with Perl variables
by Anonymous Monk
in thread Using UNIX commands inside Perl scripts, with Perl variables
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |