Nearly there now
Hi all,
Just about finished my script at last
Just need to know how to remove any commas
from a variable prior to writing it to a
text file.
example:
$address=param('address'); (* need to remove commas here *)
open(file,">>$failit");
print file "$address ,";
Any ideas - it's probably easy but my head is hurting
Thanks in advance for any help
Regards
Steve
On the last lap - seeing the finishing line
Ken Elliott posted this at 13:13 — 24th August 2000.
They have: 358 posts
Joined: Jun 1999
$address =~ s/,//g;
That will take every occurance of a comma and replace it with nothing.
VulKen
I'm Thinker Then I Drunk I Am
myriad posted this at 14:13 — 24th August 2000.
They have: 88 posts
Joined: Mar 1999
many thanks for that -
But where would it go in my example?
sorry to be a pain
Cheers
Steve
Ken Elliott posted this at 15:43 — 24th August 2000.
They have: 358 posts
Joined: Jun 1999
just put it right after your scalars assignment...
$address=param('address'); (* need to remove commas here *)
And Before your open statement
open(file,">>$failit");
So that it is processed before you open the file and write the contents.
VulKen
I Hurl For PERL
Pimpin like a pimp with an electrofied pimpin machine!
myriad posted this at 01:16 — 25th August 2000.
They have: 88 posts
Joined: Mar 1999
Many thanks - I'll give that a go!!
Thanks a lot for the help
Regards
Steve
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.