User Profile
Collapse
-
Yes I also posted on another forum. I don't see what the problem is. Thanks for the help so far. -
printing only the pattern that matches
I am trying to display only the line that ends with a . or , or ? that has the in the line that ended with .|,|?
So here is my pattern-matching operator:
m/the/ .. /(\.|\?|\,)$/im
I am not sure if that is the correct pattern to look for, but if it is how do I extract just what matches that?
For example if I had
I wish it was the that dog barked,
but it wasn't. ... -
-
Actually I see now that it is printing the edited file now all I need to do is figure out how to make the unix command: perl_sript.pl text.txt to edit text.txt.Leave a comment:
-
Accessing a file and modifying the contents
I am trying to access a file with perl and use substitution on that files contents and print the result of that substitution.
I also need the the file I am accessing to be input on the command line like this: keirnna$ perl_script.pl file.txt
Here is what I have so far:
#!/usr/bin/perl -w
open(INPUT, "+<", "/pretend/path/file.txt")
or die "Couldn't...
No activity results to display
Show More
Leave a comment: