Hi,
thnx! i put the warnings on. While xecuting the cmd interface tells me if he can not find a file. But he can, so the a.txt file adress should be ok. bīBut there is still no effect and no warnings.
Your comment on the @ lines sounds convenient, so finally he is copying the old line in the new line and nothing is happening? How can I fix that issue? And here (sorry not the original but the same principle)the code (which has no effect):
#!/usr/bin/perl -w
use strict;
my $SCU='C:/Users/name/Desktop/a.txt';
open(FILE, "<$SCU") || die "File not found";
my @lines = <FILE>;
close(FILE);
my @newlines;
foreach(@lines) {
$_ =~ s/<ABCD>/xyz/g;
push(@newlines,$_);
}
open(FILE, "$SCU") || die "File not found";
print FILE @newlines;
close(FILE);
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.