KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
How can I implement grep of Unix in Perl? I tried to use Perl's built-in grep . Here is the code which is not working: $pattern = @ARGV[0]; $file= @ARGV[1]; open($fp,$file); @arr = <$fp>; @lines = grep $pattern, @arr; close($fp); print @lines; And by the way, i am trying only basic grep functionality not full featured and secondly i don't want to do string parsing myself. I want to use inbuilt grep or some function of Perl. Thanks in advance :)
Tags (comma-separated)
Save Edits
Cancel