-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
Hi all
This feels like a really dumb question but doing a regex find and
replace is it possible to delete a line? For example,
for (@file) {
s/foo//g;
}
which equates to:
for each element in array 'file' if you find 'foo' then replace it with
null.
I then write the array to a file (using Tie::File) and it leaves a blank
line where the element containing 'foo' was like:
null
foo1
foo2
foo3
Perhaps I am confabulating two ideas here? Is there a way to walk
through an array and find a particular array element and delete it
rather than replace it with null (and then write it out to a file using
Tie::File)?
Thanks
James Turnbull
- --
James Turnbull <[EMAIL PROTECTED]>
- ---
Author of Pro Nagios 2.0
(http://www.amazon.com/gp/product/1590596099/)
Hardening Linux
(http://www.amazon.com/gp/product/1590594444/)
- ---
PGP Key (http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x0C42DF40)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)
iD8DBQFEwxCt9hTGvAxC30ARA3AUAKDQeVzurdxg3GMnwVlokIwk48Ed+ACghe0X
BJ+hUGw/QYUtQCSKU6+J8uk=
=Dmhk
-----END PGP SIGNATURE-----
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>