Hello friends, I am new to perl programming and I would like some help about reading files.
I wish to know how can you can do something like
open my $input, '<', $ARGV[0]; open my $output,'>', $ARGV[1]; while (my $sentence = <$input>) { my $substring = 'clothes.*?mall'; $sentence =~ read-only{$substring}; print $output , $sentence; }
and read from a text file that contains something like :"I used to buy clothes from the mall because they are cheap" only the values between the words "clothes" and "mall" so I could do certain operations with them and after I do all the operations with the values between the 2 keywords I want to output the file with all the values("I used to buy clothes' from the 'mall because they are cheap") the words between ' ' represent the words " from the " after the operations were done on them.
P.S. Sorry if it is a stupid question or a stupid example but I am super new in all this and a terrible question asker.
In reply to Reading from files by AmberThai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |